r24164 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24163‎ | r24164 | r24165 >
Date:15:10, 16 July 2007
Author:kim
Status:old
Tags:
Comment:
OmegaWikiAttributes Attribute names deprecated
Now located in App.php
Modified paths:
  • /trunk/extensions/Wikidata/App.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/functionvar.php (added) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/overload.php (added) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/scoping.php (added) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/small/searchterms.sh (added) (history)
  • /trunk/extensions/Wikidata/TODO (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/TODO
@@ -6,6 +6,7 @@
77 * complete
88 * robust
99 * debug
 10+* Conceptmapper will use specialsuggest
1011
1112
1213 General Tidying (refactoring)
@@ -20,3 +21,9 @@
2122 but currently cheats and allows one to access any stored item
2223 by key. This should be revisited when the attribute system
2324 is refurbished.
 25+
 26+Unit Testing
 27+=========================
 28+* Extend unit testing framework to also safely test on its own database.
 29+ Since wikidata is somewhat database based, this should allow testing
 30+ of a majority of the code.
Index: trunk/extensions/Wikidata/App.php
@@ -116,6 +116,55 @@
117117 'ow_concept_panel'=>'Concept Panel',
118118 'ow_dm_badtitle'=>'This page does not point to any DefinedMeaning (concept). Please check the web address.',
119119 'ow_dm_missing'=>'This page seems to point to a non-existent DefinedMeaning (concept). Please check the web address.',
 120+ "AlternativeDefinition" => "Alternative definition",
 121+ "AlternativeDefinitions" => "Alternative definitions",
 122+ "Annotation" => "Annotation",
 123+ "ApproximateMeanings" => "Approximate meanings",
 124+ "ClassAttributeAttribute" => "Attribute",
 125+ "ClassAttributes" => "Class attributes",
 126+ "ClassAttributeLevel" => "Level",
 127+ "ClassAttributeType" => "Type",
 128+ "ClassMembership" => "Class membership",
 129+ "Collection" => "Collection",
 130+ "CollectionMembership" => "Collection membership",
 131+ "Definition" => "Definition",
 132+ "DefinedMeaningAttributes" => "Annotation",
 133+ "DefinedMeaning" => "Defined meaning",
 134+ "DefinedMeaningReference" => "Defined meaning",
 135+ "ExactMeanings" => "Exact meanings",
 136+ "Expression" => "Expression",
 137+ "ExpressionMeanings" => "Expression meanings",
 138+ "Expressions" => "Expressions",
 139+ "IdenticalMeaning" => "Identical meaning?",
 140+ "IncomingRelations" => "Incoming relations",
 141+ "GotoSource" => "Go to source",
 142+ "Language" => "Language",
 143+ "LevelAnnotation" => "Annotation",
 144+ "OptionAttribute" => "Property",
 145+ "OptionAttributeOption" => "Option",
 146+ "OptionAttributeOptions" => "Options",
 147+ "OptionAttributeValues" => "Option properties",
 148+ "OtherDefinedMeaning" => "Other defined meaning",
 149+ "PopupAnnotation" => "Annotation",
 150+ "PossibleSynonym" => "Possible synonym",
 151+ "PossiblySynonymous" => "Possibly synonymous",
 152+ "Relations" => "Relations",
 153+ "RelationType" => "Relation type",
 154+ "Spelling" => "Spelling",
 155+ "Synonyms" => "Synonyms",
 156+ "SynonymsAndTranslations" => "Synonyms and translations",
 157+ "Source" => "Source",
 158+ "SourceIdentifier" => "Source identifier",
 159+ "TextAttribute" => "Property",
 160+ "Text" => "Text",
 161+ "TextAttributeValues" => "String properties",
 162+ "TranslatedTextAttribute" => "Property",
 163+ "TranslatedText" => "Translated text",
 164+ "TranslatedTextAttributeValue" => "Text",
 165+ "TranslatedTextAttributeValues" => "Text properties",
 166+ "LinkAttribute" => "Property",
 167+ "LinkAttributeValues" => "Links"
 168+
120169 )
121170 );
122171
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php
@@ -1,6 +1,13 @@
22 <?php
33
4 -// Attribute names
 4+require_once("Wikidata.php");
 5+// Attribute names (OLD)
 6+// deprecated/ legacy code
 7+// these definitions can now be found in App.php
 8+// would replace all now, but I'd also need to go through
 9+// OmegaWikiEditors.php with a fine-toothed comb, which I don't
 10+// feel like doing right now:-P
 11+//do not use for new items
