/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); }
protected function getInput() { $uri = JURI::root(true); $enabledCSS = ' jsn-disable'; $menuid = JRequest::getInt('id'); $app = JFactory::getApplication(); $showcaseID = $app->getUserState('com_imageshow.add.showcase_id'); if ($showcaseID != 0) { $this->value = $showcaseID; $app->setUserState('com_modules.add.showcase_id', 0); } $document = JFactory::getDocument(); $input = $app->input; $option = $input->getCmd('option', ''); $view = $input->getCmd('view', ''); if ($option == 'com_advancedmodules' && $view == 'module') { if (file_exists(JPATH_ROOT . '/media/jui/js/jquery.simplecolors.min.js')) { $document->addScript(JUri::root(true) . '/media/jui/js/jquery.simplecolors.min.js'); } } !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); JHTML::stylesheet('modules/mod_imageshow/assets/css/style.css'); JHTML::stylesheet('administrator/components/com_imageshow/assets/css/imageshow.css'); JSNHtmlAsset::addScript($uri . '/media/jui/js/jquery.min.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); JHTML::script('administrator/components/com_imageshow/assets/js/joomlashine/window.js'); JHTML::script('modules/mod_imageshow/assets/js/jsnis_module.js'); JSNHtmlAsset::addScript($uri . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); $jsCode = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar gIframeFunc = undefined;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function () {\n\t\t\t\t\tvar wWidth = \$(window).width()*0.9;\n\t\t\t\t\tvar wHeight = \$(window).height()*0.8;\n\t\t\t\t\t\$('.jsn-is-showcase-modal').click(function(event){\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar link = baseUrl+'administrator/'+\$(this).attr('href')+'&tmpl=component';\n\t\t\t\t\t\tvar save_button_lable = '" . JText::_('JSN_IMAGESHOW_SAVE_AND_SELECT', true) . "';\n\t\t\t\t\t\tvar JSNISShowcaseWindow = new \$.JSNISUIWindow(link,{\n\t\t\t\t\t\t\t\twidth: wWidth,\n\t\t\t\t\t\t\t\theight: wHeight,\n\t\t\t\t\t\t\t\ttitle: '" . JText::_('JSN_IMAGESHOW_SHOWCASE_SETTINGS') . "',\n\t\t\t\t\t\t\t\tscrollContent: true,\n\t\t\t\t\t\t\t\tbuttons:\n\t\t\t\t\t\t\t\t[{\n\t\t\t\t\t\t\t\t\ttext:save_button_lable,\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\tif(typeof gIframeFunc != 'undefined')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgIframeFunc();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('Iframe function not available')\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: '" . JText::_('JSN_IMAGESHOW_CANCEL', true) . "',\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t "; $document = JFactory::getDocument(); $document->addScriptDeclaration($jsCode); $db = JFactory::getDBO(); JHTML::stylesheet('modules/mod_imageshow/assets/css/style.css'); //build the list of categories $query = 'SELECT a.showcase_title AS text, a.showcase_id AS id' . ' FROM #__imageshow_showcase AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering'; $db->setQuery($query); $data = $db->loadObjectList(); $results[] = JHTML::_('select.option', '0', '- ' . JText::_('JSN_FIELD_SELECT_SHOWCASE') . ' -', 'id', 'text'); $results = array_merge($results, $data); if ($data) { $enabledCSS = ''; if (!$menuid && is_null($showcaseID)) { $this->value = $data[0]->id; } } else { $this->value = '0'; } $html = "<div id='jsn-showcase-icon-warning'>"; $html .= JHTML::_('select.genericList', $results, $this->name, 'class="inputbox jsn-select-value' . $enabledCSS . '" style="width: 250px;"', 'id', 'text', $this->value, $this->id); if (!$data) { $html .= '<span><i>' . JText::_('JSN_DO_NOT_HAVE_ANY_SHOWCASE') . '</i></span>'; } $html .= "<span><i class=\"jsn-icon16 jsn-icon-warning-sign icon-warning" . $enabledCSS . "\" id = \"showcase-icon-warning\"><span class=\"jsn-tooltip-wrap\"><span class=\"jsn-tooltip-anchor\"></span><p class=\"jsn-tooltip-title\">" . JText::_('JSN_FIELD_TITLE_SHOWCASE_WARNING') . "</p>" . JText::_('JSN_FIELD_DES_SHOWCASE_WARNING') . "</span></i></span>"; $html .= "<a class=\"jsn-link-edit-showcase jsn-is-showcase-modal\" id=\"jsn-link-edit-showcase\" href=\"javascript: void(0);\" rel='{\"action\": \"edit\"}' title=\"" . JText::_('EDIT_SELECTED_SHOWCASE') . "\"><i class=\"jsn-icon16 jsn-icon-pencil\" id=\"showcase-icon-edit\"></i></a>"; $html .= "<a class=\"jsn-is-showcase-modal\" href=\"index.php?option=com_imageshow&controller=showcase&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWCASE') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id=\"showcase-icon-add\"></i></a>"; $html .= "</div>"; return $html; }
/** * 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) { // Include the component HTML helpers. $this->_path['template'] = array(JPATH_ROOT . '/plugins/system/jsnframework/libraries/joomlashine/menutypes/tmpl'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Load assets JSNBaseHelper::loadAssets(); parent::display($tpl); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); //$this->_document->addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); //JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); }
/** * 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 Exception object if there is any failure, otherwise nothing is returned. */ public function display($tpl = null) { // Load assets // !!! NOTE: only auto-load if JSN UniForm is installed for backward compatible if (is_readable(JPATH_ROOT . '/administrator/components/com_uniform/uniform.defines.php')) { defined('JSN_UNIFORM_VERSION') or @(require_once JPATH_ROOT . '/administrator/components/com_uniform/uniform.defines.php'); if (version_compare(JSN_UNIFORM_VERSION, '1.3.0', '<=')) { !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); } } return parent::display($tpl); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/view.about.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); // Add toolbar menu JSNISImageShowHelper::addToolbarMenu(); // Set the submenu JSNISImageShowHelper::addSubmenu('about'); }
/** * Display the view * * @param string $tpl The name of the template file to parse. * * @return void */ public function display($tpl = null) { // Include the component HTML helpers. if (!JFactory::getUser()->authorise('core.manage', 'com_users')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } // Include the component HTML helpers. $this->_path['template'] = array(JPATH_ROOT . '/plugins/system/jsnframework/libraries/joomlashine/users/tmpl'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Load assets JSNBaseHelper::loadAssets(); parent::display($tpl); echo JSNHtmlAsset::loadScript('jsn/selectorFilter', array(), true); }
/** * 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); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.js'); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-jwysiwyg/jquery.wysiwyg.css'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/image_selector.css'); JSNHtmlAsset::loadScript('imageshow/joomlashine/showlist', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE')))); }
/** * Constructor * * @param array $config A named configuration array for object construction. */ public function __construct($config = array()) { // Display only the component output JFactory::getApplication()->input->def('tmpl', 'component'); parent::__construct($config); // Load category model $model = JSNBaseModel::getInstance('Categories', 'CategoriesModel'); $this->setModel($model, true); // Include the component HTML helpers $this->addTemplatePath(dirname(__FILE__) . '/tmpl'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Load assets JSNBaseHelper::loadAssets(); echo JSNHtmlAsset::loadScript('jsn/selectorFilter', array(), true); }
protected function getInput() { $_app = JFactory::getApplication('admin'); $_input = $_app->input; $pathOnly = JURI::root(true); $pathRoot = JURI::root(); $enabledCSS = ' jsn-disable'; $menuid = $_input->getInt('id', 0); $app = JFactory::getApplication(); $db = JFactory::getDBO(); $db = JFactory::getDBO(); $doc = JFactory::getDocument(); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $doc->addStyleSheet($pathOnly . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $doc->addStyleSheet($pathOnly . '/administrator/components/com_imageshow/assets/css/menu.galleries.collection.css'); JSNHtmlAsset::addScript($pathOnly . '/media/jui/js/jquery.min.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); $doc->addScript($pathOnly . '/administrator/components/com_imageshow/assets/js/joomlashine/window.js'); JSNHtmlAsset::addScript($pathOnly . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); $jsCode = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar gIframeFunc = undefined;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function () {\n\t\t\t\t\tvar wWidth = \$(window).width()*0.9;\n\t\t\t\t\tvar wHeight = \$(window).height()*0.8;\n\t\t\t\t\t\$('.jsn-is-showcase-modal').click(function(event){\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar link = baseUrl+'administrator/'+\$(this).attr('href')+'&tmpl=component';\n\t\t\t\t\t\tvar save_button_lable = '" . JText::_('JSN_IMAGESHOW_SAVE_AND_SELECT', true) . "';\n\t\t\t\t\t\tvar JSNISShowcaseWindow = new \$.JSNISUIWindow(link,{\n\t\t\t\t\t\t\t\twidth: wWidth,\n\t\t\t\t\t\t\t\theight: wHeight,\n\t\t\t\t\t\t\t\ttitle: '" . JText::_('JSN_IMAGESHOW_SHOWCASE_SETTINGS') . "',\n\t\t\t\t\t\t\t\tscrollContent: true,\n\t\t\t\t\t\t\t\tbuttons:\n\t\t\t\t\t\t\t\t[{\n\t\t\t\t\t\t\t\t\ttext:save_button_lable,\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\tif(typeof gIframeFunc != 'undefined')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgIframeFunc();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('Iframe function not available')\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: '" . JText::_('JSN_IMAGESHOW_CANCEL', true) . "',\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t "; $doc->addScriptDeclaration($jsCode); $query = $db->getQuery(true); $query->clear(); $query->select('a.showcase_title AS text, a.showcase_id AS id'); $query->from($db->quoteName('#__imageshow_showcase') . ' AS a'); $query->where('a.published = ' . $db->quote(1)); $query->order('a.ordering DESC'); $db->setQuery($query); $data = $db->loadObjectList(); $results[] = JHTML::_('select.option', '0', '- ' . JText::_('JSN_FIELD_SELECT_SHOWCASE') . ' -', 'id', 'text'); $results = array_merge($results, $data); $html = "<div id='jsn-showcase-container'>"; if (!$data) { $html .= '<span class="jsn-menu-alert-message">' . JText::_('JSN_DO_NOT_HAVE_ANY_SHOWCASE') . '</span>'; } else { $html .= JHTML::_('select.genericList', $results, $this->name, 'class="inputbox jsn-select-value' . $enabledCSS . '"', 'id', 'text', $this->value, $this->id); } $html .= "<a class=\"jsn-is-showcase-modal\" href=\"index.php?option=com_imageshow&controller=showcase&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWCASE') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id=\"showcase-icon-add\"></i></a>"; $html .= "</div>"; return $html; }
/** * 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) { try { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); } catch (Exception $e) { throw $e; } // Include the component HTML helpers. $this->_path['template'] = array(JPATH_ROOT . '/plugins/system/jsnframework/libraries/joomlashine/modules/tmpl'); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Load assets JSNBaseHelper::loadAssets(); // Do not call parent method to skip showing warning message when there is no any module to list $result = $this->loadTemplate($tpl); if ($result instanceof Exception) { return $result; } echo $result; echo JSNHtmlAsset::loadScript('jsn/selectorFilter', array(), true); }
/** * Generate HTML markup for about page. * * If a product has sub-product, this method need to be called as below to * check all sub-product for latest version: * * <pre>JSNHtmlGenerate::about( * array( * // Core component * 'imageshow' => '4.2.0', * * // Themes * 'themeclassic' => '1.1.5', * 'themeslider' => '1.0.4', * 'themegrid' => '1.0.0', * * // Sources * 'picasa' => '1.1.2', * 'flickr' => '1.1.2', * 'phoca' => '1.0.1', * 'joomgallery' => '1.0.1', * 'rsgallery2' => '1.0.1', * 'facebook' => '1.0.1' * ) * );</pre> * * If a product does not have sub-product, the <b>$products</b> parameter * does not required when calling this method: * * <pre>JSNHtmlGenerate::about();</pre> * * @param array $products Array of product identified name. * * @return string */ public static function about($products = array()) { // Get extension manifest cache $info = JSNUtilsXml::loadManifestCache(); // Add assets JSNBaseHelper::loadAssets(); JSNHtmlAsset::loadScript('jsn/about', array('language' => JSNUtilsLanguage::getTranslated(array('JSN_EXTFW_ABOUT_SEE_OTHERS_MODAL_TITLE')))); // Generate markup $html[] = ' <div id="jsn-about" class="jsn-page-about"> <div class="jsn-bootstrap">'; $html[] = self::aboutInfo($info, $products); $html[] = ' <div class="jsn-product-support">'; $html[] = self::aboutHelp(); $html[] = self::aboutFeedback(); $html[] = ' </div> </div> </div> <div class="clr"></div>'; echo implode($html); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/joomlashine/css/jsn-view-launchpad.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/showlist.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/cpanel.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); //$objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/zeroclipboard/ZeroClipboard.js'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/window.js'); JSNHtmlAsset::loadScript('imageshow/joomlashine/launchpad', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE', 'CPANEL_PLUGIN_SYNTAX_DETAILS', 'CPANEL_GO', 'CPANEL_EDIT_SELECTED_SHOWCASE', 'CPANEL_YOU_MUST_SELECT_SOME_SHOWCASE_TO_EDIT', 'CPANEL_EDIT_SELECTED_SHOWLIST', 'CPANEL_YOU_MUST_SELECT_SOME_SHOWLIST_TO_EDIT', 'JSN_IMAGESHOW_SAVE')))); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/mediamanager.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); JSNHtmlAsset::loadScript('imageshow/joomlashine/showcases', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE', 'CPANEL_UPGRADE_TO_PRO_EDITION_FOR_MORE', 'UPGRADE_TO_PRO_EDITION', 'JSN_IMAGESHOW_SHOWCASE_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_SHOWCASES_IN_FREE_EDITION')))); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { JHTML::_('behavior.modal', 'a.modal'); JHTML::_('behavior.tooltip'); $JVersion = new JVersion(); $JVersion = $JVersion->getShortVersion(); if (version_compare($JVersion, '3.3', '>=')) { $document = JFactory::getDocument(); $js = "(function(\$) {\n\t\t\t\$(window).load(function ()\n\t\t\t{\n\t\t\t\tSqueezeBox.initialize({});\n\t\t\t\tSqueezeBox.assign(\$('a.jsn-modal').get(), {\n\t\t\t\t\tparse: 'rel'\n\t\t\t\t});\n\t\t\t});\n\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);"; $document->addScriptDeclaration($js); } else { JHTML::_('behavior.modal', 'a.jsn-modal'); } $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/view.showcase.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installshowcasethemes.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installdefault.js'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JUri::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-stickyfloat/stickyFloat.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/jquery.imageshow.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/slider.js'); //$objJSNMedia->addStyleSheet(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/jquery/colorpicker/css/colorpicker.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/jquery/colorpicker/js/colorpicker.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/jsn.jquery.noconflict.js'); JSNHtmlAsset::loadScript('imageshow/joomlashine/showlist', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE', 'JSN_IMAGESHOW_SAVE', 'JSN_IMAGESHOW_CANCEL')))); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { $input = JFactory::getApplication()->input; $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/view.maintenance.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/sampledata.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/sampledatamanual.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installimagesources.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installshowcasethemes.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installdefault.js'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/jquery.imageshow.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js'); JSNHtmlAsset::loadScript('imageshow/joomlashine/maintenance', array('pathRoot' => JURI::root(), 'group' => $input->getCmd('g'), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_SAVE', 'JSN_IMAGESHOW_CLOSE', 'JSN_IMAGESHOW_CONFIRM', 'MAINTENANCE_SOURCE_ARE_YOU_SURE_YOU_WANT_TO_DELETE_THIS_IMAGE_SOURCE_PROFILE')))); }
/** * Add nesscessary JS & CSS files * * @return void */ private function _addAssets() { JHTML::_('behavior.tooltip'); $objJSNMedia = JSNISFactory::getObj('classes.jsn_is_media'); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/imageshow.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/showlist.css'); $objJSNMedia->addStyleSheet(JURI::root(true) . '/administrator/components/com_imageshow/assets/css/image_selector.css'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imageshow.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installimagesources.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/installdefault.js'); JSNHtmlAsset::addScript(JURI::root(true) . '/media/jui/js/jquery.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/jquery/jquery.contextmenu.r2.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/jquery/jquery.overridden.layout-latest.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/window.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/jquery.imageshow.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/slider.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ck/jquery.ck.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-topzindex/jquery.topzindex.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/lang.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/imagegrid.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/tree.js'); $objJSNMedia->addScript(JURI::root(true) . '/administrator/components/com_imageshow/assets/js/joomlashine/jsn.jquery.noconflict.js'); JSNHtmlAsset::loadScript('imageshow/joomlashine/showlist', array('pathRoot' => JURI::root(), 'language' => JSNUtilsLanguage::getTranslated(array('JSN_IMAGESHOW_OK', 'JSN_IMAGESHOW_CLOSE', 'JSN_IMAGESHOW_SAVE', 'JSN_IMAGESHOW_CANCEL')))); }
/** * Add assets * * @return void */ public static function addAssets($slider = '') { // Load common assets !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); // Load proprietary assets if (empty($slider)) { if (class_exists('JSNHtmlAsset')) { JSNHtmlAsset::addStyle(JURI::root(true) . '/administrator/components/com_easyslider/assets/css/easyslider.css'); } else { $doc = JFactory::getDocument(); $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_easyslider/assets/css/easyslider.css'); } } else { // do nothing } }
/** * 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 Exception object if there is any failure, otherwise nothing is returned. */ public function display($tpl = null) { // Load assets !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); return parent::display($tpl); }
protected function getInput() { $definePath = JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'imageshow.defines.php'; if (is_file($definePath)) { include_once $definePath; } $uri = JURI::root(true); $enabledCSS = ' jsn-disable'; $menuid = JRequest::getInt('id'); $app = JFactory::getApplication(); $showlistID = $app->getUserState('com_imageshow.add.showlist_id'); if ($showlistID != 0) { $this->value = $showlistID; $app->setUserState('com_imageshow.add.showlist_id', 0); } $db = JFactory::getDBO(); $query = 'SELECT COUNT(*) FROM #__imageshow_showlist'; $db->setQuery($query); $totalShowlist = $db->loadResult(); $document = JFactory::getDocument(); !class_exists('JSNBaseHelper') or JSNBaseHelper::loadAssets(); JHTML::stylesheet('modules/mod_imageshow/assets/css/style.css'); JHTML::stylesheet('administrator/components/com_imageshow/assets/css/imageshow.css'); JSNHtmlAsset::addScript($uri . '/media/jui/js/jquery.min.js'); JSNHtmlAsset::addScript(JSN_URL_ASSETS . '/3rd-party/jquery-ui/js/jquery-ui-1.9.0.custom.min.js'); JHTML::script('administrator/components/com_imageshow/assets/js/joomlashine/window.js'); JHTML::script('modules/mod_imageshow/assets/js/jsnis_module.js'); JSNHtmlAsset::addScript($uri . '/administrator/components/com_imageshow/assets/js/joomlashine/conflict.js'); $jsCodeAddShowlistButton = ''; if ($totalShowlist >= 3 && strtolower(JSN_IMAGESHOW_EDITION) == 'free') { $jsCodeAddShowlistButton = "\n\t\t\t\t(function(\$){\n\t\t\t\t\t\$(document).ready(function () {\n\n\t\t\t\t\t\t\$('.jsn-is-add-showlist-modal').click(function(event){\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tvar cfm = \$('<div id=\"jsn-is-module-backend-confirmbox-container\" style=\"padding:10px; overflow:hidden;\"/>').appendTo('body').html('" . JText::_('JSN_IMAGESHOW_YOU_HAVE_REACHED_THE_LIMITATION_OF_3_SHOWLISTS_IN_FREE_EDITION', true) . "');\n\t\t\t\t\t\t\tcfm.dialog({\n\t\t\t\t\t\t\t\twidth : 500,\n\t\t\t\t\t\t\t\theight : 250,\n\t\t\t\t\t\t\t\tmodal : true,\n\t\t\t\t\t\t\t\tdraggable : false,\n\t\t\t\t\t\t\t\tresizable : false,\n\t\t\t\t\t\t\t\ttitle\t\t: '" . JText::_('JSN_IMAGESHOW_UPGRADE_TO_PRO_EDITION_FOR_MORE', true) . "',\n\t\t\t\t\t\t\t\tbuttons :\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\ttext: 'Close',\n\t\t\t\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\t\t\tcfm.remove();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t\t "; } $jsCode = "\n\t\t\tvar baseUrl = '" . JURI::root() . "';\n\t\t\tvar gIframeFunc = undefined;\n\t\t\t(function(\$){\n\t\t\t\t\$(document).ready(function () {\n\t\t\t\t\tvar wWidth = \$(window).width()*0.9;\n\t\t\t\t\tvar wHeight = \$(window).height()*0.8;\n\t\t\t\t\t\$('.jsn-is-showlist-modal').click(function(event){\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tvar link = baseUrl+'administrator/'+\$(this).attr('href')+'&tmpl=component';\n\t\t\t\t\t\tvar save_button_lable = '" . JText::_('JSN_IMAGESHOW_SAVE_AND_SELECT', true) . "';\n\t\t\t\t\t\tvar JSNISShowlistWindow = new \$.JSNISUIWindow(link,{\n\t\t\t\t\t\t\t\twidth: wWidth,\n\t\t\t\t\t\t\t\theight: wHeight,\n\t\t\t\t\t\t\t\ttitle: '" . JText::_('JSN_IMAGESHOW_SHOWLIST_SETTINGS') . "',\n\t\t\t\t\t\t\t\tscrollContent: true,\n\t\t\t\t\t\t\t\tbuttons:\n\t\t\t\t\t\t\t\t[{\n\t\t\t\t\t\t\t\t\ttext:save_button_lable,\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\tif(typeof gIframeFunc != 'undefined')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tgIframeFunc();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('Iframe function not available')\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttext: '" . JText::_('JSN_IMAGESHOW_CANCEL', true) . "',\n\t\t\t\t\t\t\t\t\tclass: 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only',\n\t\t\t\t\t\t\t\t\tclick: function (){\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t})((typeof JoomlaShine != 'undefined' && typeof JoomlaShine.jQuery != 'undefined') ? JoomlaShine.jQuery : jQuery);\n\t\t "; $document = JFactory::getDocument(); $document->addScriptDeclaration($jsCode . $jsCodeAddShowlistButton); //build the list of categories $query = 'SELECT a.showlist_title AS text, a.showlist_id AS id' . ' FROM #__imageshow_showlist AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering'; $db->setQuery($query); $data = $db->loadObjectList(); $results[] = JHTML::_('select.option', '0', '- ' . JText::_('JSN_FIELD_SELECT_SHOWLIST') . ' -', 'id', 'text'); $results = array_merge($results, $data); if ($data) { $enabledCSS = ''; if (!$menuid && is_null($showlistID)) { $this->value = $data[0]->id; } } else { $this->value = '0'; } $html = "<div id='jsn-showlist-icon-warning'>"; $html .= JHTML::_('select.genericList', $results, $this->name, 'class="inputbox jsn-select-value' . $enabledCSS . '" style="width: 250px;"', 'id', 'text', $this->value, $this->id); if (!$data) { $html .= '<span><i>' . JText::_('JSN_DO_NOT_HAVE_ANY_SHOWLIST') . '</i></span>'; } $html .= "<span><i class=\"jsn-icon16 jsn-icon-warning-sign icon-warning" . $enabledCSS . "\" id = \"showlist-icon-warning\"><span class=\"jsn-tooltip-wrap\"><span class=\"jsn-tooltip-anchor\"></span><p class=\"jsn-tooltip-title\">" . JText::_('JSN_FIELD_TITLE_SHOWLIST_WARNING') . "</p>" . JText::_('JSN_FIELD_DES_SHOWLIST_WARNING') . "</span></i></span>"; $html .= "<a class=\"jsn-link-edit-showlist jsn-is-showlist-modal\" id=\"jsn-link-edit-showlist\" href=\"javascript: void(0);\" rel='{\"action\": \"edit\"}' title=\"" . JText::_('EDIT_SELECTED_SHOWLIST') . "\"><i class=\"jsn-icon16 jsn-icon-pencil\" id = \"showlist-icon-edit\"></i></a>"; if ($totalShowlist >= 3 && strtolower(JSN_IMAGESHOW_EDITION) == 'free') { $html .= "<a class=\"jsn-is-add-showlist-modal\" href=\"index.php?option=com_imageshow&controller=showlist&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWLIST') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id = \"showlist-icon-add\"></i></a>"; } else { $html .= "<a class=\"jsn-is-showlist-modal\" href=\"index.php?option=com_imageshow&controller=showlist&task=add\" rel='{\"action\": \"add\"}' title=\"" . JText::_('CREATE_NEW_SHOWLIST') . "\"><i class=\"jsn-icon16 jsn-icon-plus\" id = \"showlist-icon-add\"></i></a>"; } $html .= "</div>"; return $html; }