예제 #1
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->_formId = $params->get('form_id');
     if ($this->_formId && JSNUniformHelper::checkStateForm($this->_formId)) {
         $this->_state = $this->get('State');
         $this->_items = $this->get('Items');
         $this->_pagination = $this->get('Pagination');
         $this->_fieldsForm = $this->get('FieldsForm');
         $this->_fieldView = $params->get('form_field');
         if (!empty($this->_fieldView)) {
             $this->_fieldView = json_decode($this->_fieldView);
         }
         $this->_viewField = $this->getViewField();
         //var_dump($this->_viewField);
         // Display the view
         parent::display($tpl);
         $this->addAssets();
     }
 }
예제 #2
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     // Get input object
     $input = JFactory::getApplication()->input;
     $this->isPrint = $input->getString('print', 'false');
     $this->_form = $this->get('Form');
     $this->_item = $this->get('Item');
     $this->_infoForm = $this->get('InfoForm');
     $dataContentForm = $this->get('FormPages');
     $this->nextAndPreviousForm = $this->get('NextAndPreviousForm');
     $this->_formPages = $dataContentForm;
     $this->_document = JFactory::getDocument();
     $this->_document->addScriptDeclaration("var dataId = {$this->_item->submission_id}");
     $this->_dataSubmission = $this->get('DataSubmission');
     $this->_dataFields = $this->get('DataFields');
     $config = JSNConfigHelper::get();
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('SUBMISSION');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Hide main menu
     $input->set('hidemainmenu', true);
     // Initialize toolbar
     $this->initToolbar();
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the template
     parent::display($tpl);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
예제 #3
0
 function display($tmp = null)
 {
     // Load assets
     JSNUniformHelper::addAssets();
     $lang = JFactory::getLanguage();
     $input = JFactory::getApplication()->input;
     $extensionId = $input->getInt('extension_id', 0);
     $model = $this->getModel();
     $extension = $model->getExtensionInfo($extensionId);
     if (!count($extension)) {
         $html = '<br/> <div class="alert alert-danger">' . JText::_('JSN_UNIFORM_EXTENSION_NOT_FOUND') . '</div>';
         echo $html;
         return;
     }
     $this->extension_name = (string) $extension->element;
     if (JPluginHelper::isEnabled('uniform', (string) $this->extension_name) !== true) {
         $html = '<br/> <div class="alert alert-danger">' . JText::sprintf('JSN_UNIFORM_PLUGIN_IS_NOT_EXISTED_OR_ENABLED', strtoupper(str_replace('_', ' ', (string) $this->extension_name))) . '</div>';
         echo $html;
         return;
     }
     parent::display($tmp);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
예제 #4
0
 /**
  * Display method.
  *
  * @param   string  $tpl  The name of the template file to parse.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Get product info
     $info = JSNUtilsXml::loadManifestCache();
     // Pass data to view
     $this->assignRef('product', $info);
     // Display the template
     parent::display($tpl);
 }
예제 #5
0
 /**
  * Execute and display a template script.
  *
  * @param   string $tpl The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise an Exception object.
  */
 function display($tpl = null)
 {
     // Get config parameters
     $config = JSNConfigHelper::get();
     $objJSNEasySliderSliders = new JSNEasySliderSliders();
     $totalSliders = $objJSNEasySliderSliders->countSilderItems();
     $layout = $this->getLayout();
     $this->totalSliders = $totalSliders;
     /*Check if it is FREE edition then show warning message to alert that FREE edition only allows create maximum of 3 sliders*/
     $this->edition = defined('JSN_EASYSLIDER_EDITION') ? JSN_EASYSLIDER_EDITION : "free";
     if (strtolower($this->edition) == 'free') {
         if ($totalSliders !== false && $totalSliders >= 3) {
             if ($layout == 'default') {
                 JFactory::getApplication()->enqueueMessage(JText::_('JSN_EASYSLIDER_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_SLIDERS_IN_FREE_EDITION'), 'warning');
             }
         }
     }
     // Set the toolbar
     JToolbarHelper::title(JText::_('JSN_EASYSLIDER_SLIDERS'));
     // Add toolbar menu
     JToolbarHelper::addNew('slider.add', 'JSN_EASYSLIDER_CREATE_NEW');
     JToolbarHelper::editList('slider.edit', 'JTOOLBAR_EDIT');
     JToolbarHelper::custom('sliders.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
     JToolbarHelper::divider();
     JToolbarHelper::publish('sliders.publish');
     JToolbarHelper::unpublish('sliders.unpublish');
     JToolbarHelper::divider();
     JToolbarHelper::deleteList('JSN_EASYSLIDER_CONFIRM_DELETE', 'sliders.delete', 'JTOOLBAR_DELETE');
     //        JToolbarHelper::preferences();
     //        JToolbarHelper::help();
     JToolbarHelper::custom('', ' jsnes-import fa fa-download', ' jsnes-import fa fa-download', 'JSN_EASYSLIDER_IMPORT');
     JToolbarHelper::custom('', ' jsnes-export fa fa-upload', ' jsnes-export fa fa-upload', 'JSN_EASYSLIDER_EXPORT');
     JToolbarHelper::divider();
     JSNEasySliderHelper::addToolbarMenu();
     // Set the submenu
     //        JSNEasySliderHelper::addSubmenu('sliders');
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('SLIDERS');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     $this->sliders = $objJSNEasySliderSliders->getSlidersWithoutState();
     // Assign variables for rendering
     $this->msgs = $msgs;
     $this->objJSNEasySliderSliders = $objJSNEasySliderSliders;
     // Add assets
     JSNEasySliderHelper::addAssets();
     $this->_addAssets();
     // Display the template
     parent::display($tpl);
 }
예제 #6
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Get config
     $config = JSNConfigHelper::get();
     // Display the view
     parent::display($tpl);
     // Load assets
     JSNMobilizeHelper::loadAssets();
     //		$this->addAssets();
 }
예제 #7
0
 /**
  * Display method.
  *
  * @param   string  $tpl  The name of the template file to parse.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     // Is product upgradable?
     if (!($edition = JSNUtilsText::getConstant('EDITION')) or strcasecmp($edition, 'pro unlimited') == 0) {
         $app->redirect('index.php?option=' . $app->input->getCmd('option') . '&view=update');
     }
     // Get product info
     $info = JSNUtilsXml::loadManifestCache();
     // Pass data to view
     $this->assignRef('product', $info);
     // Display the template
     parent::display($tpl);
 }
예제 #8
0
 /**
  * Display method.
  *
  * @param   string  $tpl  The name of the template file to parse.
  *
  * @return	void
  */
 public function display($tpl = null)
 {
     // Get config declaration
     $configDeclaration = $this->get('Form');
     // Pass data to view
     $this->assignRef('config', $configDeclaration);
     // Load assets
     JSNBaseHelper::loadAssets();
     JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-tipsy/tipsy.css');
     JSNHtmlAsset::loadScript('jsn/core', array('lang' => JSNUtilsLanguage::getTranslated(array('JSN_EXTFW_GENERAL_LOADING', 'JSN_EXTFW_GENERAL_CLOSE'))));
     JSNHtmlAsset::loadScript('jsn/config');
     // Display the template
     parent::display($tpl);
 }
예제 #9
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     // Initialize variables
     $this->_document = JFactory::getDocument();
     $this->_form = $this->get('Form');
     $this->_item = $this->get('Item');
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->_addAssets();
 }