512
613 global
714 $wgAlternativeDefinitionAttributeName,
@@ -191,4 +198,4 @@
192199 *
193200 */
194201 $wgPropertyToColumnFilters = array();
195 -?>
\ No newline at end of file
 202+?>
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -45,7 +45,7 @@
4646 * @deprecated use/update OmegaWikiAttributes->hardValues instead for now.
4747 */
4848 function initializeOmegaWikiAttributesOld(ViewInformation $viewInformation) {
49 - global
 49+ global
5050 $languageAttribute, $spellingAttribute, $textAttribute,
5151 $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName;
5252
@@ -351,6 +351,7 @@
352352 foreach ($annotatedAttributes as $annotatedAttribute)
353353 $annotatedAttribute->type->addAttribute($attribute);
354354 }
 355+
355356 }
356357
357358
@@ -368,226 +369,156 @@
369370 */
370371 private function hardValues($viewInformation) {
371372
372 - $a=&$this->attributes; # <- wrist/RSI protection
373 - $t=$this; #<-idem
 373+ $t=$this; #<-keep things short to declutter
374374
375 - global
376 - $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName;
377 -
378 - $t->language = new Attribute("language", $wgLanguageAttributeName, "language");
379 - $t->spelling = new Attribute("spelling", $wgSpellingAttributeName, "spelling");
380 - $t->text = new Attribute("text", $wgTextAttributeName, "text");
381 -
382 - global
383 - $wgDefinedMeaningAttributesAttributeName,
384 - $wgDefinedMeaningAttributesAttributeName, $wgDefinedMeaningAttributesAttributeId, $wgAnnotationAttributeName;
385 -
386 - $t->definedMeaningAttributes = new Attribute("defined-meaning-attributes", $wgDefinedMeaningAttributesAttributeName, "will-be-specified-below");
387 - $t->objectAttributes = new Attribute("object-attributes", $wgAnnotationAttributeName, "will-be-specified-below");
388 -
389 - global
390 - $wgIdenticalMeaningAttributeName;
391 -
 375+ $t->language = new Attribute("language", wfMsg("Language"), "language");
 376+ $t->spelling = new Attribute("spelling", wfMsg("Spelling"), "spelling");
 377+ $t->text = new Attribute("text", wfMsg("Text"), "text");
 378+ $t->definedMeaningAttributes = new Attribute("defined-meaning-attributes", wfMsg("DefinedMeaningAttributes"), "will-be-specified-below");
 379+ $t->objectAttributes = new Attribute("object-attributes", wfMsg("Annotation"), "will-be-specified-below");
392380 $t->expressionId = new Attribute("expression-id", "Expression Id", "expression-id");
393 - $t->identicalMeaning = new Attribute("indentical-meaning", $wgIdenticalMeaningAttributeName, "boolean");
 381+ $t->identicalMeaning = new Attribute("indentical-meaning", wfMsg("IdenticalMeaning"), "boolean");
394382
395 - global
396 - $wgExpressionAttributeName;
397 -
398383 if ($viewInformation->filterOnLanguage())
399 - $t->expression = new Attribute("expression", $wgSpellingAttributeName, "spelling");
 384+ $t->expression = new Attribute("expression", wfMsg("Spelling"), "spelling");
400385 else {
401386 $t->expressionStructure = new Structure("expression", $t->language, $t->spelling);
402 - $t->expression = new Attribute(null, $wgExpressionAttributeName, $t->expressionStructure);
 387+ $t->expression = new Attribute(null, wfMsg("Expression"), $t->expressionStructure);
403388 }
404389
405390 $t->definedMeaningId = new Attribute("defined-meaning-id", "Defined meaning identifier", "defined-meaning-id");
406391 $t->definedMeaningDefiningExpression = new Attribute("defined-meaning-defining-expression", "Defined meaning defining expression", "short-text");
407 -
408392 $t->definedMeaningCompleteDefiningExpressionStructure =
409 - new Structure("defined-meaning-full-defining-expression",
410 - $t->definedMeaningDefiningExpression,
411 - $t->expressionId,
412 - $t->language
413 - );
414 -
 393+ new Structure("defined-meaning-full-defining-expression",
 394+ $t->definedMeaningDefiningExpression,
 395+ $t->expressionId,
 396+ $t->language
 397+ );
415398 $t->definedMeaningCompleteDefiningExpression=new Attribute(null, "Defining expression", $t->definedMeaningCompleteDefiningExpressionStructure);
416 -
417 -
418 -
419399 global
420 - $definedMeaningReferenceType, $wgDefinedMeaningReferenceAttributeName;
 400+ $definedMeaningReferenceType;
421401
422402 $t->definedMeaningLabel = new Attribute("defined-meaning-label", "Defined meaning label", "short-text");
423403 $t->definedMeaningReferenceStructure = new Structure("defined-meaning", $t->definedMeaningId, $t->definedMeaningLabel, $t->definedMeaningDefiningExpression);
424 -
425404 $definedMeaningReferenceType = $t->definedMeaningReferenceStructure;
426 - $t->definedMeaningReference = new Attribute(null, $wgDefinedMeaningReferenceAttributeName, $definedMeaningReferenceType);
427 -
428 - global
429 - $wgCollectionAttributeName, $wgSourceIdentifierAttributeName, $wgGotoSourceAttributeName;
430 -
 405+ $t->definedMeaningReference = new Attribute(null, wfMsg("DefinedMeaningReference"), $definedMeaningReferenceType);
431406 $t->collectionId = new Attribute("collection", "Collection", "collection-id");
432 - $t->collectionMeaning = new Attribute("collection-meaning", $wgCollectionAttributeName, $t->definedMeaningReferenceStructure);
433 - $t->sourceIdentifier = new Attribute("source-identifier", $wgSourceIdentifierAttributeName, "short-text");
 407+ $t->collectionMeaning = new Attribute("collection-meaning", wfMsg("Collection"), $t->definedMeaningReferenceStructure);
 408+ $t->sourceIdentifier = new Attribute("source-identifier", wfMsg("SourceIdentifier"), "short-text");
434409 $t->gotoSourceStructure = new Structure("goto-source",$t->collectionId, $t->sourceIdentifier);
435 - $t->gotoSource = new Attribute(null, $wgGotoSourceAttributeName, $t->gotoSourceStructure);
436 -
437 - global
438 - $wgCollectionMembershipAttributeName, $wgCollectionMembershipAttributeId;
439 -
 410+ $t->gotoSource = new Attribute(null, wfMsg("GotoSource"), $t->gotoSourceStructure);
440411 $t->collectionMembershipStructure = new Structure("collection-membership",$t->collectionId, $t->collectionMeaning, $t->sourceIdentifier);
441 - $t->collectionMembership = new Attribute(null, $wgCollectionMembershipAttributeName, $t->collectionMembershipStructure);
442 -
 412+ $t->collectionMembership = new Attribute(null, wfMsg("CollectionMembership"), $t->collectionMembershipStructure);
443413 $t->classMembershipId = new Attribute("class-membership-id", "Class membership id", "integer");
444414 $t->class = new Attribute("class", "Class", $t->definedMeaningReferenceStructure);
445 -
446 - global
447 - $wgClassMembershipAttributeName, $wgClassMembershipAttributeId;
448 -
449415 $t->classMembershipStructure = new Structure("class-membership", $t->classMembershipId, $t->class);
450 - $t->classMembership = new Attribute(null, $wgClassMembershipAttributeName, $t->classMembershipStructure);
451 -
 416+ $t->classMembership = new Attribute(null, wfMsg("ClassMembership"), $t->classMembershipStructure);
452417 global
453 - $wgPossibleSynonymAttributeName,
454 - $wgPossiblySynonymousAttributeName, $wgPossiblySynonymousAttributeId;
 418+ $wgPossiblySynonymousAttributeId;
455419
456420 $t->possiblySynonymousId = new Attribute("possibly-synonymous-id", "Possibly synonymous id", "integer");
457 - $t->possibleSynonym = new Attribute("possible-synonym", $wgPossibleSynonymAttributeName, $t->definedMeaningReferenceStructure);
 421+ $t->possibleSynonym = new Attribute("possible-synonym", wfMsg("PossibleSynonym"), $t->definedMeaningReferenceStructure);
458422 # Bug found ... This never worked before: (!)
459423 #$t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possiblySynonymous);
460424 $t->possiblySynonymousStructure = new Structure("possibly-synonymous", $t->possiblySynonymousId, $t->possibleSynonym);
461 - $t->possiblySynonymous = new Attribute(null, $wgPossiblySynonymousAttributeName, $t->possiblySynonymousStructure);
 425+ $t->possiblySynonymous = new Attribute(null, wfMsg("PossiblySynonymous"), $t->possiblySynonymousStructure);
462426
463427 global
464 - $relationTypeType,
465 - $wgRelationTypeAttributeName, $wgOtherDefinedMeaningAttributeName;
 428+ $relationTypeType;
466429
467430 $t->relationId = new Attribute("relation-id", "Relation identifier", "object-id");
468 - $t->relationType = new Attribute("relation-type", $wgRelationTypeAttributeName, $t->definedMeaningReferenceStructure);
469 - $t->otherDefinedMeaning = new Attribute("other-defined-meaning", $wgOtherDefinedMeaningAttributeName, $definedMeaningReferenceType);
 431+ $t->relationType = new Attribute("relation-type", wfMsg("RelationType"), $t->definedMeaningReferenceStructure);
 432+ $t->otherDefinedMeaning = new Attribute("other-defined-meaning", wfMsg("OtherDefinedMeaning"), $definedMeaningReferenceType);
470433
471434 global
472 - $wgRelationsAttributeName, $wgIncomingRelationsAttributeName, $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ;
 435+ $wgRelationsAttributeId, $wgIncomingRelationsAttributeId ;
473436
474437 $t->relationStructure = new Structure("relations", $t->relationId, $t->relationType, $t->otherDefinedMeaning, $t->objectAttributes);
475 - $t->relations = new Attribute(null, $wgRelationsAttributeName, $t->relationStructure);
476 - $t->reciprocalRelations = new Attribute("reciprocal-relations", $wgIncomingRelationsAttributeName, $t->relationStructure);
477 -
 438+ $t->relations = new Attribute(null, wfMsg("Relations"), $t->relationStructure);
 439+ $t->reciprocalRelations = new Attribute("reciprocal-relations", wfMsg("IncomingRelations"), $t->relationStructure);
478440 $t->translatedTextId = new Attribute("translated-text-id", "Translated text ID", "integer");
479441 $t->translatedTextStructure = new Structure("translated-text", $t->language, $t->text);
480442
481 - global
482 - $wgAlternativeDefinitionAttributeName, $wgSourceAttributeName;
483 -
484443 $t->definitionId = new Attribute("definition-id", "Definition identifier", "integer");
485444
486445 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
487 - $t->alternativeDefinition = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, "text");
 446+ $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), "text");
