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(); // 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(); // 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(); // 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); }