File: /home/centralexf/www/modules/mod_qtabs/helper.php
<?php
/**
* QTabs Module
*
* @version 0.7.0
* @package qtabs
* @author Massimo Giagnoni ( http://www.latenight-coding.com )
* @copyright Copyright (C) 2008 Massimo Giagnoni. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
class modQTabsHelper {
function getContent($module_id, &$params, &$document) {
$sw = array();
if($params->get('t_width')) {
$sw[]='width:'.$params->get('t_width').'px';
}
if($params->get('t_height')) {
$sw[]='height:'.$params->get('t_height').'px';
}
$cw = $params->get('width');
if(strpos($cw,'%')===false) {
$cw = $cw .'px';
}
$ch = $params->get('height','');
if($ch) {
$ch = ";height:{$ch}px";
}
//$c = '<div class="qtabs-wrapper qtwrap-'.$params->get('style','default').'" id="qtwrap-'.$module_id.'" style="width:'.$cw.$ch.'">';
$c = '<div class="qtabs-wrapper qtwrap-'.$params->get('style','default').'" id="qtwrap-'.$module_id.'">';
$c .= '<div class="qthead-'.$params->get('style','default').'" id="qthead-'.$module_id.'"';
if(count($sw)){
$c .= 'style="'. implode(';',$sw) . '"';
}
$c .= '>';
$c .= '<ul class="qtabs" id="qtabs-'. $module_id .'">';
$renderer = $document->loadRenderer('module');
$modules = JModuleHelper::getModules($params->get('position'));
$dt = $params->get('default_tab',0);
$tt = $tc = '';
for($i=0; $i < count($modules);$i++) {
$m = $modules[$i];
$cl = $st = '';
if($i == 0) {
$cl='qt-first ';
}
if($i != $dt) {
$st = ' style="visibility:hidden"';
$cl .= 'closed';
} else {
$cl .= 'open';
}
$tt .= '<li id="qtabs' . $module_id .'-'. $i . '" class="'.$cl.'"><span>' . $m->title . '</span></li>';
$tc .= '<div class="qt-content"'.$st.'>' . $renderer->render($m) .'</div>';
}
$c .= $tt . '</ul></div>';
/*$cw = $params->get('width');
if(strpos($cw,'%')===false) {
$cw = $cw .'px';
}
$ch = $params->get('height','');
if($ch) {
$ch = ";height:{$ch}px";
}*/
$c .= '<div style="position:relative;overflow:hidden;width:' . $cw . $ch .'" id="current-'. $module_id .'" class="current-' . $params->get('style','default'). '">';
//$c .= '<div style="position:relative;overflow:hidden;width:100%;" id="current-'. $module_id .'" class="current-' . $params->get('style','default'). '">';
$c .= $tc . '</div><div style="clear:both;width:100%;"></div></div>';
return $c;
}
}
?>