488447 else
489 - $t->alternativeDefinition = new Attribute("alternative-definition", $wgAlternativeDefinitionAttributeName, $t->translatedTextStructure);
 448+ $t->alternativeDefinition = new Attribute("alternative-definition", wfMsg("AlternativeDefinition"), $t->translatedTextStructure);
490449
491 - $t->source = new Attribute("source-id", $wgSourceAttributeName, $definedMeaningReferenceType);
 450+ $t->source = new Attribute("source-id", wfMsg("Source"), $definedMeaningReferenceType);
492451
493452 global
494 - $wgAlternativeDefinitionsAttributeName, $wgAlternativeDefinitionsAttributeId;
 453+ $wgAlternativeDefinitionsAttributeId;
495454
496455 $t->alternativeDefinitionsStructure = new Structure("alternative-definitions", $t->definitionId, $t->alternativeDefinition, $t->source);
497456
498 - $t->alternativeDefinitions = new Attribute(null, $wgAlternativeDefinitionsAttributeName, $t->alternativeDefinitionsStructure);
 457+ $t->alternativeDefinitions = new Attribute(null, wfMsg("AlternativeDefinitions"), $t->alternativeDefinitionsStructure);
499458
500459 global
501 - $wgSynonymsAttributeName, $wgSynonymsAndTranslationsAttributeName, $wgSynonymsAndTranslationsAttributeId;
 460+ $wgSynonymsAndTranslationsAttributeId;
