public function executeIndex($params)
 {
     $page_owner = User::newFromName($this->wg->Title->getText());
     if (!is_object($page_owner) || $page_owner->getId() == 0) {
         // do not show module if page owner does not exist or is an anonymous user
         return false;
     }
     // add CSS for this module
     $this->wg->Out->addStyle(AssetsManager::getInstance()->getSassCommonURL("skins/oasis/css/modules/FollowedPages.scss"));
     $showDeletedPages = isset($params['showDeletedPages']) ? (bool) $params['showDeletedPages'] : true;
     // get 6 followed pages
     $watchlist = FollowModel::getWatchList($page_owner->getId(), 0, 6, null, $showDeletedPages);
     $data = array();
     // weird.  why is this an array of one element?
     foreach ($watchlist as $unused_id => $item) {
         $pagelist = $item['data'];
         foreach ($pagelist as $page) {
             $data[] = $page;
         }
     }
     // only display  your own page
     if ($page_owner->getId() == $this->wg->User->getId()) {
         $this->follow_all_link = Wikia::specialPageLink('Following', 'oasis-wikiafollowedpages-special-seeall', 'more');
     }
     $this->data = $data;
     $this->max_followed_pages = min(self::MAX_FOLLOWED_PAGES, count($this->data));
 }
 /**
  *  @brief hook to add toolbar item for admin dashboard
  */
 function onBeforeToolbarMenu(&$items)
 {
     if (F::app()->wg->User->isAllowed('admindashboard')) {
         $item = array('type' => 'html', 'html' => Wikia::specialPageLink('AdminDashboard', 'admindashboard-toolbar-link', array('data-tracking' => 'admindashboard/toolbar/admin')));
         if (is_array($items)) {
             $isMenuSubElPresent = false;
             foreach ($items as $el) {
                 if (isset($el['type']) && $el['type'] === 'menu') {
                     $isMenuSubElPresent = true;
                     break;
                 }
             }
             if ($isMenuSubElPresent) {
                 $items[] = $item;
             }
         } else {
             $items = array($item);
         }
     }
     return true;
 }
<section class="WikiaActivityModule module" id="<?= !empty( $userName ) ? 'WikiaRecentActivityUser' : 'WikiaRecentActivity'; ?>">
	<h1 class="activity-heading"><?= $moduleHeader ?></h1>
	<ul>
<?php
	if(!empty($changeList)){
		foreach ($changeList as $item) {
?>
		<li>
			<img src="<?= $wg->BlankImgUrl ?>" class="sprite <?= $item['changeicon'] ?>" height="20" width="20">
			<em><?= $item['page_href'] ?></em>
			<div class="edited-by"><?= $item['changemessage'] ?></div>
		</li>
<?php
		}
	}
	elseif(!empty($userName)) {
		echo wfMsg( 'userprofilepage-recent-activity-default', $userName );
	}
?>
	</ul>

	<? if ( $userName && count($changeList) ) :?>
		<?= Wikia::specialPageLink('Contributions/' . $userName, 'userprofilepage-top-recent-activity-see-more', 'more') ;?>
	<? elseif(empty($userName)): ?>
		<?= Wikia::specialPageLink('WikiActivity', 'oasis-more', 'more') ?>
	<? endif ;?>
</section>
Esempio n. 4
0
            ?>
</div>
					<?php 
        }
        ?>
				</div>
			</div>
			<?php 
        // edit button with actions dropdown
        if (!empty($action)) {
            echo F::app()->renderView('MenuButton', 'Index', array('action' => $action, 'image' => $actionImage, 'dropdown' => $dropdown, 'name' => $actionName));
        }
        // TODO: use PageHeaderIndexExtraButtons hook for these buttons
        // "Add a photo" button
        if (!empty($isNewFiles) && !empty($wg->EnableUploads)) {
            echo Wikia::specialPageLink('Upload', 'oasis-add-photo', 'wikia-button upphotos', 'blank.gif', 'oasis-add-photo-to-wiki', 'sprite photo');
        }
        // "Add a video" button
        if (!empty($isSpecialVideos) && !empty($wg->EnableUploads) && $showAddVideoBtn) {
            ?>
				<a class="button addVideo" href="#" rel="tooltip" title="<?php 
            echo wfMsg('related-videos-tooltip-add');
            ?>
">
					<img src="<?php 
            echo wfBlankImgUrl();
            ?>
" class="sprite addRelatedVideo"/> <?php 
            echo wfMsg('videos-add-video');
            ?>
				</a>
<div id="WikiWelcome" class="WikiWelcome">
	<h1><?php 
echo wfMsg('cnw-welcome-headline', $wg->Sitename);
?>
</h1>
	<p><?php 
echo wfMsg('cnw-welcome-instruction1');
?>
</p>
	<?php 
echo Wikia::specialPageLink('CreatePage', 'button-createpage', 'wikia-button createpage', 'blank.gif', 'oasis-create-page', 'sprite new');
?>
	<p><?php 
echo wfMsg('cnw-welcome-instruction2');
?>
</p>
	<p class="help"><?php 
echo wfMsg('cnw-welcome-help');
?>
</p>
</div>
Esempio n. 6
0
}
?>
		<?php 
