2 defined('_JEXEC') or die;
4 if (!defined('_ARTX_FUNCTIONS'))
5 require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php');
7 function modChrome_artstyle($module, &$params, &$attribs)
9 $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle';
11 'art-nostyle' => 'modChrome_artnostyle',
12 'art-block' => 'modChrome_artblock',
13 'art-article' => 'modChrome_artarticle',
14 'art-vmenu' => 'modChrome_artvmenu'
16 // moduleclass_sfx support:
17 // '' or 'suffix' - use default style, suffix will not be added to the module tag
18 // but will be added to the module elements.
19 // ' suffix' - adds suffix to the module root tag as well as to the module elements.
20 // 'art-...' - overwrites module style.
21 // 'art-... suffix' - overwrites style and adds suffix to the module root tag and
22 // to the module elements, does not add art-... to the module elements.
24 $sfx = $params->get('moduleclass_sfx');
25 if (strlen($sfx) != 0) {
29 $parts = explode(' ', $sfx, 2);
30 if (in_array($parts[0], array_keys($styles))) {
32 if (count($parts) > 1)
33 $classes = ' ' . $parts[1];
34 $params->set('moduleclass_sfx', $classes);
38 $params->set('artx-module-classes', $classes);
39 call_user_func($styles[$style], $module, $params, $attribs);
42 function modChrome_artnostyle($module, &$params, &$attribs)
44 if (!empty ($module->content)) : ?>
45 <div class="art-nostyle<?php echo $params->get('artx-module-classes'); ?>">
46 <?php if ($module->showtitle != 0) : ?>
47 <h3><?php echo $module->title; ?></h3>
49 <?php echo $module->content; ?>
54 function modChrome_artblock($module, &$params, &$attribs)
56 if (!empty ($module->content))
57 echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
58 $params->get('artx-module-classes'));
61 function modChrome_artvmenu($module, &$params, &$attribs)
63 if (!empty ($module->content)) {
64 if (function_exists('artxVMenuBlock'))
65 echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
66 $params->get('artx-module-classes'));
68 echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
69 $params->get('artx-module-classes'));
73 function modChrome_artarticle($module, &$params, &$attribs)
75 if (!empty ($module->content)) {
76 $data = array('classes' => $params->get('artx-module-classes'), 'content' => $module->content);
77 if ($module->showtitle != 0)
78 $data['header-text'] = $module->title;