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' - the default module style: custom 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 as well as to the module elements.
20 // 'art-...' - overwrites the default module style.
21 // 'suffix art-...' - overwrites the default style and adds suffix to the module and
22 // to its elements, does not add art-... to the module elements.
24 $classes = explode(' ', rtrim($params->get('moduleclass_sfx')));
25 $keys = array_keys($styles);
27 foreach ($classes as $key => $class) {
28 if (in_array($class, $keys)) {
33 $classes = str_replace(' ', ' ', rtrim(implode(' ', $classes)));
34 $style = count($art) ? array_pop($art) : $style;
35 $params->set('moduleclass_sfx', $classes);
36 call_user_func($styles[$style], $module, $params, $attribs);
39 function modChrome_artnostyle($module, &$params, &$attribs)
41 if (!empty ($module->content)) : ?>
42 <!-- begin nostyle -->
43 <div class="art-nostyle<?php echo $params->get('moduleclass_sfx'); ?>">
44 <?php if ($module->showtitle != 0) : ?>
45 <h3><?php echo $module->title; ?></h3>
47 <!-- begin nostyle content -->
48 <?php echo $module->content; ?>
49 <!-- end nostyle content -->
55 function modChrome_artblock($module, &$params, &$attribs)
57 if (!empty ($module->content))
58 echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
59 $params->get('moduleclass_sfx'));
62 function modChrome_artvmenu($module, &$params, &$attribs)
64 if (!empty ($module->content)) {
65 if (function_exists('artxVMenuBlock'))
66 echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
67 $params->get('moduleclass_sfx'));
69 echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content,
70 $params->get('moduleclass_sfx'));
74 function modChrome_artarticle($module, &$params, &$attribs)
76 if (!empty ($module->content)) {
77 $data = array('classes' => $params->get('moduleclass_sfx'), 'content' => $module->content);
78 if ($module->showtitle != 0)
79 $data['header-text'] = $module->title;