function modChrome_jsnmodule($module, &$params, &$attribs) { $moduleTitleOuput = '<span class="jsn-moduleicon">' . $module->title . '</span>'; $beginModuleContainerOutput = ''; $endModuleContainerOutput = ''; // Check module class for xHTML output if (isset($attribs['class'])) { // Check value in attribute class to generate appropriate xHTML code for module title if (preg_match("/\\bjsn-duohead\\b/", (string) $attribs['class'])) { $moduleTitleOuput = '<span class="jsn-moduleicon">' . JSNMobilizeTemplateHelper::wrapFirstWord($module->title) . '</span>'; } if (preg_match("/\\bjsn-innerhead\\b/", (string) $attribs['class'])) { $moduleTitleOuput = '<span class="jsn-moduletitle_inner1"><span class="jsn-moduletitle_inner2">' . $moduleTitleOuput . '</span></span>'; } // Check value in attribute class to generate appropriate xHTML code for module container if (preg_match("/\\bjsn-triobox\\b/", (string) $attribs['class'])) { $beginModuleContainerOutput = '<div class="jsn-top"><div class="jsn-top_inner"></div></div><div class="jsn-middle"><div class="jsn-middle_inner">'; $endModuleContainerOutput = '</div></div><div class="jsn-bottom"><div class="jsn-bottom_inner"></div></div>'; } else { } if (preg_match("/\\bjsn-roundedbox\\b/", (string) $attribs['class'])) { $beginModuleContainerOutput = '<div><div>'; $endModuleContainerOutput = '</div></div>'; } else { } } // Generate output code to template echo '<div class="' . $params->get('moduleclass_sfx') . ' jsn-modulecontainer' . (isset($attribs['columnClass']) ? ' ' . $attribs['columnClass'] : '') . '"><div class="jsn-modulecontainer_inner">'; echo $beginModuleContainerOutput; if (strpos($params->get('moduleclass_sfx'), 'display-dropdown') !== false && ($module->position == 'mainmenu' || $module->position == 'toolbar')) { echo '<h3 class="jsn-moduletitle"><span>' . $moduleTitleOuput . '</span></h3>'; } else { if ($module->showtitle) { echo '<h3 class="jsn-moduletitle">' . $moduleTitleOuput . '</h3>'; } } echo '<div class="jsn-modulecontent">'; echo $module->content; echo '<div class="clearbreak"></div></div>'; echo $endModuleContainerOutput; echo '</div></div>'; }
/** * Render content block. * * @param string $name Content block name. * @param string $device Client device type. * @param integer $preview Previewing or not? * @param String $IDBlock ID Block * @param String $class Class css * * @return void */ public static function renderHtmlBlock($bgstyke = NULL, $name, $device, $preview, $IDBlock = '', $class = 'row-fluid') { // Initialize variables $mCfg = JSNMobilizeTemplateHelper::getConfig($device, $preview); $detect = new JSN_Mobile_Detect(); $classPreview = ""; $urlRequest = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : ""; $getPreView = !empty($_GET['jsn_mobilize_preview']) ? $_GET['jsn_mobilize_preview'] : ''; if ($getPreView == 1) { $classPreview = "jsn-mobilize-block "; } if (!empty($name)) { $nameLeft = $name . '-left'; $nameRight = $name . '-right'; // Counting block content $counted[$name] = is_array($mCfg->get($name)) ? count($mCfg->get($name)) : 0; $counted[$nameLeft] = is_array($mCfg->get($nameLeft)) ? count($mCfg->get($nameLeft)) : 0; $counted[$nameRight] = is_array($mCfg->get($nameRight)) ? count($mCfg->get($nameRight)) : 0; $htmlBlock = ""; // Render block content $html[$nameLeft] = JSNMobilizeTemplateHelper::renderBlock($mCfg->get($nameLeft), true); $html[$nameRight] = JSNMobilizeTemplateHelper::renderBlock($mCfg->get($nameRight), true); $classSpan = 'span6'; if (!empty($html[$nameLeft]) or !empty($html[$nameRight])) { //echo '<div id="jsn-mobilize-' . str_replace('_', '-', $name) . '" class="row-fluid">'; if (!empty($html[$nameLeft])) { $htmlBlock .= "\t" . '<div id="jsn-mobilize-' . str_replace('_', '-', $nameLeft) . '" class="' . $classPreview . (!empty($html[$nameRight]) ? $classSpan : 'span12') . '">' . "\n\t\t" . $html[$nameLeft] . "\n\t" . '</div>'; } if (!empty($html[$nameRight])) { $htmlBlock .= "\t" . '<div id="jsn-mobilize-' . str_replace('_', '-', $nameRight) . '" class=" ' . $classPreview . (!empty($html[$nameLeft]) ? $classSpan : 'span12') . '">' . "\n\t\t" . $html[$nameRight] . "\n\t" . '</div>'; } //echo '</div>'; } if (!empty($htmlBlock)) { $class = !empty($class) ? 'class="' . $class . '"' : ''; echo '<div id="' . $IDBlock . '"' . $class . '>' . $bgstyke . '<div class="row-fluid">' . $htmlBlock . '</div></div>'; } } }
* @author JoomlaShine Team <*****@*****.**> * @copyright Copyright (C) 2012 JoomlaShine.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * Websites: http://www.joomlashine.com * Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html */ // no direct access defined('_JEXEC') or die; // Create a shortcut for params. $params =& $this->item->params; $canEdit = $this->item->params->get('access-edit'); $app = JFactory::getApplication(); $template = $app->getTemplate(); JHtml::_('behavior.tooltip'); if (JSNMobilizeTemplateHelper::isJoomla3()) { JHtml::_('behavior.framework'); ?> <?php if ($this->item->state == 0) { ?> <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?> </span> <?php } ?> <?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
$flag_last = false; foreach ($list as $i => &$item) { $class = ''; if ($item->id == $active_id) { $class .= 'current '; } if (in_array($item->id, $path)) { $class .= 'active '; } if ($item->deeper) { $class .= 'parent '; } if ($count == 1 || $flag == true) { $class .= 'first '; } if ($count == $menuCount || $item->shallower || JSNMobilizeTemplateHelper::isLastMenu($item)) { $class .= 'last '; } // Icon menu if ($item->anchor_css) { $class .= $item->anchor_css . ' '; } if (!empty($class)) { $class = ' class="' . trim($class) . '"'; } echo '<li ' . $class . '>'; $flag = false; $item->title = html_entity_decode($item->title); // Render the menu item. switch ($item->type) { case 'separator':
//$document->addScript(JURI::root() . '/templates/jsn_mobilize/js/mobilize.js'); $logoAlignment = $mCfg->get('logo-alignment'); if (JSNMobilizeTemplateHelper::checkMTREE()) { $document->addStyleSheet(JURI::root() . '/templates/jsn_mobilize/ext/mosetstree/jsn_mosetstree.css'); } if (JSNMobilizeTemplateHelper::checkK2()) { $document->addStyleSheet(JURI::root() . '/templates/jsn_mobilize/ext/k2/jsn_ext_k2.css'); } if (JSNMobilizeTemplateHelper::checkVM()) { $document->addStyleSheet(JURI::root() . '/templates/jsn_mobilize/ext/vm/jsn_ext_vm.css'); } ?> </head> <?php $tpl = new JSNMobilizeTemplateHelper(); echo $tpl->renderOpcity('', $preview, $cookieStyle, $cookieStl, 'jsn_template'); ?> <body id="jsn-master" class="<?php echo $app->input->getInt('jsn_mobilize_preview') ? ' jsn-mobilize-preview' : ''; ?> jsn-preview-<?php echo $device; ?> "> <div id="jsn-page" class="jsn-mobile-layout"> <div> <div id="jsn-header"> <div id="jsn-menu">
/** * Alter response body if necessary. * * - Mobile/tablet site: alter URI based on detected client device type. * - Desktop site: inject switcher link if visitor viewing desktop site on either mobile device or tablet PC. * * @return void */ public static function onAfterRender() { self::$_app = JFactory::getApplication(); if (!self::$_app->isAdmin()) { require_once dirname(__FILE__) . '/libraries/joomlashine/client/mobiledetect.php'; $detect = new JSN_Mobile_Detect(); $deviceType = $detect->isMobile() ? 'mobilize' : 'desktop'; $getPreview = !empty($_GET['jsn_mobilize_preview']) ? $_GET['jsn_mobilize_preview'] : ''; $getSwitch = !empty($_GET['switch_to_desktop_ui']) ? $_GET['switch_to_desktop_ui'] : ''; if (JSNMobilizeTemplateHelper::getConfig("mobilize")) { if (!defined('JSN_MOBILIZE_LAST_EXECUTION')) { return; } } if (!self::$_app->isAdmin() && self::$_device == "mobilize" && ($device = $deviceType) == 'desktop') { // Alter and/or optimize response body based on detected client device type self::_finalizeResponse(); } elseif (self::$_device == 'desktop' && ($device = $deviceType) != 'desktop' || $getSwitch == 1 && $getPreview == 1) { // Inject UI switcher link if visitor viewing desktop site on either mobile device or tablet PC self::_injectUISwitcher($device); } if (self::$_device != 'desktop') { self::Optimize(); } } }