本文整理汇总了PHP中Article::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Article::__construct方法的具体用法?PHP Article::__construct怎么用?PHP Article::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Article
的用法示例。
在下文中一共展示了Article::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct($title, $mvTitle = false)
{
if ($mvTitle) {
$this->mvTitle = $mvTitle;
}
return parent::__construct($title);
}
示例2: WikilogCommentFormatter
/**
* 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() );
}
}
示例3: __construct
public function __construct($title, $verticalId)
{
wfProfileIn(__METHOD__);
parent::__construct($title);
$this->verticalId = $verticalId;
wfProfileOut(__METHOD__);
}
示例4: mvfAddHTMLHeader
function __construct($title)
{
global $wgRequest;
mvfAddHTMLHeader('sequence');
parent::__construct($title);
return $this;
}
示例5: Link
function __construct(Title $title)
{
parent::__construct($title);
$this->setContent();
$l = new Link();
$this->link = $l->getLinkByPageID($title->getArticleID());
}
示例6: create
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.
}
示例7: __construct
public function __construct($title)
{
wfProfileIn(__METHOD__);
parent::__construct($title);
$this->mPage = new WAMPage($title);
wfProfileOut(__METHOD__);
}
示例8: array
function __construct(Title $title, $oldId = null)
{
global $wgHooks;
$wgHooks['ShowBreadCrumbs'][] = array('WikihowHomepage::removeBreadcrumb');
$wgHooks['AfterHeader'][] = array('WikihowHomepage::showTopImage');
parent::__construct($title, $oldId);
}
示例9: __construct
public function __construct($title, $hubTimestamp = null)
{
wfProfileIn(__METHOD__);
parent::__construct($title);
$this->hubTimestamp = $hubTimestamp;
$this->mPage = new WikiaHubsV3Page($title);
wfProfileOut(__METHOD__);
}
示例10: __construct
public function __construct($title, $text, $source)
{
$this->source = $source;
parent::__construct($title, $text);
/*
или в таком порядке, то же самое
parent::__construct($title, $text);
$this->source = $source;
*/
}
示例11: __construct
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");
}
示例12: array
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
}
}
示例13: __construct
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");
}
示例14: __construct
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");
}
示例15: wfFindFile
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;
}