Last active
October 5, 2015 04:36
-
-
Save RyujiAMANO/bbbd50887bc1e884e73d to your computer and use it in GitHub Desktop.
XOOPS Cube テーマで使えるトップページ判定変数 xoops_is_topをセットするpreload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @see http://xoops.ryus.co.jp/modules/d3blog/details.php?bid=373 | |
// @see http://qiita.com/RyujiAMANO/items/24f5f0397621f007c07e | |
class IsToppage extends XCube_ActionFilter | |
{ | |
protected $isTop = false; | |
public function preBlockFilter() | |
{ | |
$this->mController->mRoot->mDelegateManager->add("Legacypage.Top.Access", array(&$this, 'topAccess')); | |
} | |
public function topAccess() | |
{ | |
$this->isTop = true; | |
$GLOBALS['xoopsTpl']->assign('xoops_is_top', $this->isTop); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment