r23900 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23899‎ | r23900 | r23901 >
Date:12:57, 9 July 2007
Author:proes
Status:old
Tags:
Comment:
Renamed URL to Link in code and user interface.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Controller.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataTables.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php
@@ -27,6 +27,8 @@
2828 $wgIdenticalMeaningAttributeName,
2929 $wgIncomingRelationsAttributeName,
3030 $wgLevelAnnotationAttributeName,
 31+ $wgLinkAttributeAttributeName,
 32+ $wgLinkAttributeValuesAttributeName,
3133 $wgOptionAttributeOptionAttributeName,
3234 $wgOptionAttributeOptionsAttributeName,
3335 $wgOptionAttributeValuesAttributeName,
@@ -47,9 +49,7 @@
4850 $wgTranslatedTextAttributeAttributeName,
4951 $wgTranslatedTextAttributeName,
5052 $wgTranslatedTextAttributeValueAttributeName,
51 - $wgTranslatedTextAttributeValuesAttributeName,
52 - $wgUrlAttributeAttributeName,
53 - $wgUrlAttributeValuesAttributeName;
 53+ $wgTranslatedTextAttributeValuesAttributeName;
5454
5555 $wgAlternativeDefinitionAttributeName = "Alternative definition";
5656 $wgAlternativeDefinitionsAttributeName = "Alternative definitions";
@@ -97,8 +97,8 @@
9898 $wgTranslatedTextAttributeName = "Translated text";
9999 $wgTranslatedTextAttributeValueAttributeName = "Text";
100100 $wgTranslatedTextAttributeValuesAttributeName = "Text properties";
101 -$wgUrlAttributeAttributeName = "Property";
102 -$wgUrlAttributeValuesAttributeName = "URLs";
 101+$wgLinkAttributeAttributeName = "Property";
 102+$wgLinkAttributeValuesAttributeName = "Links";
103103
104104 // Attribute Ids
105105
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialSuggest.php
@@ -71,7 +71,7 @@
7272 case 'text-attribute':
7373 $sql = getSQLToSelectPossibleAttributes($objectId, $attributesLevel, 'TEXT');
7474 break;
75 - case 'url-attribute':
 75+ case 'link-attribute':
7676 $sql = getSQLToSelectPossibleAttributes($objectId, $attributesLevel, 'URL');
7777 break;
7878 case 'language':
@@ -118,7 +118,7 @@
119119 $query == 'option-attribute' or
120120 $query == 'translated-text-attribute' or
121121 $query == 'text-attribute' or
122 - $query == 'url-attribute' or
 122+ $query == 'link-attribute' or
123123 $query == 'collection')
124124 $searchCondition = " WHERE $rowText LIKE " . $dbr->addQuotes("$search%");
125125 else
@@ -162,8 +162,8 @@
163163 case 'option-attribute':
164164 list($recordSet, $editor) = getOptionAttributeAsRecordSet($queryResult);
165165 break;
166 - case 'url-attribute':
167 - list($recordSet, $editor) = getURLAttributeAsRecordSet($queryResult);
 166+ case 'link-attribute':
 167+ list($recordSet, $editor) = getLinkAttributeAsRecordSet($queryResult);
