public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get model and update context with current $model = ShlMvcModel_Base::getInstance('urls', 'Sh404sefModel'); $context = $model->setContext($this->_context . '.' . $this->getLayout()); // display type: simple for very large sites/slow slq servers $sefConfig = Sh404sefFactory::getConfig(); // store it $model = $this->setModel($model, true); // read data from model $list = $model->getList((object) array('layout' => $this->getLayout(), 'getMetaData' => true, 'simpleUrlList' => true, 'slowServer' => $sefConfig->slowServer)); // and push it into the view for display $this->assign('items', $list); $this->assign('itemCount', count($this->items)); $this->assign('contentcs', Sh404sefHelperGeneral::getDataMD5($this->items, array('metatitle', 'metadesc'))); $this->assign('pagination', $model->getPagination((object) array('layout' => $this->getLayout(), 'simpleUrlList' => true, 'slowServer' => $sefConfig->slowServer))); $options = $model->getDisplayOptions(); $this->assign('options', $options); $this->assign('helpMessage', JText::_('COM_SH404SEF_META_HELP')); if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // add our own css and js JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css'); JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/shajax.js'); JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/j3.js'); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // variable for modal, not used in 3..x+ $params = array(); $this->_addFilters(); // render submenu sidebar $this->sidebar = Sh404sefHelperHtml::renderSubmenu(); } else { // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_urls.css'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js'); JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/metas.js'); // add behaviors and styles as needed $modalSelector = 'a.modalediturl'; $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) {parent.window.location=\'' . $this->defaultRedirectUrl . '\';window.parent.shReloadModal=true}}'; $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js); Sh404sefHelperHtml::modal($modalSelector, $params); $this->assign('optionsSelect', $this->_makeOptionsSelect($options)); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css'); } // build the toolbar $toolbarMethod = '_makeToolbar' . ucfirst($this->getLayout() . ucfirst($this->joomlaVersionPrefix)); if (is_callable(array($this, $toolbarMethod))) { $this->{$toolbarMethod}($params); } // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get model and update context with current $model = $this->getModel(); $context = $model->updateContext($this->_context . '.' . $this->getLayout()); // get url id $notFoundUrlId = JRequest::getInt('notfound_url_id'); // read url data from model. This is the 404 request we want to // redirect to something else // must be called before model->getList() $url = $model->getUrl($notFoundUrlId); // and push url into the template for display $this->assign('url', $url); // attach data, according to specific layout requested if ($this->getLayout() == 'default') { $this->_attachDataDefault(); } if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css'); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // variable for modal, not used in 3..x+ $params = array(); if ($this->getLayout() == 'default') { // add display filters $this->_addFilters(); } } else { // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_urls.css'); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/notfound.js'); // add behaviors and styles as needed $modalSelector = 'a.modalediturl'; $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) {parent.window.location=\'' . $this->defaultRedirectUrl . '\';window.parent.shReloadModal=true}}'; $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js); Sh404sefHelperHtml::modal($modalSelector, $params); $this->assign('optionsSelect', $this->_makeOptionsSelect($options)); // add confirmation phrase to toolbar $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_NOT_FOUND_SELECT_REDIRECT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title')); $this->_makeToolbarDefaultJ2($params); } // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // prepare the view, based on layout $method = '_makeView' . ucfirst($this->getLayout()); if (is_callable(array($this, $method))) { $this->{$method}(); } JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css'); parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); $layout = $this->getLayout(); switch ($layout) { case 'qcontrol': $this->_doQuickControl($this->joomlaVersionPrefix); break; default: $this->_doDefault($tpl); break; } }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get action $this->task = empty($this->task) ? 'delete' : $this->task; if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/j3_list.css'); if (!empty($this->redirectTo) && !empty($this->message)) { // redirecting to parent page, but there's a message // let's enqueue it, so it's displayed after the redirect JFactory::getApplication()->enqueueMessage($this->message); } } else { // J2 // if redirecting to another page, we need to simply send some javascript // to : a / close the popup, b / redirect the parent page to where we // want to go if (!empty($this->redirectTo)) { $js = 'window.addEvent( \'domready\', function () { setTimeout( \'shRedirectTo()\', 2000); }); function shRedirectTo() { parent.window.location="' . $this->redirectTo . '"; window.parent.SqueezeBox.close(); } '; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); } else { // build the toolbar $toolBar = $this->_makeToolbar(); $this->assignRef('toolbar', $toolBar); // add confirmation phrase to toolbar $this->assign('toolbarTitle', '<div class="headerconfirm" >' . JText::_('COM_SH404SEF_CONFIRM_TITLE') . '</div>'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/edit.js'); } // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/confirm.css'); } // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); $layout = JRequest::getCmd('layout', 'default'); switch ($layout) { case 'secstats': $this->_doSecStats($tpl); break; case 'updates': $this->_doUpdates($tpl); break; default: $this->_doDefault($tpl); break; } }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get model and update context with current $model = $this->getModel(); $context = $model->updateContext($this->_context . '.' . $this->getLayout()); // read data from model $list = $model->getList((object) array('layout' => $this->getLayout(), 'simpleUrlList' => true)); // and push it into the view for display $this->assign('items', $list); $this->assign('itemCount', count($this->items)); $this->assign('pagination', $model->getPagination()); $options = $model->getDisplayOptions(); $this->assign('options', $options); $this->assign('mainUrl', $model->getMainUrl()); if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css'); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // add display filters $this->_addFilters(); // render submenu sidebar $this->sidebar = JHtmlSidebar::render(); } else { // add confirmation phrase to toolbar $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_DUPLICATE_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title')); // build the toolbar $this->_makeToolbarJ2(); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_urls.css'); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js'); $this->assign('optionsSelect', $this->_makeOptionsSelect($options)); } // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/list.js'); // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // build the toolbar $this->toolbar = $this->_makeToolbarJ3(); } else { // J2 // if redirecting to another page, we need to simply send some javascript // to : a / close the popup, b / redirect the parent page to where we // want to go // push a title $this->assign('stepTitle', $this->pageTitle); if (!empty($this->redirectTo)) { $document = JFactory::getDocument(); if (!empty($this->redirectTo)) { $js = 'window.addEvent( \'domready\', function () { setTimeout( \'shRedirectTo()\', 100); }); function shRedirectTo() { parent.window.location="' . $this->redirectTo . '"; } '; $document->addScriptDeclaration($js); } } else { // build the toolbar $toolbar = $this->_makeToolbarJ2(); $this->assignRef('toolbar', $toolbar); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/wizard.css'); } // collect any error $this->errors = $this->getErrors(); } // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // prepare the view, based on request // do we force reading updates from server ? $options = Sh404sefHelperAnalytics::getRequestOptions(); // push display options into template $this->assign('options', $options); // call report specific methods to get data $method = '_makeView' . ucfirst($options['report']); if (is_callable(array($this, $method))) { $this->{$method}($tpl); } // flag to know if we should display placeholder for ajax fillin $this->assign('isAjaxTemplate', false); parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get model and update context with current $model = $this->getModel(); $context = $model->updateContext($this->_context . '.' . $this->getLayout()); // get url id $notFoundUrlId = JRequest::getInt('notfound_url_id'); // read url data from model $url = $model->getUrl($notFoundUrlId); // and push url into the template for display $this->assign('url', $url); if (version_compare(JVERSION, '3.0', 'ge')) { // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // add title JToolbarHelper::title('sh404SEF: ' . JText::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT')); // CSS JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/configuration.css'); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/j3_list.css'); // add tooltips // @TODO replace with a viable jQuery equivalent JHTML::_('behavior.tooltip'); } else { // build the toolbar $toolBar = $this->_makeToolbar(); $this->assignRef('toolbar', $toolBar); // add title. $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title')); // add tooltips JHTML::_('behavior.tooltip'); } // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/' . $this->joomlaVersionPrefix . '_edit.js'); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_editurl.css'); // now display normally parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); if ($this->getLayout() != 'close') { // get model $model = $this->getModel(); // ask for the form $this->form = $model->getForm(); // prepare layouts objects, to be used by sub-layouts $this->layoutRenderer = array(); $this->layoutRenderer['default'] = new ShlMvcLayout_File('com_sh404sef.configuration.fields.default', sh404SEF_LAYOUTS); $this->layoutRenderer['shlegend'] = new ShlMvcLayout_File('com_sh404sef.configuration.fields.legend', sh404SEF_LAYOUTS); $this->layoutRenderer['Rules'] = new ShlMvcLayout_File('com_sh404sef.configuration.fields.rules', sh404SEF_LAYOUTS); if (version_compare(JVERSION, '3.0', 'ge')) { ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/j3_list.css'); } } parent::display($this->joomlaVersionPrefix); }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // get model and update context with current $model = $this->getModel(); $context = $model->updateContext($this->_context . '.' . $this->getLayout()); // get url id $cid = JRequest::getVar('cid', array(0), 'default', 'array'); $cid = intval($cid[0]); // get home page flag, and make sure id is 0 if editing home data $home = JRequest::getInt('home'); if ($home == 1) { $cid = 0; } $this->assign('home', $home); // optional starting pane in case of tabbed edition $startOffset = JRequest::getInt('startOffset', 0); $this->assign('startOffset', $startOffset); // read url data from model $url = $model->getById($cid); // if editing home, set home url if ($this->home == 1) { $url->set('newurl', sh404SEF_HOMEPAGE_CODE); } // controllers may forbid to edit sef or non-sef urls $noUrlEditing = empty($this->noUrlEditing) ? false : $this->noUrlEditing; $this->assign('noUrlEditing', $noUrlEditing); // and push url into the template for display $this->assign('url', $url); // we only allow editing of non-sef url for new urls, that is when non sef url field is empty // of for 404s, when we have a sef but no non-sef $newUrl = $url->get('newurl'); $this->assign('canEditNewUrl', empty($newUrl)); // are we creating a new url rcord or editing an existing one $oldUrl = $url->get('oldurl'); $existingUrl = !empty($newUrl) || !empty($oldUrl); // now read meta for this url, using meta model if ($existingUrl) { $metaModel = ShlMvcModel_Base::getInstance('metas', 'Sh404sefModel'); $metas = $metaModel->getList((object) array('newurl' => $url->get('newurl')), $returnZeroElement = true); $meta = $metas[0]; } else { $meta = JTable::getInstance('metas', 'Sh404sefTable'); } $this->assign('meta', $meta); // now read aliases for this url, using an aliases model if ($existingUrl) { $aliasModel = ShlMvcModel_Base::getInstance('aliases', 'Sh404sefModel'); $aliases = $aliasModel->getDisplayableList((object) array('newurl' => $url->get('newurl'))); } else { $aliases = ''; } $this->assign('aliases', $aliases); // now read pageid for this url, using pageid model $pageidModel = ShlMvcModel_Base::getInstance('pageids', 'Sh404sefModel'); $pageids = $pageidModel->getList((object) array('newurl' => $url->get('newurl')), $returnZeroElement = true); $this->assign('pageid', $pageids[0]); // url used to create QRCode $sefConfig = Sh404sefFactory::getConfig(); $this->qrCodeUrl = JUri::root() . ltrim($sefConfig->shRewriteStrings[$sefConfig->shRewriteMode], '/') . $this->url->get('oldurl'); // push social seo data $this->_pushDataSocial_seo(); // find active starting panel $this->activePanel = $this->_getActiveStartingPanel(); // add title. If there is an id, we are editing an existing url, or else we create a new one // other case : edting home page, there is a specific title if ($this->home == 1) { $title = JText::_('COM_SH404SEF_HOME_PAGE_EDIT_TITLE'); } else { $title = $url->get('id') ? JText::_('COM_SH404SEF_EDIT_URL_TITLE') : JText::_('COM_SH404SEF_ADD_URL_TITLE'); } if (version_compare(JVERSION, '3.0', 'ge')) { // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapModalFixCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // add title JToolbarHelper::title('sh404SEF: ' . $title); // prepare layouts objects, to be used by sub-layouts $this->layoutRenderer = array(); $this->layoutRenderer['custom'] = new ShlMvcLayout_File('com_sh404sef.form.fields.custom', sh404SEF_LAYOUTS); $this->layoutRenderer['shlegend'] = new ShlMvcLayout_File('com_sh404sef.configuration.fields.legend', sh404SEF_LAYOUTS); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/configuration.css'); JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/j3_list.css'); // add tooltips // @TODO replace with a viable jQuery equivalent JHTML::_('behavior.tooltip'); } else { // build the toolbar $toolBar = $this->_makeToolbar(); $this->assignRef('toolbar', $toolBar); $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle($title, $icon = 'sh404sef', $class = 'sh404sef-toolbar-title')); // add tooltips JHTML::_('behavior.tooltip'); // link to custom javascript JHtml::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/' . $this->joomlaVersionPrefix . '_edit.js'); } // add link to css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_editurl.css'); // now display normally parent::display($this->joomlaVersionPrefix); }
public function getForm() { // import com_config model $comConfigModel = Sh404sefHelperGeneral::getComConfigComponentModel('com_sh404sef', JPATH_ADMINISTRATOR . '/components/com_sh404sef/configuration'); $form = $comConfigModel->getForm(); $component = $comConfigModel->getComponent(); // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); $method = '_getByComponentField' . $this->joomlaVersionPrefix; // inject the by components part in the form $field = $this->{$method}(); $form->setField($field); // inject the languages part in the form $method = '_getLanguagesField' . $this->joomlaVersionPrefix; $field = $this->{$method}(); $form->setField($field); // inject the current content of the 404 error page as default value in the txt404 form field $currentErrorPageContent = $this->_getErrorPageContent(); $form->setFieldAttribute('txt404', 'default', $currentErrorPageContent); // inject analytics group field in form $field = $this->_getAnalyticsGroupsField(); $form->setField($field); // merge categories in jooomla tab $field = $this->_getCategoriesField(); $form->setField($field); // Bind the form to the data. if ($form && $component->params) { $form->bind($component->params); } // make sure Analytics password is not visible in the source code of the page $form->setValue('analyticsPassword', null, '********'); // special processing for various parameters: turn string into an array // security $form->setValue('shSecOnlyNumVars', null, implode("\n", $form->getValue('shSecOnlyNumVars', null, array()))); $form->setValue('shSecAlphaNumVars', null, implode("\n", $form->getValue('shSecAlphaNumVars', null, array()))); $form->setValue('shSecNoProtocolVars', null, implode("\n", $form->getValue('shSecNoProtocolVars', null, array()))); $form->setValue('ipWhiteList', null, implode("\n", $form->getValue('ipWhiteList', null, array()))); $form->setValue('ipBlackList', null, implode("\n", $form->getValue('ipBlackList', null, array()))); $form->setValue('uAgentWhiteList', null, implode("\n", $form->getValue('uAgentWhiteList', null, array()))); $form->setValue('uAgentBlackList', null, implode("\n", $form->getValue('uAgentBlackList', null, array()))); // analytics $form->setValue('analyticsExcludeIP', null, implode("\n", $form->getValue('analyticsExcludeIP', null, array()))); // read mobile params from the mobile plugin, not from the component config, which only has a copy $plugin = JPluginHelper::getPlugin('system', 'shmobile'); $params = new JRegistry(); $params->loadString($plugin->params); $form->setValue('mobile_switch_enabled', null, $params->get('mobile_switch_enabled', 0)); $form->setValue('mobile_template', null, $params->get('mobile_template', '')); // inject a link to shLib plugin params for cache settings $form->setFieldAttribute('UrlCacheHandlerLink', 'additionaltext', '<span class = "btn sh404sef-textinput"><a href="' . Sh404sefHelperGeneral::getShLibPluginLink() . '" target="_blank">' . JText::_('COM_SH404SEF_CONFIGURE_SHLIB_PLUGIN') . '</a></span>'); return $form; }
public function display($tpl = null) { // version prefix $this->joomlaVersionPrefix = Sh404sefHelperGeneral::getJoomlaVersionPrefix(); // prepare the view, based on request // do we force reading updates from server ? $options = Sh404sefHelperAnalytics::getRequestOptions(); // push display options into template $this->assign('options', $options); // Get the JComponent instance of JToolBar $bar = JToolBar::getInstance('toolbar'); if (version_compare(JVERSION, '3.0', 'ge')) { $document = JFactory::getDocument(); // render submenu sidebar $this->sidebar = Sh404sefHelperHtml::renderSubmenu(); // add custom css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_list.css'); // add modal css and js ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument()); ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument()); // add title JToolbarHelper::title('sh404SEF: ' . JText::_('COM_SH404SEF_ANALYTICS_MANAGER'), 'sh404sef-toolbar-title'); // needed javascript jimport('joomla.html.html.bootstrap'); JHtml::_('formbehavior.chosen', 'select'); // add Joomla calendar behavior, needed to input start and end dates if ($options['showFilters'] == 'yes') { JHTML::_('behavior.calendar'); } // add quick control panel loader $js = 'jQuery(document).ready(function(){ shSetupAnalytics({report:" ' . $options['report'] . '"});});'; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); } else { // add Joomla calendar behavior, needed to input start and end dates if ($options['showFilters'] == 'yes') { JHTML::_('behavior.calendar'); } // add tooltips handler JHTML::_('behavior.tooltip'); // add title $app = JFactory::getApplication(); $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_ANALYTICS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'); JFactory::getApplication()->JComponentTitle = $title; // add quick control panel loader $js = 'window.addEvent(\'domready\', function(){ shSetupAnalytics({report:" ' . $options['report'] . '"});});'; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); } // call methods to prepare display based on report type $method = '_makeView' . ucfirst($options['report']); if (is_callable(array($this, $method))) { $this->{$method}($tpl); } // add our javascript JHTML::script(Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/' . $this->joomlaVersionPrefix . '_cp.js'); // add our own css JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/' . $this->joomlaVersionPrefix . '_cp.css'); // flag to know if we should display placeholder for ajax fillin $this->assign('isAjaxTemplate', true); parent::display($this->joomlaVersionPrefix); }