LoginSignup
2
2

More than 5 years have passed since last update.

XOOPS Cube のプリロード CssPreload.class.php

Posted at

マルチメニューでブロックにメニューを積むのはよくやりますが、そこで「CSS3なイケてるデザインを入れたい」という要望に応えるプラグインです。

/modules/multiMenu/preload/CssPreload.class.php
<?php
if (!defined('XOOPS_ROOT_PATH')) exit();
define('MULTIMENUCSS_PATH','/modules/multiMenu/templates/blocks/css/multimenu_panel.css');

class multiMenu_CssPreload extends XCube_ActionFilter
{
    function preBlockFilter()
    {
        $this->mRoot->mDelegateManager->add('XoopsTpl.New', array(&$this, 'MultimenuCssfile'));

    }
    function MultimenuCssfile(&$xoopsTpl)
    {
        $filename = XOOPS_URL . MULTIMENUCSS_PATH;
        $filepath = XOOPS_ROOT_PATH . MULTIMENUCSS_PATH;
        if( file_exists( $filepath ) ) {
            $xoops_module_header = '<link rel="stylesheet" type="text/css" media="screen" href="'.$filename.'" />';
            $xoopsTpl->assign('xoops_module_header', $xoops_module_header . "\n" . $xoopsTpl->get_template_vars('xoops_module_header'));
        }
    }
}
?>
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2