echo $app->renderView('WikiNavigation', 'Index');
?>
    </nav>
	<?php 
if ($displayHeaderButtons) {
    ?>
    <div class="buttons">
		<?php 
    echo $app->renderView('ContributeMenu', 'Index');
    ?>
    </div>
	<?php 
}
?>
    <div class="hiddenLinks">
		<?php 
echo Wikia::specialPageLink('Watchlist', 'watchlist', array('accesskey' => 'l'));
?>
		<?php 
echo Wikia::specialPageLink('Random', 'randompage', array('accesskey' => 'x'));
?>
		<?php 
echo Wikia::specialPageLink('RecentChanges', 'recentchanges', array('accesskey' => 'r'));
?>
    </div>
</header>

Esempio n. 7
0
	function testWikiaSpecialPageLink() {
		$this->assertTag (
			array("tag" => "a"),
			Wikia::specialPageLink('CreatePage', 'button-createpage', 'wikia-button')
		);
	}
Esempio n. 8
0
					<br>
					<button title="<?php 
echo wfMessage('toplists-list-add-item-label')->inContentLanguage()->escaped();
?>
" class="AddButton">
						<img class="osprite icon-add" src="<?php 
echo wfBlankImgUrl();
?>
" alt="<?php 
echo wfMessage('toplists-list-add-item-label')->inContentLanguage()->escaped();
?>
"/>
						<?php 
echo wfMessage('toplists-list-add-item-label')->inContentLanguage()->escaped();
?>
					</button>
					<p class="error"></p>
				</form>
			</li>
	</ul>
	<div class="create-new-list">
		<h5><?php 
echo wfMessage('toplists-create-heading')->inContentLanguage()->parse();
?>
</h5>
		<?php 
echo Wikia::specialPageLink('CreateTopList', 'toplists-create-button-msg', 'wikia-button createtoplist', 'blank.gif', 'toplists-create-button-msg', 'sprite new');
?>
	</div>