168168 break;
169169 case 'defined-meaning':
170170 list($recordSet, $editor) = getDefinedMeaningAsRecordSet($queryResult);
@@ -414,20 +414,20 @@
415415 return array($recordSet, $editor);
416416 }
417417
418 -function getURLAttributeAsRecordSet($queryResult) {
 418+function getLinkAttributeAsRecordSet($queryResult) {
419419 global
420420 $idAttribute;
421421
422422 $dbr =& wfGetDB(DB_SLAVE);
423423
424 - $urlAttributeAttribute = new Attribute("url-attribute", "URL attribute", "short-text");
425 - $recordSet = new ArrayRecordSet(new Structure($idAttribute, $urlAttributeAttribute), new Structure($idAttribute));
 424+ $linkAttributeAttribute = new Attribute("link-attribute", "Link attribute", "short-text");
 425+ $recordSet = new ArrayRecordSet(new Structure($idAttribute, $linkAttributeAttribute), new Structure($idAttribute));
426426
427427 while ($row = $dbr->fetchObject($queryResult))
428428 $recordSet->addRecord(array($row->attribute_mid, $row->spelling));
429429
430430 $editor = createSuggestionsTableViewer(null);
431 - $editor->addEditor(createShortTextViewer($urlAttributeAttribute));
 431+ $editor->addEditor(createShortTextViewer($linkAttributeAttribute));
432432
433433 return array($recordSet, $editor);
434434 }
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -215,19 +215,19 @@
216216 $textAttributeValuesAttribute = new Attribute(null, $wgTextAttributeValuesAttributeName, $textAttributeValuesStructure);
217217
218218 global
219 - $urlAttribute, $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttributeValuesStructure, $urlAttributeValuesAttribute,
220 - $wgUrlAttributeValuesAttributeName, $wgUrlAttributeAttributeName, $hyperLinkAttribute, $hyperLinkLabelAttribute, $hyperLinkURLAttribute;
 219+ $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttributeValuesStructure, $linkAttributeValuesAttribute,
 220+ $wgLinkAttributeValuesAttributeName, $wgLinkAttributeAttributeName,
 221+ $linkAttribute, $linkLabelAttribute, $linkURLAttribute;
221222
222 - $hyperLinkLabelAttribute = new Attribute("label", "Label", "short-text");
223 - $hyperLinkURLAttribute = new Attribute("url", "URL", "url");
224 - $hyperLinkAttribute = new Attribute("hyperlink", "Link", new Structure($hyperLinkLabelAttribute, $hyperLinkURLAttribute));
 223+ $linkLabelAttribute = new Attribute("label", "Label", "short-text");
 224+ $linkURLAttribute = new Attribute("url", "URL", "url");
 225+ $linkAttribute = new Attribute("link", "Link", "url");// new Structure($linkLabelAttribute, $linkURLAttribute));
225226
226 - $urlAttribute = new Attribute("url", "URL", "url");
227 - $urlAttributeIdAttribute = new Attribute("url-attribute-id", "Attribute identifier", "object-id");
228 - $urlAttributeObjectAttribute = new Attribute("url-attribute-object-id", "Attribute object", "object-id");
229 - $urlAttributeAttribute = new Attribute("url-attribute", $wgUrlAttributeAttributeName, $definedMeaningReferenceStructure);
230 - $urlAttributeValuesStructure = new Structure("url-attribute-values", $urlAttributeIdAttribute, $urlAttributeObjectAttribute, $urlAttributeAttribute, $urlAttribute, $objectAttributesAttribute);
231 - $urlAttributeValuesAttribute = new Attribute(null, $wgUrlAttributeValuesAttributeName, $urlAttributeValuesStructure);
 227+ $linkAttributeIdAttribute = new Attribute("link-attribute-id", "Attribute identifier", "object-id");
 228+ $linkAttributeObjectAttribute = new Attribute("link-attribute-object-id", "Attribute object", "object-id");
 229+ $linkAttributeAttribute = new Attribute("link-attribute", $wgLinkAttributeAttributeName, $definedMeaningReferenceStructure);
 230+ $linkAttributeValuesStructure = new Structure("link-attribute-values", $linkAttributeIdAttribute, $linkAttributeObjectAttribute, $linkAttributeAttribute, $linkAttribute, $objectAttributesAttribute);
 231+ $linkAttributeValuesAttribute = new Attribute(null, $wgLinkAttributeValuesAttributeName, $linkAttributeValuesStructure);
232232
233233 global
234234 $optionAttributeIdAttribute, $optionAttributeAttribute, $optionAttributeObjectAttribute, $optionAttributeOptionAttribute, $optionAttributeValuesAttribute,
Index: trunk/extensions/Wikidata/OmegaWiki/Controller.php
@@ -518,35 +518,35 @@
519519 }
520520 }
521521
522 -class URLAttributeValuesController extends ObjectAttributeValuesController {
 522+class LinkAttributeValuesController extends ObjectAttributeValuesController {
523523 public function add($keyPath, $record) {
524524 global
525 - $urlAttribute, $urlAttributeAttribute;
 525+ $linkAttribute, $linkAttributeAttribute;
526526
527527 $objectId = $this->objectIdFetcher->fetch($keyPath);
528 - $urlAttributeId = $record->getAttributeValue($urlAttributeAttribute);
529 - $url = $record->getAttributeValue($urlAttribute);
 528+ $linkAttributeId = $record->getAttributeValue($linkAttributeAttribute);
 529+ $url = $record->getAttributeValue($linkAttribute);
530530
531 - if ($urlAttributeId != 0 && $url != '')
532 - addURLAttributeValue($objectId, $urlAttributeId, $url);
 531+ if ($linkAttributeId != 0 && $url != '')
 532+ addLinkAttributeValue($objectId, $linkAttributeId, $url);
533533 }
534534
535535 public function remove($keyPath) {
536536 global
537 - $urlAttributeIdAttribute;
 537+ $linkAttributeIdAttribute;
538538
539 - $urlId = $keyPath->peek(0)->getAttributeValue($urlAttributeIdAttribute);
540 - removeURLAttributeValue($urlId);
 539+ $linkId = $keyPath->peek(0)->getAttributeValue($linkAttributeIdAttribute);
 540+ removeLinkAttributeValue($linkId);
541541 }
542542
543543 public function update($keyPath, $record) {
544544 global
545 - $urlAttributeIdAttribute, $urlAttribute;
 545+ $linkAttributeIdAttribute, $linkAttribute;
546546
547 - $urlId = $keyPath->peek(0)->getAttributeValue($urlAttributeIdAttribute);
548 - $url = $record->getAttributeValue($urlAttribute);
 547+ $linkId = $keyPath->peek(0)->getAttributeValue($linkAttributeIdAttribute);
 548+ $url = $record->getAttributeValue($linkAttribute);
549549
550 - updateURLAttributeValue($url, $urlId);
 550+ updateLinkAttributeValue($url, $linkId);
551551 }
552552 }
553553
Index: trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php
@@ -1169,7 +1169,7 @@
11701170
11711171 $editor->addEditor(new ObjectPathEditor($objectIdAttribute));
11721172 $editor->addEditor(createDefinedMeaningReferenceViewer($attributeAttribute));
1173 - $editor->addEditor(createURLViewer($URLAttribute));
 1173+ $editor->addEditor(createLinkViewer($URLAttribute));
11741174 $editor->addEditor(createShortTextViewer($operationAttribute));
11751175 $editor->addEditor(createBooleanViewer($isLatestAttribute));
11761176
@@ -1666,9 +1666,9 @@
16671667
16681668 function rollBackURLAttribute($rollBackAction, $valueId, $objectId, $attributeId, $url, $operation) {
16691669 if (shouldRemove($rollBackAction, $operation))
1670 - removeURLAttributeValue($valueId);
 1670+ removeLinkAttributeValue($valueId);
16711671 else if (shouldRestore($rollBackAction, $operation))
1672 - createURLAttributeValue($valueId, $objectId, $attributeId, $url);
 1672+ createLinkAttributeValue($valueId, $objectId, $attributeId, $url);
16731673 }
16741674
16751675 function rollBackTextAttributes($idStack, $textAttributes) {
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php
@@ -730,22 +730,22 @@
731731 return $dbr->fetchObject($queryResult);
732732 }
733733
734 -function addURLAttributeValue($objectId, $urlAttributeId, $url) {
 734+function addLinkAttributeValue($objectId, $linkAttributeId, $url) {
735735 $dc=wdGetDataSetContext();
736736 $urlValueAttributeId = newObjectId("{$dc}_url_attribute_values");
737 - createURLAttributeValue($urlValueAttributeId, $objectId, $urlAttributeId, $url);
 737+ createLinkAttributeValue($urlValueAttributeId, $objectId, $linkAttributeId, $url);
738738 }
739739
740 -function createURLAttributeValue($urlValueAttributeId, $objectId, $urlAttributeId, $url) {
 740+function createLinkAttributeValue($urlValueAttributeId, $objectId, $linkAttributeId, $url) {
741741 $dc=wdGetDataSetContext();
742742 $dbr = &wfGetDB(DB_MASTER);
743743 $dbr->query(
744744 "INSERT INTO {$dc}_url_attribute_values (value_id, object_id, attribute_mid, url, label, add_transaction_id) " .
745 - "VALUES ($urlValueAttributeId, $objectId, $urlAttributeId, " . $dbr->addQuotes($url) . ", " . $dbr->addQuotes($url) . ", ". getUpdateTransactionId() .")"
 745+ "VALUES ($urlValueAttributeId, $objectId, $linkAttributeId, " . $dbr->addQuotes($url) . ", " . $dbr->addQuotes($url) . ", ". getUpdateTransactionId() .")"
746746 );
747747 }
748748
749 -function removeURLAttributeValue($urlValueAttributeId) {
 749+function removeLinkAttributeValue($urlValueAttributeId) {
750750 $dc=wdGetDataSetContext();
751751 $dbr = &wfGetDB(DB_MASTER);
752752 $dbr->query(
@@ -755,10 +755,10 @@
756756 );
757757 }
758758
759 -function updateURLAttributeValue($url, $urlValueAttributeId) {
 759+function updateLinkAttributeValue($url, $urlValueAttributeId) {
760760 $urlValueAttribute = getURLValueAttribute($urlValueAttributeId);
761 - removeURLAttributeValue($urlValueAttributeId);
762 - createURLAttributeValue($urlValueAttributeId, $urlValueAttribute->object_id, $urlValueAttribute->attribute_mid, $url);
 761+ removeLinkAttributeValue($urlValueAttributeId);
 762+ createLinkAttributeValue($urlValueAttributeId, $urlValueAttribute->object_id, $urlValueAttribute->attribute_mid, $url);
763763 }
764764
765765 function getURLValueAttribute($urlValueAttributeId) {
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php
@@ -12,17 +12,17 @@
1313 global
1414 $objectAttributesAttribute, $definedMeaningIdAttribute,
1515 $textValueObjectAttributesEditor, $textAttributeIdAttribute,
16 - $urlValueObjectAttributesEditor, $urlAttributeIdAttribute,
 16+ $linkValueObjectAttributesEditor, $linkAttributeIdAttribute,
1717 $translatedTextValueObjectAttributesEditor, $translatedTextAttributeIdAttribute,
1818 $optionValueObjectAttributesEditor, $optionAttributeIdAttribute, $annotationMeaningName;
1919
2020 $textValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5);
21 - $urlValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5);
 21+ $linkValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5);
2222 $translatedTextValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5);
2323 $optionValueObjectAttributesEditor = new RecordUnorderedListEditor($objectAttributesAttribute, 5);
2424
2525 setObjectAttributesEditor($textValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $textAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute));
26 - setObjectAttributesEditor($urlValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $urlAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute));
 26+ setObjectAttributesEditor($linkValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $linkAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute));