502461
503462 if ($viewInformation->filterOnLanguage())
504 - $synonymsAndTranslationsCaption = $wgSynonymsAttributeName;
 463+ $synonymsAndTranslationsCaption = wfMsg("Synonyms");
505464 else
506 - $synonymsAndTranslationsCaption = $wgSynonymsAndTranslationsAttributeName;
 465+ $synonymsAndTranslationsCaption = wfMsg("SynonymsAndTranslations");
507466
508467 $t->syntransId = new Attribute("syntrans-id", "$synonymsAndTranslationsCaption identifier", "integer");
509468 $t->synonymsTranslationsStructure = new Structure("synonyms-translations", $t->syntransId, $t->expression, $t->identicalMeaning, $t->objectAttributes);
510469 $t->synonymsAndTranslations = new Attribute(null, "$synonymsAndTranslationsCaption", $t->synonymsTranslationsStructure);
511 -
512 - global
513 - $wgTranslatedTextAttributeValuesAttributeName, $wgTranslatedTextAttributeAttributeName, $wgTranslatedTextAttributeValueAttributeName;
514 -
515470 $t->translatedTextAttributeId = new Attribute("translated-text-attribute-id", "Attribute identifier", "object-id");
516471 $t->translatedTextAttributeObject = new Attribute("translated-text-attribute-object-id", "Attribute object", "object-id");
517 - $t->translatedTextAttribute = new Attribute("translated-text-attribute", $wgTranslatedTextAttributeAttributeName, $definedMeaningReferenceType);
 472+ $t->translatedTextAttribute = new Attribute("translated-text-attribute", wfMsg("TranslatedTextAttribute"), $definedMeaningReferenceType);
518473 $t->translatedTextValueId = new Attribute("translated-text-value-id", "Translated text value identifier", "translated-text-value-id");
519474
520475 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
521 - $t->translatedTextValue = new Attribute("translated-text-value", $wgTranslatedTextAttributeValueAttributeName, "text");
 476+ $t->translatedTextValue = new Attribute("translated-text-value", wfMsg("TranslatedTextAttributeValue"), "text");
522477 else
523 - $t->translatedTextValue = new Attribute("translated-text", $wgTranslatedTextAttributeValueAttributeName, $t->translatedTextStructure);
 478+ $t->translatedTextValue = new Attribute("translated-text", wfMsg("TranslatedTextAttributeValue"), $t->translatedTextStructure);
