Esempio n. 1
0
 public function getInput()
 {
     if (!class_exists('Yjsg')) {
         return;
     }
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.folder');
     $yjsg = Yjsg::getInstance();
     // make sure is YJ template
     if ($yjsg->yjtmpl()) {
         $e_folder = basename(dirname(dirname(__FILE__)));
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'plugins/system/' . $e_folder . '/elements/css/yjsgplg.css');
         if (intval(JVERSION) < 3) {
             $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/assets/src/libraries/jquery.min.js');
             $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/assets/src/libraries/jquery-noconflict.js');
         }
         $document->addScript(JURI::root() . 'plugins/system/' . $e_folder . '/elements/src/yjsgplg.js');
         $document->addScriptDeclaration("\n\t\t\t\n\t\t\t\n\t\t\t\t\tvar yjsgPlgpath = '" . JURI::root() . "';\n\t\t\t\t\tvar updatingTemplate ='" . JText::_('YJSG_UPDATING_TXT') . "';\n\t\t\t\t\tvar restoringTemplate ='" . JText::_('YJSG_RESTORING_TXT') . "';\n\t\t\t");
     }
     $html = '<div class="update_template">';
     $html .= '<div class="update_msg"><i class="fa fa-refresh fa-spin"></i> ' . JText::_('YJSG_COMP_CHECK') . '</div>';
     $html .= '<a id="update" class="updatebuttons" href="#">' . JText::_('YJSG_UPDATE') . '</a>';
     $html .= '<a id="restore" class="updatebuttons" href="#">' . JText::_('YJSG_RESTORE') . '</a>';
     $html .= '<a id="cleanup" class="updatebuttons" href="#">' . JText::_('YJSG_CLEANUP') . '</a>';
     $html .= '</div>';
     if ($yjsg->yjtmpl()) {
         return $html;
     } else {
         return;
     }
 }
Esempio n. 2
0
 public function getInput()
 {
     $yjsg = Yjsg::getInstance();
     $app = JFactory::getApplication();
     $templateId = $app->input->get('id');
     $YjsgDbParams = json_decode($yjsg->getDbParams($templateId), true);
     $sidebars = false;
     $searchName1 = array('leftcolumn', 'rightcolumn', 'insetcolumn');
     if (in_array($this->element['name'], $searchName1)) {
         $sidebars = true;
     }
     $customchrome = $this->element['customchrome'];
     $gridgroup = $this->element['gridgroup'];
     $clabel = $this->element['clabel'];
     $cclass = $this->element['cclass'];
     $chromename = str_replace(array('jform[params]', '[', ']'), '', $this->name) . '_custom_chrome';
     $html = '';
     if ($this->element['customchrome']) {
         if (array_key_exists($chromename, $YjsgDbParams)) {
             $chromeDefault = $YjsgDbParams[$chromename];
         } else {
             $chromeDefault = $customchrome;
         }
         $html .= '<a href="#" class="openChrome" data-chromedefault="' . $customchrome . '" data-chromemodule="#' . $chromename . '">';
         $html .= '<i class="adminicons-chrome"></i>';
         $html .= '</a>';
         $html .= '<div class="chromesHolder"  data-toggle="popover" data-placement="bottom" data-original-title="' . JText::_('YJSG_MOD_CHROME') . '" data-content="' . JText::_('YJSG_MOD_CHROME_TIP') . '">';
         $html .= '<a href="#" data-thischrome="YJsgxhtml" class="seldefault">' . JText::_('YJSG_DEFAULT') . ' <i class="fa fa-check-square-o"></i></a>';
         $html .= '<a href="#" data-thischrome="YJsground">' . JText::_('YJSG_MOD_CHROME_ROUND_NAV') . ' <i class="fa fa-square-o"></i></a>';
         $html .= '<a href="#" data-thischrome="YJsgblank">' . JText::_('YJSG_MOD_CHROME_BLANK_NAV') . ' <i class="fa fa-square-o"></i></a>';
         if (!$sidebars) {
             $html .= '<a href="#" data-thischrome="YJsgtabs">' . JText::_('YJSG_MOD_CHROME_TABS') . ' <i class="fa fa-square-o"></i></a>';
             $html .= '<a href="#" data-thischrome="YJsgaccordion">' . JText::_('YJSG_MOD_CHROME_ACCORDION') . ' <i class="fa fa-square-o"></i></a>';
             $html .= '<a href="#" data-thischrome="YJsgslides">' . JText::_('YJSG_MOD_CHROME_SLIDES') . ' <i class="fa fa-square-o"></i></a>';
         }
         $html .= '<input type="hidden" class="defChromes" name="jform[params][' . $chromename . ']" id="' . $chromename . '"';
         $html .= ' data-default="' . $customchrome . '" value="' . $chromeDefault . '">';
         $html .= '</div>';
     }
     if ($clabel != 'insettop' && $clabel != 'insetbottom') {
         $html .= '<div class="yjsg_module">';
         $html .= '<label>' . $clabel . '</label>';
         $html .= '<input type="text" name="' . $this->name . '" id="' . $this->id . '"';
         $html .= ' value="' . $this->value . '" class="input-mini yjsg_' . $gridgroup . '_width" size="4">';
         $html .= '<div class="yjsgcheck">';
         $html .= '<label>';
         $html .= '<input type="checkbox" name="jform[params][yjsg_' . $gridgroup . '_width_locked][]" class="YJSG_checkbox yjsg_' . $gridgroup . '_width hidden">';
         $html .= '<i class="fa fa-unlock"></i>';
         $html .= '</label>';
         $html .= '</div>';
         $html .= '</div>';
     } else {
         $html .= '<div class="yjsg_module orange">';
         $html .= '<label>' . $clabel . '</label>';
         $html .= '</div>';
     }
     return $html;
 }
