예제 #1
0
	/**
	 * Creates a new wikilog article object from a wikilog info object.
	 * Data is fetched from the database.
	 * @param $wi WikilogItem object.
	 * @return New WikilogItem object, or NULL if article doesn't exist.
	 */
	public static function newFromInfo( WikilogInfo &$wi ) {
		$itemTitle = $wi->getItemTitle();
		if ( $itemTitle ) {
			return self::newFromID( $itemTitle->getArticleID() );
		} else {
			return null;
		}
	}
예제 #2
0
	/**
	 * Configure wikilog views links.
	 * Helper function for SkinTemplateTabs and SkinTemplateNavigation hooks
	 * to configure views links in wikilog pages.
	 */
	private static function skinConfigViewsLinks( WikilogInfo &$wi, $skin, &$views ) {
		global $wgRequest, $wgWikilogEnableComments;

		$action = $wgRequest->getText( 'action' );
		if ( $wi->isMain() && $skin->getTitle()->quickUserCan( 'edit' ) ) {
			$views['wikilog'] = array(
				'class' => ( $action == 'wikilog' ) ? 'selected' : false,
				'text' => wfMsg( 'wikilog-tab' ),
				'href' => $skin->getTitle()->getLocalUrl( 'action=wikilog' )
			);
		}
		if ( $wgWikilogEnableComments && $wi->isTalk() ) {
			if ( isset( $views['addsection'] ) ) {
				unset( $views['addsection'] );
			}
		}
	}