/**
  * Construct instance of class.
  * @param $special object calling object
  * @param $type string type of log - 'bannercontent' or 'bannermessages' (optional)
  */
 function __construct($special, $type = 'bannercontent')
 {
     $this->special = $special;
     parent::__construct();
     $this->viewPage = SpecialPage::getTitleFor('NoticeTemplate', 'view');
     $this->logType = $type;
 }
 function __construct($form, $conds = array(), $title)
 {
     $this->mForm = $form;
     $this->mConds = $conds;
     $this->pageID = $title->getArticleID();
     parent::__construct();
 }
 function __construct($specialPage, $searchConds, $y, $m)
 {
     parent::__construct();
     $this->getDateCond($y, $m);
     $this->searchConds = $searchConds ? $searchConds : array();
     $this->specialPage = $specialPage;
 }
Ejemplo n.º 4
0
 function __construct(IContextSource $context, array $options)
 {
     parent::__construct($context);
     $msgs = ['diff', 'hist', 'pipe-separator', 'uctop'];
     foreach ($msgs as $msg) {
         $this->messages[$msg] = $this->msg($msg)->escaped();
     }
     $this->target = isset($options['target']) ? $options['target'] : '';
     $this->contribs = isset($options['contribs']) ? $options['contribs'] : 'users';
     $this->namespace = isset($options['namespace']) ? $options['namespace'] : '';
     $this->tagFilter = isset($options['tagfilter']) ? $options['tagfilter'] : false;
     $this->nsInvert = isset($options['nsInvert']) ? $options['nsInvert'] : false;
     $this->associated = isset($options['associated']) ? $options['associated'] : false;
     $this->deletedOnly = !empty($options['deletedOnly']);
     $this->topOnly = !empty($options['topOnly']);
     $this->newOnly = !empty($options['newOnly']);
     $this->hideMinor = !empty($options['hideMinor']);
     $year = isset($options['year']) ? $options['year'] : false;
     $month = isset($options['month']) ? $options['month'] : false;
     $this->getDateCond($year, $month);
     // Most of this code will use the 'contributions' group DB, which can map to replica DBs
     // with extra user based indexes or partioning by user. The additional metadata
     // queries should use a regular replica DB since the lookup pattern is not all by user.
     $this->mDbSecondary = wfGetDB(DB_REPLICA);
     // any random replica DB
     $this->mDb = wfGetDB(DB_REPLICA, 'contributions');
 }
Ejemplo n.º 5
0
 function __construct($par = null)
 {
     global $wgRequest;
     $this->like = $wgRequest->getText('like');
     $this->showbots = $wgRequest->getBool('showbots', 0);
     $this->skin = $this->getSkin();
     parent::__construct();
 }
Ejemplo n.º 6
0
 function __construct(IContextSource $context = null)
 {
     parent::__construct($context);
     // Override the defaults
     $this->mLimitsShown = array(10, 20);
     $this->mDefaultLimit = 10;
     $this->mLimit = 10;
 }
Ejemplo n.º 7
0
 function __construct()
 {
     global $wgSpecialsDB;
     parent::__construct();
     $this->mDb = wfGetDB(DB_SLAVE, array(), $wgSpecialsDB);
     // create a Linker object so we don't have to create it every time in formatRow
     $this->linker = new Linker();
 }
Ejemplo n.º 8
0
 public function __construct()
 {
     global $wgExternalSharedDB, $wgRequest;
     parent::__construct();
     $this->mDb = wfGetDB(DB_SLAVE, array(), $wgExternalSharedDB);
     $this->mSearchText = $wgRequest->getText('wpPhalanxCheckBlocker', null);
     $this->mSearchFilter = $wgRequest->getArray('wpPhalanxTypeFilter');
     $this->mSearchId = $wgRequest->getInt('id');
 }
 function __construct($special)
 {
     $this->special = $special;
     parent::__construct();
     // Override paging defaults
     list($this->mLimit, ) = $this->mRequest->getLimitOffset(20, '');
     $this->mLimitsShown = array(20, 50, 100);
     $this->viewPage = SpecialPage::getTitleFor('CentralNotice');
 }
Ejemplo n.º 10
0
 function __construct(IContextSource $context, $par = null)
 {
     $this->like = $context->getRequest()->getText('like');
     $this->showbots = $context->getRequest()->getBool('showbots', 0);
     if (is_numeric($par)) {
         $this->setLimit($par);
     }
     parent::__construct($context);
 }
Ejemplo n.º 11
0
 function __construct($specialPage, $searchConds, $y, $m)
 {
     parent::__construct();
     /*
     		$this->messages = array_map( 'wfMsg',
     			array( 'comma-separator', 'checkuser-log-userips', 'checkuser-log-ipedits', 'checkuser-log-ipusers',
     			'checkuser-log-ipedits-xff', 'checkuser-log-ipusers-xff' ) );*/
     $this->getDateCond($y, $m);
     $this->searchConds = $searchConds ? $searchConds : array();
     $this->specialPage = $specialPage;
 }
