function __construct($title, $mvTitle = false) { if ($mvTitle) { $this->mvTitle = $mvTitle; } return parent::__construct($title); }
/** * Constructor. * * @param $title Title of the page. * @param $wi WikilogInfo object with information about the wikilog and * the item. */ function __construct( Title &$title, WikilogInfo &$wi ) { global $wgUser, $wgRequest; parent::__construct( $title ); # Check if user can post. $this->mUserCanPost = $wgUser->isAllowed( 'wl-postcomment' ) || ( $wgUser->isAllowed( 'edit' ) && $wgUser->isAllowed( 'createtalk' ) ); $this->mUserCanModerate = $wgUser->isAllowed( 'wl-moderation' ); # Prepare the skin and the comment formatter. $this->mSkin = $wgUser->getSkin(); $this->mFormatter = new WikilogCommentFormatter( $this->mSkin, $this->mUserCanPost ); # Get item object relative to this comments page. $this->mItem = WikilogItem::newFromInfo( $wi ); # Form options. $this->mFormOptions = new FormOptions(); $this->mFormOptions->add( 'wlAnonName', '' ); $this->mFormOptions->add( 'wlComment', '' ); $this->mFormOptions->fetchValuesFromRequest( $wgRequest, array( 'wlAnonName', 'wlComment' ) ); # This flags if we are viewing a single comment (subpage). $this->mTrailing = $wi->getTrailing(); $this->mTalkTitle = $wi->getItemTalkTitle(); if ( $this->mItem && $this->mTrailing ) { $this->mSingleComment = WikilogComment::newFromPageID( $this->mItem, $this->getID() ); } }
public function __construct($title, $verticalId) { wfProfileIn(__METHOD__); parent::__construct($title); $this->verticalId = $verticalId; wfProfileOut(__METHOD__); }
function __construct($title) { global $wgRequest; mvfAddHTMLHeader('sequence'); parent::__construct($title); return $this; }
function __construct(Title $title) { parent::__construct($title); $this->setContent(); $l = new Link(); $this->link = $l->getLinkByPageID($title->getArticleID()); }
public function create(&$title, &$article) { // Check the special cases $ns = $title->getNamespace(); if ($ns == NS_MEDIA || $ns == NS_IMAGE || $ns == NS_CATEGORY) { return null; } // let the normal flow proceed. parent::__construct($title); $article = $this; // Let's check the database if a page matching the title name // actually exists... if one does, then abort our special hook. if ($this->getID() != 0) { return true; } // continue the hook chain. // First, extract base name from MW Title Class object. // The base name takes the form: // somemwprefixeddbkey.type // Where only the right most '.' delimits the 'type' information $n = $this->fname = $this->getTitle()->getPrefixedDBkey(); $p = strrpos($n, "."); if ($p === false) { // no '.' found, bail out. return true; } // Raise a flag to simplify our lives in the view() method. $this->foundDot = true; // We are anyhow dealing with a valid MW title name, // so spare the security checks. $this->bname = substr($n, 0, $p); $this->type = substr($n, $p + 1); return true; // continue the hook chain. }
public function __construct($title) { wfProfileIn(__METHOD__); parent::__construct($title); $this->mPage = new WAMPage($title); wfProfileOut(__METHOD__); }
function __construct(Title $title, $oldId = null) { global $wgHooks; $wgHooks['ShowBreadCrumbs'][] = array('WikihowHomepage::removeBreadcrumb'); $wgHooks['AfterHeader'][] = array('WikihowHomepage::showTopImage'); parent::__construct($title, $oldId); }
public function __construct($title, $hubTimestamp = null) { wfProfileIn(__METHOD__); parent::__construct($title); $this->hubTimestamp = $hubTimestamp; $this->mPage = new WikiaHubsV3Page($title); wfProfileOut(__METHOD__); }
public function __construct($title, $text, $source) { $this->source = $source; parent::__construct($title, $text); /* или в таком порядке, то же самое parent::__construct($title, $text); $this->source = $source; */ }
public function __construct() { parent::__construct(); $this->setFunction("edit_quest", "edit_question"); $this->setFunction("add_quest", "add_question"); $this->setFunction("rem_quest", "remove_question"); $this->setFunction("edit_desc", "edit_description"); $this->setForm("edit_desc", "", "edit_desc", "edit_description_form"); $this->setFunction("set_image", "set_image"); $this->setForm("set_image", "Nastav obrázok", "set_image", "set_image_form"); }
function __construct($title) { parent::__construct($title); // quiz object is linked to NS_WIKIA_QUIZ namespace $quizTitle = F::build('Title', array($title->getText(), NS_WIKIA_QUIZ), 'newFromText'); $this->mQuiz = WikiaQuiz::newFromTitle($quizTitle); if (!empty($this->mQuiz)) { $this->mQuiz->getData(); // lazy load data } }
public function __construct() { parent::__construct(); $this->readGalery(); $this->setFunction("edit_desc", "edit_description"); $this->setForm("edit_desc", "Edit description", "edit_desc", "edit_description_form"); $this->setFunction("add_img", "add_img"); $this->setForm("add_img", "Add image", "add_img", "add_img_form"); $this->setFunction("rem_picture", "remove_picture"); $this->setFunction("edit_pic", "edit_picture"); }
public function __construct() { parent::__construct(); //$this->createArticle(true); $this->setFunction("set_image", "set_image"); $this->setForm("set_image", "Nastav obrázok", "set_image", "set_image_form"); $this->setFunction("edit_info", "edit_info"); $this->setFunction("edit_quest", "edit_question"); $this->setFunction("add_quest", "add_question"); $this->setFunction("rem_quest", "remove_question"); }
function __construct($title, $time = false) { parent::__construct($title); $this->img = wfFindFile($this->mTitle, $time); if (!$this->img) { $this->img = wfLocalFile($this->mTitle); $this->current = $this->img; } else { $this->current = $time ? wfLocalFile($this->mTitle) : $this->img; } $this->repo = $this->img->repo; }
/** * Constructor */ function __construct(&$title) { global $wgUser; parent::__construct($title); $this->user_name = $title->getText(); $this->user_id = User::idFromName($this->user_name); $this->user = User::newFromId($this->user_id); $this->user->loadFromDatabase(); $this->is_owner = $this->user_name == $wgUser->getName(); $profile = new UserProfile($this->user_name); $this->profile_data = $profile->getProfile(); }
public function __construct() { parent::__construct(); $this->setFunction("add_cat", "add_cathegory"); $this->setForm("add_cat", "", "add_cat", "add_cathegory_form"); $this->setFunction("edit_cat", "edit_cathegory"); $this->setForm("edit_cat", "", "edit_cat", "edit_cathegory_form"); $this->setFunction("rem_cat", "remove_cathegory"); $this->setForm("rem_cat", "", "rem_cat", "remove_cathegory_form"); $this->setFunction("add_post", "add_post"); $this->setForm("add_post", "", "add_post", "add_post_form"); $this->setFunction("edit_post", "edit_post"); $this->setFunction("rem_post", "remove_post"); $this->setFunction("rel_post", "release_post"); $this->setFunction("drop_post", "drop_post"); }
/** * Contstruct as a normal article with no differences */ function __construct($param) { global $wgHooks; // Initialise the function cache self::$cache = array(); // The text for newly created ArticleProperties articles should be preloaded with a default message // NOTE: this is not called for page previews $wgHooks['EditFormPreloadText'][] = $this; // Allow sub-classes to have an edit method that can add its own fields $wgHooks['EditPage::showEditForm:fields'][] = array($this, 'onShowEditFormFields'); // Allow sub-classes to have a save method that can store its fields into the page_props $wgHooks['ArticleSaveComplete'][] = $this; // Remove associated properties when an article is deleted $wgHooks['ArticleDeleteComplete'][] = $this; return parent::__construct($param); }
/** * Constructor. */ function __construct() { parent::__construct(); }
function __construct($title) { parent::__construct($title); $this->dupes = null; $this->repo = null; }
function __construct($title) { parent::__construct($title); $this->mQuiz = WikiaQuiz::newFromArticle($this); }
function __construct($title, $format) { Article::__construct($title); $this->mFeedFormat = $format; }
public function __construct($id, $title, $content, $source) { parent::__construct($id, $title, $content); date_default_timezone_set('UTC'); $this->source = $source; }
public function __construct($id, $title, $content, $source) { parent::__construct($id, $title, $content); $this->source = $source; }
function __construct(&$folder) { parent::__construct($folder); }
public function __construct($title, $text, $source) { $this->source = $source; parent::__construct($title, $text); }
function __construct(Title $title) { parent::__construct($title); $this->setContent(); $this->getAuthors(); }
function __construct($title) { global $wgRequest; return parent::__construct($title); }
/** * Constructor. * @param $title Article title object. * @param $wi Wikilog info object. */ public function __construct( Title $title, WikilogItem $item = null ) { parent::__construct( $title ); $this->mItem = $item; }
/** * function __contstruct() * The structure of $info is * array(2) { * [0|origin]=> first Article * [1|lastreply]=> last Article * [2|articlenum]=> num * } * do not use this to get a object * * @param array $info * @param Board $board * @param array $articles * @return Threads * @access public * @throws ThreadsNullException */ public function __construct($info, $board, $articles = null) { if (!array($info) || count($info) != 3) { throw new ThreadsNullException(); } if (!is_a($board, "Board")) { throw new ThreadsNullException(); } //make sure it is number-index $info = array_values($info); $this->articleNum = intval($info[2]); $this->_board = $board; $this->_last = new Article($info[1], $this->_board, $this->articleNum - 1); try { parent::__construct($info[0], $this->_board, 0); } catch (ArticleNullException $e) { throw new ThreadsNullException(); } if (is_array($articles)) { foreach ($articles as $k => $v) { try { $this->_articles[] = new Article($v, $this->_board, $k); } catch (Exception $e) { throw new ThreadsNullException(); } } } }