예제 #10
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     // Assign data to the view
     $this->_input = JFactory::getApplication()->input;
     $formId = $this->_input->get('form_id');
     $this->_state = $this->get('State');
     $this->_formId = $formId ? $formId : $this->_state->get('form.id');
     $this->_formName = md5(date("Y-m-d H:i:s") . $this->_formId);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     // Display the view
     parent::display($tpl);
 }
예제 #11
0
 public function display($tpl = null)
 {
     $JSNMedia = JSNFactory::getMedia();
     $JSNMedia->addStyleSheet(JSN_POWERADMIN_STYLE_URI . 'styles.css');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.mousecheck.js");
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.submenu.js");
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.manage-styles.js");
     $JSNMedia->addStyleDeclaration("\n\t\t.template-item {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-24/icon-24-loading-circle.gif) no-repeat center center;\n\t\t}\n\t\t.loading {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-16/icon-16-loading-circle.gif) no-repeat center right;\n\t\t}\n\t\t");
     $JSNMedia->addScriptDeclaration("\n            (function (\$){\n               \$(document).ready(function (){\n                    \$('#client-switch').change(function (e) {\n                        var val =\$(this).attr('value');\n                        if(val == 0){\n                            \$('.template-list').hide();\n                            \$('#site').show();\n                        }else{\n                            \$('.template-list').hide();\n                            \$('#admin').show();\n                        }\n                    })\n\t           });\n            })(JoomlaShine.jQuery);\n        ");
     // Add javascript lang translation
     $jsnLang = new JSNJavascriptLanguages();
     $jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_DELETE');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_UNINSTALL');
     $jsnLang->addLang('JSN_POWERADMIN_TM_ALREADY_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_DELETE_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_UNINSTALL_DEFAULT');
     $jsnLang->addLang('JSN_POWERADMIN_TM_DELETE_STYLE_CONFIRM');
     $jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE_CONFIRM');
     $JSNMedia->addScriptDeclaration($jsnLang->loadLang());
     $model = $this->getModel('templates');
     $rows = $model->getTemplates();
     $adminRows = $model->getTemplates(1);
     // Check permission for removing styles.
     JSNFactory::import('components.com_templates.helpers.templates');
     $canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_templates') : TemplatesHelper::getActions();
     $canDelete = $canDo->get('core.delete');
     $canDelete = '<input type="hidden" id="candelete" value="' . $canDelete . '"></input>';
     echo $canDelete;
     // Check permission for uninstalling template.
     JSNFactory::import('components.com_installer.helpers.installer');
     $canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_installer') : TemplatesHelper::getActions();
     $canUninstall = $canDo->get('core.delete');
     $canUninstall = '<input type="hidden" id="canuninstall" value="' . $canUninstall . '"></input>';
     echo $canUninstall;
     //assign to view
     $this->assign('templates', $rows);
     $this->assign('adminTemplates', $adminRows);
     $this->assign('canDelete', $canDelete);
     return parent::display();
 }
예제 #12
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     $this->_item = $this->get('Item');
     if (JSNUniformHelper::checkStateForm($this->_item->form_id)) {
         $menu = JFactory::getApplication()->getMenu();
         $this->_input = JFactory::getApplication()->input;
         $menuItem = $menu->getItem((int) $this->_input->get("Itemid"));
         $this->_params = json_decode($menuItem->params);
         $this->_infoForm = $this->get('InfoForm');
         $dataContentForm = $this->get('FormPages');
         $this->nextAndPreviousForm = $this->get('NextAndPreviousForm');
         $this->_formPages = $dataContentForm;
         $this->_dataSubmission = $this->get('DataSubmission');
         $this->_dataFields = $this->get('DataFields');
         // Display the template
         parent::display($tpl);
         $this->addAssets();
     }
 }
예제 #13
0
 /**
  * Display method
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return void
  */
 public function display($tpl = null)
 {
     // Set toolbar title
     JToolBarHelper::title(JText::_('JSN_UNIFORM_HELP_HELP_AND_SUPPORT'));
     // Get config
     $config = JSNConfigHelper::get();
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('HELP');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Load assets
     JSNUniformHelper::addAssets();
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the template
     parent::display($tpl);
 }
예제 #14
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     $this->_document = JFactory::getDocument();
     $this->_state = $this->get('State');
     $this->_formId = 0;
     if ($this->_state->get('filter.filter_form_id') != 0) {
         $this->_items = $this->get('Items');
         $this->_pagination = $this->get('Pagination');
         $this->_viewField = $this->getViewField();
         $this->_formId = $this->_state->get('filter.filter_form_id');
         $edition = defined('JSN_UNIFORM_EDITION') ? strtolower(JSN_UNIFORM_EDITION) : "free";
         if ($edition == "free") {
             $this->_countSubmission = $this->get('CountSubmission');
             $countSubmission = 300 - $this->_countSubmission > 0 ? 300 - $this->_countSubmission : 0;
             $msg = JText::sprintf('JSN_UNIFORM_YOU_CAN_ONLY_ACCEPT_UP_TO_300_SUBMISSION', (int) $countSubmission) . ' <a class="jsn-link-action" href="index.php?option=com_uniform&view=upgrade">' . JText::_("JSN_UNIFORM_UPGRADE_EDITION") . '</a>';
             if ($this->_countSubmission <= 300) {
                 JFactory::getApplication()->enqueueMessage($msg);
             } else {
                 JError::raiseNotice(100, $msg);
             }
         }
     }
     $config = JSNConfigHelper::get();
     // Load the submenu.
     $input = JFactory::getApplication()->input;
     JSNUniformHelper::addSubmenu($input->get('view', 'submissions'));
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('SUBMISSIONS');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Initialize toolbar
     $this->initToolbar();
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     parent::display($tpl);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
예제 #15
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     // Get config
     $config = JSNConfigHelper::get();
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('PROFIELS');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Initialize toolbar
     $this->initToolbar();
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Set sub-menu
     JSNMobilizeHelper::addSubmenu('profiles');
     // Display the view
     parent::display($tpl);
     // Load assets
     JSNMobilizeHelper::loadAssets();
     $this->addAssets();
 }
예제 #16
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  */
 function display($tpl = null)
 {
     // Get config parameters
     $config = JSNConfigHelper::get();
     // Initialize toolbar
     JSNUniformHelper::initToolbar('JSN_UNIFORM_ABOUT', 'uniform-about', false);
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('ABOUT');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Load assets
     JSNUniformHelper::addAssets();
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Load the submenu.
     $input = JFactory::getApplication()->input;
     JSNUniformHelper::addSubmenu($input->get('view', 'about'));
     // Display the template
     parent::display($tpl);
 }
예제 #17
0
 /**
  * Display method
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return	void
  */
 function display($tpl = null)
 {
     // Get config parameters
     $config = JSNConfigHelper::get();
     // Set the toolbar
     JToolbarHelper::title(JText::_('JSN_EASYSLIDER_ABOUT_TITLE'));
     // Add toolbar menu
     JSNEasySliderHelper::addToolbarMenu();
     // Set the submenu
     JSNEasySliderHelper::addSubmenu('about');
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('ABOUT');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Add assets
     JSNEasySliderHelper::addAssets();
     // Display the template
     parent::display($tpl);
 }
예제 #18
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 function display($tpl = null)
 {
     // Get config
     $config = JSNConfigHelper::get();
     // Get messages
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('FORMS');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Initialize toolbar
     $this->initToolbar();
     // Load the submenu.
     $input = JFactory::getApplication()->input;
     JSNUniformHelper::addSubmenu($input->get('view', 'forms'));
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the view
     parent::display($tpl);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
예제 #19
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     // Initialize variables
     $input = JFactory::getApplication()->input;
     $this->_document = JFactory::getDocument();
     $this->_item = $this->get('Item');
     $this->_style = new stdClass();
     $this->_styleContainer = "";
     $this->_styleModule = "";
     $this->_styleContentTitle = "";
     $this->_styleContentBody = "";
     $this->_form = $this->get('Form');
     $this->_menuType = $this->get("MenuType");
     $dataDesign = $this->get("DataDesign");
     $this->_styleIcon = "";
     $this->_os = $this->get("DataOS");
     $osSupport = $this->get("DataOSSupport");
     $this->_osSupport = array();
     if (!empty($osSupport)) {
         foreach ($osSupport as $os) {
             $this->_osSupport[] = $os->os_id;
         }
     }
     $this->_dataDesign = array();
     if (!empty($dataDesign)) {
         foreach ($dataDesign as $item) {
             $value = json_decode($item->value);
             if (!empty($value)) {
                 $this->_dataDesign[$item->name] = $value;
             } else {
                 $this->_dataDesign[$item->name] = $item->value;
             }
         }
     }
     $this->_style = !empty($this->_dataDesign['mobilize-style']) ? $this->_dataDesign['mobilize-style'] : "";
     if (empty($this->_style->jsn_menu)) {
         @($this->_style->jsn_menu = '[{"key":"jsn_menu_container_bo_borderThickness","value":""},{"key":"jsn_menu_container_bo_borderStyle","value":"hidden"},{"key":"jsn_menu_container_bo_borderColor","value":""},{"key":"jsn_menu_container_ba_backgroundType","value":"Solid"},{"key":"jsn_menu_container_ba_soildColor","value":"#282828"},{"key":"jsn_menu_container_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_menu_container_ba_activeColor","value":"#404040"},{"key":"jsn_menu_container_ic_iconColor","value":"#ffffff"},{"key":"jsn_menu_sublevel1_bo_borderThickness","value":""},{"key":"jsn_menu_sublevel1_bo_borderStyle","value":"hidden"},{"key":"jsn_menu_sublevel1_bo_borderColor","value":""},{"key":"jsn_menu_sublevel1_ba_normalColor","value":"#333333"},{"key":"jsn_menu_sublevel1_ba_activeColor","value":""},{"key":"jsn_menu_sublevel1_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_menu_sublevel1_fo_fontFace","value":"Verdana"},{"key":"jsn_menu_sublevel1_fo_fontSize","value":""},{"key":"jsn_menu_sublevel1_fo_fontStyle","value":"inherit"},{"key":"jsn_menu_sublevel1_fo_fontColor","value":""},{"key":"jsn_menu_sublevel2_ba_normalColor","value":""},{"key":"jsn_menu_sublevel2_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_menu_sublevel2_fo_fontFace","value":"Verdana"},{"key":"jsn_menu_sublevel2_fo_fontSize","value":""},{"key":"jsn_menu_sublevel2_fo_fontStyle","value":"inherit"},{"key":"jsn_menu_sublevel2_fo_fontColor","value":""}]');
     }
     if (empty($this->_style->jsn_content_top)) {
         @($this->_style->jsn_content_top = '[{"key":"jsn_content_top_container_bo_borderThickness","value":""},{"key":"jsn_content_top_container_bo_borderStyle","value":"hidden"},{"key":"jsn_content_top_container_bo_borderColor","value":""},{"key":"jsn_content_top_container_ba_backgroundType","value":"Solid"},{"key":"jsn_content_top_container_ba_soildColor","value":"#404040"},{"key":"jsn_content_top_container_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_content_top_container_sp_padding","value":""},{"key":"jsn_content_top_module_tabContainer_bo_borderThickness","value":""},{"key":"jsn_content_top_module_tabContainer_bo_borderStyle","value":"hidden"},{"key":"jsn_content_top_module_tabContainer_bo_borderColor","value":""},{"key":"jsn_content_top_module_tabContainer_ba_backgroundType","value":"Solid"},{"key":"jsn_content_top_module_tabContainer_ba_soildColor","value":""},{"key":"jsn_content_top_module_tabContainer_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_content_top_module_tabContainer_bo_roundedCornerRadius","value":""},{"key":"jsn_content_top_module_tabContainer_sh_shadowSpread","value":""},{"key":"jsn_content_top_module_tabContainer_sh_shadowColor","value":""},{"key":"jsn_content_top_module_tabContainer_sp_margin","value":""},{"key":"jsn_content_top_module_tabContainer_sp_padding","value":""},{"key":"jsn_content_top_module_tabContent_title_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_content_top_module_tabContent_title_fo_fontFace","value":"Verdana"},{"key":"jsn_content_top_module_tabContent_title_fo_fontSize","value":""},{"key":"jsn_content_top_module_tabContent_title_fo_fontStyle","value":"inherit"},{"key":"jsn_content_top_module_tabContent_title_fo_fontColor","value":""},{"key":"jsn_content_top_module_tabContent_body_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_content_top_m_ct_fo_fontFace","value":"Verdana"},{"key":"jsn_content_top_module_tabContent_body_fo_fontSize","value":""},{"key":"jsn_content_top_module_tabContent_body_fo_fontStyle","value":"inherit"},{"key":"jsn_content_top_module_tabContent_body_fo_fontColor","value":""},{"key":"jsn_content_top_module_tabContent_link_linkColor","value":""}]');
     }
     if (empty($this->_style->jsn_mainbody)) {
         @($this->_style->jsn_mainbody = '[{"key":"jsn_mainbody_container_sp_paddingleft","value":"20"},{"key":"jsn_mainbody_container_sp_paddingright","value":"20"},{"key":"jsn_mainbody_container_sp_paddingtop","value":"10"},{"key":"jsn_mainbody_container_sp_paddingbottom","value":"10"}]');
     }
     if (empty($this->_style->jsn_user_bottom)) {
         @($this->_style->jsn_user_bottom = '[{"key":"jsn_user_bottom_container_bo_borderThickness","value":""},{"key":"jsn_user_bottom_container_bo_borderStyle","value":"hidden"},{"key":"jsn_user_bottom_container_bo_borderColor","value":""},{"key":"jsn_user_bottom_container_ba_backgroundType","value":"Solid"},{"key":"jsn_user_bottom_container_ba_soildColor","value":"#d9d9d9"},{"key":"jsn_user_bottom_container_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_user_bottom_container_sp_padding","value":""},{"key":"jsn_user_bottom_module_tabContainer_bo_borderThickness","value":""},{"key":"jsn_user_bottom_module_tabContainer_bo_borderStyle","value":"hidden"},{"key":"jsn_user_bottom_module_tabContainer_bo_borderColor","value":""},{"key":"jsn_user_bottom_module_tabContainer_ba_backgroundType","value":"Solid"},{"key":"jsn_user_bottom_module_tabContainer_ba_soildColor","value":""},{"key":"jsn_user_bottom_module_tabContainer_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_user_bottom_module_tabContainer_bo_roundedCornerRadius","value":""},{"key":"jsn_user_bottom_module_tabContainer_sh_shadowSpread","value":""},{"key":"jsn_user_bottom_module_tabContainer_sh_shadowColor","value":""},{"key":"jsn_user_bottom_module_tabContainer_sp_margin","value":""},{"key":"jsn_user_bottom_module_tabContainer_sp_padding","value":""},{"key":"jsn_user_bottom_module_tabContent_title_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_user_bottom_module_tabContent_title_fo_fontFace","value":"Verdana"},{"key":"jsn_user_bottom_module_tabContent_title_fo_fontSize","value":""},{"key":"jsn_user_bottom_module_tabContent_title_fo_fontStyle","value":"inherit"},{"key":"jsn_user_bottom_module_tabContent_title_fo_fontColor","value":""},{"key":"jsn_user_bottom_module_tabContent_body_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_user_bottom_m_ct_fo_fontFace","value":"Verdana"},{"key":"jsn_user_bottom_module_tabContent_body_fo_fontSize","value":""},{"key":"jsn_user_bottom_module_tabContent_body_fo_fontStyle","value":"inherit"},{"key":"jsn_user_bottom_module_tabContent_body_fo_fontColor","value":""},{"key":"jsn_user_bottom_module_tabContent_link_linkColor","value":""}]');
     }
     if (empty($this->_style->jsn_content_bottom)) {
         @($this->_style->jsn_content_bottom = '[{"key":"jsn_content_bottom_container_bo_borderThickness","value":""},{"key":"jsn_content_bottom_container_bo_borderStyle","value":"hidden"},{"key":"jsn_content_bottom_container_bo_borderColor","value":""},{"key":"jsn_content_bottom_container_ba_backgroundType","value":"Solid"},{"key":"jsn_content_bottom_container_ba_soildColor","value":"#d9d9d9"},{"key":"jsn_content_bottom_container_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_content_bottom_container_sp_padding","value":""},{"key":"jsn_content_bottom_module_tabContainer_bo_borderThickness","value":""},{"key":"jsn_content_bottom_module_tabContainer_bo_borderStyle","value":"hidden"},{"key":"jsn_content_bottom_module_tabContainer_bo_borderColor","value":""},{"key":"jsn_content_bottom_module_tabContainer_ba_backgroundType","value":"Solid"},{"key":"jsn_content_bottom_module_tabContainer_ba_soildColor","value":""},{"key":"jsn_content_bottom_module_tabContainer_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_content_bottom_module_tabContainer_bo_roundedCornerRadius","value":""},{"key":"jsn_content_bottom_module_tabContainer_sh_shadowSpread","value":""},{"key":"jsn_content_bottom_module_tabContainer_sh_shadowColor","value":""},{"key":"jsn_content_bottom_module_tabContainer_sp_margin","value":""},{"key":"jsn_content_bottom_module_tabContainer_sp_padding","value":""},{"key":"jsn_content_bottom_module_tabContent_title_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_content_bottom_module_tabContent_title_fo_fontFace","value":"Verdana"},{"key":"jsn_content_bottom_module_tabContent_title_fo_fontSize","value":""},{"key":"jsn_content_bottom_module_tabContent_title_fo_fontStyle","value":"inherit"},{"key":"jsn_content_bottom_module_tabContent_title_fo_fontColor","value":""},{"key":"jsn_content_bottom_module_tabContent_body_fo_fontFaceType","value":"standard fonts"},{"value":""},{"value":""},{"key":"jsn_content_bottom_m_ct_fo_fontFace","value":"Verdana"},{"key":"jsn_content_bottom_module_tabContent_body_fo_fontSize","value":""},{"key":"jsn_content_bottom_module_tabContent_body_fo_fontStyle","value":"inherit"},{"key":"jsn_content_bottom_module_tabContent_body_fo_fontColor","value":""},{"key":"jsn_content_bottom_module_tabContent_link_linkColor","value":""}]');
     }
     if (empty($this->_style->jsn_logo)) {
         @($this->_style->jsn_logo = '[{"key":"jsn_logo_container_bo_borderThickness","value":""},{"key":"jsn_logo_container_bo_borderStyle","value":"solid"},{"key":"jsn_logo_container_bo_borderColor","value":""},{"key":"jsn_logo_container_ba_backgroundType","value":"Solid"},{"key":"jsn_logo_container_ba_soildColor","value":""},{"key":"jsn_logo_container_ba_gradientColor","value":"-moz-linear-gradient(-90deg, #ffffff 0%, #ffffff 100%)"},{"key":"jsn_logo_container_sp_paddingleft","value":""},{"key":"jsn_logo_container_sp_paddingright","value":""},{"key":"jsn_logo_container_sp_paddingbottom","value":""},{"key":"jsn_logo_container_sp_paddingtop","value":""},{"key":"jsn_logo_content_alignment","value":"center"}]');
     }
     $this->_JSNMobilize = new JSNMobilize($this->_dataDesign);
     $this->_Modules = $this->_JSNMobilize->getModules();
     $this->_defaultTempateSite = $this->_JSNMobilize->getTemplateDefault();
     // Hide the main menu
     $input->set('hidemainmenu', true);
     // Initialize toolbar
     $this->initToolbar();
     // Get config
     $config = JSNConfigHelper::get();
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('PROFILE');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the template
     parent::display($tpl);
     JSNMobilizeHelper::loadAssets();
     $this->addAssets();
 }
예제 #20
0
    public function display($tpl = null)
    {
        JSNHtmlAsset::addScript(JSNPB_ADMIN_URL . '/assets/js/shortcodesetting/settings-handler.js');
        $js = '
			var JSNPbParams	= {pbstrings : {}};
			JSNPbParams.rootUrl = \'' . JUri::root() . '\';
			JSNPbParams.pbstrings.NO_ITEM_FOUND = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_NO_ITEM_FOUND') . '\';
			JSNPbParams.pbstrings.SINGLE_ENTRY = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_SINGLE_ENTRY') . '\';
			JSNPbParams.pbstrings.SETTINGS = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_SETTINGS') . '\';
			JSNPbParams.pbstrings.INVALID_LINK = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_THE_LINK_IS_INVALID') . '\';
			JSNPbParams.pbstrings.COPY = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_COPY') . '\';
			JSNPbParams.pbstrings.EMPTY = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_EMPTY') . '\';
			JSNPbParams.pbstrings.SELECT_DES_MARKER = \'' . JText::_('JSN_PAGEBUILDER_CONTROLLERS_SHORTCODE_SELECT_DES_MARKER') . '\';
		';
        JSNHtmlAsset::addInlineScript($js);
        $shortcode = JRequest::getString('shortcode');
        $params = '';
        // Get params from session then clear the session
        if (isset($_SESSION[JSNPB_SHORTCODE_SESSION_NAME][$shortcode]['params'])) {
            $params = $_SESSION[JSNPB_SHORTCODE_SESSION_NAME][$shortcode]['params'];
            $params = json_decode($params);
            $_SESSION[JSNPB_SHORTCODE_SESSION_NAME][$shortcode]['params'] = '';
        }
        // TODO: move under assets inside shortcode
        // Add common js library for elements.
        JSNHtmlAsset::addScript(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/jquery.tipsy.js');
        JSNHtmlAsset::addStyle(JSNPB_FRAMEWORK_ASSETS . '/3rd-party/jquery-tipsy/tipsy.css');
        JSNHtmlAsset::addStyle(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-general.css');
        // for accordion_item, buttonbar_item,
        JSNHtmlAsset::addStyle(JSNPB_FRAMEWORK_ASSETS . '/joomlashine/css/jsn-fonticomoon.css');
        // for accordion_item, buttonbar_item,
        $extract_params = '';
        $shortcodeHelper = new JSNPagebuilderHelpersShortcode();
        $data = array();
        if (!empty($shortcode)) {
            // elements
            $class = $shortcodeHelper->getShortcodeClass($shortcode);
            if (class_exists($class)) {
                // Get all regitered element shortcodes
                global $JSNPbElements;
                $elements = $JSNPbElements->getElements();
                $instance = isset($elements[strtolower($class)]) ? $elements[strtolower($class)] : null;
                // Init and register new instance if it not
                if (!is_object($instance)) {
                    $instance = new $class();
                }
                if (!empty($params)) {
                    $params = stripslashes($params);
                    $params = urldecode($params);
                } else {
                    $params = $instance->config['shortcode_structure'];
                }
                // Add neccessary assets for the shortcode
                $instance->backend_element_assets();
                // process require_js at backend setting
                if (isset($instance->config['exception']['require_js'])) {
                    $requires = $instance->config['exception']['require_js'];
                    foreach ($requires as $i => $require) {
                        if (file_exists(JSNPB_ASSETS_PATH . $require)) {
                            JSNHtmlAsset::addScript(JSNPB_ASSETS_PATH . $require);
                        }
                    }
                }
                if (!empty($params)) {
                    $extract_params = JSNPagebuilderHelpersShortcode::extractParams($params, $shortcode);
                    // if have sub-shortcode, get content
                    if (!empty($instance->config['has_subshortcode'])) {
                        $sub_sc_data = JSNPagebuilderHelpersShortcode::extractSubShortcode($params, true);
                        $extract_params['sub_sc_content'] = $sub_sc_data;
                    }
                    // MODIFY $instance->items
                    $shortcodeHelper->generateShortcodeParams($instance->items, NULL, $extract_params, TRUE);
                    // recall this to re-extract params
                    $instance->shortcode_data();
                }
                // get Modal setting box
                $settings = $instance->items;
                $shortcodeAterfix = substr($shortcode, -5);
                $showPreview = true;
                if ($shortcodeAterfix == '_item') {
                    $showPreview = false;
                }
                if ($shortcode == 'pb_row') {
                    $showPreview = false;
                }
                $modalContent = $shortcodeHelper->getShortcodeModalSettings($settings, $shortcode, $extract_params);
                $this->assign('content', $modalContent);
                $this->assign('params', $params);
                $this->assign('shortcodeName', $shortcode);
                $this->assign('showPreview', $showPreview);
            }
        }
        return parent::display();
    }
예제 #21
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $template = JSNTemplateHelper::getInstance();
     $onPositionClick = '';
     $initFilter = '';
     $displayNotice = $app->input->getInt('notice');
     $bypassNotif = $app->input->getVar('bypassNotif', '');
     // Get template author.
     $templateAuthor = $template->getAuthor();
     JSNPositionsHelper::dispatchTemplateFramework($templateAuthor);
     $document->addStyleSheet(JSN_URL_ASSETS . '/joomlashine/css/jsn-positions.css');
     if (JSNVersion::isJoomlaCompatible('3.0')) {
         $document->addScript(JURI::root(true) . '/media/jui/js/jquery.js');
     } else {
         $document->addScript(JSN_URL_ASSETS . '/3rd-party/jquery/jquery-1.8.2.js');
     }
     if (isset($this->filterEnabled) and $this->filterEnabled) {
         $document->addScript(JSN_URL_ASSETS . '/joomlashine/js/positions.filter.js');
         $initFilter = 'changeposition = new JoomlaShine.jQuery.visualmodeFilter({});';
     }
     if (isset($this->customScripts)) {
         $document->addScriptDeclaration(implode('\\n', $this->customScripts));
     }
     $onPositionClick = isset($this->onPositionClickCallBack) ? implode('\\n', $this->onPositionClickCallBack) : '';
     // Get JSN Template Framework version
     $db = JFactory::getDbo();
     $q = $db->getQuery(true);
     $q->select('manifest_cache');
     $q->from('#__extensions');
     $q->where("element = 'jsntplframework'");
     $q->where("type = 'plugin'", 'AND');
     $q->where("folder = 'system'", 'AND');
     $db->setQuery($q);
     // Load dependency installation status.
     $res = $db->loadObject();
     $res = json_decode($res->manifest_cache);
     $jsnTplFwVersion = $res->version;
     $jsnTemplateCustomJs = '';
     if (version_compare($jsnTplFwVersion, '2.0.1', '<=')) {
         $jsnTemplateCustomJs = "\$('body').addClass('jsn-bootstrap');";
     }
     $_customScript = "\n\t\t\tvar changeposition;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\tvar posOutline\t= \$('.jsn-position');\n\t\t\t\t\tvar _idAlter\t= false;\n\t\t\t\t\tif (\$('.jsn-position').length == 0) {\n\t\t\t\t\t\tposOutline\t= \$('.mod-preview');\n\t\t\t\t\t\t_idAlter\t= true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tposOutline.css({'z-index':'9999', 'position':'relative'});\n\t\t\t\t\t}\n\t\t\t\t\tposOutline.each(function(){\n\t\t\t\t\t\tif(_idAlter){\n\t\t\t\t\t\t\tpreviewInfo = \$(this).children('.mod-preview-info').text();\n\n\t\t\t\t\t\t\t_splitted = previewInfo.split('[');\n\t\t\t\t\t\t\tif(_splitted.length > 1){\n\t\t\t\t\t\t\t\tposname\t= _splitted[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_splitted = posname.split(': ');\n\t\t\t\t\t\t\tif(_splitted.length > 1){\n\t\t\t\t\t\t\t\tposname\t= _splitted[1];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tposname = \$.trim(posname);\n\n\t\t\t\t\t\t\t\$(this).attr('id', posname + '-jsnposition');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\$(this)[0].oncontextmenu = function() {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.click(function () {\n\t\t\t\t\t\t" . $onPositionClick . "\n\t\t\t\t\t});\n\t\t\t\t\t" . $jsnTemplateCustomJs . "\n\t\t\t\t});\n\t\t\t\t" . $initFilter . "\n\t\t\t\t\n\t\t\t})(jQuery);\n\t\t";
     $document->addScriptDeclaration($_customScript);
     $jsnrender = JSNPositionsRender::getInstance();
     $jsnrender->renderPage(JURI::root() . 'index.php?poweradmin=1&vsm_changeposition=1&tp=1', 'changePosition');
     $this->assignRef('jsnrender', $jsnrender);
     parent::display($tpl);
 }
예제 #22
0
파일: view.php 프로젝트: densem-2013/exikom
 /**
  * Method for display page.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise an Exception object.
  */
 public function display($tpl = null)
 {
     // Get component name
     $component = substr($this->input->getCmd('option'), 4);
     // Get extension info
     $this->xml = simplexml_load_file(JPATH_COMPONENT_ADMINISTRATOR . '/' . $component . '.xml');
     // Hide main menu
     $this->input->set('hidemainmenu', true);
     // Set toolbar title
     JToolbarHelper::title(JText::sprintf('JSN_EXTFW_INSTALLER_TITLE', JText::_((string) $this->xml->name)));
     // Get dependency
     $this->dependencies = $this->xml->xpath('subinstall/extension');
     // Check dependency
     $this->missingDependency = true;
     if (($result = $this->model->check($this->dependencies)) == -1) {
         // No missing dependency found
         $this->missingDependency = false;
     } elseif (is_array($result)) {
         $this->errors = $result;
     } elseif ($result === true) {
         $this->authentication = true;
     }
     // Load assets
     $JVersion = new JVersion();
     if (version_compare($JVersion->RELEASE, '3.0', '<')) {
         // Load Mootools compatible script
         JHtml::_('behavior.mootools');
         $this->script = JUri::root(true) . '/administrator/components/com_' . $component . '/assets/js/installer/mootools_compat.js';
         // Load bootstrap
         $this->doc->addStyleSheet(JUri::root(true) . '/administrator/components/com_' . $component . '/assets/css/bootstrap.min.css');
     } elseif (strpos($JVersion->RELEASE, '3.') === 0) {
         // Use jQuery compatible script
         JHtml::_('behavior.framework');
         $this->script = JUri::root(true) . '/administrator/components/com_' . $component . '/assets/js/installer/jquery_compat.js';
     } else {
         jexit(JText::_('JSN_EXTFW_INSTALLER_OBSOLETE_JOOMLA_VERSION'));
     }
     $this->doc->addStyleSheet(JUri::root(true) . '/administrator/components/com_' . $component . '/assets/css/installer.css');
     // Set layout path
     $this->addTemplatePath(dirname(__FILE__) . '/tmpl');
     // Display the template
     parent::display($tpl);
 }
예제 #23
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     // Initialize variables
     $session = JFactory::getSession();
     $seesionQueue = $session->get('application.queue');
     $input = JFactory::getApplication()->input;
     $this->urlAction = $input->getString('tmpl', '');
     $this->_document = JFactory::getDocument();
     $this->_item = $this->get('Item');
     $emailModel = JModelForm::getInstance('EmailSettings', 'JSNUniformModel');
     $this->checkSubmitModal = false;
     if ($seesionQueue[0]['type'] != "warning") {
         unset($_SESSION["__form-design-" . $this->_item->form_id]);
         unset($_SESSION["__form-design-"]);
         if ($seesionQueue[0]) {
             if ($this->urlAction == "component") {
                 $this->checkSubmitModal = true;
             }
         }
     }
     $this->_listFontType = array(" Verdana, Geneva, sans-serif", "\"Times New Roman\", Times, serif", "\"Courier New\", Courier, monospace", "Tahoma, Geneva, sans-serif", "Arial, Helvetica, sans-serif", "\"Trebuchet MS\", Arial, Helvetica, sans-serif", "\"Arial Black\", Gadget, sans-serif", "\"Lucida Sans Unicode\", \"Lucida Grande\", sans-serif", "\"Palatino Linotype\", \"Book Antiqua\", Palatino, serif", "\"Comic Sans MS\", cursive");
     $formContent = $this->_item->form_content;
     $this->_listPage = JSNUniformHelper::getListPage($formContent, $this->_item->form_id);
     $this->_form = $this->get('Form');
     $this->_fromEmail = array();
     if (empty($this->_item->form_id)) {
         $this->_fromConfig = $this->get('DataConfig');
         $this->formAction = 0;
         $this->formActionData = '';
         foreach ($this->_fromConfig as $formConfig) {
             if (isset($formConfig->name) && $formConfig->name == 'email_notification') {
                 $this->_fromEmail = json_decode($formConfig->value);
             }
             if (isset($formConfig->name) && $formConfig->name == 'form_action') {
                 $this->formAction = $formConfig->value;
             }
         }
         foreach ($this->_fromConfig as $formConfig) {
             if ($this->formAction == 1 && $formConfig->name == 'form_action_url') {
                 $this->formActionData = $formConfig->value;
             }
             if ($this->formAction == 2 && $formConfig->name == 'form_action_menu') {
                 $this->formActionData = json_decode($formConfig->value);
             }
             if ($this->formAction == 3 && $formConfig->name == 'form_action_article') {
                 $this->formActionData = json_decode($formConfig->value);
             }
             if ($this->formAction == 4 && $formConfig->name == 'form_action_message') {
                 $this->formActionData = $formConfig->value;
             }
         }
     } else {
         $this->_fromEmail = $this->get('FormEmail');
     }
     $this->form_page = isset($formContent[0]->page_content) ? $formContent[0]->page_content : "";
     $this->actionForm = array('redirect_to_url' => "", 'menu_item' => "", 'menu_item_title' => "", 'article' => "", 'article_title' => "", 'message' => "", 'action' => "1");
     $this->actionForm = JSNUniformHelper::actionFrom($this->_item->form_post_action, $this->_item->form_post_action_data);
     $this->globalFormStyle = JSNUniformHelper::getDataConfig("form_style");
     $this->formStyle = new stdClass();
     if (!empty($this->_item->form_style)) {
         $this->formStyle = json_decode($this->_item->form_style);
     } else {
         $this->formStyle->themes_style->light = '{"background_color":"","background_active_color":"#FCF8E3","border_thickness":"0","border_color":"","border_active_color":"#FBEED5","rounded_corner_radius":"0","padding_space":"10","margin_space":"0","text_color":"#333333","font_type":" Verdana, Geneva, sans-serif","font_size":"14","field_background_color":"#ffffff","field_border_color":"","field_shadow_color":"","field_text_color":"#666666","message_error_background_color":"#B94A48","message_error_text_color":"#FFFFFF"}';
         $this->formStyle->themes_style->dark = '{"background_color":"","background_active_color":"#444444","border_thickness":"0","border_color":"","border_active_color":"#666666","rounded_corner_radius":"0","padding_space":"10","margin_space":"0","text_color":"#C6C6C6","font_type":" Verdana, Geneva, sans-serif","font_size":"14","field_background_color":"#000000","field_border_color":"#111111","field_shadow_color":"#000000","field_text_color":"#333333","message_error_background_color":"#B94A48","message_error_text_color":"#FFFFFF"}';
         $this->formStyle->themes = array('light', 'dark');
     }
     if (!empty($this->globalFormStyle)) {
         $globalFormStyle = json_decode($this->globalFormStyle->value);
         if (!empty($globalFormStyle->themes_style)) {
             foreach ($globalFormStyle->themes_style as $key => $value) {
                 $this->formStyle->themes_style->{$key} = $value;
             }
         }
         if (!empty($globalFormStyle->themes)) {
             foreach ($globalFormStyle->themes as $key => $value) {
                 $this->formStyle->themes[] = $value;
             }
         }
     }
     if (!empty($this->formStyle->theme) && !empty($this->formStyle->themes_style) && $this->formStyle->theme != "jsn-style-light" && $this->formStyle->theme != "jsn-style-dark") {
         $theme = str_replace("jsn-style-", "", $this->formStyle->theme);
         if (!empty($this->formStyle->themes_style->{$theme})) {
             $styles = json_decode($this->formStyle->themes_style->{$theme});
         }
         $this->formStyle->background_color = !empty($styles->background_color) ? $styles->background_color : "";
         $this->formStyle->background_active_color = !empty($styles->background_active_color) ? $styles->background_active_color : "";
         $this->formStyle->border_active_color = !empty($styles->border_active_color) ? $styles->border_active_color : "";
         $this->formStyle->border_thickness = !empty($styles->border_thickness) ? $styles->border_thickness : "";
         $this->formStyle->border_color = !empty($styles->border_color) ? $styles->border_color : "";
         $this->formStyle->rounded_corner_radius = !empty($styles->rounded_corner_radius) ? $styles->rounded_corner_radius : "";
         $this->formStyle->padding_space = !empty($styles->padding_space) ? $styles->padding_space : "";
         $this->formStyle->margin_space = !empty($styles->margin_space) ? $styles->margin_space : "";
         $this->formStyle->text_color = !empty($styles->text_color) ? $styles->text_color : "";
         $this->formStyle->font_type = !empty($styles->font_type) ? $styles->font_type : "";
         $this->formStyle->font_size = !empty($styles->font_size) ? $styles->font_size : "";
     } else {
         $this->formStyle->background_color = !empty($this->formStyle->background_color) ? $this->formStyle->background_color : "";
         $this->formStyle->background_active_color = !empty($this->formStyle->background_active_color) ? $this->formStyle->background_active_color : "";
         $this->formStyle->border_active_color = !empty($this->formStyle->border_active_color) ? $this->formStyle->border_active_color : "";
         $this->formStyle->border_thickness = !empty($this->formStyle->border_thickness) ? $this->formStyle->border_thickness : "";
         $this->formStyle->border_color = !empty($this->formStyle->border_color) ? $this->formStyle->border_color : "";
         $this->formStyle->rounded_corner_radius = !empty($this->formStyle->rounded_corner_radius) ? $this->formStyle->rounded_corner_radius : "";
         $this->formStyle->padding_space = !empty($this->formStyle->padding_space) ? $this->formStyle->padding_space : "";
         $this->formStyle->margin_space = !empty($this->formStyle->margin_space) ? $this->formStyle->margin_space : "";
         $this->formStyle->text_color = !empty($this->formStyle->text_color) ? $this->formStyle->text_color : "";
         $this->formStyle->font_type = !empty($this->formStyle->font_type) ? $this->formStyle->font_type : "";
         $this->formStyle->font_size = !empty($this->formStyle->font_size) ? $this->formStyle->font_size : "";
         if (empty($this->formStyle->background_active_color) && empty($this->formStyle->border_active_color) && empty($this->formStyle->border_thickness) && empty($this->formStyle->border_color) && empty($this->formStyle->rounded_corner_radius) && empty($this->formStyle->background_color) && empty($this->formStyle->font_size) && empty($this->formStyle->text_color) && empty($this->formStyle->margin_space) && empty($this->formStyle->padding_space)) {
             $this->formStyle->theme = "";
             $this->formStyle->themes_style->light = '{"background_color":"","background_active_color":"#FCF8E3","border_thickness":"0","border_color":"","border_active_color":"#FBEED5","rounded_corner_radius":"0","padding_space":"10","margin_space":"0","text_color":"#333333","font_type":" Verdana, Geneva, sans-serif","font_size":"14","field_background_color":"#ffffff","field_border_color":"","field_shadow_color":"","field_text_color":"#666666","message_error_background_color":"#B94A48","message_error_text_color":"#FFFFFF"}';
             $this->formStyle->themes_style->dark = '{"background_color":"","background_active_color":"#444444","border_thickness":"0","border_color":"","border_active_color":"#666666","rounded_corner_radius":"0","padding_space":"10","margin_space":"0","text_color":"#C6C6C6","font_type":" Verdana, Geneva, sans-serif","font_size":"14","field_background_color":"#000000","field_border_color":"#111111","field_shadow_color":"#000000","field_text_color":"#333333","message_error_background_color":"#B94A48","message_error_text_color":"#FFFFFF"}';
             $this->formStyle->themes = array('light', 'dark');
         }
     }
     // Hide the main menu
     $input->set('hidemainmenu', true);
     // Initialize toolbar
     $this->initToolbar();
     // Get config
     $config = JSNConfigHelper::get();
     $msgs = '';
     if (!$config->get('disable_all_messages')) {
         $msgs = JSNUtilsMessage::getList('FORMS');
         $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : '';
     }
     // Assign variables for rendering
     $this->assignRef('msgs', $msgs);
     // Display the template
     parent::display($tpl);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
예제 #24
0
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     // Check if this view is used for module editing page.
     $moduleEdit = JRequest::getCmd('moduleedit', '');
     $active_positions = array();
     $model = $this->getModel('changeposition');
     if (!$moduleEdit) {
         $moduleid = $app->getUserState('com_poweradmin.changeposition.moduleid');
     } else {
         $moduleid = array(JRequest::getCmd('moduleid', ''));
     }
     for ($i = 0; $i < count($moduleid); $i++) {
         $active_positions[] = "\$('#" . $model->getModulePosition($moduleid[$i]) . "-jsnposition').addClass('active-position').attr('title', 'Active position');";
     }
     JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.jquery.noconflict.js');
     JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.functions.js');
     //$document->addScript(JSN_POWERADMIN_LIB_JSNJS_URI. 'jsn.filter.visualmode.js');
     //Enable position filter.
     $this->setFilterable(true);
     $customScript = "\n\t\t\tvar baseUrl  = '" . JURI::root() . "';\n\t\t\tvar moduleid = new Array();\n\t\t\tmoduleid = [" . @implode(",", $moduleid) . "];\n\t\t\t(function (\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\t" . implode(PHP_EOL, $active_positions) . "\n\t\t\t\t});\n\t\t\t})(JoomlaShine.jQuery);\n \t\t";
     $this->addCustomScripts($customScript);
     //Callback after position clicked.
     if (!$moduleEdit) {
         $onPostionClick = "\n \t\t\tif ( !\$(this).hasClass('active-position') ){\n\t\t\t\tJoomlaShine.jQuery.setPosition(moduleid, \$(this).attr('id').replace('-jsnposition', ''));\n \t\t\t\tparent.JoomlaShine.jQuery('.ui-dialog-content').dialog('close');\n \t\t\t}\n \t\t\t";
     } else {
         $onPostionClick = "\n \t\t\tif ( !\$(this).hasClass('active-position') ){\n \t\t\t\tvar posName = \$(this).attr('id').replace('-jsnposition', '');\n \t\t\t\tparent.JoomlaShine.jQuery('#jform_position').val(posName);\n \t\t\t\tparent.modal.close();\n \t\t\t}\n \t\t\t";
     }
     $this->addPositionClickCallBack($onPostionClick);
     $template = JSNTemplateHelper::getInstance();
     $onPositionClick = '';
     $initFilter = '';
     $displayNotice = $app->input->getInt('notice');
     $bypassNotif = $app->input->getVar('bypassNotif', '');
     // Get template author.
     $templateAuthor = $template->getAuthor();
     JSNPositionsHelper::dispatchTemplateFramework($templateAuthor);
     $document->addStyleSheet(JSN_URL_ASSETS . '/joomlashine/css/jsn-positions.css');
     if (JSNVersion::isJoomlaCompatible('3.0')) {
         $document->addScript(JURI::root(true) . '/media/jui/js/jquery.js');
     } else {
         $document->addScript(JSN_URL_ASSETS . '/3rd-party/jquery/jquery-1.8.2.js');
     }
     if (isset($this->filterEnabled) and $this->filterEnabled) {
         $document->addScript(JSN_URL_ASSETS . '/joomlashine/js/positions.filter.js');
         $initFilter = 'changeposition = new JoomlaShine.jQuery.visualmodeFilter({});';
     }
     if (isset($this->customScripts)) {
         $document->addScriptDeclaration(implode('\\n', $this->customScripts));
     }
     $onPositionClick = isset($this->onPositionClickCallBack) ? implode('\\n', $this->onPositionClickCallBack) : '';
     // Get JSN Template Framework version
     $db = JFactory::getDbo();
     $q = $db->getQuery(true);
     $q->select('manifest_cache');
     $q->from('#__extensions');
     $q->where("element = 'jsntplframework'");
     $q->where("type = 'plugin'", 'AND');
     $q->where("folder = 'system'", 'AND');
     $db->setQuery($q);
     // Load dependency installation status.
     $res = $db->loadObject();
     $res = json_decode($res->manifest_cache);
     $jsnTplFwVersion = $res->version;
     $jsnTemplateCustomJs = '';
     if (version_compare($jsnTplFwVersion, '2.0.1', '<=')) {
         $jsnTemplateCustomJs = "\$('body').addClass('jsn-bootstrap');";
     }
     $_customScript = "\n\t\t\tvar changeposition;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\tvar posOutline\t= \$('.jsn-position');\n\t\t\t\t\tvar _idAlter\t= false;\n\t\t\t\t\tif (\$('.jsn-position').length == 0) {\n\t\t\t\t\t\tposOutline\t= \$('.mod-preview');\n\t\t\t\t\t\t_idAlter\t= true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tposOutline.css({'z-index':'9999', 'position':'relative'});\n\t\t\t\t\t}\n\t\t\t\t\tposOutline.each(function(){\n\t\t\t\t\t\tif(_idAlter){\n\t\t\t\t\t\t\tpreviewInfo = \$(this).children('.mod-preview-info').text();\n\n\t\t\t\t\t\t\t_splitted = previewInfo.split('[');\n\t\t\t\t\t\t\tif(_splitted.length > 1){\n\t\t\t\t\t\t\t\tposname\t= _splitted[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_splitted = posname.split(': ');\n\t\t\t\t\t\t\tif(_splitted.length > 1){\n\t\t\t\t\t\t\t\tposname\t= _splitted[1];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tposname = \$.trim(posname);\n\n\t\t\t\t\t\t\t\$(this).attr('id', posname + '-jsnposition');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\$(this)[0].oncontextmenu = function() {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t.click(function () {\n\t\t\t\t\t\t" . $onPositionClick . "\n\t\t\t\t\t});\n\t\t\t\t\t" . $jsnTemplateCustomJs . "\n\t\t\t\t});\n\t\t\t\t" . $initFilter . "\n\t\t\t\t\n\t\t\t})(jQuery);\n\t\t";
     $document->addScriptDeclaration($_customScript);
     $previewModulePositionsIsEnabled = JComponentHelper::getParams('com_templates')->get('template_positions_display', 0);
     if (!$previewModulePositionsIsEnabled) {
         /**
          * Get config class
          */
         JSNFactory::localimport('libraries.joomlashine.config');
         JSNConfig::extension('com_templates', array('template_positions_display' => 1));
     }
     $config = JFactory::getConfig();
     $secret = $config->get('secret');
     $jsnrender = JSNPositionsRender::getInstance();
     $jsnrender->renderPage(JURI::root() . 'index.php?poweradmin=1&vsm_changeposition=1&tp=1&jsnpa_key=' . md5($secret), 'changePosition');
     $this->jsnrender = $jsnrender;
     parent::display($tpl);
 }