Esempio n. 3
0
 public function getInput()
 {
     if (!defined('YJSGRUN')) {
         echo '<h1 style="color:red;">' . JText::_('YJSG_PLUGIN_NOT_FOUND') . '</h1>';
         return;
     }
     $document = YjsgDochead::getDocument();
     $document->addJsInhead("var comp_dis ='" . JText::_('YJSG_COMPONENT_DISABLED') . "';");
     $yjsg = Yjsg::getInstance();
     $YjsgCurrentVersion = $yjsg->version;
     $YjsgHasUpdate = $yjsg->hasupdate;
     $YjsgLatestVersion = $yjsg->getUpdateVersion();
     $template_folder = basename(dirname(dirname(__FILE__)));
     $params_obj = $this->form->getValue('params');
     $params = new JRegistry();
     $params->loadObject($params_obj);
     $comp_dis = '<div id="option-resut">';
     if ($params->get('component_switch')) {
         $comp_dis .= JText::_('YJSG_COMPONENT_DISABLED');
     }
     $comp_dis .= '</div>';
     $yjsgManageLink = 'index.php?option=com_plugins&view=plugins&filter_folder=system&filter_search=Yjsg';
     $yjsgText = '' . JText::_('YJSG_INS_PUB') . " <strong>v" . $YjsgCurrentVersion . "</strong> " . JText::_('YJSG_INS_PUB2') . ' <a href="' . $yjsgManageLink . '">' . JText::_('YJSC_MAN_EXT') . '</a>';
     if ($YjsgHasUpdate == 1) {
         $updateclass = ' updateavailable';
     } else {
         $updateclass = '';
     }
     // yjsg
     $syshtml = '<div class="yj_system_check">';
     $syshtml .= '<div id="yjsgBox" class="systemBox' . $updateclass . '">';
     $syshtml .= '<h2 id="yjmmpTitle" class="systemBoxTitle yjsgtips" data-original-title="' . JText::_('YJSG_CHECK') . '" data-content="' . JText::_('YJSG_CHECK_TIP') . '">' . JText::_('YJSG_CHECK') . '</h2>';
     if ($YjsgHasUpdate == 1) {
         $syshtml .= '<div class="infoText"><span class="showIcon"></span> ';
         $syshtml .= JText::_('UPDATE_AVAILABLE_TEXT') . '<strong>' . $YjsgCurrentVersion . '</strong>';
         $syshtml .= JText::_('UPDATE_AVAILABLE_TEXT2') . '<strong>' . $YjsgLatestVersion . '</strong>';
         $syshtml .= '<a href="index.php?option=com_installer&amp;view=update">' . JText::_('UPDATE_AVAILABLE_TEXT3') . '</a>';
         $syshtml .= '</div>';
     } else {
         $syshtml .= '<div class="infoText"><span class="showIcon"></span>' . $yjsgText . '</div>';
     }
     $syshtml .= '</div>';
     $syshtml .= '<div  id="settmsgBox" class="systemBox hide">';
     $syshtml .= '<h2 id="yjjbpTitle" class="systemBoxTitle yjsgtips" data-original-title="' . JText::_('YJSG_SETT_MSG') . '" data-content="' . JText::_('YJSG_SETT_MSG_TIP') . '">' . JText::_('YJSG_SETT_MSG') . '</h2>';
     $syshtml .= '<div class="infoText"><span class="showIcon"></span>' . $comp_dis . '</div>';
     $syshtml .= '</div>';
     $syshtml .= '</div>';
     // close yj_system_check
     // Output
     echo $syshtml;
 }