524479
525480 $t->translatedTextAttributeValuesStructure = new Structure("translated-text-attribute-values",$t->translatedTextAttributeId, $t->translatedTextAttributeObject, $t->translatedTextAttribute, $t->translatedTextValueId, $t->translatedTextValue, $t->objectAttributes);
526 - $t->translatedTextAttributeValues = new Attribute(null, $wgTranslatedTextAttributeValuesAttributeName, $t->translatedTextAttributeValuesStructure);
527 -
528 - global
529 - $wgTextAttributeValuesAttributeName, $wgTextAttributeAttributeName;
530 -
 481+ $t->translatedTextAttributeValues = new Attribute(null, wfMsg("TranslatedTextAttributeValues"), $t->translatedTextAttributeValuesStructure);
531482 $t->textAttributeId = new Attribute("text-attribute-id", "Attribute identifier", "object-id");
532483 $t->textAttributeObject = new Attribute("text-attribute-object-id", "Attribute object", "object-id");
533 - $t->textAttribute = new Attribute("text-attribute", $wgTextAttributeAttributeName, $t->definedMeaningReferenceStructure);
 484+ $t->textAttribute = new Attribute("text-attribute", wfMsg("TextAttribute"), $t->definedMeaningReferenceStructure);
534485 $t->textAttributeValuesStructure = new Structure("text-attribute-values", $t->textAttributeId, $t->textAttributeObject, $t->textAttribute, $t->text, $t->objectAttributes);
535 - $t->textAttributeValues = new Attribute(null, $wgTextAttributeValuesAttributeName, $t->textAttributeValuesStructure);
536 -
537 - global
538 - $wgLinkAttributeValuesAttributeName, $wgLinkAttributeAttributeName;
539 -
 486+ $t->textAttributeValues = new Attribute(null, wfMsg("TextAttributeValues"), $t->textAttributeValuesStructure);
540487 $t->linkLabel = new Attribute("label", "Label", "short-text");
541488 $t->linkURL = new Attribute("url", "URL", "url");
542489 $t->link = new Attribute("link", "Link", new Structure($t->linkLabel, $t->linkURL));
543490
544491 $t->linkAttributeId = new Attribute("link-attribute-id", "Attribute identifier", "object-id");
545492 $t->linkAttributeObject = new Attribute("link-attribute-object-id", "Attribute object", "object-id");
546 - $t->linkAttribute = new Attribute("link-attribute", $wgLinkAttributeAttributeName, $t->definedMeaningReferenceStructure);
 493+ $t->linkAttribute = new Attribute("link-attribute", wfMsg("LinkAttribute"), $t->definedMeaningReferenceStructure);
547494 $t->linkAttributeValuesStructure = new Structure("link-attribute-values", $t->linkAttributeId, $t->linkAttributeObject, $t->linkAttribute, $t->link, $t->objectAttributes);
548 - $t->linkAttributeValues = new Attribute(null, $wgLinkAttributeValuesAttributeName, $t->linkAttributeValuesStructure);
549 -
550 - global
551 - $wgOptionAttributeAttributeName, $wgOptionAttributeOptionAttributeName, $wgOptionAttributeValuesAttributeName;
552 -
 495+ $t->linkAttributeValues = new Attribute(null, wfMsg("LinkAttributeValues"), $t->linkAttributeValuesStructure);
553496 $t->optionAttributeId = new Attribute('option-attribute-id', 'Attribute identifier', 'object-id');
554497 $t->optionAttributeObject = new Attribute('option-attribute-object-id', 'Attribute object', 'object-id');
555 - $t->optionAttribute = new Attribute('option-attribute', $wgOptionAttributeAttributeName, $definedMeaningReferenceType);
556 - $t->optionAttributeOption = new Attribute('option-attribute-option', $wgOptionAttributeOptionAttributeName, $definedMeaningReferenceType);
 498+ $t->optionAttribute = new Attribute('option-attribute', wfMsg("OptionAttribute"), $definedMeaningReferenceType);
 499+ $t->optionAttributeOption = new Attribute('option-attribute-option', wfMsg("OptionAttributeOption"), $definedMeaningReferenceType);
557500 $t->optionAttributeValuesStructure = new Structure('option-attribute-values', $t->optionAttributeId, $t->optionAttribute, $t->optionAttributeObject, $t->optionAttributeOption, $t->objectAttributes);
558 - $t->optionAttributeValues = new Attribute(null, $wgOptionAttributeValuesAttributeName, $t->optionAttributeValuesStructure);
559 -
560 - global
561 - $wgOptionAttributeOptionsAttributeName;
562 -
 501+ $t->optionAttributeValues = new Attribute(null, wfMsg("OptionAttributeValues"), $t->optionAttributeValuesStructure);