Ejemplo n.º 12
0
 /**
  * Constructor.
  *
  * @param IContextSource $context
  * @param string $className
  * @param array $conds
  */
 public function __construct(IContextSource $context, array $conds = array())
 {
     $this->conds = $conds;
     $this->context = $context;
     $this->mDefaultDirection = true;
     if (method_exists('ReverseChronologicalPager', 'getUser')) {
         parent::__construct($context);
     } else {
         parent::__construct();
     }
 }
Ejemplo n.º 13
0
 /**
  * @param ImagePage $imagePage
  */
 function __construct($imagePage)
 {
     parent::__construct($imagePage->getContext());
     $this->mImagePage = $imagePage;
     $this->mTitle = clone $imagePage->getTitle();
     $this->mTitle->setFragment('#filehistory');
     $this->mImg = null;
     $this->mHist = array();
     $this->mRange = array(0, 0);
     // display range
 }
Ejemplo n.º 14
0
 function __construct(SpecialMergeHistory $form, $conds, Title $source, Title $dest)
 {
     $this->mForm = $form;
     $this->mConds = $conds;
     $this->title = $source;
     $this->articleID = $source->getArticleID();
     $dbr = wfGetDB(DB_REPLICA);
     $maxtimestamp = $dbr->selectField('revision', 'MIN(rev_timestamp)', ['rev_page' => $dest->getArticleID()], __METHOD__);
     $this->maxTimestamp = $maxtimestamp;
     parent::__construct($form->getContext());
 }
Ejemplo n.º 15
0
 function __construct($special)
 {
     $this->special = $special;
     $this->editable = $special->editable;
     parent::__construct();
     // Override paging defaults
     list($this->mLimit, ) = $this->mRequest->getLimitOffset(20, '');
     $this->mLimitsShown = array(20, 50, 100);
     $msg = Xml::encodeJsVar(wfMsg('centralnotice-confirm-delete'));
     $this->onRemoveChange = "if( this.checked ) { this.checked = confirm( {$msg} ) }";
     $this->viewPage = SpecialPage::getTitleFor('NoticeTemplate', 'view');
 }
Ejemplo n.º 16
0
 /**
  * Constructor
  *
  * @param LogEventsList $list
  * @param string $types or Array: log types to show
  * @param string $performer the user who made the log entries
  * @param string|Title $title the page title the log entries are for
  * @param string $pattern do a prefix search rather than an exact title match
  * @param array $conds extra conditions for the query
  * @param int $year The year to start from
  * @param int $month The month to start from
  * @param string $tagFilter tag
  */
 public function __construct($list, $types = array(), $performer = '', $title = '', $pattern = '', $conds = array(), $year = false, $month = false, $tagFilter = '')
 {
     parent::__construct($list->getContext());
     $this->mConds = $conds;
     $this->mLogEventsList = $list;
     $this->limitType($types);
     // also excludes hidden types
     $this->limitPerformer($performer);
     $this->limitTitle($title, $pattern);
     $this->getDateCond($year, $month);
     $this->mTagFilter = $tagFilter;
 }
Ejemplo n.º 17
0
 function __construct()
 {
     global $wgStatsDB, $wgDevelEnvironment;
     parent::__construct();
     if ($wgDevelEnvironment) {
         $this->mDb = wfGetDB(DB_SLAVE);
     } else {
         $this->mDb = wfGetDB(DB_SLAVE, array(), $wgStatsDB);
         $this->mDb->selectDB('specials');
     }
     // create a Linker object so we don't have to create it every time in formatRow
     $this->linker = new Linker();
 }
 function __construct($special, $filter = '')
 {
     $this->special = $special;
     $this->editable = $special->editable;
     $this->filter = $filter;
     parent::__construct();
     // Override paging defaults
     list($this->mLimit, ) = $this->mRequest->getLimitOffset(20, '');
     $this->mLimitsShown = array(20, 50, 100);
     $msg = Xml::encodeJsVar($this->msg('promoter-confirm-delete')->text());
     $this->onRemoveChange = "if( this.checked ) { this.checked = confirm( {$msg} ) }";
     $this->viewPage = SpecialPage::getTitleFor('CampaignAd', 'view');
 }
