当前位置: 首页>>代码示例>>PHP>>正文


PHP Article::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:7,代码来源:MV_StreamPage.php

示例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() );
		}
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:39,代码来源:WikilogCommentsPage.php

示例3: __construct

 public function __construct($title, $verticalId)
 {
     wfProfileIn(__METHOD__);
     parent::__construct($title);
     $this->verticalId = $verticalId;
     wfProfileOut(__METHOD__);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:7,代码来源:WikiaHubsV2Article.class.php

示例4: mvfAddHTMLHeader

 function __construct($title)
 {
     global $wgRequest;
     mvfAddHTMLHeader('sequence');
     parent::__construct($title);
     return $this;
 }
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:7,代码来源:MV_SequencePage.php

示例5: Link

 function __construct(Title $title)
 {
     parent::__construct($title);
     $this->setContent();
     $l = new Link();
     $this->link = $l->getLinkByPageID($title->getArticleID());
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:LinkPage.php

示例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.
 }
开发者ID:clrh,项目名称:mediawiki,代码行数:35,代码来源:ArticleExClass.php

示例7: __construct

 public function __construct($title)
 {
     wfProfileIn(__METHOD__);
     parent::__construct($title);
     $this->mPage = new WAMPage($title);
     wfProfileOut(__METHOD__);
 }
开发者ID:yusufchang,项目名称:app,代码行数:7,代码来源:WAMPageArticle.class.php

示例8: array

 function __construct(Title $title, $oldId = null)
 {
     global $wgHooks;
     $wgHooks['ShowBreadCrumbs'][] = array('WikihowHomepage::removeBreadcrumb');
     $wgHooks['AfterHeader'][] = array('WikihowHomepage::showTopImage');
     parent::__construct($title, $oldId);
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:WikihowHomepage.body.php

示例9: __construct

 public function __construct($title, $hubTimestamp = null)
 {
     wfProfileIn(__METHOD__);
     parent::__construct($title);
     $this->hubTimestamp = $hubTimestamp;
     $this->mPage = new WikiaHubsV3Page($title);
     wfProfileOut(__METHOD__);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:8,代码来源:WikiaHubsV3Article.class.php

示例10: __construct

 public function __construct($title, $text, $source)
 {
     $this->source = $source;
     parent::__construct($title, $text);
     /*
     или в таком порядке, то же самое
     parent::__construct($title, $text);
     $this->source = $source;
     */
 }
开发者ID:AnnaOzer,项目名称:php1_2015,代码行数:10,代码来源:19.php

示例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");
 }
开发者ID:estrom85,项目名称:sample-codes,代码行数:11,代码来源:Article_quiz.php

示例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
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:11,代码来源:WikiaQuizPlayArticle.class.php

示例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");
 }
开发者ID:estrom85,项目名称:sample-codes,代码行数:11,代码来源:Article_galery.php

示例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");
 }
开发者ID:estrom85,项目名称:sample-codes,代码行数:11,代码来源:Article_interview.php

示例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;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:12,代码来源:ImagePage.php


注:本文中的Article::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。