Index: trunk/extensions/LiquidThreads/lqt.css |
— | — | @@ -447,13 +447,10 @@ |
448 | 448 | font-size:85%; |
449 | 449 | float:right; |
450 | 450 | } |
451 | | -.lqt_sorting_order { |
| 451 | +.lqt_view_options input { |
| 452 | + /* This doesn't cascade for some reason. */ |
452 | 453 | font-size:85%; |
453 | 454 | } |
454 | 455 | .lqt_go_sort { |
455 | | - font-size:85%; |
456 | 456 | font-weight:bold; |
457 | 457 | } |
458 | | -.lqt_remember_sort { |
459 | | - font-size:85%; |
460 | | -} |
Index: trunk/extensions/LiquidThreads/LqtPages.php |
— | — | @@ -114,58 +114,57 @@ |
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | | - function show() { |
119 | | - global $wgHooks, $wgUser; |
120 | | - $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
| 118 | + function showTalkpageViewOptions($article) { |
| 119 | + // TODO WTF who wrote this? |
121 | 120 | |
122 | | - $this->output->setPageTitle( $this->title->getTalkpage()->getPrefixedText() ); |
123 | | - self::addJSandCSS(); |
124 | | - $article = new Article( $this->title ); |
125 | | - |
126 | 121 | if( $this->methodApplies('talkpage_sort_order') ) { |
127 | | - global $wgRequest; |
128 | | - $remember_sort_checked = $wgRequest->getVal('lqt_remember_sort') ? 'checked ' : ''; |
129 | | - $wgUser->setOption('lqt_sort_order', $this->sort_order); |
130 | | - $wgUser->saveSettings(); |
| 122 | + $remember_sort_checked = $this->request->getBool('lqt_remember_sort') ? 'checked ' : ''; |
| 123 | + $this->user->setOption('lqt_sort_order', $this->sort_order); |
| 124 | + $this->user->saveSettings(); |
131 | 125 | } else { |
132 | 126 | $remember_sort_checked = ''; |
133 | | - } |
| 127 | + } |
134 | 128 | |
135 | | - global $wgRequest; |
136 | | - if( $this->methodApplies('talkpage_new_thread') ) { |
137 | | - $this->showNewThreadForm(); |
138 | | - } else { |
139 | | - |
140 | | - // Only show sort controls if there is stuff to be sorted |
141 | | - if($article->exists()) { |
142 | | - $nc_sort = $this->sort_order==LQT_NEWEST_CHANGES ? ' selected' : ''; |
143 | | - $nt_sort = $this->sort_order==LQT_NEWEST_THREADS ? ' selected' : ''; |
144 | | - $ot_sort = $this->sort_order==LQT_OLDEST_THREADS ? ' selected' : ''; |
145 | | - $newest_changes = wfMsg('lqt_sort_newest_changes'); |
146 | | - $newest_threads = wfMsg('lqt_sort_newest_threads'); |
147 | | - $oldest_threads = wfMsg('lqt_sort_oldest_threads'); |
148 | | - $lqt_remember_sort = wfMsg('lqt_remember_sort') ; |
149 | | - $form_action_url = $this->talkpageUrl( $this->title, 'talkpage_sort_order'); |
150 | | - $lqt_sorting_order = wfMsg('lqt_sorting_order'); |
151 | | - $lqt_sort_newest_changes = wfMsg('lqt_sort_newest_changes'); |
152 | | - $lqt_sort_newest_threads = wfMsg('lqt_sort_newest_threads'); |
153 | | - $lqt_sort_oldest_threads = wfMsg('lqt_sort_oldest_threads'); |
154 | | - $go=wfMsg('go'); |
155 | | - if($wgUser->isLoggedIn()) { |
156 | | - $remember_sort = |
157 | | - <<<HTML |
| 129 | + if($article->exists()) { |
| 130 | + $nc_sort = $this->sort_order==LQT_NEWEST_CHANGES ? ' selected' : ''; |
| 131 | + $nt_sort = $this->sort_order==LQT_NEWEST_THREADS ? ' selected' : ''; |
| 132 | + $ot_sort = $this->sort_order==LQT_OLDEST_THREADS ? ' selected' : ''; |
| 133 | + $newest_changes = wfMsg('lqt_sort_newest_changes'); |
| 134 | + $newest_threads = wfMsg('lqt_sort_newest_threads'); |
| 135 | + $oldest_threads = wfMsg('lqt_sort_oldest_threads'); |
| 136 | + $lqt_remember_sort = wfMsg('lqt_remember_sort') ; |
| 137 | + $form_action_url = $this->talkpageUrl( $this->title, 'talkpage_sort_order'); |
| 138 | + $lqt_sorting_order = wfMsg('lqt_sorting_order'); |
| 139 | + $lqt_sort_newest_changes = wfMsg('lqt_sort_newest_changes'); |
| 140 | + $lqt_sort_newest_threads = wfMsg('lqt_sort_newest_threads'); |
| 141 | + $lqt_sort_oldest_threads = wfMsg('lqt_sort_oldest_threads'); |
| 142 | + $go=wfMsg('go'); |
| 143 | + if($this->user->isLoggedIn()) { |
| 144 | + $remember_sort = |
| 145 | + <<<HTML |
158 | 146 | <br /> |
159 | 147 | <label for="lqt_remember_sort_checkbox"> |
160 | | -<input id="lqt_remember_sort_checkbox" name="lqt_remember_sort" type="checkbox" value="1" $remember_sort_checked class="lqt_remember_sort" /> |
| 148 | +<input id="lqt_remember_sort_checkbox" name="lqt_remember_sort" type="checkbox" value="1" $remember_sort_checked /> |
161 | 149 | $lqt_remember_sort</label> |
162 | 150 | HTML; |
163 | | - } else { |
164 | | - $remember_sort = ''; |
165 | | - } |
166 | | - $this->openDiv('lqt_view_options'); |
167 | | - $this->output->addHTML( |
168 | | - |
169 | | - <<<HTML |
| 151 | + } else { |
| 152 | + $remember_sort = ''; |
| 153 | + } |
| 154 | + if ( in_array('deletedhistory', $this->user->getRights()) ) { |
| 155 | + $show_deleted_checked = $this->request->getBool('lqt_show_deleted_threads') ? 'checked ' : ''; |
| 156 | + $show_deleted = <<<HTML |
| 157 | +<br /> |
| 158 | +<label for="lqt_show_deleted_threads_checkbox"> |
| 159 | +<input id="lqt_show_deleted_threads_checkbox" name="lqt_show_deleted_threads" type="checkbox" value="1" $show_deleted_checked /> |
| 160 | +Show deleted threads</label> |
| 161 | +HTML; |
| 162 | + } else { |
| 163 | + $show_deleted = ""; |
| 164 | + } |
| 165 | + $this->openDiv('lqt_view_options'); |
| 166 | + $this->output->addHTML( |
| 167 | + |
| 168 | + <<<HTML |
170 | 169 | <form name="lqt_sort" action="$form_action_url" method="post">$lqt_sorting_order |
171 | 170 | <select name="lqt_order" class="lqt_sort_select"> |
172 | 171 | <option value="nc"$nc_sort>$lqt_sort_newest_changes</option> |
— | — | @@ -173,12 +172,29 @@ |
174 | 173 | <option value="ot"$ot_sort>$lqt_sort_oldest_threads</option> |
175 | 174 | </select> |
176 | 175 | $remember_sort |
| 176 | +$show_deleted |
177 | 177 | <input name="submitsort" type="submit" value="$go" class="lqt_go_sort"/> |
178 | 178 | </form> |
179 | 179 | HTML |
180 | | - ); |
181 | | - $this->closeDiv(); |
182 | | - } |
| 180 | + ); |
| 181 | + $this->closeDiv(); |
| 182 | + } |
| 183 | + |
| 184 | + } |
| 185 | + |
| 186 | + function show() { |
| 187 | + global $wgHooks; |
| 188 | + $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
| 189 | + |
| 190 | + $this->output->setPageTitle( $this->title->getTalkpage()->getPrefixedText() ); |
| 191 | + self::addJSandCSS(); |
| 192 | + $article = new Article( $this->title ); |
| 193 | + |
| 194 | + global $wgRequest; // TODO |
| 195 | + if( $this->methodApplies('talkpage_new_thread') ) { |
| 196 | + $this->showNewThreadForm(); |
| 197 | + } else { |
| 198 | + $this->showTalkpageViewOptions($article); |
183 | 199 | $url = $this->talkpageUrl( $this->title, 'talkpage_new_thread' ); |
184 | 200 | $this->output->addHTML("<strong><a class=\"lqt_start_discussion\" href=\"$url\">".wfMsg('lqt_new_thread')."</a></strong>"); |
185 | 201 | } |
Index: trunk/extensions/LiquidThreads/LqtBaseView.php |
— | — | @@ -861,6 +861,10 @@ |
862 | 862 | function showThread( $thread ) { |
863 | 863 | global $wgLang; # TODO global. |
864 | 864 | |
| 865 | + if ( $thread->type() == Threads::TYPE_DELETED |
| 866 | + && ! $this->request->getBool('lqt_show_deleted_threads') ) |
| 867 | + return; |
| 868 | + |
865 | 869 | if( $this->lastUnindentedSuperthread ) { |
866 | 870 | $tmp = $this->lastUnindentedSuperthread; |
867 | 871 | $msg = wfMsg('lqt_in_response_to', |