Ejemplo n.º 19
0
 /**
  * Constructor
  *
  * @param LogEventsList $list
  * @param string|array $types Log types to show
  * @param string $performer The user who made the log entries
  * @param string|Title $title The page title the log entries are for
  * @param string $pattern Do a prefix search rather than an exact title match
  * @param array $conds Extra conditions for the query
  * @param int|bool $year The year to start from. Default: false
  * @param int|bool $month The month to start from. Default: false
  * @param string $tagFilter Tag
  * @param string $action Specific action (subtype) requested
  */
 public function __construct($list, $types = [], $performer = '', $title = '', $pattern = '', $conds = [], $year = false, $month = false, $tagFilter = '', $action = '')
 {
     parent::__construct($list->getContext());
     $this->mConds = $conds;
     $this->mLogEventsList = $list;
     $this->limitType($types);
     // also excludes hidden types
     $this->limitPerformer($performer);
     $this->limitTitle($title, $pattern);
     $this->limitAction($action);
     $this->getDateCond($year, $month);
     $this->mTagFilter = $tagFilter;
     $this->mDb = wfGetDB(DB_REPLICA, 'logpager');
 }
Ejemplo n.º 20
0
 function __construct($target, $namespace = false, $year = false, $month = false)
 {
     parent::__construct();
     foreach (explode(' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter') as $msg) {
         $this->messages[$msg] = wfMsgExt($msg, array('escape'));
     }
     $this->target = $target;
     $this->namespace = $namespace;
     $year = intval($year);
     $month = intval($month);
     $this->year = $year > 0 && $year < 10000 ? $year : false;
     $this->month = $month > 0 && $month < 13 ? $month : false;
     $this->getDateCond();
     $this->mDb = wfGetDB(DB_SLAVE, 'contributions');
 }
 /**
  * @param IContextSource $hostTitle
  * @param string         $formSection
  * @param array          $prependPrototypes
  * @param array          $appendPrototypes
  * @param string         $adFilter
  * @param bool           $editable
  */
 function __construct($hostTitle, $formSection = null, $prependPrototypes = array(), $appendPrototypes = array(), $adFilter = '', $editable = false)
 {
     $this->editable = $editable;
     $this->filter = $adFilter;
     parent::__construct();
     $this->prependPrototypes = $prependPrototypes;
     $this->appendPrototypes = $appendPrototypes;
     $this->formSection = $formSection;
     $this->viewPage = $hostTitle;
     // Override paging defaults
     list($this->mLimit, $this->mOffset) = $this->mRequest->getLimitOffset(20, '');
     $this->mLimitsShown = array(20, 50, 100);
     // Get the database object
     $this->mDb = PRDatabase::getDb();
 }
Ejemplo n.º 22
0
 public function __construct()
 {
     parent::__construct();
     $this->app = F::app();
     $this->mDb = wfGetDB(DB_SLAVE, array(), $this->app->wg->ExternalSharedDB);
     $this->mSearchText = $this->app->wg->Request->getText('wpPhalanxCheckBlocker', null);
     $this->mSearchFilter = $this->app->wg->Request->getArray('wpPhalanxTypeFilter');
     $this->mSearchId = $this->app->wg->Request->getInt('id');
     // handle "type" parameter from URLs comming from hook messages
     $type = $this->app->wg->Request->getInt('type');
     if ($type > 0) {
         $this->mSearchFilter = array($type);
     }
     $this->mTitle = Title::newFromText('Phalanx/stats', NS_SPECIAL);
     $this->mSkin = RequestContext::getMain()->getSkin();
     $this->phalanxPage = SpecialPage::getTitleFor('Phalanx');
     $this->phalanxStatsPage = SpecialPage::getTitleFor('PhalanxStats');
 }
	/**
	 * Constructor.
	 * @param $query Query object, containing the parameters that will select
	 *   which articles will be shown.
	 * @param $limit Override how many articles will be listed.
	 */
	function __construct( WikilogItemQuery $query, $limit = false, $including = false ) {
		# WikilogItemQuery object drives our queries.
		$this->mQuery = $query;
		$this->mIncluding = $including;

		# Parent constructor.
		parent::__construct();

		# Fix our limits, Pager's defaults are too high.
		global $wgUser, $wgWikilogNumArticles;
		$this->mDefaultLimit = $wgWikilogNumArticles;

		if ( $limit ) {
			$this->mLimit = $limit;
		} else {
			list( $this->mLimit, /* $offset */ ) =
				$this->mRequest->getLimitOffset( $wgWikilogNumArticles, '' );
		}

		# This is too expensive, limit listing.
		global $wgWikilogExpensiveLimit;
		if ( $this->mLimit > $wgWikilogExpensiveLimit )
			$this->mLimit = $wgWikilogExpensiveLimit;

		# Check parser state, setup edit links.
		global $wgOut, $wgParser, $wgTitle;
		if ( $this->mIncluding ) {
			$popt = $wgParser->getOptions();
		} else {
			$popt = $wgOut->parserOptions();

			# We will need a clean parser if not including.
			$wgParser->startExternalParse( $wgTitle, $popt, Parser::OT_HTML );
		}
		$this->mShowEditLink = $popt->getEditSection();
	}
