Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaning.php |
— | — | @@ -11,6 +11,8 @@ |
12 | 12 | |
13 | 13 | parent::view(); |
14 | 14 | |
| 15 | + $this->outputViewHeader(); |
| 16 | + |
15 | 17 | $definedMeaningId = $this->getDefinedMeaningIdFromTitle($wgTitle->getText()); |
16 | 18 | |
17 | 19 | $wgOut->addHTML( |
— | — | @@ -26,8 +28,7 @@ |
27 | 29 | ) |
28 | 30 | ); |
29 | 31 | |
30 | | - $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
31 | | - $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
| 32 | + $this->outputViewFooter(); |
32 | 33 | } |
33 | 34 | |
34 | 35 | public function edit() { |
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataGlobals.php |
— | — | @@ -152,5 +152,12 @@ |
153 | 153 | |
154 | 154 | $wgDefinedMeaningPageTitlePrefix = ""; |
155 | 155 | $wgExpressionPageTitlePrefix = "Multiple meanings"; |
| 156 | + |
| 157 | +global |
| 158 | + $wgShowAuthoritativeContributionPanelAtBottom, |
| 159 | + $wgShowAuthoritativeContributionPanelAtTop; |
156 | 160 | |
| 161 | +$wgShowAuthoritativeContributionPanelAtBottom = false; |
| 162 | +$wgShowAuthoritativeContributionPanelAtTop = true; |
| 163 | + |
157 | 164 | ?> |
\ No newline at end of file |
Index: trunk/extensions/Wikidata/OmegaWiki/Wikidata.php |
— | — | @@ -17,6 +17,8 @@ |
18 | 18 | protected $queryTransactionInformation; |
19 | 19 | protected $viewQueryTransactionInformation; |
20 | 20 | protected $shouldShowAuthorities; |
| 21 | + protected $showCommunityContribution; |
| 22 | + protected $authoritiesToShow; |
21 | 23 | |
22 | 24 | // The following member variables control some application specific preferences |
23 | 25 | protected $availableAuthorities = array(); // A map containing (userId => displayName) combination for authoritative contribution view |
— | — | @@ -68,53 +70,78 @@ |
69 | 71 | return wfMsg('wz_uilang',"<b>$userlang</b>"). " — " . $skin->makeLink("Special:Preferences", wfMsg('wz_uilang_set')); |
70 | 72 | } |
71 | 73 | |
| 74 | + protected function outputAuthoritativeContributionPanel() { |
| 75 | + global |
| 76 | + $wgOut; |
| 77 | + |
| 78 | + if (count($this->availableAuthorities) > 0) { |
| 79 | + $authorityOptions = array( |
| 80 | + "Show contribution by the community" => getCheckBox('authority-community', $this->showCommunityContribution) |
| 81 | + ); |
| 82 | + |
| 83 | + foreach ($this->availableAuthorities as $authorityId => $authorityName) |
| 84 | + $authorityOptions["Show contribution by " . $authorityName] = |
| 85 | + getCheckBox( |
| 86 | + 'authority-' . $authorityId, |
| 87 | + in_array($authorityId, $this->authoritiesToShow) |
| 88 | + ); |
| 89 | + |
| 90 | + $wgOut->addHTML(getOptionPanel($authorityOptions)); |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + protected function outputViewHeader() { |
| 95 | + global |
| 96 | + $wgOut, $wgShowAuthoritativeContributionPanelAtTop; |
| 97 | + |
| 98 | + if ($this->showLanguageSelector) |
| 99 | + $wgOut->addHTML($this->getLanguageSelector()); |
| 100 | + |
| 101 | + if ($wgShowAuthoritativeContributionPanelAtTop) |
| 102 | + $this->outputAuthoritativeContributionPanel(); |
| 103 | + } |
| 104 | + |
| 105 | + protected function outputViewFooter() { |
| 106 | + global |
| 107 | + $wgOut, $wgShowAuthoritativeContributionPanelAtBottom; |
| 108 | + |
| 109 | + if ($wgShowAuthoritativeContributionPanelAtBottom) |
| 110 | + $this->outputAuthoritativeContributionPanel(); |
| 111 | + |
| 112 | + $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
| 113 | + $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
| 114 | + } |
| 115 | + |
72 | 116 | public function view() { |
73 | 117 | global |
74 | 118 | $wgOut, $wgTitle; |
75 | 119 | |
76 | 120 | $wgOut->enableClientCache(false); |
77 | | - |
| 121 | + |
78 | 122 | $title = $wgTitle->getPrefixedText(); |
79 | 123 | |
80 | | - if (!$this->showClassicPageTitles) { |
81 | | - $title = $this->getTitle()->getText(); |
82 | | - } |
| 124 | + if (!$this->showClassicPageTitles) |
| 125 | + $title = $this->getTitle(); |
83 | 126 | |
84 | 127 | $wgOut->setPageTitle($title); |
85 | 128 | |
86 | | - if ($this->showLanguageSelector) |
87 | | - $wgOut->addHTML($this->getLanguageSelector()); |
88 | | - |
89 | | - $this->shouldShowAuthorities = count($this->availableAuthorities) > 0; |
90 | | - |
91 | | - if ($this->shouldShowAuthorities) { |
92 | | - $showCommunityContribution = isset($_GET['authority-community']); |
| 129 | + if (count($this->availableAuthorities) > 0) { |
| 130 | + $this->showCommunityContribution = isset($_GET['authority-community']); |
| 131 | + $this->authoritiesToShow = array(); |
93 | 132 | |
94 | | - $authoritiesToShow = array(); |
95 | | - $authorityOptions = array( |
96 | | - "Show contribution by the community" => getCheckBox('authority-community', $showCommunityContribution) |
97 | | - ); |
98 | | - |
99 | | - foreach($this->availableAuthorities as $authorityId => $authorityName) { |
100 | | - $showAuthority = isset($_GET['authority-' . $authorityId]); |
101 | | - |
102 | | - if ($showAuthority) |
103 | | - $authoritiesToShow[] = $authorityId; |
104 | | - |
105 | | - $authorityOptions["Show contribution by " . $authorityName] = getCheckBox('authority-' . $authorityId, $showAuthority); |
106 | | - } |
107 | | - |
108 | | - $wgOut->addHTML(getOptionPanel($authorityOptions)); |
| 133 | + foreach ($this->availableAuthorities as $authorityId => $authorityName) |
| 134 | + if (isset($_GET['authority-' . $authorityId])) |
| 135 | + $this->authoritiesToShow[] = $authorityId; |
109 | 136 | } |
110 | 137 | else |
111 | | - $showCommunityContribution = false; |
| 138 | + $this->showCommunityContribution = false; |
112 | 139 | |
113 | | - $this->shouldShowAuthorities = count($authoritiesToShow) > 0 || $showCommunityContribution; |
| 140 | + $this->shouldShowAuthorities = count($this->authoritiesToShow) > 0 || $this->showCommunityContribution; |
114 | 141 | initializeOmegaWikiAttributes($this->filterLanguageId != 0, $this->shouldShowAuthorities); |
115 | 142 | initializeObjectAttributeEditors($this->filterLanguageId, false, $this->shouldShowAuthorities); |
116 | 143 | |
117 | 144 | if ($this->shouldShowAuthorities) |
118 | | - $this->viewQueryTransactionInformation = new QueryAuthoritativeContributorTransactionInformation($this->availableAuthorities, $authoritiesToShow, $showCommunityContribution); |
| 145 | + $this->viewQueryTransactionInformation = new QueryAuthoritativeContributorTransactionInformation($this->availableAuthorities, $this->authoritiesToShow, $this->showCommunityContribution); |
119 | 146 | else |
120 | 147 | $this->viewQueryTransactionInformation = new QueryLatestTransactionInformation(); |
121 | 148 | } |
— | — | @@ -159,9 +186,8 @@ |
160 | 187 | |
161 | 188 | $title = $wgTitle->getPrefixedText(); |
162 | 189 | |
163 | | - if (!$this->showClassicPageTitles) { |
164 | | - $title = $this->getTitle()->getText(); |
165 | | - } |
| 190 | + if (!$this->showClassicPageTitles) |
| 191 | + $title = $this->getTitle(); |
166 | 192 | |
167 | 193 | $wgOut->setPageTitle(wfMsg('wz_history',$title)); |
168 | 194 | |
— | — | @@ -203,9 +229,8 @@ |
204 | 230 | |
205 | 231 | $title = $wgTitle->getPrefixedText(); |
206 | 232 | |
207 | | - if (!$this->showClassicPageTitles) { |
208 | | - $title = $this->getTitle()->getText(); |
209 | | - } |
| 233 | + if (!$this->showClassicPageTitles) |
| 234 | + $title = $this->getTitle(); |
210 | 235 | |
211 | 236 | $wgOut->setPageTitle($title); |
212 | 237 | $wgOut->setPageTitle(wfMsg('editing',$title)); |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWiki.php |
— | — | @@ -24,6 +24,8 @@ |
25 | 25 | |
26 | 26 | parent::view(); |
27 | 27 | |
| 28 | + $this->outputViewHeader(); |
| 29 | + |
28 | 30 | $spelling = $wgTitle->getText(); |
29 | 31 | |
30 | 32 | $wgOut->addHTML( |
— | — | @@ -38,8 +40,7 @@ |
39 | 41 | ) |
40 | 42 | ); |
41 | 43 | |
42 | | - $wgOut->addHTML(DefaultEditor::getExpansionCss()); |
43 | | - $wgOut->addHTML("<script language='javascript'><!--\nexpandEditors();\n--></script>"); |
| 44 | + $this->outputViewFooter(); |
44 | 45 | } |
45 | 46 | |
46 | 47 | public function history() { |