Esempio n. 4
0
 /**
  * method to run after an install/update/uninstall method
  *
  * @return void
  */
 public function postflight($type, $parent)
 {
     $db = JFactory::getDbo();
     try {
         $q = $db->getQuery(true);
         $q->update('#__extensions');
         $q->set(array('enabled = 1', 'ordering = -5000'));
         $q->where("element = 'yjsg'");
         $q->where("type = 'plugin'", 'AND');
         $q->where("folder = 'system'", 'AND');
         $db->setQuery($q);
         method_exists($db, 'execute') ? $db->execute() : $db->query();
     } catch (Exception $e) {
         throw $e;
     }
     JLoader::register('Yjsg', JPATH_ROOT . '/plugins/system/yjsg/includes/yjsgcore/classes/yjsg.class.php', true);
     $this->yjsg = Yjsg::getInstance();
     $language = JFactory::getLanguage();
     $language->load('plg_system_yjsg', JPATH_ADMINISTRATOR);
     $yjsgTemplateName = Yjsg::getDefaultTemplate();
     $yjsgTemplateNameTxt = ucfirst(Yjsg::getDefaultTemplate());
     $defaultTemplate = JPATH_ROOT . '/templates/' . $yjsgTemplateName;
     $beforeCleanup = JPATH_ROOT . '/templates/' . $yjsgTemplateName . '-beforeCleanup';
     $extendFolder = JPATH_ROOT . '/plugins/system/yjsg/includes/yjsgcore/classes/extend/classes/';
     $indexContent = '';
     if (!JFolder::exists($beforeCleanup) && $this->yjsg->yjtmpl() && $this->yjsg->tmplVersion($yjsgTemplateName) == '1.0.16') {
         if (JFolder::copy($defaultTemplate, $beforeCleanup)) {
             $backedUpMsg = $yjsgTemplateNameTxt . JText::_('YJSG_INSTALLER_TMPL_BACKUP');
             JFactory::getApplication()->enqueueMessage($backedUpMsg);
         } else {
             $nobackupMsg = JText::_('YJSG_INSTALLER_TMPL_NO_BACKUP1') . $yjsgTemplateNameTxt . JText::_('YJSG_INSTALLER_TMPL_NO_BACKUP2');
             JError::raiseWarning(100, $nobackupMsg);
         }
     }
     if (JFolder::exists($extendFolder)) {
         JFolder::delete($extendFolder);
         JFolder::create($extendFolder);
         JFile::write($extendFolder . 'index.html', $indexContent);
     }
 }
Esempio n. 5
0
/*======================================================================*\
|| #################################################################### ||
|| # Package - Joomla Template based on YJSimpleGrid Framework          ||
|| # Copyright (C) 2010  Youjoomla.com. All Rights Reserved.            ||
|| # license - PHP files are licensed under  GNU/GPL V2                 ||
|| # license - CSS  - JS - IMAGE files  are Copyrighted material        ||
|| # bound by Proprietary License of Youjoomla.com                      ||
|| # for more information visit http://www.youjoomla.com/license.html   ||
|| # Redistribution and  modification of this software                  ||
|| # is bounded by its licenses                                         ||
|| # websites - http://www.youjoomla.com | http://www.yjsimplegrid.com  ||
|| #################################################################### ||
\*======================================================================*/
// No direct access.
defined('_JEXEC') or die;
$yjsg = Yjsg::getInstance();
$getapps = JFactory::getApplication();
$template = $getapps->getTemplate();
$menu_path = YJSGPATH . "legacy" . YJDS . "html" . YJDS . "mod_menu" . YJDS;
$menu_type = $params->get('yjsg_menu_module_type', 'default');
require $menu_path . "yjsg_menuswitch.php";
if (!empty($class_sfx)) {
    $class_sfx = ' ' . $class_sfx;
}
switch ($menu_type) {
    case "default":
        $menuclass = '';
        $type_selected = 'default';
        break;
    case "inline":
        $menuclass = ' inline';
Esempio n. 6
0
 /**
  * Construct
  *
  * @since 2.0.0
  */
 public function __construct($subject, $config)
 {
     parent::__construct($subject, $config);
     JLoader::register('Yjsg', dirname(__FILE__) . '/includes/yjsgcore/classes/yjsg.class.php', true);
     $this->yjsg = Yjsg::getInstance();
     defined('YJDS') or define('YJDS', DIRECTORY_SEPARATOR);
     defined('YJSGCUSTOMFOLDER') or define('YJSGCUSTOMFOLDER', JPATH_ROOT . YJDS . "templates" . YJDS . $this->yjsg->getDefaultTemplate() . YJDS . "custom" . YJDS);
     $this->loadLanguage();
     $this->app = $this->yjsg->app;
     $this->user = $this->yjsg->user;
     $this->option = $this->Input('option');
     $this->view = $this->Input('view');
     $id = $this->Int('id');
     $exid = $this->Int('extension_id');
     $task = $this->Input('task');
     $this->canEdit = $this->user->authorise('core.edit', 'com_templates');
     $find_template = JPATH_SITE . YJDS . "templates" . YJDS . Yjsg::getDefaultTemplate() . YJDS . "custom" . YJDS;
     if ($this->option == 'com_templates' && $this->view == 'style') {
         $this->templateView = true;
     }
     if ($this->app->isAdmin()) {
         //get the edited template for back-end
         $this->edited_template = $this->getEditedTemplate($id, 0);
         // check if edited template is based on plugin
         if (!is_null($this->edited_template) && $this->yjsg->tmplVersion($this->edited_template) >= '2.0.0') {
             $this->yjsg_newtmpl_check = 1;
         }
         // check for conversion to turn on buttons in plugin admin
         if ($this->yjsg->yjtmpl() && $this->yjsg->tmplVersion(Yjsg::getDefaultTemplate()) == '1.0.16') {
             $this->yjsg_convert_check = 1;
         }
         // run the plugin in backend if template needs to be converted
         if ($this->canEdit && $this->option == 'com_plugins' && $this->view == 'plugin' && $this->yjsg_convert_check == 1 && $this->_name == 'yjsg') {
             $this->run_plg = 1;
         }
         // check media manager for modal and logo and make sure the element belongs to yjsg, if yes run the plugin
         if ($this->option == 'com_media' && $this->view == 'images' && $this->Input('author') == 'yjsg') {
             $this->run_plg = 1;
         }
         // if default template is not based on plugin and plugin runs, show msg
         if ($this->templateView && $this->yjsg_convert_check == 1 && $this->edited_template == Yjsg::getDefaultTemplate()) {
             $this->app->enqueueMessage(JText::_('YJSG_OLD_TEMPLATE_FOUND'), 'warning');
         }
         // run plugin on form tasks for ajax save
         if ($this->canEdit && $task == 'clearCache' || $task == 'adminUpdate' || $task == 'checkBootstrap' || $task == 'convertTemplate' || $task == 'checkTemplate' || $task == 'restoreTemplate' || $task == 'cleanupTemplate') {
             $this->run_plg = 1;
         }
         // default checks done run plugin for admin
         if ($this->canEdit && $this->templateView && $this->yjsg_newtmpl_check == 1) {
             $this->run_plg = 1;
         }
         // load the constants and override for admin
         if ($this->run_plg == 1) {
             $this->yjsgConstants();
             // load Extend J classes
             $this->yjsgExtendJoomla();
         }
         // check if we need to cleanup
         if ($this->edited_template == Yjsg::getDefaultTemplate() && $this->yjsg->cleanup()) {
             echo JText::_('YJSG_RUN_CLEANUP');
             die;
         }
     }
 }
Esempio n. 7
0
 /**
  * Load a template file -- first look in the templates folder for an override
  *
  * @param   string  $tpl  The name of the template source file; automatically searches the template paths and compiles as needed.
  *
  * @return  string  The output of the the template script.
  *
  * @since   12.2
  * @throws  Exception
  */
 public function loadTemplate($tpl = null)
 {
     // Clear prior output
     $this->_output = null;
     $template = JFactory::getApplication()->getTemplate();
     // Yjsg instance
     $yjsg = Yjsg::getInstance();
     $layout = $this->getLayout();
     $layoutTemplate = $this->getLayoutTemplate();
     // Create the template file name based on the layout
     $file = isset($tpl) ? $layout . '_' . $tpl : $layout;
     // Clean the file name
     $file = preg_replace('/[^A-Z0-9_\\.-]/i', '', $file);
     $tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\\.-]/i', '', $tpl) : $tpl;
     // Load the language file for the template
     $lang = JFactory::getLanguage();
     $lang->load('tpl_' . $template, JPATH_BASE, null, false, false) || $lang->load('tpl_' . $template, JPATH_THEMES . "/{$template}", null, false, false) || $lang->load('tpl_' . $template, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load('tpl_' . $template, JPATH_THEMES . "/{$template}", $lang->getDefault(), false, false);
     // Change the template folder if alternative layout is in different template
     if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) {
         $this->_path['template'] = str_replace($template, $layoutTemplate, $this->_path['template']);
     }
     //yjsg start
     $option = JFactory::getApplication()->input->getCmd('option');
     $folderName = $this->getName();
     if ($yjsg->preplugin() && JFactory::getApplication()->isSite()) {
         $yjsg_path = array(YJSGTEMPLATEPATH . 'html' . YJDS . $option . YJDS . $folderName, YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . $option . YJDS . $folderName);
     } else {
         $yjsg_path = array(YJSGTEMPLATEPATH . 'html' . YJDS . $option . YJDS . $folderName, YJSGPATH . 'includes' . YJDS . 'html' . YJDS . $option . YJDS . $folderName);
     }
     foreach ($this->_path['template'] as $jpath) {
         if (!in_array($jpath, $yjsg_path)) {
             $yjsg_path[] = $jpath;
         }
     }
     $this->_path['template'] = $yjsg_path;
     //yjsg end
     // Load the template script
     jimport('joomla.filesystem.path');
     $filetofind = $this->_createFileName('template', array('name' => $file));
     $this->_template = JPath::find($this->_path['template'], $filetofind);
     // If alternate layout can't be found, fall back to default layout
     if ($this->_template == false) {
         $filetofind = $this->_createFileName('', array('name' => 'default' . (isset($tpl) ? '_' . $tpl : $tpl)));
         $this->_template = JPath::find($this->_path['template'], $filetofind);
     }
     if ($this->_template != false) {
         // Unset so as not to introduce into template scope
         unset($tpl);
         unset($file);
         // Never allow a 'this' property
         if (isset($this->this)) {
             unset($this->this);
         }
         // Start capturing output into a buffer
         ob_start();
         // Include the requested template filename in the local scope
         // (this will execute the view logic).
         include $this->_template;
         // Done with the requested template; get the buffer and
         // clear it.
         $this->_output = ob_get_contents();
         ob_end_clean();
         return $this->_output;
     } else {
         throw new Exception(JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $file), 500);
     }
 }
Esempio n. 8
0
 /**
  * Get the path to a layout for a module
  *
  * @param   string  $module  The name of the module
  * @param   string  $layout  The name of the module layout. If alternative layout, in the form template:filename.
  *
  * @return  string  The path to the module layout
  *
  * @since   11.1
  */
 public static function getLayoutPath($module, $layout = 'default')
 {
     $template = JFactory::getApplication()->getTemplate();
     $defaultLayout = $layout;
     // Yjsg instance
     $yjsg = Yjsg::getInstance();
     if (strpos($layout, ':') !== false) {
         // Get the template and file name from the string
         $temp = explode(':', $layout);
         $template = $temp[0] == '_' ? $template : $temp[0];
         $layout = $temp[1];
         $defaultLayout = $temp[1] ? $temp[1] : 'default';
     }
     // Build the template and base path for the layout
     $tPath = JPATH_THEMES . '/' . $template . '/html/' . $module . '/' . $layout . '.php';
     //yjsg start
     if (JFactory::getApplication()->isSite()) {
         if ($yjsg->preplugin()) {
             $yjsgPath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . $module . YJDS . $layout . '.php';
         } else {
             $yjsgPath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . $module . YJDS . $layout . '.php';
         }
     }
     //yjsg end
     $bPath = JPATH_BASE . '/modules/' . $module . '/tmpl/' . $defaultLayout . '.php';
     $dPath = JPATH_BASE . '/modules/' . $module . '/tmpl/default.php';
     // If the template has a layout override use it
     if (file_exists($tPath)) {
         return $tPath;
     } elseif (isset($yjsgPath) && file_exists($yjsgPath)) {
         return $yjsgPath;
     } elseif (file_exists($bPath)) {
         return $bPath;
     } else {
         return $dPath;
     }
 }
Esempio n. 9
0
 /**
  * Return the pagination footer.
  *
  * @return  string   Pagination footer.
  *
  * @since   11.1
  */
 public function getListFooter()
 {
     $app = JFactory::getApplication();
     // Yjsg instance
     $yjsg = Yjsg::getInstance();
     $list = array();
     $list['prefix'] = $this->prefix;
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     $list['pageslinks'] = $this->getPagesLinks();
     $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';
     //yjsg start
     if (!file_exists($chromePath)) {
         if ($yjsg->preplugin()) {
             $chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';
         } else {
             $chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';
         }
     }
     //yjsg end
     if (file_exists($chromePath)) {
         include_once $chromePath;
         if (function_exists('pagination_list_footer')) {
             return pagination_list_footer($list);
         }
     }
     return $this->_list_footer($list);
 }
Esempio n. 10
0
 public function getInput()
 {
     // process element properties
     $items = $this->element['items'];
     $default = explode('|', $this->element['default']);
     $values = is_array($this->value) ? $this->value : explode('|', $this->value);
     $size = $this->element['size'];
     $css_class = $this->element['class'];
     $labels = explode('|', $this->element['labels']);
     if ($this->element['customchrome']) {
         $cChrome = is_array($this->element['customchrome']) ? $this->element['customchrome'] : explode('|', $this->element['customchrome']);
     }
     $unique_id = $this->element['name'];
     $turnof = $this->element['turnof'];
     $turnoflabel = $this->element['turnoflabel'];
     if ($turnof == 1) {
         $disableme = 'disabled="disabled';
         $disabletext = '<div class="disabled_text">' . $turnoflabel . '</div>';
     } else {
         $disableme = '';
         $disabletext = '';
     }
     $chk_name = str_replace($this->element['name'], $this->element['name'] . '_locked', $this->name) . '[]';
     // create input text elements
     $div = array();
     $new_div = array();
     $yjsg = Yjsg::getInstance();
     $app = JFactory::getApplication();
     $templateId = $app->input->get('id');
     $YjsgDbParams = json_decode($yjsg->getDbParams($templateId), true);
     for ($i = 0; $i < $items; $i++) {
         $div[$i] = array();
         $div[$i][] = '<label for="' . $labels[$i] . '">' . $labels[$i] . '</label>';
         $div[$i][] = '<input type="text" id="' . $labels[$i] . '" class="input-mini ' . $unique_id . '" name="' . $this->name . '[]" value="' . (isset($values[$i]) ? $values[$i] : $default[$i]) . '" size="' . $size . '" ' . $disableme . '/>';
         if (array_key_exists($i + $items, $values)) {
             $checked = $values[$i + $items] == 1 ? 'checked="checked"' : '';
         } else {
             $checked = '';
         }
         $chormeName = strtolower($labels[$i]) . '_custom_chrome';
         if ($this->element['customchrome']) {
             if (array_key_exists($chormeName, $YjsgDbParams)) {
                 $chromeDefault = $YjsgDbParams[$chormeName];
             } else {
                 $chromeDefault = $cChrome[$i];
             }
         }
         if ($this->element['customchrome']) {
             $chromeInput[] = '<input type="hidden" class="defChromes" name="jform[params][' . $chormeName . ']" id="' . strtolower($labels[$i]) . '_custom_chrome" data-default="' . $cChrome[$i] . '" value="' . $chromeDefault . '" />';
             $chromeModule[] = $chormeName;
             $chromeDataDef[] = $cChrome[$i];
         }
         $div[$i][] = '<div class="yjsgcheck check ' . $unique_id . '">';
         $div[$i][] = '<label>';
         $div[$i][] = '<input type="checkbox" name="' . $chk_name . '" class="YJSG_checkbox ' . $unique_id . ' hidden" ' . $checked . ' />';
         $div[$i][] = '<i class="fa fa-unlock"></i>';
         $div[$i][] = '</label>';
         $div[$i][] = '</div>';
     }
     foreach ($div as $div_row => $div_value) {
         $new_div[] = '<div class="yjsg_moduleh groupname">';
         if ($this->element['customchrome']) {
             $new_div[] = '<a href="#" class="openChrome" data-chromedefault="' . $chromeDataDef[$div_row] . '" data-chromemodule="#' . $chromeModule[$div_row] . '">';
             $new_div[] = '<i class="adminicons-chrome"></i>';
             $new_div[] = '</a>';
             $new_div[] = '<div class="chromesHolder"  data-toggle="popover" data-placement="bottom" data-original-title="' . JText::_('YJSG_MOD_CHROME') . '" data-content="' . JText::_('YJSG_MOD_CHROME_TIP') . '">';
             $new_div[] = '<a href="#" data-thischrome="YJsgxhtml" class="seldefault">' . JText::_('YJSG_DEFAULT') . ' <i class="fa fa-check-square-o"></i></a>';
             $new_div[] = '<a href="#" data-thischrome="YJsground">' . JText::_('YJSG_MOD_CHROME_ROUND_NAV') . ' <i class="fa fa-square-o"></i></a>';
             $new_div[] = '<a href="#" data-thischrome="YJsgblank">' . JText::_('YJSG_MOD_CHROME_BLANK_NAV') . ' <i class="fa fa-square-o"></i></a>';
             $new_div[] = '<a href="#" data-thischrome="YJsgtabs">' . JText::_('YJSG_MOD_CHROME_TABS') . ' <i class="fa fa-square-o"></i></a>';
             $new_div[] = '<a href="#" data-thischrome="YJsgaccordion">' . JText::_('YJSG_MOD_CHROME_ACCORDION') . ' <i class="fa fa-square-o"></i></a>';
             $new_div[] = '<a href="#" data-thischrome="YJsgslides">' . JText::_('YJSG_MOD_CHROME_SLIDES') . ' <i class="fa fa-square-o"></i></a>';
             $new_div[] = $chromeInput[$div_row];
             $new_div[] = '</div>';
         }
         $new_div[] = '<div class="yjsg_module">';
         $new_div[] = implode("\n", $div_value);
         $new_div[] = '</div>';
         $new_div[] = '</div>';
     }
     $yjsglayoutarray = json_decode(YJSGLAYOUT);
     $setdivid = $unique_id;
     $divClass = ' class="yjsg_grid yjsg_grid_widths yjsgorder"';
     $dataPosition = '';
     if (strstr($this->element['name'], 'newgrid')) {
         $newGridCase = $this->element['name'];
         $newGridName = str_replace(array('yjsg_', '_width'), array('', ''), $this->element['name']);
     } else {
         $newGridName = 'fakeGrid';
         $newGridCase = 'fakeGrid';
     }
     $findZero = explode('|', $this->element['default']);
     $hasZero = false;
     if (in_array('0', $findZero)) {
         $hasZero = true;
     }
     switch ($unique_id) {
         case 'yjsg_1_width':
             $dataPosition = ' data-position="' . array_search('yjsg1', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_header_width':
             $dataPosition = '';
             $setdivid = 'yjsg_headergrid';
             $divClass = ' class="yjsg_grid_widths"';
             break;
         case 'yjsg_bodytop_width':
             $dataPosition = '';
             $setdivid = 'yjsg_bodytop';
             $divClass = ' class="yjsg_grid_widths jmainbodygrid"';
             break;
         case 'yjsg_yjsgbodytbottom_width':
             $dataPosition = '';
             $setdivid = 'yjsg_bodybottom';
             $divClass = ' class="yjsg_grid_widths jmainbodygrid"';
             break;
         case 'yjsg_2_width':
             $dataPosition = ' data-position="' . array_search('yjsg2', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_3_width':
             $dataPosition = ' data-position="' . array_search('yjsg3', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_4_width':
             $dataPosition = ' data-position="' . array_search('yjsg4', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_5_width':
             $dataPosition = ' data-position="' . array_search('yjsg5', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_6_width':
             $dataPosition = ' data-position="' . array_search('yjsg6', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case 'yjsg_7_width':
             $dataPosition = ' data-position="' . array_search('yjsg7', $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('yjsg', ''), $setdivid);
             break;
         case $newGridCase:
             $dataPosition = ' data-position="' . array_search($newGridName, $yjsglayoutarray) . '"';
             $setdivid = str_replace(array('yjsg_', '_width'), array('', ''), $setdivid);
             break;
     }
     $output = '<div id="' . $setdivid . '"' . $dataPosition . $divClass . '>';
     //		$output.='<a href="javascript:;" class="opensettings" data-settings=".'.$setdivid.'_settings"><i class="fa fa-cog"></i></a>';
     //		$output.='<div class="'.$setdivid.'_settings settingpannel">';
     //		$output .='<ul class="adminformlist gridSetting">';
     //		$output .='</ul>';
     //		$output.='</div>';
     $output .= implode("\n", $new_div);
     $output .= '';
     $output .= '';
     $output .= '';
     $output .= '<a class="YJSG_reset-values btn btn-xs btn-primary" data-elementcss="' . $unique_id . '" href="javascript:;" data-resets="' . $this->element['default'] . '">' . Jtext::_('YJSG_RESET') . '</a>';
     $output .= '</div>';
     return $output;
 }