563502 $t->optionAttributeOptionId = new Attribute('option-attribute-option-id', 'Option identifier', 'object-id');
564503 $t->optionAttributeOptionsStructure = new Structure('option-attribute-options', $t->optionAttributeOptionId, $t->optionAttribute, $t->optionAttributeOption, $t->language);
565 - $t->optionAttributeOptions = new Attribute(null, $wgOptionAttributeOptionsAttributeName, $t->optionAttributeOptionsStructure);
566 -
567 - global
568 - $wgDefinitionAttributeName, $wgTranslatedTextAttributeName;
569 -
 504+ $t->optionAttributeOptions = new Attribute(null, wfMsg("OptionAttributeOptions"), $t->optionAttributeOptionsStructure);
570505 if ($viewInformation->filterOnLanguage() && !$viewInformation->hasMetaDataAttributes())
571 - $t->translatedText = new Attribute("translated-text", $wgTextAttributeName, "text");
 506+ $t->translatedText = new Attribute("translated-text", wfMsg("Text"), "text");
572507 else
573 - $t->translatedText = new Attribute(null, $wgTranslatedTextAttributeName, $t->translatedTextStructure);
 508+ $t->translatedText = new Attribute(null, wfMsg("TranslatedText"), $t->translatedTextStructure);
574509
575 - $t->definition = new Attribute(null, $wgDefinitionAttributeName, new Structure("definition", $t->translatedText, $t->objectAttributes));
 510+ $t->definition = new Attribute(null, wfMsg("Definition"), new Structure("definition", $t->translatedText, $t->objectAttributes));
576511
577512 global
578 - $wgClassAttributeAttributeAttributeName, $wgClassAttributeLevelAttributeName,
579 - $wgClassAttributeTypeAttributeName, $wgClassAttributesAttributeName, $wgClassAttributesAttributeId;
 513+ $wgClassAttributesAttributeId;
580514
581515 $t->classAttributeId = new Attribute("class-attribute-id", "Class attribute identifier", "object-id");
582 - $t->classAttributeAttribute = new Attribute("class-attribute-attribute", $wgClassAttributeAttributeAttributeName, $t->definedMeaningReferenceStructure);
583 - $t->classAttributeLevel = new Attribute("class-attribute-level", $wgClassAttributeLevelAttributeName, $t->definedMeaningReferenceStructure);
584 - $t->classAttributeType = new Attribute("class-attribute-type", $wgClassAttributeTypeAttributeName, "short-text");
 516+ $t->classAttributeAttribute = new Attribute("class-attribute-attribute", wfMsg("ClassAttributeAttribute"), $t->definedMeaningReferenceStructure);
 517+ $t->classAttributeLevel = new Attribute("class-attribute-level", wfMsg("ClassAttributeLevel"), $t->definedMeaningReferenceStructure);
 518+ $t->classAttributeType = new Attribute("class-attribute-type", wfMsg("ClassAttributeType"), "short-text");
585519 $t->classAttributesStructure = new Structure("class-attributes", $t->classAttributeId, $t->classAttributeAttribute, $t->classAttributeLevel, $t->classAttributeType, $t->optionAttributeOptions);
586 - $t->classAttributes = new Attribute(null, $wgClassAttributesAttributeName, $t->classAttributesStructure);
587 -
588 - global
589 - $wgDefinedMeaningAttributeName;
 520+ $t->classAttributes = new Attribute(null, wfMsg("ClassAttributes"), $t->classAttributesStructure);
