Created
May 7, 2011 05:44
-
-
Save nissuk/960239 to your computer and use it in GitHub Desktop.
Joomla 1.5: カスタムモジュールスタイルの例
This file contains hidden or 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 | |
/** | |
* カスタムモジュールスタイルを定義します。 | |
* {JoomlaのROOTパス}/templates/{テンプレートフォルダ}/html/modules.php | |
* に配置して下さい。 | |
*/ | |
// no direct access | |
defined('_JEXEC') or die('Restricted access'); | |
/** | |
* list -- モジュールをリスト形式で表示します。 | |
* | |
* 使用例: | |
* <jdoc:include type="modules" name="left" style="list" /> | |
* | |
* 展開例: | |
* <ul><li> | |
* <span>モジュールタイトル</span> | |
* モジュール内容 | |
* </li></ul> | |
*/ | |
function modChrome_list($module, &$params, &$attribs) | |
{ ?> | |
<ul><li class="module moduletable<?php echo $params->get('moduleclass_sfx'); ?>"> | |
<?php if ($module->showtitle): ?> | |
<span class="title"><?php echo $module->title ?></span> | |
<?php endif ?> | |
<?php echo $module->content ?> | |
</li></ul> | |
<?php } | |
/** | |
* listitem -- モジュールをリスト項目形式で表示します。 | |
* | |
* 使用例: | |
* <ul><jdoc:include type="modules" name="left" style="listitem" /></ul> | |
* | |
* 展開例: | |
* <li> | |
* <span>モジュールタイトル</span> | |
* モジュール内容 | |
* </li> | |
*/ | |
function modChrome_listitem($module, &$params, &$attribs) | |
{ ?> | |
<li class="module moduletable<?php echo $params->get('moduleclass_sfx'); ?>"> | |
<?php if ($module->showtitle): ?> | |
<span class="title"><?php echo $module->title ?></span> | |
<?php endif ?> | |
<?php echo $module->content ?> | |
</li> | |
<?php } | |
/** | |
* box -- モジュールの各部をdivで囲んで表示します。 | |
* | |
* 使用例: | |
* <jdoc:include type="modules" name="left" style="box" /> | |
* | |
* 展開例: | |
* <div class="module moduletable"> | |
* <div class="title">モジュールタイトル</div> | |
* <div class="content">モジュール内容</div> | |
* </div> | |
*/ | |
function modChrome_box($module, &$params, &$attribs) | |
{ ?> | |
<div class="module moduletable<?php echo $params->get('moduleclass_sfx'); ?>"> | |
<?php if ($module->showtitle): ?> | |
<div class="title"><?php echo $module->title ?></div> | |
<?php endif ?> | |
<div class="content"><?php echo $module->content ?></div> | |
</div> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment