Skip to content

Instantly share code, notes, and snippets.

@RyujiAMANO
Last active October 5, 2015 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyujiAMANO/bbbd50887bc1e884e73d to your computer and use it in GitHub Desktop.
Save RyujiAMANO/bbbd50887bc1e884e73d to your computer and use it in GitHub Desktop.
XOOPS Cube テーマで使えるトップページ判定変数 xoops_is_topをセットするpreload
<?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