590521
591 - $t->definedMeaning = new Attribute(null, $wgDefinedMeaningAttributeName,
 522+ $t->definedMeaning = new Attribute(null, wfMsg("DefinedMeaning"),
592523 new Structure(
593524 "defined-meaning",
594525 $t->definition,
@@ -601,26 +532,14 @@
602533 $t->definedMeaningAttributes)
603534 );
604535
605 - global
606 - $wgExactMeaningsAttributeName, $wgApproximateMeaningsAttributeName;
607 -
608536 $t->expressionMeaningStructure = new Structure("expression-exact-meanings", $t->definedMeaningId, $t->text, $t->definedMeaning);
609 - $t->expressionExactMeanings = new Attribute(null, $wgExactMeaningsAttributeName, $t->expressionMeaningStructure);
610 - $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", $wgApproximateMeaningsAttributeName, $t->expressionMeaningStructure);
611 -
612 - global
613 - $wgExpressionMeaningsAttributeName, $wgExpressionsAttributeName;
614 -
 537+ $t->expressionExactMeanings = new Attribute(null, wfMsg("ExactMeanings"), $t->expressionMeaningStructure);
 538+ $t->expressionApproximateMeanings = new Attribute("expression-approximate-meanings", wfMsg("ApproximateMeanings"), $t->expressionMeaningStructure);
615539 # bug found here also: $t->expressionAoproximateMeaning_S_
616540 $t->expressionMeaningsStructure = new Structure("expression-meanings", $t->expressionExactMeanings, $t->expressionApproximateMeanings);
617 - $t->expressionMeanings = new Attribute(null, $wgExpressionMeaningsAttributeName, $t->expressionMeaningsStructure);
618 -
 541+ $t->expressionMeanings = new Attribute(null, wfMsg("ExpressionMeanings"), $t->expressionMeaningsStructure);
619542 $t->expressionsStructure = new Structure("expressions", $t->expressionId, $t->expression, $t->expressionMeanings);
620 - $t->expressions = new Attribute(null, $wgExpressionsAttributeName, $t->expressionsStructure);
621 -
622 - global
623 - $wgAnnotationAttributeName;
624 -
 543+ $t->expressions = new Attribute(null, wfMsg("Expressions"), $t->expressionsStructure);
625544 $t->objectId = new Attribute("object-id", "Object identifier", "object-id");
626545 $t->objectAttributesStructure = new Structure("object-attributes", $t->objectId, $t->textAttributeValues, $t->translatedTextAttributeValues, $t->optionAttributeValues);
627546 $t->objectAttributes->setAttributeType($t->objectAttributesStructure);
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -137,44 +137,34 @@
138138 return false;
139139 }
140140
141 - global
142 - $definedMeaningAttribute,
143 - $definitionAttribute,
144 - $classAttributesAttribute,
145 - $alternativeDefinitionsAttribute,
146 - $synonymsAndTranslationsAttribute,
147 - $relationsAttribute,
148 - $reciprocalRelationsAttribute,
149 - $classMembershipAttribute,
150 - $collectionMembershipAttribute,
151 - $definedMeaningAttributesAttribute,
152 - $possiblySynonymousAttribute,
153 - $definedMeaningCompleteDefiningExpressionAttribute;
154 -
155141 $id=$this->getId();
156142 $view=$this->getViewInformation();
157143 /** FIXME: Records should be loaded using helpers rather than
158144 global functions! */
159 - $record = new ArrayRecord($definedMeaningAttribute->type);
160 - $record->setAttributeValue($definedMeaningCompleteDefiningExpressionAttribute, getDefiningExpressionRecord($id));
161 - $record->setAttributeValue($definitionAttribute, getDefinedMeaningDefinitionRecord($id, $view));
162 - $record->setAttributeValue($classAttributesAttribute, getClassAttributesRecordSet($id, $view));
163 - $record->setAttributeValue($alternativeDefinitionsAttribute, getAlternativeDefinitionsRecordSet($id, $view));
164 - $record->setAttributeValue($synonymsAndTranslationsAttribute, getSynonymAndTranslationRecordSet($id, $view));
 145+ global
 146+ $omegaWikiAttributes;
 147+ $o=$omegaWikiAttributes;
 148+
 149+ $record = new ArrayRecord($o->definedMeaning->type);
 150+ $record->definedMeaningCompleteDefiningExpression = getDefiningExpressionRecord($id);
 151+ $record->definition = getDefinedMeaningDefinitionRecord($id, $view);
 152+ $record->classAttributes = getClassAttributesRecordSet($id, $view);
 153+ $record->alternativeDefinitions = getAlternativeDefinitionsRecordSet($id, $view);
 154+ $record->synonymsAndTranslations = getSynonymAndTranslationRecordSet($id, $view);
165155 $filterRelationTypes = array();
166156
167157 if ($view->possiblySynonymousRelationTypeId != 0) {
168 - $record->setAttributeValue($possiblySynonymousAttribute, getPossiblySynonymousRecordSet($id, $view));
 158+ $record->possiblySynonymous = getPossiblySynonymousRecordSet($id, $view);
169159 $filterRelationTypes[] = $view->possiblySynonymousRelationTypeId;
170160 }
171161
172 - $record->setAttributeValue($relationsAttribute, getDefinedMeaningRelationsRecordSet($id, $filterRelationTypes, $view));
173 - $record->setAttributeValue($reciprocalRelationsAttribute, getDefinedMeaningReciprocalRelationsRecordSet($id, $view));
174 - $record->setAttributeValue($classMembershipAttribute, getDefinedMeaningClassMembershipRecordSet($id, $view));
175 - $record->setAttributeValue($collectionMembershipAttribute, getDefinedMeaningCollectionMembershipRecordSet($id, $view));
 162+ $record->relations = getDefinedMeaningRelationsRecordSet($id, $filterRelationTypes, $view);
 163+ $record->reciprocalRelations = getDefinedMeaningReciprocalRelationsRecordSet($id, $view);
 164+ $record->classMembership = getDefinedMeaningClassMembershipRecordSet($id, $view);
 165+ $record->collectionMembership= getDefinedMeaningCollectionMembershipRecordSet($id, $view);
176166
177167 $objectAttributesRecord = getObjectAttributesRecord($id, $view);
178 - $record->setAttributeValue($definedMeaningAttributesAttribute, $objectAttributesRecord);
 168+ $record->definedMeaningAttributes = $objectAttributesRecord;
