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(); }
/** * This event fired right after this plugin loaded */ public static function loadJavascriptLang() { $jsnLang = new JSNJavascriptLanguages(); $jsnLang->addLang('JSN_RAWMODE_COMPONENT_EDIT_CONTACT'); return $jsnLang->loadLang(false); }