</div>
Esempio n. 9
0
<section class="<?= $blogListingClass ?>">
	<?php // only display header block for the BlogListingBox
	if (strpos($blogListingClass, 'WikiaBlogListingBox') !== false) { ?>
	<?= Wikia::specialPageLink('CreateBlogPage', 'blog-create-post-label', 'wikia-button', 'blank.gif', 'blog-create-post-label', 'sprite blog') ?>
	<h3>
		<?= $title ?>
	</h3>
	<?php } // end BlogListingBox header ?>
	<ul>
		<?php
		foreach ($posts as $post) {
			$title = Title::newFromText($post['title'], $post['namespace']);
		?>
			<li class="WikiaBlogListingPost">
				<?= F::app()->renderView('CommentsLikes', 'Index', array('comments' => $post['comments'], 'bubble' => true, 'title' => $title, 'accesskey' => false)); ?>

				<?= $post['avatar'] ?>
				<div class="author-details">
					<h1><a href="<?= htmlspecialchars($title->getLocalUrl()) ?>"><?= htmlspecialchars(BlogTemplateClass::getSubpageText($title)) ?></a></h1>
					<span><?= wfMsg('blog-by', $post['date'], Xml::element('a', array('href' => htmlspecialchars($post['userpage'])), $post['username'], false)) ?></span>
				</div>

				<blockquote>
					<?php
					// handle proper rendering of "read more"
					$readMoreLink = Xml::openElement('span', array('class' => 'read-more')) .
							Wikia::link($title, wfMsg('blog-readfullpost') . ' &gt;') .
							Xml::closeElement('span');

					// if blog post rendered text ends with </p>
					if (!empty($post['readmore'])) {
Esempio n. 10
0
<section class="WikiaPagesOnWikiModule module">
	<h2><?php 
echo wfMsg('oasis-pages-on-wiki-header', $wg->Sitename);
?>
</h2>
	<?php 
if (empty($wg->EnableWikiAnswers)) {
    $loginClass = empty($wg->DisableAnonymousEditing) ? '' : ' require-login';
    echo Wikia::specialPageLink('CreatePage', 'oasis-add-page', 'wikia-button createpage' . $loginClass, 'blank.gif', 'oasis-create-page', 'sprite new');
}
?>
	<div class="tally">
		<?php 
echo wfMessage('oasis-total-articles-mainpage', $total)->parse();
?>
	</div>
</section>
Esempio n. 11
0
<header id="WikiaPageHeader" class="WikiaPageHeader<?= (empty($revisions) && empty($categories)) ? ' separator' : '' ?>">
	<h1><?= !empty($displaytitle) ? $title : htmlspecialchars($title) ?></h1>

<?php
	// edit button with actions dropdown
	if (!empty($action)) {
		echo F::app()->renderView('MenuButton', 'Index', array('action' => $action, 'image' => $actionImage, 'dropdown' => $dropdown, 'name' => $actionName));
	}

	// "Add a photo" button
	if (!empty($isNewFiles) && !empty($wg->EnableUploads)) {
		echo Wikia::specialPageLink('Upload', 'oasis-add-photo', (!$isUserLoggedIn ? 'wikia-button upphotoslogin' :'wikia-button upphotos'), 'blank.gif', 'oasis-add-photo-to-wiki', 'sprite photo');
	}

	// "Add a photo" button
	if (!empty($isSpecialVideos) && !empty($wg->EnableUploads)) { ?>
		<a class="button addVideo" href="#" rel="tooltip" title="<?=wfMsg('related-videos-tooltip-add');?>"><img src="<?=wfBlankImgUrl();?>" class="sprite addRelatedVideo" /> <?=wfMsg('videos-add-video')?></a>
	<? }

	// comments & like button
	if( !$isWallEnabled ) {
		echo F::app()->renderView('CommentsLikes', 'Index', array('comments' => $comments, 'likes' => $likes));
	}
	foreach( $extraButtons as $button ){
		echo $button;
	}

	// "pages on this wiki" counter
	if (!is_null($tallyMsg)) {
?>
	<div class="tally">
Esempio n. 12
0
    ?>
</span>
					<?php 
    echo wfMsg('themedesigner-previous-versions');
    ?>
					<img class="chevron" src="<?php 
    echo $wg->BlankImgUrl;
    ?>
">
					<ul>
					<?php 
    foreach ($themeHistory as $themeHistoryItem) {
        ?>
						<li>
							<?php 
        echo Wikia::specialPageLink('#', null, 'wikia-chiclet-button', 'blank.gif', 'recycle');
        ?>
							<?php 
        echo wfMsg('themedesigner-history-item', $themeHistoryItem['timeago'], $themeHistoryItem['author']);
        ?>
						</li>
					<?php 
    }
    ?>
					</ul>
				</span>
<?php 
}
//end if
?>
				<button class="save"><?php 
Esempio n. 13
0
        ?>
<li class="watchlist"><?php 
        echo Wikia::specialPageLink('WikiActivity/activity', 'myhome-activity-feed');
        ?>
</li><?php 
    } else {
        ?>
<li class="watchlist"><?php 
        echo Wikia::specialPageLink('WikiActivity/watchlist', 'oasis-button-wiki-activity-watchlist');
        ?>
</li><?php 
    }
}
?>
		<li><?php 
echo Wikia::specialPageLink('RecentChanges', 'oasis-button-wiki-activity-feed');
?>
</li>
	</ul>
<?php 
// render checkbox select default view
if ($showDefaultViewSwitch) {
    ?>
	<p>
		<input type="checkbox" id="wikiactivity-default-view-switch" data-type="<?php 
    echo $type;
    ?>
" disabled="disabled">
		<label for="wikiactivity-default-view-switch"><?php 
    echo wfMsg('myhome-default-view-checkbox', wfMsg("myhome-{$type}-feed"));
    ?>
    ?>
			<?php 
    if (in_array($change['type'], ['new', 'edit', 'delete'])) {
        $message = wfMessage("recent-wiki-activity-{$change['type']}-details")->params(AvatarService::renderLink($change['username']), wfTimeFormatAgoOnlyRecent($change['timestamp']))->text();
    } else {
        $message = wfTimeFormatAgoOnlyRecent($change['timestamp']);
    }
    ?>
			<li>
				<a class="recent-wiki-activity-link" href="<?php 
    echo $change['url'];
    ?>
"><?php 
    echo $change['title'];
    ?>
</a>
				<span><?php 
    echo $message;
    ?>
</span>
			</li>
		<?php 
}
?>
	</ul>

	<?php 
echo Wikia::specialPageLink('WikiActivity', 'recent-wiki-activity-see-more', 'more');
?>
</aside>