OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / _admin2 / html / modules.php
1 <?php
2 defined('_JEXEC') or die('Restricted access'); // no direct access
3
4 $GLOBALS['artx_settings'] = array('block' => array('has_header' => true));
5
6 function modChrome_artstyle($module, &$params, &$attribs)
7 {
8   $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle';
9   $styles = array(
10     'art-nostyle' => 'modChrome_artnostyle',
11     'art-block' => 'modChrome_artblock',
12     'art-article' => 'modChrome_artarticle',
13     'art-vmenu' => 'modChrome_artvmenu'
14   );
15   $sfx = $params->get('moduleclass_sfx');
16   if (in_array($sfx, array_keys($styles)))
17     $style = $sfx;
18   call_user_func($styles[$style], $module, $params, $attribs);
19 }
20
21 function modChrome_artnostyle($module, &$params, &$attribs)
22 {
23 if (!empty ($module->content)) : ?>
24 <div class="art-nostyle">
25 <?php if ($module->showtitle != 0) : ?>
26 <h3><?php echo $module->title; ?></h3>
27 <?php endif; ?>
28 <?php echo $module->content; ?>
29 </div>
30 <?php endif;
31 }
32
33 function modChrome_artblock($module, &$params, &$attribs)
34 {
35   if (!empty ($module->content))
36     echo _artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content);
37 }
38
39 function modChrome_artarticle($module, &$params, &$attribs)
40 {
41   if (!empty ($module->content))
42     echo artxPost(($module->showtitle != 0) ? $module->title : '', $module->content);
43 }
44
45 function _artxBlock($caption, $content)
46 {
47         $hasCaption = ($GLOBALS['artx_settings']['block']['has_header']
48                 && null !== $caption && strlen(trim($caption)) > 0);
49         $hasContent = (null !== $content && strlen(trim($content)) > 0);
50
51         if (!$hasCaption && !$hasContent)
52                 return '';
53
54         ob_start();
55 ?>
56 <div class="m3widget_box ui-widget">
57 <?php if ($hasCaption): ?>
58 <div class="m3widget_box_head ui-state-default ui-priority-primary ui-corner-tl ui-corner-tr"><?php echo $caption; ?></div>
59 <?php endif; ?>
60 <?php if ($hasContent): ?>
61                 <div class="m3widget_box_content ui-widget-content ui-corner-bl ui-corner-br">
62                 <!-- block-content -->
63 <?php echo $content; ?>
64                 <!-- /block-content -->
65                 </div>
66 <?php endif; ?>
67 </div>
68 <?php
69         return ob_get_clean();
70 }
71 ?>