2727 setObjectAttributesEditor($translatedTextValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $translatedTextAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute));
2828 setObjectAttributesEditor($optionValueObjectAttributesEditor, $viewInformation, new ObjectIdFetcher(0, $optionAttributeIdAttribute), $annotationMeaningName, new ObjectIdFetcher(1, $definedMeaningIdAttribute));
2929 }
@@ -125,7 +125,7 @@
126126 function setObjectAttributesEditor(Editor $objectAttributesEditor, ViewInformation $viewInformation, Fetcher $objectIdFetcher, $levelDefinedMeaningName, Fetcher $dmObjectIdFetcher) {
127127 $objectAttributesEditor->addEditor(getTextAttributeValuesEditor($viewInformation, new TextAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher));
128128 $objectAttributesEditor->addEditor(getTranslatedTextAttributeValuesEditor($viewInformation, new TranslatedTextAttributeValuesController($objectIdFetcher, $viewInformation->filterLanguageId), $levelDefinedMeaningName, $dmObjectIdFetcher));
129 - $objectAttributesEditor->addEditor(getURLAttributeValuesEditor($viewInformation, new URLAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher));
 129+ $objectAttributesEditor->addEditor(getLinkAttributeValuesEditor($viewInformation, new LinkAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher));
130130 $objectAttributesEditor->addEditor(getOptionAttributeValuesEditor($viewInformation, new OptionAttributeValuesController($objectIdFetcher), $levelDefinedMeaningName, $dmObjectIdFetcher));
131131 }
132132
@@ -361,15 +361,15 @@
362362 return $editor;
363363 }
364364
365 -function getURLAttributeValuesEditor(ViewInformation $viewInformation, UpdateController $controller, $levelDefinedMeaningName, Fetcher $objectIdFetcher) {
 365+function getLinkAttributeValuesEditor(ViewInformation $viewInformation, UpdateController $controller, $levelDefinedMeaningName, Fetcher $objectIdFetcher) {
366366 global
367 - $urlAttributeAttribute, $urlAttribute, $urlAttributeValuesAttribute, $urlValueObjectAttributesEditor,
 367+ $linkAttributeAttribute, $linkAttribute, $linkAttributeValuesAttribute, $linkValueObjectAttributesEditor,
368368 $wgPopupAnnotationName;
369369
370 - $editor = new RecordSetTableEditor($urlAttributeValuesAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, $controller);
371 - $editor->addEditor(new URLAttributeEditor($urlAttributeAttribute, new SimplePermissionController(false), true, $levelDefinedMeaningName, $objectIdFetcher));
372 - $editor->addEditor(new URLEditor($urlAttribute, new SimplePermissionController(true), true));
373 - $editor->addEditor(new PopUpEditor($urlValueObjectAttributesEditor, $wgPopupAnnotationName));
 370+ $editor = new RecordSetTableEditor($linkAttributeValuesAttribute, new SimplePermissionController(true), new ShowEditFieldChecker(true), new AllowAddController(true), true, false, $controller);
 371+ $editor->addEditor(new LinkAttributeEditor($linkAttributeAttribute, new SimplePermissionController(false), true, $levelDefinedMeaningName, $objectIdFetcher));
 372+ $editor->addEditor(new LinkEditor($linkAttribute, new SimplePermissionController(true), true));
 373+ $editor->addEditor(new PopUpEditor($linkValueObjectAttributesEditor, $wgPopupAnnotationName));
374374
375375 addTableMetadataEditors($editor, $viewInformation);
376376
@@ -580,8 +580,8 @@
581581 return new ShortTextEditor($attribute, new SimplePermissionController(false), false);
582582 }
583583
584 -function createURLViewer($attribute) {
585 - return new URLEditor($attribute, new SimplePermissionController(false), false);
 584+function createLinkViewer($attribute) {
 585+ return new LinkEditor($attribute, new SimplePermissionController(false), false);
586586 }
587587
588588 function createBooleanViewer($attribute) {
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiRecordSets.php
@@ -557,7 +557,7 @@
558558 function getObjectAttributesRecord($objectId, ViewInformation $viewInformation, $structuralOverride = null) {
559559 global
560560 $objectIdAttribute,
561 - $urlAttributeValuesAttribute, $textAttributeValuesAttribute,
 561+ $linkAttributeValuesAttribute, $textAttributeValuesAttribute,
562562 $translatedTextAttributeValuesAttribute, $optionAttributeValuesAttribute,
563563 $definedMeaningAttributesAttribute;
564564
@@ -569,7 +569,7 @@
570570 $record->setAttributeValue($objectIdAttribute, $objectId);
571571 $record->setAttributeValue($textAttributeValuesAttribute, getTextAttributesValuesRecordSet(array($objectId), $viewInformation));
572572 $record->setAttributeValue($translatedTextAttributeValuesAttribute, getTranslatedTextAttributeValuesRecordSet(array($objectId), $viewInformation));
573 - $record->setAttributeValue($urlAttributeValuesAttribute, getURLAttributeValuesRecordSet(array($objectId), $viewInformation));
 573+ $record->setAttributeValue($linkAttributeValuesAttribute, getLinkAttributeValuesRecordSet(array($objectId), $viewInformation));
574574 $record->setAttributeValue($optionAttributeValuesAttribute, getOptionAttributeValuesRecordSet(array($objectId), $viewInformation));
575575
576576 return $record;
@@ -601,7 +601,7 @@
602602 $definedMeaningAttributesAttribute, $objectIdAttribute,
603603 $textAttributeValuesAttribute, $textAttributeAttribute,
604604 $translatedTextAttributeAttribute, $translatedTextAttributeValuesAttribute,
605 - $urlAttributeAttribute, $urlAttributeValuesAttribute,
 605+ $linkAttributeAttribute, $linkAttributeValuesAttribute,
606606 $optionAttributeAttribute, $optionAttributeValuesAttribute;
607607
608608 $result = new ArrayRecord(new Structure($definedMeaningAttributesAttribute));
@@ -619,9 +619,9 @@
620620 $attributeIds
621621 ));
622622
623 - $result->setAttributeValue($urlAttributeValuesAttribute, filterAttributeValues(
624 - $sourceRecord->getAttributeValue($urlAttributeValuesAttribute),
625 - $urlAttributeAttribute,
 623+ $result->setAttributeValue($linkAttributeValuesAttribute, filterAttributeValues(
 624+ $sourceRecord->getAttributeValue($linkAttributeValuesAttribute),
 625+ $linkAttributeAttribute,
626626 $attributeIds
627627 ));
628628
@@ -743,7 +743,7 @@
744744 global
745745 $textAttributeObjectAttribute, $textAttributeValuesAttribute,
746746 $translatedTextAttributeObjectAttribute, $translatedTextAttributeValuesAttribute,
747 - $urlAttributeObjectAttribute, $urlAttributeValuesAttribute,
 747+ $linkAttributeObjectAttribute, $linkAttributeValuesAttribute,
748748 $optionAttributeObjectAttribute, $optionAttributeValuesAttribute;
749749
750750 $recordSetStructure = $recordSet->getStructure();
@@ -780,15 +780,15 @@
781781
782782 $emptyTranslatedTextAttributesRecordSet = new ArrayRecordSet($allTranslatedTextAttributeValuesRecordSet->getStructure(), $allTranslatedTextAttributeValuesRecordSet->getKey());
783783
784 - // URL attributes
785 - $allURLAttributeValuesRecordSet = getURLAttributeValuesRecordSet($objectIds, $viewInformation);
786 - $urlAttributeValuesRecordSets =
 784+ // Link attributes
 785+ $allLinkAttributeValuesRecordSet = getLinkAttributeValuesRecordSet($objectIds, $viewInformation);
 786+ $linkAttributeValuesRecordSets =
787787 splitRecordSet(
788 - $allURLAttributeValuesRecordSet,
789 - $urlAttributeObjectAttribute
 788+ $allLinkAttributeValuesRecordSet,
 789+ $linkAttributeObjectAttribute
790790 );
791791
792 - $emptyURLAttributesRecordSet = new ArrayRecordSet($allURLAttributeValuesRecordSet->getStructure(), $allURLAttributeValuesRecordSet->getKey());
 792+ $emptyLinkAttributesRecordSet = new ArrayRecordSet($allLinkAttributeValuesRecordSet->getStructure(), $allLinkAttributeValuesRecordSet->getKey());
793793
794794 // Option attributes
795795 $allOptionAttributeValuesRecordSet = getOptionAttributeValuesRecordSet($objectIds, $viewInformation);
@@ -817,11 +817,11 @@
818818 else
819819 $translatedTextAttributeValuesRecordSet = $emptyTranslatedTextAttributesRecordSet;
820820
821 - // URL attributes
822 - if (isset($urlAttributeValuesRecordSets[$objectId]))
823 - $urlAttributeValuesRecordSet = $urlAttributeValuesRecordSets[$objectId];
 821+ // Link attributes
 822+ if (isset($linkAttributeValuesRecordSets[$objectId]))
 823+ $linkAttributeValuesRecordSet = $linkAttributeValuesRecordSets[$objectId];
824824 else
825 - $urlAttributeValuesRecordSet = $emptyURLAttributesRecordSet;
 825+ $linkAttributeValuesRecordSet = $emptyLinkAttributesRecordSet;
826826
827827 // Option attributes
828828 if (isset($optionAttributeValuesRecordSets[$objectId]))
@@ -833,7 +833,7 @@
834834 $objectAttributesRecord->setAttributeValue($objectIdAttribute, $objectId);
835835 $objectAttributesRecord->setAttributeValue($textAttributeValuesAttribute, $textAttributeValuesRecordSet);
836836 $objectAttributesRecord->setAttributeValue($translatedTextAttributeValuesAttribute, $translatedTextAttributeValuesRecordSet);
837 - $objectAttributesRecord->setAttributeValue($urlAttributeValuesAttribute, $urlAttributeValuesRecordSet);
 837+ $objectAttributesRecord->setAttributeValue($linkAttributeValuesAttribute, $linkAttributeValuesRecordSet);
838838 $objectAttributesRecord->setAttributeValue($optionAttributeValuesAttribute, $optionAttributeValuesRecordSet);
839839
840840 $record->setAttributeValue($attributeToExpand, $objectAttributesRecord);
@@ -1006,28 +1006,28 @@
10071007 return $recordSet;
10081008 }
10091009
1010 -function getURLAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) {
 1010+function getLinkAttributeValuesRecordSet(array $objectIds, ViewInformation $viewInformation) {
10111011 global
1012 - $urlAttributeValuesTable, $urlAttributeIdAttribute, $urlAttributeObjectAttribute,
1013 - $urlAttributeAttribute, $urlAttribute, $objectAttributesAttribute,
1014 - $urlAttributeValuesStructure;
 1012+ $linkAttributeValuesTable, $linkAttributeIdAttribute, $linkAttributeObjectAttribute,
 1013+ $linkAttributeAttribute, $linkAttribute, $objectAttributesAttribute,
 1014+ $linkAttributeValuesStructure;
10151015
10161016 $recordSet = queryRecordSet(
1017 - $urlAttributeValuesStructure->getStructureType(),
 1017+ $linkAttributeValuesStructure->getStructureType(),
10181018 $viewInformation->queryTransactionInformation,
1019 - $urlAttributeIdAttribute,
 1019+ $linkAttributeIdAttribute,
10201020 new TableColumnsToAttributesMapping(
1021 - new TableColumnsToAttribute(array('value_id'), $urlAttributeIdAttribute),
1022 - new TableColumnsToAttribute(array('object_id'), $urlAttributeObjectAttribute),
1023 - new TableColumnsToAttribute(array('attribute_mid'), $urlAttributeAttribute),
1024 - new TableColumnsToAttribute(array('url'), $urlAttribute)
 1021+ new TableColumnsToAttribute(array('value_id'), $linkAttributeIdAttribute),
 1022+ new TableColumnsToAttribute(array('object_id'), $linkAttributeObjectAttribute),
 1023+ new TableColumnsToAttribute(array('attribute_mid'), $linkAttributeAttribute),
 1024+ new TableColumnsToAttribute(array('url'), $linkAttribute)
10251025 ),
1026 - $urlAttributeValuesTable,
 1026+ $linkAttributeValuesTable,
10271027 array("object_id IN (" . implode(", ", $objectIds) . ")")
10281028 );
10291029
1030 - expandDefinedMeaningReferencesInRecordSet($recordSet, array($urlAttributeAttribute));
1031 - expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $urlAttributeIdAttribute, $viewInformation);
 1030+ expandDefinedMeaningReferencesInRecordSet($recordSet, array($linkAttributeAttribute));
 1031+ expandObjectAttributesAttribute($recordSet, $objectAttributesAttribute, $linkAttributeIdAttribute, $viewInformation);
10321032
10331033 return $recordSet;
10341034 }
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -1016,7 +1016,7 @@
10171017 }
10181018 }
10191019
1020 -class URLEditor extends ShortTextEditor {
 1020+class LinkEditor extends ShortTextEditor {
10211021 public function getViewHTML(IdStack $idPath, $value) {
10221022 global
10231023 $escapedValue;
@@ -1230,9 +1230,9 @@
12311231 }
12321232 }
12331233
1234 -class URLAttributeEditor extends AttributeEditor {
 1234+class LinkAttributeEditor extends AttributeEditor {
12351235 protected function suggestType() {
1236 - return "url-attribute";
 1236+ return "link-attribute";
12371237 }
12381238 }
12391239
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataTables.php
@@ -351,7 +351,7 @@
352352 }
353353 }
354354
355 -class URLAttributeValuesTable extends VersionedTable {
 355+class LinkAttributeValuesTable extends VersionedTable {
356356 public $valueId;
357357 public $objectId;
358358 public $attributeMid;
@@ -381,6 +381,7 @@
382382 $collectionMembershipsTable,
383383 $definedMeaningTable,
384384 $expressionTable,
 385+ $linkAttributeValuesTable,
385386 $meaningRelationsTable,
386387 $optionAttributeOptionsTable,
387388 $optionAttributeValuesTable,
@@ -388,8 +389,7 @@
389390 $textAttributeValuesTable,
390391 $translatedContentAttributeValuesTable,
391392 $translatedContentTable,
392 - $transactionsTable,
393 - $urlAttributeValuesTable;
 393+ $transactionsTable;
394394
395395 $dc=wdGetDataSetContext();
396396 $alternativeDefinitionsTable = new AlternativeDefinitionsTable("alt_meaningtexts");
@@ -399,6 +399,7 @@
400400 $collectionMembershipsTable = new CollectionMembershipsTable("collection_contents");
401401 $definedMeaningTable = new DefinedMeaningTable("defined_meaning");
402402 $expressionTable = new ExpressionTable("expression_ns");
 403+$linkAttributeValuesTable = new LinkAttributeValuesTable("url_attribute_values");
403404 $meaningRelationsTable = new MeaningRelationsTable("meaning_relations");
404405 $syntransTable = new SyntransTable("syntrans");
405406 $textAttributeValuesTable = new TextAttributeValuesTable("text_attribute_values");
@@ -407,7 +408,6 @@
408409 $translatedContentTable = new TranslatedContentTable("translated_content");
409410 $optionAttributeOptionsTable = new OptionAttributeOptionsTable("option_attribute_options");
410411 $optionAttributeValuesTable = new OptionAttributeValuesTable("option_attribute_values");
411 -$urlAttributeValuesTable = new URLAttributeValuesTable("url_attribute_values");
412412
413413 function select(array $expressions, array $tables, array $restrictions) {
414414 $result = "SELECT " . $expressions[0]->toExpression();

Status & tagging log