MediaWiki  1.23.2
CategoryViewer.php
Go to the documentation of this file.
1 <?php
30 
34  var $nextPage;
35 
39  var $flip;
40 
44  var $title;
45 
50 
54  var $gallery;
55 
60  private $cat;
61 
66  private $query;
67 
80  $until = array(), $query = array()
81  ) {
82  global $wgCategoryPagingLimit;
83  $this->title = $title;
84  $this->setContext( $context );
85  $this->from = $from;
86  $this->until = $until;
87  $this->limit = $wgCategoryPagingLimit;
88  $this->cat = Category::newFromTitle( $title );
89  $this->query = $query;
90  $this->collation = Collation::singleton();
91  unset( $this->query['title'] );
92  }
93 
99  public function getHTML() {
100  global $wgCategoryMagicGallery;
101  wfProfileIn( __METHOD__ );
102 
103  $this->showGallery = $wgCategoryMagicGallery && !$this->getOutput()->mNoGallery;
104 
105  $this->clearCategoryState();
106  $this->doCategoryQuery();
107  $this->finaliseCategoryState();
108 
109  $r = $this->getSubcategorySection() .
110  $this->getPagesSection() .
111  $this->getImageSection();
112 
113  if ( $r == '' ) {
114  // If there is no category content to display, only
115  // show the top part of the navigation links.
116  // @todo FIXME: Cannot be completely suppressed because it
117  // is unknown if 'until' or 'from' makes this
118  // give 0 results.
119  $r = $r . $this->getCategoryTop();
120  } else {
121  $r = $this->getCategoryTop() .
122  $r .
123  $this->getCategoryBottom();
124  }
125 
126  // Give a proper message if category is empty
127  if ( $r == '' ) {
128  $r = $this->msg( 'category-empty' )->parseAsBlock();
129  }
130 
131  $lang = $this->getLanguage();
132  $langAttribs = array( 'lang' => $lang->getCode(), 'dir' => $lang->getDir() );
133  # put a div around the headings which are in the user language
134  $r = Html::openElement( 'div', $langAttribs ) . $r . '</div>';
135 
136  wfProfileOut( __METHOD__ );
137  return $r;
138  }
139 
140  function clearCategoryState() {
141  $this->articles = array();
142  $this->articles_start_char = array();
143  $this->children = array();
144  $this->children_start_char = array();
145  if ( $this->showGallery ) {
146  // Note that null for mode is taken to mean use default.
147  $mode = $this->getRequest()->getVal( 'gallerymode', null );
148  try {
149  $this->gallery = ImageGalleryBase::factory( $mode );
150  } catch ( MWException $e ) {
151  // User specified something invalid, fallback to default.
152  $this->gallery = ImageGalleryBase::factory();
153  }
154 
155  $this->gallery->setHideBadImages();
156  $this->gallery->setContext( $this->getContext() );
157  } else {
158  $this->imgsNoGallery = array();
159  $this->imgsNoGallery_start_char = array();
160  }
161  }
162 
169  function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
170  // Subcategory; strip the 'Category' namespace from the link text.
171  $title = $cat->getTitle();
172 
173  $link = Linker::link( $title, htmlspecialchars( $title->getText() ) );
174  if ( $title->isRedirect() ) {
175  // This didn't used to add redirect-in-category, but might
176  // as well be consistent with the rest of the sections
177  // on a category page.
178  $link = '<span class="redirect-in-category">' . $link . '</span>';
179  }
180  $this->children[] = $link;
181 
182  $this->children_start_char[] =
183  $this->getSubcategorySortChar( $cat->getTitle(), $sortkey );
184  }
185 
197  function getSubcategorySortChar( $title, $sortkey ) {
199 
200  if ( $title->getPrefixedText() == $sortkey ) {
201  $word = $title->getDBkey();
202  } else {
203  $word = $sortkey;
204  }
205 
206  $firstChar = $this->collation->getFirstLetter( $word );
207 
208  return $wgContLang->convert( $firstChar );
209  }
210 
218  function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
220  if ( $this->showGallery ) {
221  $flip = $this->flip['file'];
222  if ( $flip ) {
223  $this->gallery->insert( $title );
224  } else {
225  $this->gallery->add( $title );
226  }
227  } else {
229  if ( $isRedirect ) {
230  // This seems kind of pointless given 'mw-redirect' class,
231  // but keeping for back-compatibility with user css.
232  $link = '<span class="redirect-in-category">' . $link . '</span>';
233  }
234  $this->imgsNoGallery[] = $link;
235 
236  $this->imgsNoGallery_start_char[] = $wgContLang->convert(
237  $this->collation->getFirstLetter( $sortkey ) );
238  }
239  }
240 
248  function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
250 
252  if ( $isRedirect ) {
253  // This seems kind of pointless given 'mw-redirect' class,
254  // but keeping for back-compatibility with user css.
255  $link = '<span class="redirect-in-category">' . $link . '</span>';
256  }
257  $this->articles[] = $link;
258 
259  $this->articles_start_char[] = $wgContLang->convert(
260  $this->collation->getFirstLetter( $sortkey ) );
261  }
262 
263  function finaliseCategoryState() {
264  if ( $this->flip['subcat'] ) {
265  $this->children = array_reverse( $this->children );
266  $this->children_start_char = array_reverse( $this->children_start_char );
267  }
268  if ( $this->flip['page'] ) {
269  $this->articles = array_reverse( $this->articles );
270  $this->articles_start_char = array_reverse( $this->articles_start_char );
271  }
272  if ( !$this->showGallery && $this->flip['file'] ) {
273  $this->imgsNoGallery = array_reverse( $this->imgsNoGallery );
274  $this->imgsNoGallery_start_char = array_reverse( $this->imgsNoGallery_start_char );
275  }
276  }
277 
278  function doCategoryQuery() {
279  $dbr = wfGetDB( DB_SLAVE, 'category' );
280 
281  $this->nextPage = array(
282  'page' => null,
283  'subcat' => null,
284  'file' => null,
285  );
286  $this->flip = array( 'page' => false, 'subcat' => false, 'file' => false );
287 
288  foreach ( array( 'page', 'subcat', 'file' ) as $type ) {
289  # Get the sortkeys for start/end, if applicable. Note that if
290  # the collation in the database differs from the one
291  # set in $wgCategoryCollation, pagination might go totally haywire.
292  $extraConds = array( 'cl_type' => $type );
293  if ( isset( $this->from[$type] ) && $this->from[$type] !== null ) {
294  $extraConds[] = 'cl_sortkey >= '
295  . $dbr->addQuotes( $this->collation->getSortKey( $this->from[$type] ) );
296  } elseif ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
297  $extraConds[] = 'cl_sortkey < '
298  . $dbr->addQuotes( $this->collation->getSortKey( $this->until[$type] ) );
299  $this->flip[$type] = true;
300  }
301 
302  $res = $dbr->select(
303  array( 'page', 'categorylinks', 'category' ),
304  array( 'page_id', 'page_title', 'page_namespace', 'page_len',
305  'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title',
306  'cat_subcats', 'cat_pages', 'cat_files',
307  'cl_sortkey_prefix', 'cl_collation' ),
308  array_merge( array( 'cl_to' => $this->title->getDBkey() ), $extraConds ),
309  __METHOD__,
310  array(
311  'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ),
312  'LIMIT' => $this->limit + 1,
313  'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey',
314  ),
315  array(
316  'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ),
317  'category' => array( 'LEFT JOIN', array(
318  'cat_title = page_title',
319  'page_namespace' => NS_CATEGORY
320  ))
321  )
322  );
323 
324  $count = 0;
325  foreach ( $res as $row ) {
326  $title = Title::newFromRow( $row );
327  if ( $row->cl_collation === '' ) {
328  // Hack to make sure that while updating from 1.16 schema
329  // and db is inconsistent, that the sky doesn't fall.
330  // See r83544. Could perhaps be removed in a couple decades...
331  $humanSortkey = $row->cl_sortkey;
332  } else {
333  $humanSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix );
334  }
335 
336  if ( ++$count > $this->limit ) {
337  # We've reached the one extra which shows that there
338  # are additional pages to be had. Stop here...
339  $this->nextPage[$type] = $humanSortkey;
340  break;
341  }
342 
343  if ( $title->getNamespace() == NS_CATEGORY ) {
344  $cat = Category::newFromRow( $row, $title );
345  $this->addSubcategoryObject( $cat, $humanSortkey, $row->page_len );
346  } elseif ( $title->getNamespace() == NS_FILE ) {
347  $this->addImage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect );
348  } else {
349  $this->addPage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect );
350  }
351  }
352  }
353  }
354 
358  function getCategoryTop() {
359  $r = $this->getCategoryBottom();
360  return $r === ''
361  ? $r
362  : "<br style=\"clear:both;\"/>\n" . $r;
363  }
364 
368  function getSubcategorySection() {
369  # Don't show subcategories section if there are none.
370  $r = '';
371  $rescnt = count( $this->children );
372  $dbcnt = $this->cat->getSubcatCount();
373  $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'subcat' );
374 
375  if ( $rescnt > 0 ) {
376  # Showing subcategories
377  $r .= "<div id=\"mw-subcategories\">\n";
378  $r .= '<h2>' . $this->msg( 'subcategories' )->text() . "</h2>\n";
379  $r .= $countmsg;
380  $r .= $this->getSectionPagingLinks( 'subcat' );
381  $r .= $this->formatList( $this->children, $this->children_start_char );
382  $r .= $this->getSectionPagingLinks( 'subcat' );
383  $r .= "\n</div>";
384  }
385  return $r;
386  }
387 
391  function getPagesSection() {
392  $ti = wfEscapeWikiText( $this->title->getText() );
393  # Don't show articles section if there are none.
394  $r = '';
395 
396  # @todo FIXME: Here and in the other two sections: we don't need to bother
397  # with this rigmarole if the entire category contents fit on one page
398  # and have already been retrieved. We can just use $rescnt in that
399  # case and save a query and some logic.
400  $dbcnt = $this->cat->getPageCount() - $this->cat->getSubcatCount()
401  - $this->cat->getFileCount();
402  $rescnt = count( $this->articles );
403  $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'article' );
404 
405  if ( $rescnt > 0 ) {
406  $r = "<div id=\"mw-pages\">\n";
407  $r .= '<h2>' . $this->msg( 'category_header', $ti )->text() . "</h2>\n";
408  $r .= $countmsg;
409  $r .= $this->getSectionPagingLinks( 'page' );
410  $r .= $this->formatList( $this->articles, $this->articles_start_char );
411  $r .= $this->getSectionPagingLinks( 'page' );
412  $r .= "\n</div>";
413  }
414  return $r;
415  }
416 
420  function getImageSection() {
421  $r = '';
422  $rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery );
423  if ( $rescnt > 0 ) {
424  $dbcnt = $this->cat->getFileCount();
425  $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' );
426 
427  $r .= "<div id=\"mw-category-media\">\n";
428  $r .= '<h2>' .
429  $this->msg(
430  'category-media-header',
431  wfEscapeWikiText( $this->title->getText() )
432  )->text() .
433  "</h2>\n";
434  $r .= $countmsg;
435  $r .= $this->getSectionPagingLinks( 'file' );
436  if ( $this->showGallery ) {
437  $r .= $this->gallery->toHTML();
438  } else {
439  $r .= $this->formatList( $this->imgsNoGallery, $this->imgsNoGallery_start_char );
440  }
441  $r .= $this->getSectionPagingLinks( 'file' );
442  $r .= "\n</div>";
443  }
444  return $r;
445  }
446 
454  private function getSectionPagingLinks( $type ) {
455  if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
456  return $this->pagingLinks( $this->nextPage[$type], $this->until[$type], $type );
457  } elseif ( $this->nextPage[$type] !== null
458  || ( isset( $this->from[$type] ) && $this->from[$type] !== null )
459  ) {
460  return $this->pagingLinks( $this->from[$type], $this->nextPage[$type], $type );
461  } else {
462  return '';
463  }
464  }
465 
469  function getCategoryBottom() {
470  return '';
471  }
472 
483  function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
484  $list = '';
485  if ( count( $articles ) > $cutoff ) {
487  } elseif ( count( $articles ) > 0 ) {
488  // for short lists of articles in categories.
490  }
491 
492  $pageLang = $this->title->getPageLanguage();
493  $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
494  'class' => 'mw-content-' . $pageLang->getDir() );
495  $list = Html::rawElement( 'div', $attribs, $list );
496 
497  return $list;
498  }
499 
515  static function columnList( $articles, $articles_start_char ) {
516  $columns = array_combine( $articles, $articles_start_char );
517  # Split into three columns
518  $columns = array_chunk( $columns, ceil( count( $columns ) / 3 ), true /* preserve keys */ );
519 
520  $ret = '<table style="width: 100%;"><tr style="vertical-align: top;">';
521  $prevchar = null;
522 
523  foreach ( $columns as $column ) {
524  $ret .= '<td style="width: 33.3%;">';
525  $colContents = array();
526 
527  # Kind of like array_flip() here, but we keep duplicates in an
528  # array instead of dropping them.
529  foreach ( $column as $article => $char ) {
530  if ( !isset( $colContents[$char] ) ) {
531  $colContents[$char] = array();
532  }
533  $colContents[$char][] = $article;
534  }
535 
536  $first = true;
537  foreach ( $colContents as $char => $articles ) {
538  # Change space to non-breaking space to keep headers aligned
539  $h3char = $char === ' ' ? '&#160;' : htmlspecialchars( $char );
540 
541  $ret .= '<h3>' . $h3char;
542  if ( $first && $char === $prevchar ) {
543  # We're continuing a previous chunk at the top of a new
544  # column, so add " cont." after the letter.
545  $ret .= ' ' . wfMessage( 'listingcontinuesabbrev' )->escaped();
546  }
547  $ret .= "</h3>\n";
548 
549  $ret .= '<ul><li>';
550  $ret .= implode( "</li>\n<li>", $articles );
551  $ret .= '</li></ul>';
552 
553  $first = false;
554  $prevchar = $char;
555  }
556 
557  $ret .= "</td>\n";
558  }
559 
560  $ret .= '</tr></table>';
561  return $ret;
562  }
563 
571  static function shortList( $articles, $articles_start_char ) {
572  $r = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n";
573  $r .= '<ul><li>' . $articles[0] . '</li>';
574  $articleCount = count( $articles );
575  for ( $index = 1; $index < $articleCount; $index++ ) {
576  if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) {
577  $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>";
578  }
579 
580  $r .= "<li>{$articles[$index]}</li>";
581  }
582  $r .= '</ul>';
583  return $r;
584  }
585 
595  private function pagingLinks( $first, $last, $type = '' ) {
596  $prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped();
597 
598  if ( $first != '' ) {
599  $prevQuery = $this->query;
600  $prevQuery["{$type}until"] = $first;
601  unset( $prevQuery["{$type}from"] );
602  $prevLink = Linker::linkKnown(
603  $this->addFragmentToTitle( $this->title, $type ),
604  $prevLink,
605  array(),
606  $prevQuery
607  );
608  }
609 
610  $nextLink = $this->msg( 'nextn' )->numParams( $this->limit )->escaped();
611 
612  if ( $last != '' ) {
613  $lastQuery = $this->query;
614  $lastQuery["{$type}from"] = $last;
615  unset( $lastQuery["{$type}until"] );
616  $nextLink = Linker::linkKnown(
617  $this->addFragmentToTitle( $this->title, $type ),
618  $nextLink,
619  array(),
620  $lastQuery
621  );
622  }
623 
624  return $this->msg( 'categoryviewer-pagedlinks' )->rawParams( $prevLink, $nextLink )->escaped();
625  }
626 
636  private function addFragmentToTitle( $title, $section ) {
637  switch ( $section ) {
638  case 'page':
639  $fragment = 'mw-pages';
640  break;
641  case 'subcat':
642  $fragment = 'mw-subcategories';
643  break;
644  case 'file':
645  $fragment = 'mw-category-media';
646  break;
647  default:
648  throw new MWException( __METHOD__ .
649  " Invalid section $section." );
650  }
651 
653  $title->getDBkey(), $fragment );
654  }
655 
666  private function getCountMessage( $rescnt, $dbcnt, $type ) {
667  // There are three cases:
668  // 1) The category table figure seems sane. It might be wrong, but
669  // we can't do anything about it if we don't recalculate it on ev-
670  // ery category view.
671  // 2) The category table figure isn't sane, like it's smaller than the
672  // number of actual results, *but* the number of results is less
673  // than $this->limit and there's no offset. In this case we still
674  // know the right figure.
675  // 3) We have no idea.
676 
677  // Check if there's a "from" or "until" for anything
678 
679  // This is a little ugly, but we seem to use different names
680  // for the paging types then for the messages.
681  if ( $type === 'article' ) {
682  $pagingType = 'page';
683  } else {
684  $pagingType = $type;
685  }
686 
687  $fromOrUntil = false;
688  if ( ( isset( $this->from[$pagingType] ) && $this->from[$pagingType] !== null ) ||
689  ( isset( $this->until[$pagingType] ) && $this->until[$pagingType] !== null )
690  ) {
691  $fromOrUntil = true;
692  }
693 
694  if ( $dbcnt == $rescnt ||
695  ( ( $rescnt == $this->limit || $fromOrUntil ) && $dbcnt > $rescnt )
696  ) {
697  // Case 1: seems sane.
698  $totalcnt = $dbcnt;
699  } elseif ( $rescnt < $this->limit && !$fromOrUntil ) {
700  // Case 2: not sane, but salvageable. Use the number of results.
701  // Since there are fewer than 200, we can also take this opportunity
702  // to refresh the incorrect category table entry -- which should be
703  // quick due to the small number of entries.
704  $totalcnt = $rescnt;
705  $this->cat->refreshCounts();
706  } else {
707  // Case 3: hopeless. Don't give a total count at all.
708  // Messages: category-subcat-count-limited, category-article-count-limited,
709  // category-file-count-limited
710  return $this->msg( "category-$type-count-limited" )->numParams( $rescnt )->parseAsBlock();
711  }
712  // Messages: category-subcat-count, category-article-count, category-file-count
713  return $this->msg( "category-$type-count" )->numParams( $rescnt, $totalcnt )->parseAsBlock();
714  }
715 }
CategoryViewer\$query
array $query
The original query array, to be used in generating paging links.
Definition: CategoryViewer.php:59
Category\getTitle
getTitle()
Definition: Category.php:239
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:33
CategoryViewer\shortList
static shortList( $articles, $articles_start_char)
Format a list of articles chunked by letter in a bullet list.
Definition: CategoryViewer.php:564
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
ContextSource\getContext
getContext()
Get the RequestContext object.
Definition: ContextSource.php:40
query
For a write query
Definition: database.txt:26
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
CategoryViewer\$imgsNoGallery
$imgsNoGallery
Definition: CategoryViewer.php:24
CategoryViewer\$flip
Array $flip
Definition: CategoryViewer.php:37
ContextSource\msg
msg()
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:175
CategoryViewer\$until
$until
Definition: CategoryViewer.php:24
$last
$last
Definition: profileinfo.php:365
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
CategoryViewer\addFragmentToTitle
addFragmentToTitle( $title, $section)
Takes a title, and adds the fragment identifier that corresponds to the correct segment of the catego...
Definition: CategoryViewer.php:629
Category
Category objects are immutable, strictly speaking.
Definition: Category.php:31
wfProfileIn
wfProfileIn( $functionname)
Begin profiling of a function.
Definition: Profiler.php:33
CategoryViewer\columnList
static columnList( $articles, $articles_start_char)
Format a list of articles chunked by letter in a three-column list, ordered vertically.
Definition: CategoryViewer.php:508
CategoryViewer\$imgsNoGalley
$imgsNoGalley
Definition: CategoryViewer.php:24
$ret
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1530
CategoryViewer\getCountMessage
getCountMessage( $rescnt, $dbcnt, $type)
What to do if the category table conflicts with the number of results returned? This function says wh...
Definition: CategoryViewer.php:659
CategoryViewer\$children
$children
Definition: CategoryViewer.php:24
Title\getPrefixedText
getPrefixedText()
Get the prefixed title with spaces.
Definition: Title.php:1369
NS_FILE
const NS_FILE
Definition: Defines.php:85
CategoryViewer\getImageSection
getImageSection()
Definition: CategoryViewer.php:413
ImageGalleryBase\factory
static factory( $mode=false)
Get a new image gallery.
Definition: ImageGalleryBase.php:66
CategoryViewer\getPagesSection
getPagesSection()
Definition: CategoryViewer.php:384
CategoryViewer\getSubcategorySortChar
getSubcategorySortChar( $title, $sortkey)
Get the character to be used for sorting subcategories.
Definition: CategoryViewer.php:190
ContextSource\getRequest
getRequest()
Get the WebRequest object.
Definition: ContextSource.php:77
$wgContLang
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
Definition: design.txt:56
$link
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
Definition: hooks.txt:2149
CategoryViewer\clearCategoryState
clearCategoryState()
Definition: CategoryViewer.php:133
CategoryViewer\$articles_start_char
$articles_start_char
Definition: CategoryViewer.php:24
Collation
Definition: Collation.php:23
Linker\linkKnown
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
Definition: Linker.php:264
CategoryViewer\formatList
formatList( $articles, $articles_start_char, $cutoff=6)
Format a list of articles chunked by letter, either as a bullet list or a columnar format,...
Definition: CategoryViewer.php:476
CategoryViewer\finaliseCategoryState
finaliseCategoryState()
Definition: CategoryViewer.php:256
CategoryViewer\doCategoryQuery
doCategoryQuery()
Definition: CategoryViewer.php:271
$dbr
$dbr
Definition: testCompression.php:48
Linker\link
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
Definition: Linker.php:192
ContextSource\getLanguage
getLanguage()
Get the Language object.
Definition: ContextSource.php:154
Collation\singleton
static singleton()
Definition: Collation.php:29
CategoryViewer\$articles
$articles
Definition: CategoryViewer.php:24
CategoryViewer\$cat
Category $cat
Category object for this page.
Definition: CategoryViewer.php:54
title
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
Definition: All_system_messages.txt:2703
CategoryViewer\getSectionPagingLinks
getSectionPagingLinks( $type)
Get the paging links for a section (subcats/pages/files), to go at the top and bottom of the output.
Definition: CategoryViewer.php:447
Html\openElement
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:166
Title\getDBkey
getDBkey()
Get the main part with underscores.
Definition: Title.php:857
MWException
MediaWiki exception.
Definition: MWException.php:26
Title\getNamespace
getNamespace()
Get the namespace index, i.e.
Definition: Title.php:880
CategoryViewer\$collation
Collation $collation
Definition: CategoryViewer.php:45
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:345
Title\getCategorySortkey
getCategorySortkey( $prefix='')
Returns the raw sort key to be used for categories, with the specified prefix.
Definition: Title.php:4841
ContextSource\getOutput
getOutput()
Get the OutputPage object.
Definition: ContextSource.php:122
ContextSource
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
Definition: ContextSource.php:30
wfProfileOut
wfProfileOut( $functionname='missing')
Stop profiling of a function.
Definition: Profiler.php:46
wfMessage
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
CategoryViewer\$children_start_char
$children_start_char
Definition: CategoryViewer.php:24
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:93
$columns
if(! $in) $columns
Definition: Utf8Test.php:50
CategoryViewer\addSubcategoryObject
addSubcategoryObject(Category $cat, $sortkey, $pageLength)
Add a subcategory to the internal lists, using a Category object.
Definition: CategoryViewer.php:162
ContextSource\setContext
setContext(IContextSource $context)
Set the IContextSource object.
Definition: ContextSource.php:57
CategoryViewer\getCategoryBottom
getCategoryBottom()
Definition: CategoryViewer.php:462
Category\newFromRow
static newFromRow( $row, $title=null)
Factory function, for constructing a Category object from a result set.
Definition: Category.php:167
CategoryViewer\getHTML
getHTML()
Format the category data list.
Definition: CategoryViewer.php:92
Category\newFromTitle
static newFromTitle( $title)
Factory function.
Definition: Category.php:134
$section
$section
Definition: Utf8Test.php:88
CategoryViewer\$from
$from
Definition: CategoryViewer.php:24
CategoryViewer
Definition: CategoryViewer.php:23
CategoryViewer\$title
Title $title
Definition: CategoryViewer.php:41
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:2077
CategoryViewer\$gallery
ImageGallery $gallery
Definition: CategoryViewer.php:49
IContextSource
Interface for objects which can provide a context on request.
Definition: IContextSource.php:29
CategoryViewer\$showGallery
$showGallery
Definition: CategoryViewer.php:24
$count
$count
Definition: UtfNormalTest2.php:96
CategoryViewer\$imgsNoGallery_start_char
$imgsNoGallery_start_char
Definition: CategoryViewer.php:24
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
Title
Represents a title within MediaWiki.
Definition: Title.php:35
Title\isRedirect
isRedirect( $flags=0)
Is this an article that is a redirect page? Uses link cache, adding it if necessary.
Definition: Title.php:3147
CategoryViewer\pagingLinks
pagingLinks( $first, $last, $type='')
Create paging links, as a helper method to getSectionPagingLinks().
Definition: CategoryViewer.php:588
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
CategoryViewer\getSubcategorySection
getSubcategorySection()
Definition: CategoryViewer.php:361
from
Please log in again after you receive it</td >< td > s a saved copy from
Definition: All_system_messages.txt:3297
CategoryViewer\addPage
addPage( $title, $sortkey, $pageLength, $isRedirect=false)
Add a miscellaneous page.
Definition: CategoryViewer.php:241
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:124
$e
if( $useReadline) $e
Definition: eval.php:66
CategoryViewer\$limit
$limit
Definition: CategoryViewer.php:24
CategoryViewer\__construct
__construct( $title, IContextSource $context, $from=array(), $until=array(), $query=array())
Constructor.
Definition: CategoryViewer.php:72
$attribs
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
Definition: hooks.txt:1530
CategoryViewer\getCategoryTop
getCategoryTop()
Definition: CategoryViewer.php:351
$article
Using a hook running we can avoid having all this option specific stuff in our mainline code Using the function array $article
Definition: hooks.txt:78
ImageGallery
Backwards compatibility.
Definition: TraditionalImageGallery.php:333
$res
$res
Definition: database.txt:21
CategoryViewer\addImage
addImage(Title $title, $sortkey, $pageLength, $isRedirect=false)
Add a page in the image namespace.
Definition: CategoryViewer.php:211
Title\getText
getText()
Get the text form (spaces not underscores) of the main part.
Definition: Title.php:839
CategoryViewer\$nextPage
Array $nextPage
Definition: CategoryViewer.php:33
$type
$type
Definition: testCompression.php:46