Ejemplo n.º 24
0
 function __construct($from)
 {
     global $wgExternalDatawareDB;
     parent::__construct();
     $this->mDb = wfGetDB(DB_MASTER, array(), $wgExternalDatawareDB);
     $from = str_replace(' ', '_', $from);
     if ($from !== '') {
         global $wgCapitalLinks, $wgContLang;
         if ($wgCapitalLinks) {
             $from = $wgContLang->ucfirst($from);
         }
         $this->mOffset = $from;
     }
     // filtering by type and by user name
     $this->aConds = array();
     $sType = $this->mRequest->getText('type', '');
     if (!empty($sType)) {
         $this->aConds['slog_type'] = $sType;
     }
     $sUser = $this->mRequest->getText('user', '');
     if (!empty($sUser)) {
         $this->aConds['slog_user_name'] = $sUser;
     }
 }
 /**
  * @param HistoryAction $historyPage
  * @param string $year
  * @param string $month
  * @param string $tagFilter
  * @param array $conds
  */
 function __construct($historyPage, $year = '', $month = '', $tagFilter = '', $conds = array())
 {
     parent::__construct($historyPage->getContext());
     $this->historyPage = $historyPage;
     $this->tagFilter = $tagFilter;
     $this->getDateCond($year, $month);
     $this->conds = $conds;
 }
Ejemplo n.º 26
0
 function __construct($form, $conds = array(), $source, $dest)
 {
     $this->mForm = $form;
     $this->mConds = $conds;
     $this->title = $source;
     $this->articleID = $source->getArticleID();
     $dbr = wfGetDB(DB_SLAVE);
     $maxtimestamp = $dbr->selectField('revision', 'MIN(rev_timestamp)', array('rev_page' => $dest->getArticleID()), __METHOD__);
     $this->maxTimestamp = $maxtimestamp;
     parent::__construct();
 }
Ejemplo n.º 27
0
 function __construct(IContextSource $context, array $options)
 {
     parent::__construct($context);
     $msgs = array('uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator');
     foreach ($msgs as $msg) {
         $this->messages[$msg] = $this->msg($msg)->escaped();
     }
     $this->target = isset($options['target']) ? $options['target'] : '';
     $this->contribs = isset($options['contribs']) ? $options['contribs'] : 'users';
     $this->namespace = isset($options['namespace']) ? $options['namespace'] : '';
     $this->tagFilter = isset($options['tagfilter']) ? $options['tagfilter'] : false;
     $this->nsInvert = isset($options['nsInvert']) ? $options['nsInvert'] : false;
     $this->associated = isset($options['associated']) ? $options['associated'] : false;
     $this->deletedOnly = !empty($options['deletedOnly']);
     $this->topOnly = !empty($options['topOnly']);
     $year = isset($options['year']) ? $options['year'] : false;
     $month = isset($options['month']) ? $options['month'] : false;
     $this->getDateCond($year, $month);
     $this->mDb = wfGetDB(DB_SLAVE, 'contributions');
 }
 function __construct($form, $conds, $type, $rejects = false, $showHeld = false, $showStale = false)
 {
     $this->mForm = $form;
     $this->mConds = $conds;
     $this->mConds['acr_type'] = $type;
     $this->rejects = $rejects;
     $this->stale = $showStale;
     if ($rejects || $showStale) {
         $this->mConds['acr_deleted'] = 1;
     } else {
         $this->mConds['acr_deleted'] = 0;
         if ($showHeld) {
             $this->mConds[] = 'acr_held IS NOT NULL';
         } else {
             $this->mConds[] = 'acr_held IS NULL';
         }
     }
     parent::__construct();
     # Treat 20 as the default limit, since each entry takes up 5 rows.
     $urlLimit = $this->mRequest->getInt('limit');
     $this->mLimit = $urlLimit ? $urlLimit : 20;
 }
 function __construct($form, FormOptions $opts)
 {
     parent::__construct($form->getContext());
     $this->mForm = $form;
     $this->opts = $opts;
 }
Ejemplo n.º 30
0
 /**
  * @param HistoryAction $historyPage
  * @param string $year
  * @param string $month
  * @param string $tagFilter
  * @param array $conds
  */
 function __construct($historyPage, $year = '', $month = '', $tagFilter = '', $conds = [])
 {
     parent::__construct($historyPage->getContext());
     $this->historyPage = $historyPage;
     $this->tagFilter = $tagFilter;
     $this->getDateCond($year, $month);
     $this->conds = $conds;
     $this->showTagEditUI = ChangeTags::showTagEditingUI($this->getUser());
 }