OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / s / default / html / modules.php
1 <?php
2 defined('_JEXEC') or die('Restricted access'); // no direct access
3
4 if (!defined('_ARTX_FUNCTIONS'))
5   require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php');
6
7 function modChrome_artstyle($module, &$params, &$attribs)
8 {
9   $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle';
10   $styles = array(
11     'art-nostyle' => 'modChrome_artnostyle',
12     'art-block' => 'modChrome_artblock',
13     'art-article' => 'modChrome_artarticle',
14     'art-vmenu' => 'modChrome_artvmenu'
15   );
16   $sfx = $params->get('moduleclass_sfx');
17   if (in_array($sfx, array_keys($styles)))
18     $style = $sfx;
19   call_user_func($styles[$style], $module, $params, $attribs);
20 }
21
22 function modChrome_artnostyle($module, &$params, &$attribs)
23 {
24 if (!empty ($module->content)) : ?>
25 <div class="art-nostyle">
26 <?php if ($module->showtitle != 0) : ?>
27 <h3><?php echo $module->title; ?></h3>
28 <?php endif; ?>
29 <?php echo $module->content; ?>
30 </div>
31 <?php endif;
32 }
33
34 function modChrome_artblock($module, &$params, &$attribs)
35 {
36   if (!empty ($module->content))
37     echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
38 }
39
40 function modChrome_artvmenu($module, &$params, &$attribs)
41 {
42   if (!empty ($module->content)) {
43     if (function_exists('artxVMenuBlock'))
44       echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
45     else
46       echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
47   }
48 }
49
50 function modChrome_artarticle($module, &$params, &$attribs)
51 {
52   if (!empty ($module->content))
53     echo artxPost(($module->showtitle != 0) ? $module->title : '', $module->content);
54 }