/** * 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) { $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils'); $objJSNXML = JSNISFactory::getObj('classes.jsn_is_readxmldetails'); $objJSNMsg = JSNISFactory::getObj('classes.jsn_is_message'); // Get config parameters $config = JSNConfigHelper::get(); $this->_document = JFactory::getDocument(); JHtmlBehavior::framework(); // Set the toolbar JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('HELP_HELP_AND_SUPPORT'), 'help'); $shortEdition = ''; $xml = array(); // Get messages $msgs = ''; $msgs = $objJSNMsg->getList('HELP_AND_SUPPORT'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; $xml = $objJSNXML->parserXMLDetails(); $shortEdition = $objJSNUtils->getShortEdition(); // Assign variables for rendering $this->assignRef('msgs', $msgs); $this->assignRef('xml', $xml); $this->assignRef('shortEdition', $shortEdition); $this->_addAssets(); $this->addToolbar(); // Display the template parent::display($tpl); }
function display($tpl = null) { if (JVERSION < 3.0) { JHTML::_('behavior.mootools'); } else { JHtmlBehavior::framework(); } $this->_setToolBar(); $this->setLayout('settings'); $model = $this->getModel('settings'); $gatewayplugin = $this->get('APIpluginData'); $this->assignRef('gatewayplugin', $gatewayplugin); $model->refreshUpdateSite(); $geotable_list = $model->checkgeotables(); if (!empty($geotable_list)) { $geotablepresent = 0; } else { $geotablepresent = 1; } $this->assignRef('geotablepresent', $geotablepresent); if (JVERSION >= 3.0) { $this->sidebar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * Method to get the field input markup. * * @return string The field input markup. */ protected function getInput() { $plugin = JPluginHelper::isEnabled('system', 'ezset'); if (!$plugin) { return print_r($plugin, 1) . '需要先啟動外掛!'; } $name = str_replace('jform_params_', '', $this->id); \JHtmlBehavior::framework(true); $token = JFactory::getSession()->getFormToken(); $ajaxUrl = JURI::root() . 'index.php?cmd=ajax.overlay.' . $name; $ajaxCode = <<<AJAX window.addEvent('domready', function() { \t\$('{$name}').addEvent('click', function(e) { \t\tvar myRequest = new Request({ \t\t\tmethod: 'post', \t\t\tdata: { \t\t\t\t'{$token}': 1 \t\t\t}, \t\t\turl: '{$ajaxUrl}', \t\t\tonSuccess: function(responseText) { \t\t\t\t\$('{$name}_response').set('html', '<input class="btn btn-default" disabled="true" type="button" value="'+responseText+'">'); \t\t\t} \t\t}); \t\tmyRequest.send(); \t}); }); AJAX; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($ajaxCode); $link = '<div id="' . $name . '_response" ><input class="btn btn-default" id="' . $name . '" type="button" value="按此覆蓋"></div>'; return $link; }
function fetchButton($type = 'Wizard', $namekey = '', $id = 'wizard') { if (version_compare(JVERSION, '3.0.0', '<')) { JHTML::_('behavior.mootools'); } else { JHtmlBehavior::framework(); } $defaultPage = 'jnewsdoc_glossary'; if (empty($namekey)) { $namekey = $defaultPage; } else { $namekey = 'jnewsdoc_' . $namekey; } $langID = substr(JNEWS_CONFIG_LANG, 0, 2); $link = 'http://www.joobi.co/index.php?option=com_jlinks&controller=redirect&link=' . $namekey . '&alt=' . $defaultPage . '&lang=' . $langID; //.'&Itemid=312'; $iFrame = "'<iframe src=\\'{$link}\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'"; $js = "var wizardOn = true; function showWizard(){\n\t\tvar box=\$('jNewsWizard');\n\t\tif(wizardOn){box.innerHTML = " . $iFrame . ";box.style.display = 'block';box.style.height = '0';}"; $js .= "try{\n var fx = box.effects({duration: 2500, transition:\n\t\t\t\t\tFx.Transitions.Quart.easeOut});\n\t\t\t\t\tif(wizardOn){\n\t\t\t\t\t\tfx.start({'height': 500});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tfx.start({'height': 0}).chain(function() {\n\t\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}catch(err){\n\t\t\t\t\tbox.style.height = '500px';\n\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('jNewsWizard');\n \t\t\t\t\tif(wizardOn){\n\t\t\t\t\t\tmyVerticalSlide.slideIn();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\n\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} wizardOn = !wizardOn;}"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); if (version_compare(JVERSION, '3.0.0', '<')) { return '<a href="' . $link . '" target="_blank" onclick="showWizard();return false;" class="toolbar"><span class="icon-32-wizard" title="' . _JNEWS_WIZARD . '"></span>' . _JNEWS_WIZARD . '</a>'; } else { return '<a class="btn btn-small" href="' . $link . '" target="_blank" onclick="showWizard();return false;" class="toolbar"><span style="float:left;" class="icon-16-wizard" title="' . _JNEWS_WIZARD . '"></span><span style="float:left; margin-left:8px;">' . _JNEWS_WIZARD . '</span></a>'; } }
/** * Constructor * * @access protected * @return void * @since 1.5.5 */ function __construct($config = array()) { parent::__construct($config); $this->_ambit = JoomAmbit::getInstance(); $this->_config = JoomConfig::getInstance(); $this->_mainframe = JFactory::getApplication('administrator'); $this->_user = JFactory::getUser(); $this->_doc = JFactory::getDocument(); $this->_doc->addStyleSheet($this->_ambit->getStyleSheet('admin.joomgallery.css')); JHtmlBehavior::framework(); $this->_doc->addScript($this->_ambit->getScript('admin.js')); JoomHelper::addSubmenu(); JHTML::addIncludePath(JPATH_COMPONENT . '/helpers/html'); // Check for available updates if (!($checked = $this->_mainframe->getUserState('joom.update.checked'))) { $controller = JRequest::getCmd('controller'); if ($this->_config->get('jg_checkupdate') && $controller && $controller != 'control') { $dated_extensions = JoomExtensions::checkUpdate(); if (count($dated_extensions)) { $this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning'); $this->_mainframe->setUserState('joom.update.checked', -1); } else { $this->_mainframe->setUserState('joom.update.checked', 1); } } } else { if ($checked == -1) { $controller = JRequest::getCmd('controller'); if ($controller && $controller != 'control') { $this->_mainframe->enqueueMessage(JText::_('COM_JOOMGALLERY_ADMENU_SYSTEM_NOT_UPTODATE'), 'warning'); } } } }
/** * Method to get the field input markup. * * @return string The field input markup. */ public function getInput() { // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal'); JHtmlBehavior::framework(true); $this->setElement(); // Build the script. $script = array(); $script[] = ' function jSelect' . ucfirst($this->component) . '_' . $this->id . '(id, title) {'; $script[] = ' document.id("jform_link").value = id;'; $script[] = ' document.id("jform_link").highlight();'; $script[] = ' SqueezeBox.close();'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display. $html = array(); $link = $this->getLink(); $title = $this->getTitle(); if (empty($title)) { $title = JText::_('COM_' . strtoupper($this->component) . '_SELECT_ITEM'); } $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); if (JVERSION >= 3) { // The current user display field. $html[] = '<span class="">'; $html[] = '<a class="modal btn" title="' . JText::_('COM_' . strtoupper($this->component) . '_CHANGE_ITEM_BUTTON') . '" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('JSELECT') . '</a>'; $html[] = '</span>'; } else { // The user select button. $html[] = '<div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="' . JText::_('COM_' . strtoupper($this->component) . '_CHANGE_ITEM') . '" href="' . $link . '&' . JSession::getFormToken() . '=1" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('JSELECT') . '</a>'; $html[] = ' </div>'; $html[] = '</div>'; } // The active article id field. if (0 == (int) $this->value) { $value = ''; } else { $value = (int) $this->value; } // class='required' for client side validation $class = ''; if ($this->required) { $class = ' class="required modal-value"'; } $html[] = '<input type="hidden" id="' . $this->id . '_id"' . $class . ' name="' . $this->name . '" value="' . $value . '" />'; return implode("\n", $html); }
/** * 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) { // Get config parameters $config = JSNConfigHelper::get(); $this->_document = JFactory::getDocument(); JHtmlBehavior::framework(); // Set the toolbar JToolBarHelper::title(JText::_('JSN_IMAGESHOW') . ': ' . JText::_('MAINTENANCE_CONFIGURATION_AND_MAINTENANCE'), 'maintenance'); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('CONFIGURATION_AND_MAINTENANCE'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Assign variables for rendering $this->assignRef('msgs', $msgs); $this->_addAssets(); $this->addToolbar(); // Type of screen $type = JRequest::getWord('type', 'backup'); $themeName = JRequest::getWord('theme_name'); $sourceType = JRequest::getString('source_type'); switch ($type) { case 'themeparameters': $this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $themeName . DS . 'views' . DS . 'maintenance' . DS . 'tmpl'); echo $this->loadTemplate('theme_config'); break; case 'profileparameters': $this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl'); echo $this->loadTemplate('source_config'); break; case 'editprofile': $sourceID = JRequest::getInt('external_source_id'); $countShowlist = JRequest::getInt('count_showlist'); $imageSource = JSNISFactory::getSource($sourceType, 'external'); $imageSource->_source['sourceTable']->load($sourceID); $this->assignRef('sourceInfo', $imageSource->_source['sourceTable']); $this->assignRef('countShowlist', $countShowlist); $this->addTemplatePath(JPATH_PLUGINS . DS . 'jsnimageshow' . DS . 'source' . $sourceType . DS . 'views' . DS . 'maintenance' . DS . 'tmpl'); echo $this->loadTemplate('edit_source_profile'); break; default: // Display the template parent::display($tpl); break; } }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ public function getInput() { // load core and extra mootools JHTML::_('behavior.framework'); JHtmlBehavior::framework(); JHtmlBehavior::framework(true); // Must load admin language files $lang = JFactory::getLanguage(); $lang->load("com_jevents", JPATH_ADMINISTRATOR); $node = $this->element; $value = $this->value; $name = $this->name; $control_name = $this->type; $help = $node['help']; if (!is_null($help) && version_compare(JVERSION, '1.6.0', ">=")) { if (is_object($help)) { $help = (string) $help; } $help = isset($help) && JString::strlen($help) <= 0 ? null : $help; } if (!is_null($help)) { $parts = explode(",", $value); $helps = explode(",", $help); foreach ($parts as $key => $valuepart) { $help = $helps[$key]; list($helpfile, $varname, $part) = explode("::", $help); $lang = JFactory::getLanguage(); $langtag = $lang->getTag(); if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile)) { $jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile; } else { $jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/en-GB/' . $helpfile; } if (!file_exists($jeventHelpPopup)) { return ""; } include $jeventHelpPopup; $help = $this->help(${$varname}, $part); $parts[$key] = JText::_($valuepart) . $help; } $value = implode(", ", $parts); } JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return "<strong style='color:#993300'>" . JText::_($value) . "</strong>"; }
/** * register * * @return void */ public static function register() { /** @var $doc \JDocumentHtml */ $doc = \JFactory::getDocument(); $es = \Ezset::getInstance(); $input = \JFactory::getApplication()->input; if ($doc->getType() !== 'html') { return; } $uri = \JUri::getInstance(); $root = $uri::root(); $base = $uri::base(); $host = $uri->toString(array('scheme', 'host')) . '/'; if ($smoothScroll = $es->params->get('smoothScroll', 0)) { \JHtmlBehavior::framework(true); } $smoothScroll = $smoothScroll ? 'true' : 'false'; $confirmLeave = $es->params->get('confirmLeave', 0) && UriChecker::isArticleEdit() ? 'true' : 'false'; $logoLink = \JFactory::getApplication()->isAdmin() ? 'true' : 'false'; $script = <<<SCRIPT <script type="text/javascript"> \tvar ezsetOption = { \t\tsmoothScroll: {$smoothScroll}, \t\tconfirmLeave: {$confirmLeave}, \t\tlogoLink: {$logoLink} \t}; \tvar ezsetConfig = { \t\troot : '{$root}', \t\tbase : '{$base}', \t\thost : '{$host}' \t}; \tEzset.init(ezsetOption, ezsetConfig); </script> SCRIPT; $doc->addCustomTag($script); $doc->addScript(\JUri::root(true) . '/plugins/system/ezset/asset/js/ezset.js'); $doc->addScript(\JUri::root(true) . '/ezset/js/ezset-custom.js'); }
/** * * Parse all queue to page * */ public function addMedia() { $document = JFactory::getDocument(); $docType = $document->getType(); if ($this->_load_js_language) { JSNFactory::localimport('libraries.joomlashine.language.javascriptlanguages'); $jsLang = JSNJavascriptLanguages::getInstance(); $this->addScriptDeclaration($jsLang->loadLang()); } if ($this->_docType == 'raw') { $medias = array(); //Add all style file to page if (count($this->_styles)) { foreach ($this->_styles as $style) { $medias[] = '<link type="text/css" rel="stylesheet" href="' . $style . '" />'; } } //Add all script file to page if (count($this->_scripts)) { foreach ($this->_scripts as $script) { $medias[] = '<script type="text/javascript" src="' . $script . '"></script>'; } if (!in_array(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'conflict.js'), $this->_scripts)) { $medias[] = '<script type="text/javascript" src="' . PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.conflict.js') . '"></script>'; } } //Add all custom tag to page if (count($this->_customs)) { foreach ($this->_customs as $custom) { $medias[] = $custom; } } //Add all style declaration to page if (count($this->_styleDeclaration)) { $medias[] = '<style type="text/css">' . implode(PHP_EOL, $this->_styleDeclaration) . '</style>'; } //Add all script declaration to page if (count($this->_scriptDeclaration)) { $medias[] = '<script type="text/javascript">' . implode(PHP_EOL, $this->_scriptDeclaration) . '</script>'; } echo implode(PHP_EOL, $medias); } else { //behavior mootools JHtmlBehavior::framework(); //behavior modal JHtml::_('behavior.modal'); //behavior tooltip JHtml::_('behavior.tooltip'); //behavior formvalidation JHtml::_('behavior.formvalidation'); //behavior combobox JHtml::_('behavior.combobox'); //Add all style file to page if (count($this->_styles)) { foreach ($this->_styles as $style) { $document->addStyleSheet($style); } } $system_js = array(); $user_js = array(); $docScripts = $document->_scripts; if (count($docScripts)) { foreach ($docScripts as $key => $script) { if (strpos($key, '/media/system/') !== false) { $system_js[$key] = $script; } else { if (!is_jquery($key)) { $user_js[$key] = $script; } } } $document->_scripts = array(); } //Add all script file to page if (count($this->_scripts)) { foreach ($this->_scripts as $script) { JSNHtmlAsset::addScript($script); } if (!in_array(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'conflict.js'), $this->_scripts)) { JSNHtmlAsset::addScript(PoweradminHelper::makeUrlWithSuffix(JSN_POWERADMIN_LIB_JSNJS_URI . 'jsn.conflict.js')); } } $docScripts = $document->_scripts; $index = 0; $jsn_jquery = array(); foreach ($docScripts as $key => $script) { if ($index < 2) { $jsn_jquery[$key] = $script; } else { $user_js[$key] = $script; } $index++; } $document->_scripts = $system_js + $jsn_jquery + $user_js; //Add all custom tag to page if (count($this->_customs)) { foreach ($this->_customs as $custom) { $document->addCustomTag($custom); } } //Add all style declaration to page if (count($this->_styleDeclaration)) { $document->addStyleDeclaration(implode(PHP_EOL, $this->_styleDeclaration)); } //Add all script declaration to page if (count($this->_scriptDeclaration)) { $document->addScriptDeclaration(implode(PHP_EOL, $this->_scriptDeclaration)); } } $this->_dispatch = true; $this->__construct(); }
if (strpos($task = $input->getCmd('task', ''), '.') !== false) { list($controller, $task) = explode('.', $task, 2); } if ($controller == "updater") { $controller = "update"; } if ($controller == "configuration") { $controller = "maintenance"; JRequest::setVar('view', $controller); } if ($controller == "update" || $controller == "installer" || $controller == "upgrade") { JRequest::setVar('view', $controller); } if ($option != 'image' && $task != 'editimage') { if ($view != 'update' && $view != 'upgrade' && $view != 'about') { JHtmlBehavior::framework(true); } } // Check if all dependency is installed if ($tmpl !== 'component') { include_once JPATH_COMPONENT_ADMINISTRATOR . '/dependency.php'; } if ($controller) { $path = JPATH_COMPONENT_ADMINISTRATOR . DS . 'controllers' . DS . $controller . '.php'; if (file_exists($path)) { require_once $path; } else { $controller = ''; } } $classname = 'ImageShowController' . $controller;
function jnewsbot_content_editab($forms) { if (version_compare(JVERSION, '3.0.0', '<')) { JHTML::_('behavior.mootools'); } else { JHtmlBehavior::framework(); } $siteContent = new siteContent(); // $limit = -1; $limit = 5; $limittotal = $siteContent->countSiteCount(); $setLimit = jnews::setLimitPagination($limittotal); $action = JRequest::getVar('act', '', '', 'WORD'); $task = JRequest::getVar('task'); $contentsearch = JRequest::getVar('contentsearch', ''); echo $forms['main']; $hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />'; $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />'; $toSearch = new stdClass(); $toSearch->forms = ''; $toSearch->hidden = $hidden; $toSearch->listsearch = $contentsearch; $toSearch->id = 'contentsearch'; $app = JFactory::getApplication(); $setSort = new stdClass(); if (!isset($_POST['c_filter_order'])) { $setSort->orderValue = "a.id"; } else { $setSort->orderValue = $_POST['filter_order']; } //$setSort->orderValue = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order', 'filter_order', 'a.id', 'cmd'); $setSort->orderDir = $app->getUserStateFromRequest(JNEWS_OPTION . '.content.filter_order_Dir', 'filter_order_Dir', 'desc', 'word'); //$setSort->orderValue = "a.id"; $contentItems = jnewsbot_content_getitems($contentsearch, $setLimit, $setSort); ob_start(); $js = "function setContentTag(id, url, changeType , hide_title)\n {\n\n if(hide_title ==undefined)\n {\n var check_title = document.getElementById('hide_title_no').checked;\n if(check_title) hide_title = 0;\n else hide_title = 1;\n\n }\n\n\n\n var form = document.adminForm;\n if(!form)\n {\n form = document.mosForm;\n }\n\n if(form.content_type[2].checked === false)\n {\n document.getElementById('hide_title_yes').disabled=false;\n }\n else\n {\n document.getElementById('hide_title_no').click();\n hide_title = 0;\n document.getElementById('hide_title_yes').disabled=true;\n }\n if(id!=null)\n {\n for (i=0; i<form.content_type.length; i++)\n {\n if (form.content_type[i].checked)\n {\n var content_type = form.content_type[i].value;\n }\n }"; // if ( @include_once( JNEWSPATH_ADMIN . 'social' .DS. 'class.social.php' ) ) { if (!$GLOBALS[JNEWS . 'use_tags'] and class_exists('jNews_Social') or !$GLOBALS[JNEWS . 'use_tags'] and $GLOBALS[JNEWS . 'level'] > 2) { $js .= "\n if(changeType!=null)\n id = document.getElementById('insertbot').value;\n\n template = window.top.document.getElementById('template_id');\n templateid = template.value;\n\n var tag = id;\n if(id != 0)\n getContent(id, content_type, url,templateid);\n\n form.contenttag.value = tag;\n }\n //if id == null\n else\n {\n var tag = form.contentreplace.value;"; if (version_compare(JVERSION, '1.6.0', '<')) { //1.5 $js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}"; } else { if (version_compare(JVERSION, '3.0.0', '<')) { $js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}'; } else { $js .= 'if(window.top.insertTag(tag)) { var need_click = jQuery(window.top.document).find("div.modal-backdrop"); if(need_click.length == 0) window.parent.SqueezeBox.close(); else jQuery(window.top.document).find("div.modal-backdrop").click();}'; } } $js .= "}\n }"; } else { $js .= "\n if(changeType==null)\n form.botID.value= id;\n\n var tag = '{contentitem:' + form.botID.value + '|' + content_type +'|'+hide_title+ '}';\n\n form.contenttag.value = tag;\n }\n //if id -- null\n else\n {\n\n var tag = form.contenttag.value;"; if (version_compare(JVERSION, '1.6.0', '<')) { //1.5 $js .= " if(window.top.insertTag(tag)){window.top.document.getElementById('sbox-window').close();}"; } else { if (version_compare(JVERSION, '3.0.0', '<')) { $js .= ' if(window.top.insertTag(tag)) {window.parent.SqueezeBox.close();}'; } else { $js .= ' if(window.top.insertTag(tag)) { var need_click = jQuery(window.top.document).find("div.modal-backdrop"); if(need_click.length == 0) window.parent.SqueezeBox.close(); else jQuery(window.top.document).find("div.modal-backdrop").click();}'; } } $js .= "}\n }"; } //end function if (version_compare(JVERSION, '1.6.0', '<')) { //1.5 $js .= "\n\n \t\t\tfunction getContent(id, content_type, url, templateid){\n\n \t\t\t\tvar ajax = new Ajax(url,\n \t\t\t\t\t{data: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n \t\t\t\t\tmethod: 'POST',\n \t\t\t\t\tonComplete : function(result){insertContent(result, id); }\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t\tajax.request();\n \t\t\t}"; } else { $js .= "\n \t\t\tfunction getContent(id, content_type, url,templateid){\n\n\t\t\t\tvar ajax = new Request({\n\t\t\t\turl : url,\n\t\t\t\tdata: 'artId='+id+'&content_type='+content_type+'&templateid='+templateid,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tonComplete : function(result){insertContent(result, id); }\n\t\t\t\t});\n\t\t\t\tajax.send();\n \t\t\t}"; } $js .= "\n \t\t\tfunction insertContent(html, id){\n\t\t\t\tvar form = document.adminForm;\n\t\t\t\tif(!form){\n\t\t\t\t\tform = document.mosForm;\n\t\t\t\t}\n\n\t\t\t\tvar root = document.createElement('div');\n\n\t\t\t\troot.innerHTML = html;\n\t\t\t\tvar body = document.getElementsByTagName('body')[0].appendChild(root);\n\n\t\t\t\troot.setAttribute(\"style\", \"width:150px; display:none\");\n\t\t\t\tvar element = document.getElementById('artcontent_'+id);\n\n\t\t\t\tform.contentreplace.value = element.innerHTML;\n\n\t\t\t\tdocument.getElementsByTagName('body')[0].removeChild(root);\n\t\t\t}\n\t\t\t"; $url = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=mailing&task=articleContent', false, false, true); $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); ?> <style type="text/css"> table.smartcontent { border: 1px solid #D5D5D5; background-color: #F6F6F6; width: 100%; margin-bottom: 10px; -moz-border-radius:3px; -webkit-border-radius:3px; padding: 5px; } table.smartcontent td.key { background-color: #f6f6f6; text-align: left; width: 140px; color: #666; font-weight: bold; border-bottom: 1px solid #e9e9e9; border-right: 1px solid #e9e9e9; } </style> <div id="element-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <!--<form name="adminForm" method="post" action="index.php?option=<?php echo JNEWS_OPTION; ?> &tmpl=component">--> <table class="smartcontent" width="100%""> <tr> <td width="185" class="key"> <span class="editlinktip"> <?php $tip = _JNEWS_AUTONEWS_TYPE_TIPS; $title = _JNEWS_AUTONEWS_TYPE; echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td style="vertical-align: top;"> <span class="editlinktip"> <?php $tip = _JNEWS_TITLE_ONLY_TIPS; $title = _JNEWS_TITLE_ONLY; $title_only = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>"; $tip = _JNEWS_INTRO_ONLY_TIPS; $title = _JNEWS_INTRO_ONLY; $intro_only = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>"; $tip = _JNEWS_FULL_ARTICLE_TIPS; $title = _JNEWS_FULL_ARTICLE; $full_article = "<span class=\"editlinktip\">" . jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0) . "</span>"; // $tip = _JNEWS_HIDE_TITTLE_ARTICLE_TIPS; // $title = _JNEWS_HIDE_TITLE ; // $hide_title = "<span class=\"editlinktip\">" . jNews_Tools::toolTip( $tip, '', 280, 'tooltip.png', $title, '', 0 ) . "</span>"; ?> </span> <span class="editlinktip"> <input id="content_type" type="radio" name="content_type" value="0" checked="checked" onclick="setContentTag(1,'<?php echo $url; ?> ', 0);"/><?php echo $full_article; ?> <input id="content_type" type="radio" name="content_type" value="1" onclick="setContentTag(1, '<?php echo $url; ?> ', 1);"/><?php echo $intro_only; ?> <input id="content_type" type="radio" name="content_type" value="2" onclick="setContentTag(1, '<?php echo $url; ?> ', 2);"/><?php echo $title_only; ?> <!--<input id="content_type" type="radio" name="content_type" value="3" onclick="setContentTag(1, '<?php //echo $url ?> ', 3);"/><?php //echo $hide_title; ?> --> </span> </td> <td rowspan="2"> <input onclick="setContentTag(null,'<?php echo $url; ?> ')" class="inserttag" type="button" label="Insert Content" name="Insert Content" value="Insert Content"/> </td> </tr> <tr> <td width="185" class="key"> <span class="editlinktip"> <?php $tip = _JNEWS_CONTENT_TIP; $title = _JNEWS_CONTENT_ID; echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td style="vertical-align: top;"> <!-- <input type="text" onchange="setCaptionTags();" size="60px" name="jnewstagcaption"> --> <input id="insertbot" type="text" size="20px" name="contenttag" value="0"/> </td> </tr> <tr> <td colspan="2"> <input id="insertbot" type="hidden" size="60px" name="contentreplace" /> </td> </tr> <tr> <td colspan="2"> <input id="botID" size="10px" name="botID" value="0" type="hidden"/> </td> </tr> <tr> <td width="185" class="key"> <span class="editlinktip"> <?php $tip = _JNEWS_HIDE_TITTLE_ARTICLE_TIPS; $title = _JNEWS_HIDE_TITLE; echo jNews_Tools::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td style="vertical-align: top;"> <input id="hide_title_no" onclick="setContentTag(1, '<?php echo $url; ?> ', 2, 0);" type="radio" name="hide_title" value="0" checked="checked" /><?php echo 'No'; ?> <input id="hide_title_yes" onclick="setContentTag(1, '<?php echo $url; ?> ', 2, 1);" type="radio" name="hide_title" value="1" /><?php echo 'Yes'; ?> </td> </tr> </table> <div id="element-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m" style="position:relative;"> <?php echo jnews::setTop($toSearch, null); $select_cat = version_compare(JVERSION, '1.6.0', '<') ? 'SELECT CATEGORY' : 'JOPTION_SELECT_CATEGORY'; ?> <div style="position:absolute;top:5px; left:55%;"> <?php $sort_select = JRequest::getVar('filter_category_id', '', 'POST', 'int'); ?> <select name="filter_category_id" class="inputbox" onchange="this.form.submit()"> <option value=""><?php echo JText::_($select_cat); ?> </option> <?php if (version_compare(JVERSION, '1.6.0', '<')) { echo getCatListFromJoomla15($sort_select); } else { echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $sort_select); } ?> </select> </div> <!-- border: 1px solid #CCCCCC;--> <table class="joobilist" cellpadding="0" cellspacing="0"> <tbody> <thead> <tr> <th class="title"> <?php if ($setSort->orderDir == 'asc') { $new_sort = "desc"; } else { $new_sort = "asc"; } ?> <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.title','<?php echo $new_sort; ?> ', 'content');" href="#"> <?php echo JText::_(_JNEWS_TAGPICKLIST_TITLE); ?> <?php if ($setSort->orderValue == 'a.title') { ?> <i class="icon-arrow-<?php echo $new_sort == "asc" ? "up" : "down"; ?> "></i><?php } ?> </a> <?php //echo _JNEWS_TAGPICKLIST_TITLE; // echo jnews::HTML_GridSort(_JNEWS_TAGPICKLIST_TITLE, 'a.title', $setSort->orderDir, $setSort->orderValue); ?> </th> <th width="80px" class="title"> <?php //echo _JNEWS_TAG_ARTICLESECTION; if (version_compare(JVERSION, '1.6.0', '<')) { //j15 echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLESECTION, 'b.title', $setSort->orderDir, $setSort->orderValue); } else { ?> <?php if ($setSort->orderDir == 'asc') { $new_sort = "desc"; } else { $new_sort = "asc"; } ?> <a class="hasTip" title="" onclick="Joomla.tableOrdering('c.title_2','<?php echo $new_sort; ?> ', 'content');" href="#"> <?php echo JText::_(_JNEWS_TAG_ARTICLESECTION); ?> <?php if ($setSort->orderValue == 'c.title_2') { ?> <i class="icon-arrow-<?php echo $new_sort == "asc" ? "up" : "down"; ?> "></i><?php } ?> </a> <!-- echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLESECTION, 'b.title', $setSort->orderDir, $setSort->orderValue);--> <?php } ?> </th> <th width="80px" class="title"> <?php if ($setSort->orderDir == 'asc') { $new_sort = "desc"; } else { $new_sort = "asc"; } ?> <a class="hasTip" title="" onclick="Joomla.tableOrdering('c.title','<?php echo $new_sort; ?> ', 'content');" href="#"> <?php echo JText::_(_JNEWS_TAG_ARTICLECATEGORY); ?> <?php if ($setSort->orderValue == 'c.title') { ?> <i class="icon-arrow-<?php echo $new_sort == "asc" ? "up" : "down"; ?> "></i><?php } ?> </a> <?php //echo _JNEWS_TAG_ARTICLECATEGORY; // echo jnews::HTML_GridSort(_JNEWS_TAG_ARTICLECATEGORY, 'c.title', $setSort->orderDir, $setSort->orderValue); ?> </th> <th width="30px" class="title"> <?php if ($setSort->orderDir == 'asc') { $new_sort = "desc"; } else { $new_sort = "asc"; } ?> <a class="hasTip" title="" onclick="Joomla.tableOrdering('a.id','<?php echo $new_sort; ?> ', 'content');" href="#"> ID <?php if ($setSort->orderValue == 'a.id') { ?> <i class="icon-arrow-<?php echo $new_sort == "asc" ? "up" : "down"; ?> "></i><?php } ?> </a> <?php //echo jnews::HTML_GridSort('ID', 'a.id', $setSort->orderDir, $setSort->orderValue, 'task'); ?> </th> </tr> </thead> <?php if (sizeof($contentItems) > 0) { $k = 0; foreach ($contentItems as $contentItem) { if (empty($contentItem->section)) { $contentItem->section = JText::_('Uncategorised'); } if (empty($contentItem->category)) { $contentItem->category = JText::_('Uncategorised'); } echo '<tr style="cursor:pointer" class="row' . $k . '" onclick="setContentTag(\'' . $contentItem->id . '\',\'' . $url . '\');" ><td>' . $contentItem->title . '</td><td nowrap="nowrap" align="center">' . $contentItem->section . '</td><td nowrap="nowrap" align="center">' . $contentItem->category . '</td><td nowrap="nowrap" align="center">' . $contentItem->id . '</td></tr>'; //echo '<tr style="cursor:pointer" class="row'.$k.'" onclick="setContentTag(\''.$contentItem->id.'\',\''.$url.'\');" ><td>'.$contentItem->title.'</td><td nowrap="nowrap" align="center">'.$contentItem->section.'</td><td nowrap="nowrap" align="center">'.$contentItem->category.'</td><td nowrap="nowrap" align="center">'.$contentItem->id.'</td></tr>'; $k = 1 - $k; } } ?> </tbody> </table> <?php echo jnews::setPaginationBot($setLimit, 'margin:auto;'); ?> <input type="hidden" value="<?php echo JNEWS_OPTION; ?> " name="option"/> <input type="hidden" value="<?php echo $action; ?> " name="act"/> <input type="hidden" value="<?php echo $task; ?> " name="task"/> <input type="hidden" value="<?php echo $setSort->orderValue; ?> " name="c_filter_order"/> <input type="hidden" value="<?php echo $setSort->orderValue; ?> " name="filter_order"/> <input type="hidden" value="<?php echo $setSort->orderDir; ?> " name="filter_order_Dir"/> </form> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <?php $return = ob_get_contents(); ob_end_clean(); return array(_JNEWS_CONTENT_ITEM, $return); }
protected function getTooltip($currentDay, $linkattr) { $tooltip = ""; if (!isset($currentDay["events"]) || !is_array($currentDay["events"]) || count($currentDay["events"]) == 0) { return $tooltip; } // load core and extra mootools JHTML::_('behavior.framework'); JHtmlBehavior::framework(); JHtmlBehavior::framework(true); foreach ($currentDay["events"] as $event) { $link = $event->viewDetailLink($event->yup(), $event->mup(), $event->dup(), true, $this->myItemid); //JRoute::_('index.php?option='.$jev_component_name.'&Itemid='.$this->myItemid.$this->cat.'&task=icalrepeat.detail'; $tooltip .= "<a href='" . $link . "'>" . $event->title() . "</a><br/>"; } $tooltip .= "<hr class='jev-click-to-open'/><small class='jev-click-to-open'>" . JText::_("JEV_EVENTS_CLICK_EVENT_FOR_MORE_DETAILS", true) . "</small>"; $tipTitle = '<div class="jevtt_title" >' . JText::_("JEV_EVENTS_THIS_DAY", true) . '</div>'; $tipText = '<div class="jevtt_text">' . $tooltip . '</div>'; $tooltip = htmlspecialchars($tipTitle . $tipText, ENT_QUOTES); $link = $this->htmlLinkCloaking($currentDay["link"], $currentDay['d'], $linkattr); $tooltip = '<span class="editlinktip hasjevtip" title="' . $tooltip . '" >' . $link . '</span>'; static $script; if (!isset($script)) { $script = true; JevHtmlBootstrap::popover('.hasjevtip', array("trigger" => "hover focus", "placement" => "top", "container" => "body", "delay" => array("hide" => 150))); } return $tooltip; }
protected function getInput() { jimport('joomla.filesystem.folder'); $invalue = str_replace(" ", "", $this->value); $invalue = explode(",", $invalue); $pluginsDir = JPATH_ROOT . '/plugins/jevents'; $filterpath = $pluginsDir . "/filters"; $this->filterpath = array(); if (JFolder::exists($filterpath)) { $this->filterpath[] = $filterpath; } $this->filterpath[] = JPATH_SITE . "/components/com_jevents/libraries/filters"; if (JFolder::exists(JPATH_SITE . "/plugins/jevents")) { $others = JFolder::folders(JPATH_SITE . "/plugins/jevents", 'filters', true, true); if (is_array($others)) { $this->filterpath = array_merge($this->filterpath, $others); } } $filters = array(); include_once JPATH_SITE . "/components/com_jevents/libraries/filters.php"; foreach ($this->filterpath as $path) { foreach (JFolder::files($path, ".php") as $filtername) { if (!array_key_exists($filtername, $filters)) { if (strpos($filtername, "-") > 0 || strpos($filtername, ".zip") > 0 || strpos($filtername, ".php") != strlen($filtername) - 4) { continue; } $filterpath = $path . "/" . $filtername; $filtername = substr($filtername, 0, strlen($filtername) - 4); // skip special function filters if ($filtername == "startdate" || $filtername == "Startdate") { continue; } $filter = "jev" . ucfirst($filtername) . "Filter"; if (!class_exists($filter)) { include_once $filterpath; } if (!class_exists($filter)) { continue; } $filters[$filtername] = $path . "/" . $filter; } } } $validvalues = array(); $input = '<div style="clear:left"></div><table><tr valign="top"> <td><div style="font-weight:bold">' . JText::_("JEV_CLICK_TO_ADD_FILTER") . '</div> <div id="filterchoices" style="width:150px;margin-top:10px;height:100px;;border:solid 1px #ccc;overflow-y:auto" >'; foreach ($filters as $filter => $filterpath) { if (!in_array($filter, $invalue) && !in_array(strtolower($filter), $invalue)) { $input .= '<div>' . $filter . "<span style='display:none'>{$filter}</span></div>"; $validvalues[] = $filter; } } $validvalue = implode(",", $validvalues); $input .= '</div></td> <td><div style="font-weight:bold">' . JText::_("JEV_FILTER_CLICK_TO_REMOVE") . '</div> <div id="filtermatches" style="margin:10px 0px 0px 10px;">'; $invalues = array(); foreach ($invalue as $filter) { if (array_key_exists($filter, $filters) || array_key_exists(ucfirst($filter), $filters)) { $filter = ucfirst($filter); $input .= '<div id="filter' . $filter . '">' . $filter . "</div>"; $invalues[] = $filter; } } $invalues = implode(",", $invalues); $input .= '</div></td> </tr></table>'; // load core and extra mootools JHTML::_('behavior.framework'); JHtmlBehavior::framework(); JHtmlBehavior::framework(true); JEVHelper::script('modules/mod_jevents_filter/fields/filterSelect.js'); // Initialize some field attributes. $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : ''; $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : ''; $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : ''; // Initialize JavaScript field attributes. $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; return $input . '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>'; }
/** * <p>public static function to create the view of the template list where the user can assign a template to a newsletter.</p> * @param mixed $templates - the array object list of templates in the database */ public static function assignTemplate($templates, $forms, $setLimit, $templatesearch) { if (version_compare(JVERSION, '3.0.0', '<')) { JHTML::_('behavior.modal'); } else { JHtml::_('behavior.modal'); } if (version_compare(JVERSION, '3.0.0', '<')) { JHTML::_('behavior.mootools'); } else { JHtmlBehavior::framework(); } $action = JRequest::getString('act', '', 'request'); $js = "function assignTemplate(templateid){var templatebody = window.document.getElementById('templatebody_'+templateid).innerHTML;\n\t \tvar templatealtbody = window.document.getElementById('templatealtbody_'+templateid).innerHTML;\n\t \twindow.top.changeTemplate(templatebody, templatealtbody,templateid);"; if (version_compare(JVERSION, '1.6.0', '<')) { //1.5 $js .= " window.top.document.getElementById('sbox-window').close();"; } else { if (version_compare(JVERSION, '3.0.0', '<')) { $js .= " window.parent.SqueezeBox.close();"; } else { $js .= 'jQuery(window.top.document).find("div.modal-backdrop").click();'; } } $js .= "}"; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); ?> <style type="text/css"> div#pagination { background-color: #006699; margin: auto; padding: 0 8px; color: #FFFFFF; } div.template-container { border-bottom: 1px dotted #000000; padding: 5px; margin-top: 10px; float: left; width: 596px; cursor:pointer; } div.template-container:hover { background-color: #CCFFFF; } div.template-container div#image { float:left; margin-right: 5px; } div.template-container div#name { clear: right; border: 1px solid #000; font-weight: bold; font-size: 1.2em; } div.template-container div#description { margin-top: 5px; } </style> <?php echo $forms['main']; ?> <div id="pagination"> <?php // for search $limit = -1; $hidden = '<input type="hidden" name="limit" value="' . $limit . '" />'; $toSearch = new stdClass(); //$toSearch->forms = ''; $toSearch->hidden = $hidden; $toSearch->listsearch = $templatesearch; $toSearch->id = 'templatesearch'; //echo jnews::setTop($toSearch, null, $setLimit, null, true); echo jnews::setTop($toSearch, null); ?> </div> <?php foreach ($templates as $countMeNow => $template) { if ($template->availability == 1 && $template->published == 1) { if (empty($template->thumbnail)) { $template->thumbnail = 'sample-image.png'; } $findposhttp = strpos($template->thumbnail, 'http://'); $findposwww = strpos($template->thumbnail, 'www.'); if ($findposhttp === false || $findposwww === false) { $path = $template->thumbnail; $img = '<img src="' . $path . '" alt="' . $template->name . '">'; } else { $path = $template->thumbnail; $img = '<img src="' . $path . '" alt="' . $template->name . '">'; } ?> <div class="template-container" onclick="assignTemplate(<?php echo $template->template_id; ?> );"> <div id="image"><?php echo $img; ?> </div> <div id="name" style="text-indent:10px"><?php echo $template->name; ?> </div> <div id="description" style="text-indent:25px" ><?php echo jnews::stringTruncate($template->description, 400, ".", "..."); ?> </div> <div id="templatebody_<?php echo $template->template_id; ?> " style="display:none;"><?php echo $template->body; ?> </div> <div id="templatealtbody_<?php echo $template->template_id; ?> " style="display:none;"><?php echo $template->altbody; ?> </div> </div> <?php } } $css = 'margin:auto;'; echo jnews::setPaginationBot($setLimit, $css); ?> <input type="hidden" value="<?php echo JNEWS_OPTION; ?> " name="option"/> <input type="hidden" value="<?php echo $action; ?> " name="act"/> <input type="hidden" value="assign" name="task"/> <input type="hidden" value="0" name="boxchecked" id="boxcount"/> </form> <?php }
/** * Method to load the MooTools & More framework into the document head * * If debugging mode is on an uncompressed version of MooTools is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return AssetManager Return self to support chaining. */ public function mootools($debug = null) { \JHtmlBehavior::framework(true, $debug); return $this; }
public function onContentPrepare($context, &$row, &$params, $page = 0) { if (is_file(JPATH_ADMINISTRATOR . '/components/com_imageshow/classes/jsn_is_factory.php')) { include_once JPATH_ADMINISTRATOR . '/components/com_imageshow/classes/jsn_is_factory.php'; } else { return; } if ($this->_application->isAdmin()) { return; } JPlugin::loadLanguage('plg_content_imageshow', JPATH_BASE); $dispatcher = JDispatcher::getInstance(); $objUtils = JSNISFactory::getObj('classes.jsn_is_utils'); $objJSNShow = JSNISFactory::getObj('classes.jsn_is_show'); $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase'); $objJSNShowlist = JSNISFactory::getObj('classes.jsn_is_showlist'); $objJSNImages = JSNISFactory::getObj('classes.jsn_is_images'); $coreData = $objUtils->getComponentInfo(); $coreInfo = json_decode($coreData->manifest_cache); preg_match_all('/\\{imageshow (.*)\\/\\}/U', $row->text, $matches, PREG_SET_ORDER); $paramsCom = $this->_application->getParams('com_imageshow'); $language = ''; $shortEdition = $objUtils->getShortEdition(); if ($objUtils->checkSupportLang()) { $objLanguage = JFactory::getLanguage(); $language = $objLanguage->getTag(); } $display = false; $authAvailable = $this->_user->getAuthorisedViewLevels(); if (count($matches)) { for ($i = 0, $counti = count($matches); $i < $counti; $i++) { $data = explode(' ', $matches[$i][1]); $width = ''; $height = ''; $html = ''; $showListID = 0; $showCaseID = 0; foreach ($data as $values) { $value = $values; if (stristr($values, 'sl')) { $showListValue = explode('=', $values); $showListID = $showListValue[1]; } elseif (stristr($values, 'sc')) { $showCaseValue = explode('=', $values); $showCaseID = $showCaseValue[1]; } elseif (stristr($values, 'w')) { $widthValue = explode('=', $values); $width = str_replace($values, $widthValue[1], $values); } elseif (stristr($values, 'h')) { $heightValue = explode('=', $values); $height = str_replace($values, $heightValue[1], $values); } } $showlistInfo = $objJSNShowlist->getShowListByID($showListID); if (is_null($showlistInfo)) { $missingDataBox = $objUtils->displayShowlistMissingMessage(); $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", $missingDataBox, $row->text); } $showcaseInfo = $objJSNShowcase->getShowCaseByID($showCaseID); if (is_null($showcaseInfo)) { $missingDataBox = $objUtils->displayShowcaseMissingMessage(); $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", $missingDataBox, $row->text); } $themeProfile = false; if ($showcaseInfo) { $objJSNTheme = JSNISFactory::getObj('classes.jsn_is_showcasetheme'); $themeProfile = $objJSNTheme->getThemeProfile($showcaseInfo->showcase_id); } if (!$themeProfile) { $missingDataBox = $objUtils->displayThemeMissingMessage(); $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", $missingDataBox, $row->text); } if (!is_null($showcaseInfo) && !is_null($showlistInfo) && $themeProfile) { $themeInfo = $objJSNTheme->getThemeInfo($themeProfile->theme_name); $editionVersion = '<!-- ' . @$coreInfo->description . ' ' . @$coreInfo->version . ' - ' . @$themeInfo->name . ' ' . @$themeInfo->version . ' -->'; if ($width != '') { $width = $width; } else { $width = @$showcaseInfo->general_overall_width; } if ($height != '') { $height = $height; } else { $height = @$showcaseInfo->general_overall_height; } $articleAuth = $objJSNShow->getArticleAuth($showListID); $imagesData = $objJSNImages->getImagesByShowlistID($showlistInfo['showlist_id']); if (!in_array($showlistInfo['access'], $authAvailable)) { $display = false; } else { $display = true; } if ($width == '') { $width = '100%'; } if ($height == '') { $height = '100'; } $posPercentageWidth = strpos($width, '%'); if ($posPercentageWidth) { $width = substr($width, 0, $posPercentageWidth + 1); } else { $width = (int) $width; } $height = (int) $height; $object = new stdClass(); $object->width = $width; $object->height = $height; $object->showlist_id = $showListID; $object->showcase_id = $showCaseID; $object->item_id = 0; $object->random_number = $objUtils->randSTR(8); $object->language = $language; $object->edition = $shortEdition; $object->images = $imagesData; $object->showlist = $showlistInfo; $object->showcase = $showcaseInfo; $object->theme_id = $themeProfile->theme_id; $object->theme_name = $themeProfile->theme_name; $object->plugin = true; $html .= $editionVersion; $html .= '<div class="jsn-container">'; $html .= '<div class="jsn-gallery">'; $result = $objJSNTheme->displayTheme($object); if ($result !== false) { $html .= $result; } $html .= '</div>'; $html .= '</div>'; if ($display) { $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", $html, $row->text); } else { if ($showlistInfo['authorization_status']) { $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", '<div>' . $articleAuth['introtext'] . $articleAuth['fulltext'] . '</div>', $row->text); } else { $row->text = str_replace("{imageshow " . $matches[$i][1] . "/}", ' ', $row->text); } } } } } preg_match_all('/\\{imageshow (.*)\\}(.*)\\{\\/imageshow\\}/U', $row->text, $matchesLink, PREG_SET_ORDER); if (count($matchesLink)) { for ($z = 0; $z < count($matchesLink); $z++) { $dataLink = explode(' ', $matchesLink[$z][1]); $width = ''; $height = ''; $showCaseID = 0; $showListID = 0; foreach ($dataLink as $values) { $value = $values; if (stristr($values, 'sl')) { $showListValue = explode('=', $values); $showList = str_replace($values, 'showlist_id=' . $showListValue[1], $values); $showListID = $showListValue[1]; } elseif (stristr($values, 'sc')) { $showCaseValue = explode('=', $values); $showCase = str_replace($values, 'showcase_id=' . $showCaseValue[1], $values); $showCaseID = $showCaseValue[1]; } elseif (stristr($values, 'w')) { $widthValue = explode('=', $values); $width = str_replace($values, $widthValue[1], $values); } elseif (stristr($values, 'h')) { $heightValue = explode('=', $values); $height = str_replace($values, $heightValue[1], $values); } } $showlistInfo = $objJSNShowlist->getShowListByID($showListID); $showcaseInfo = $objJSNShowcase->getShowCaseByID($showCaseID, true, 'loadAssoc'); if ($width != '') { $width = $width; } else { $width = $showcaseInfo['general_overall_width']; } if ($height != '') { $height = $height; } else { $height = $showcaseInfo['general_overall_height']; } if (strpos($width, '%')) { $width = '650'; } $width = (int) $width; $height = (int) $height; $sefRewrite = JFactory::getConfig()->get('sef_rewrite'); $link = $sefRewrite ? '' : 'index.php'; $link .= '?option=com_imageshow&tmpl=component&view=show&' . $showList . '&' . $showCase . '&w=' . $width . '&h=' . $height; $html = '<a rel="{handler: \'iframe\', size: {x: ' . $width . ', y: ' . $height . '}}" href="' . $link . '" class="modal">' . $matchesLink[$z][2] . '</a>'; $row->text = str_replace("{imageshow " . $matchesLink[$z][1] . "}" . $matchesLink[$z][2] . "{/imageshow}", $html, $row->text); } } if (count($matchesLink) || count($matches)) { JHtmlBehavior::framework(); JHTML::_('behavior.modal', 'a.modal'); } return true; }
/** * Add JS to head. * * @return void */ public function addFieldJs() { JHtmlBehavior::framework(true); $asset = $this->container->get('helper.asset'); $input = $this->container->get('input'); $asset->addJS('cck/fields.js', $input->get('option')); }
<?php /** * @version SVN: <svn_id> * @package Quick2cart * @author Techjoomla <*****@*****.**> * @copyright Copyright (c) 2009-2015 TechJoomla. All rights reserved. * @license GNU General Public License version 2 or later. */ // No direct access defined('_JEXEC') or die; //jimport('joomla.form.formvalidator'); jimport('joomla.html.pane'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior.tooltip'); JHtmlBehavior::framework(); jimport('joomla.html.parameter'); JToolBarHelper::back(JText::_('QTC_HOME'), 'index.php?option=com_quick2cart'); JToolBarHelper::save($task = 'saveCoupon', $alt = JText::_('QTC_SAVE')); JToolBarHelper::cancel($task = 'cancelcoupon', $alt = JText::_('QTC_CLOSE')); //added by aniket $entered_numerics = "'" . JText::_('QTC_ENTER_NUMERICS') . "'"; // added by sj ?> <script src="<?php echo JUri::root() . 'administrator/components/com_quick2cart/assets/js/geo/jquery-1.7.2.js'; ?> "></script> <script src="<?php echo JUri::root() . 'administrator/components/com_quick2cart/assets/js/geo/jquery.ui.core.js'; ?>
/** * Tests the framework method. * * @param string $expected @todo * @param boolean $extras @todo * @param boolean $debug @todo * * @return void * * @since 3.1 * @dataProvider getFrameworkData */ public function testFramework($expected, $extras = false, $debug = null) { JHtmlBehavior::framework($extras, $debug); $this->assertEquals($expected, JHtmlBehaviorInspector::getLoaded(), 'The framework behavior is not loaded with all expected dependencies'); }