179169 applyPropertyToColumnFiltersToRecord($record, $objectAttributesRecord, $view);
180170
181171 $this->record=$record;
Index: trunk/extensions/Wikidata/OmegaWiki/small/overload.php
@@ -0,0 +1,21 @@
 2+<?PHP
 3+
 4+
 5+class bla {
 6+ protected $foo = array();
 7+
 8+ function __set($key,$value) {
 9+ $this->foo[$key]=$value;
 10+ }
 11+
 12+ function __get($key) {
 13+ return $this->foo[$key];
 14+ }
 15+}
 16+
 17+$b=new bla();
 18+$baz="bar";
 19+$b->$baz="hello";
 20+echo $b->bar;
 21+
 22+?>
Index: trunk/extensions/Wikidata/OmegaWiki/small/functionvar.php
@@ -0,0 +1,21 @@
 2+<?php
 3+
 4+class bla {
 5+
 6+
 7+ static function a($hello) {
 8+ echo $hello;
 9+ }
 10+
 11+ function b() {
 12+ $a="a";
 13+ $x=$this->$a;
 14+ $x("hello world");
 15+ }
 16+}
 17+
 18+$c=new bla();
 19+$c->b();
 20+
 21+
 22+?>
Index: trunk/extensions/Wikidata/OmegaWiki/small/scoping.php
@@ -0,0 +1,13 @@
 2+<?php
 3+static $bla="hello";
 4+
 5+function a($foo) {
 6+ final $bla=$foo;
 7+ echo $bla;
 8+}
 9+
 10+a("hello");
 11+a("bye");
 12+
 13+
 14+?>
Index: trunk/extensions/Wikidata/OmegaWiki/small/searchterms.sh
@@ -0,0 +1,50 @@
 2+#!/bin/sh
 3+
 4+
 5+grep -l 'wgAlternativeDefinitionAttributeName' *
 6+grep -l 'wgAlternativeDefinitionsAttributeName' *
 7+grep -l 'wgAnnotationAttributeName' *
 8+grep -l 'wgApproximateMeaningsAttributeName' *
 9+grep -l 'wgClassAttributeAttributeAttributeName' *
 10+grep -l 'wgClassAttributesAttributeName' *
 11+grep -l 'wgClassAttributeLevelAttributeName' *
 12+grep -l 'wgClassAttributeTypeAttributeName' *
 13+grep -l 'wgClassMembershipAttributeName' *
 14+grep -l 'wgCollectionAttributeName' *
 15+grep -l 'wgCollectionMembershipAttributeName' *
 16+grep -l 'wgDefinedMeaningAttributesAttributeName' *
 17+grep -l 'wgDefinedMeaningAttributeName' *
 18+grep -l 'wgDefinedMeaningReferenceAttributeName' *
 19+grep -l 'wgDefinitionAttributeName' *
 20+grep -l 'wgLanguageAttributeName' *
 21+grep -l 'wgExactMeaningsAttributeName' *
 22+grep -l 'wgExpressionAttributeName' *
 23+grep -l 'wgExpressionMeaningsAttributeName' *
 24+grep -l 'wgExpressionsAttributeName' *
 25+grep -l 'wgGotoSourceAttributeName' *
 26+grep -l 'wgIdenticalMeaningAttributeName' *
 27+grep -l 'wgIncomingRelationsAttributeName' *
 28+grep -l 'wgLevelAnnotationAttributeName' *
 29+grep -l 'wgLinkAttributeAttributeName' *
 30+grep -l 'wgLinkAttributeValuesAttributeName' *
 31+grep -l 'wgOptionAttributeOptionAttributeName' *
 32+grep -l 'wgOptionAttributeOptionsAttributeName' *
 33+grep -l 'wgOptionAttributeValuesAttributeName' *
 34+grep -l 'wgOtherDefinedMeaningAttributeName' *
 35+grep -l 'wgPopupAnnotationName' *
 36+grep -l 'wgPossibleSynonymAttributeName' *
 37+grep -l 'wgPossiblySynonymousAttributeName' *
 38+grep -l 'wgRelationsAttributeName' *
 39+grep -l 'wgRelationTypeAttributeName' *
 40+grep -l 'wgSourceAttributeName' *
 41+grep -l 'wgSourceIdentifierAttributeName' *
 42+grep -l 'wgSpellingAttributeName' *
 43+grep -l 'wgSynonymsAttributeName' *
 44+grep -l 'wgSynonymsAndTranslationsAttributeName' *
 45+grep -l 'wgTextAttributeAttributeName' *
 46+grep -l 'wgTextAttributeName' *
 47+grep -l 'wgTextAttributeValuesAttributeName' *
 48+grep -l 'wgTranslatedTextAttributeAttributeName' *
 49+grep -l 'wgTranslatedTextAttributeName' *
 50+grep -l 'wgTranslatedTextAttributeValueAttributeName' *
 51+grep -l 'wgTranslatedTextAttributeValuesAttributeName' *
Property changes on: trunk/extensions/Wikidata/OmegaWiki/small/searchterms.sh
___________________________________________________________________
Added: svn:executable
152 + *

Status & tagging log