r23694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23693‎ | r23694 | r23695 >
Date:09:57, 4 July 2007
Author:erik
Status:old
Tags:
Comment:
show dataset context on DM page if no mapping exists
Modified paths:
  • /trunk/extensions/Wikidata/App.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/App.php
@@ -112,7 +112,8 @@
113113 'ow_will_insert'=>"Will insert the following:",
114114 'ow_contents_of_mapping'=>'Contents of mapping',
115115 'ow_available_contexts'=>'Available contexts',
116 - 'add_concept_link'=>'Add link to other concepts'
 116+ 'add_concept_link'=>'Add link to other concepts',
 117+ 'ow_concept_panel'=>'Concept Panel'
117118 )
118119 );
119120
Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php
@@ -154,22 +154,27 @@
155155 $active=true; # wrong place, but hey
156156 $dm=$this->getDefinedMeaningId();
157157 $dc=wdGetDataSetContext();
158 - $ow_conceptpanel="Concept Panel";
 158+ $ow_conceptpanel=wfMsg("ow_concept_panel");
159159
160160 $html="<div class=\"dataset-panel\">";;
161161 $html.="<table border=\"0\"><tr><th class=\"dataset-panel-heading\">$ow_conceptpanel</th></tr>";
162162 $sk=$wgUser->getSkin();
163163 $meanings=getDefinedMeaningDataAssociatedByConcept($dm,$dc);
164 - foreach ($meanings as $dm) {
165 - $dataset=$dm->getDataset();
166 - $active=($dataset->getPrefix()==$dc->getPrefix());
167 - $name=$dataset->fetchName();
168 - #$name="woo";
169 - $prefix=$dataset->getPrefix();
170 -
171 - $class= $active ? 'dataset-panel-active' : 'dataset-panel-inactive';
172 - $slot = $active ? "$name" : $sk->makeLinkObj($dm->getTitle(),$name,"dataset=$prefix");
173 - $html.="<tr><td class=\"$class\">$slot</td></tr>";
 164+ if($meanings) {
 165+ foreach ($meanings as $dm) {
 166+ $dataset=$dm->getDataset();
 167+ $active=($dataset->getPrefix()==$dc->getPrefix());
 168+ $name=$dataset->fetchName();
 169+ #$name="woo";
 170+ $prefix=$dataset->getPrefix();
 171+
 172+ $class= $active ? 'dataset-panel-active' : 'dataset-panel-inactive';
 173+ $slot = $active ? "$name" : $sk->makeLinkObj($dm->getTitle(),$name,"dataset=$prefix");
 174+ $html.="<tr><td class=\"$class\">$slot</td></tr>";
 175+ }
 176+ } else {
 177+ $name=$dc->fetchName();
 178+ $html.="<tr><td class=\"dataset-panel-active\">$name</td></tr>";
174179 }
175180 $cmtitle=Title::newFromText("Special:ConceptMapping");
176181 $titleText=$wgTitle->getPrefixedURL();

Status & tagging log