r17080 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17079‎ | r17080 | r17081 >
Date:08:38, 18 October 2006
Author:proes
Status:old
Tags:
Comment:
Proper truncation of defined meaning header: hide '...' when not truncated.
Modified paths:
  • /trunk/extensions/Wikidata/WiktionaryZ/Editor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/WiktionaryZ/Editor.php
@@ -739,15 +739,14 @@
740740 $definedMeaningAsLink = definedMeaningAsLink($value);
741741 $escapedDefinition = htmlspecialchars($definition);
742742
743 - if ($this->truncate || strlen($definition) >= $this->truncateAt)
 743+ if ($this->truncate && strlen($definition) >= $this->truncateAt)
744744 $escapedDefinition = '<span title="'. $escapedDefinition .'">'. htmlspecialchars(substr($definition, 0, $this->truncateAt)) . '...</span>';
745745
746746 return $definedMeaningAsLink . ": " . $escapedDefinition;
747747 }
748748
749749 public function getEditHTML($idPath, $value) {
750 - //Not editable
751 - return null;
 750+ return "";
752751 }
753752
754753 public function add($idPath) {
@@ -921,30 +920,18 @@
922921 protected function suggestType() {
923922 return "class";
924923 }
925 -
926 -// public function getViewHTML($idPath, $value) {
927 -// return definedMeaningAsLink($value);
928 -// }
929924 }
930925
931926 class CollectionReferenceEditor extends DefinedMeaningReferenceEditor {
932927 protected function suggestType() {
933928 return "collection";
934929 }
935 -
936 -// public function getViewHTML($idPath, $value) {
937 -// return collectionAsLink($value);
938 -// }
939930 }
940931
941932 class TextAttributeEditor extends DefinedMeaningReferenceEditor {
942933 protected function suggestType() {
943934 return "text-attribute";
944935 }
945 -
946 -// public function getViewHTML($idPath, $value) {
947 -// return definedMeaningAsLink($value);
948 -// }
949936 }
950937
951938 class RecordListEditor extends RecordEditor {