Exemplo n.º 1
0
 public function display($tpl = null)
 {
     // get current layout
     $params['layout'] = JRequest::getCmd('layout', 'default');
     // push the appropriate data into the view
     $methodName = '_pushConfigData' . ucfirst($params['layout']);
     if (is_callable(array($this, $methodName))) {
         $this->{$methodName}();
     }
     // build the toolbar
     $toolBar = $this->_makeToolbar($params);
     $this->assignRef('toolbar', $toolBar);
     // add title and icon to toolbar
     $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_CONFIGURATION'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
     // insert needed css files
     $this->_addCss();
     // link to  custom javascript
     JHtml::script('config.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // also add some custom javascript tp collect editor content
     if ($params['layout'] == 'errordocs') {
         $this->_addJs();
     }
     // add tooltips
     JHTML::_('behavior.tooltip');
     // now display normally
     parent::display($tpl);
 }
Exemplo n.º 2
0
 public function display($tpl = null)
 {
     // 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);
     // build the toolbar
     $toolBar = $this->_makeToolbar();
     $this->assignRef('toolbar', $toolBar);
     // add title.
     $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT'), $icon = 'addedit.png', $class = 'header'));
     // insert needed css files
     $this->_addCss();
     // link to  custom javascript
     JHtml::script('edit.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // add domready event
     $document =& JFactory::getDocument();
     // add tooltips
     JHTML::_('behavior.tooltip');
     // now display normally
     parent::display($tpl);
 }
Exemplo n.º 3
0
 public function display($tpl = null)
 {
     // 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
     $methodName = '_attachData' . ucfirst($this->getLayout());
     if (is_callable(array($this, $methodName))) {
         $this->{$methodName}();
     }
     // build the toolbar
     $methodName = '_makeToolbar' . ucfirst($this->getLayout());
     if (is_callable(array($this, $methodName))) {
         $this->{$methodName}();
     }
     // add confirmation phrase to toolbar
     $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_NOT_FOUND_SELECT_REDIRECT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
     // insert needed css files
     $this->_addCss();
     // link to  custom javascript
     JHtml::script('notfound.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
Exemplo n.º 4
0
 public function display($tpl = null)
 {
     // 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('optionsSelect', $this->_makeOptionsSelect($options));
     $this->assign('mainUrl', $model->getMainUrl());
     // build the toolbar
     $toolBar = $this->_makeToolbar();
     // add confirmation phrase to toolbar
     $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_DUPLICATE_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
     // insert needed css files
     $this->_addCss();
     // link to  custom javascript
     JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
Exemplo n.º 5
0
 /**
  * Create toolbar for default layout view
  *
  * @param midxed $params
  */
 private function _makeToolbarDefaultJ2($params = null)
 {
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_PAGEIDS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     JFactory::getApplication()->JComponentTitle = $title;
     // get toolbar object
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 400);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=pageids';
     $bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('COM_SH404SEF_IMPORT_BUTTON'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 380);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=pageids';
     $bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('COM_SH404SEF_EXPORT_BUTTON'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // add delete button as an ajax call
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=pageids&task=confirmdelete&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'purgeselected', $list = true, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
 }
Exemplo n.º 6
0
 /**
  * Attach css, js and create toolbar for Info view
  *
  * @param midxed $params
  */
 private function _makeViewInfo($params = null)
 {
     global $mainframe;
     // add our own css
     JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
 }
Exemplo n.º 7
0
 /**
  * Create toolbar for default layout view
  *
  * @param midxed $params
  */
 private function _makeToolbar($params = null)
 {
     $mainframe =& JFactory::getApplication();
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_ALIASES_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
     // add "New url" button
     $bar =& JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     // add edit button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 800, 'y' => 600);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=editalias&task=edit&tmpl=component&view=editurl&startOffset=2';
     $bar->appendButton('Shpopuptoolbarbutton', 'edit', $url, JText::_('Edit'), $msg = '', $task = 'edit', $list = true, $hidemenu = true, $params);
     // add delete button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=editalias&task=confirmdelete&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'delete', $list = true, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 400);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=aliases';
     $bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('COM_SH404SEF_IMPORT_BUTTON'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=aliases';
     $bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('COM_SH404SEF_EXPORT_BUTTON'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // edit home page button
     $params['class'] = 'modalediturl';
     $params['size'] = array('x' => 800, 'y' => 600);
     $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) parent.window.location=\'' . $this->defaultRedirectUrl . '\';window.parent.shReloadModal=true}';
     $params['onClose'] = $js;
     $bar->appendButton('Shpopupbutton', 'home', JText::_('COM_SH404SEF_HOME_PAGE_ICON'), "index.php?option=com_sh404sef&c=editalias&task=edit&view=editurl&home=1&tmpl=component&startOffset=1", $params);
     // separator
     JToolBarHelper::divider();
 }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
 /**
  * Create toolbar for default layout view
  *
  * @param midxed $params
  */
 private function _makeToolbarDefault($params = null)
 {
     global $mainframe;
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_META_TAGS'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
     // get toolbar object
     $bar =& JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 400);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=import&opsubject=urls';
     // importing metas is same as importing urls, as export format is same
     $bar->appendButton('Shpopuptoolbarbutton', 'import', $url, JText::_('Import'), $msg = '', $task = 'import', $list = false, $hidemenu = true, $params);
     // add export button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=metas';
     $bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('Export'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // edit home page button
     $params['class'] = 'modalediturl';
     $params['size'] = array('x' => 700, 'y' => 500);
     $js = '\\function(){shAlreadySqueezed = false;if(parent.shReloadModal) parent.window.location=\'' . $this->defaultRedirectUrl . '\';parent.shReloadModal=true}';
     $params['onClose'] = $js;
     $bar->appendButton('Shpopupbutton', 'home', JText16::_('COM_SH404SEF_HOME_PAGE_ICON'), "index.php?option=com_sh404sef&c=editurl&task=edit&home=1&tmpl=component", $params);
     // separator
     JToolBarHelper::divider();
     // add save button as an ajax call
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     $params['class'] = 'savemeta';
     $params['id'] = 'savemeta';
     $params['closewindow'] = 0;
     $bar->appendButton('Shajaxbutton', 'save', 'Save', "index.php?option=com_sh404sef&c=metas&task=save&shajax=1&tmpl=component", $params);
     // separator
     JToolBarHelper::divider();
 }
Exemplo n.º 10
0
 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);
 }
Exemplo n.º 11
0
 public function display($tpl = null)
 {
     // prepare the view, based on request
     // do we force reading updates from server ?
     $options = Sh404sefHelperAnalytics::getRequestOptions();
     $method = '_makeView' . ucfirst($options['report']);
     if (is_callable(array($this, $method))) {
         $this->{$method}($tpl);
     }
     // push display options into template
     $this->assign('options', $options);
     // add our javascript
     JHTML::script('cp.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // add Joomla calendar behavior, needed to input start and end dates
     if ($options['showFilters'] == 'yes') {
         JHTML::_('behavior.calendar');
     }
     // add our own css
     JHtml::styleSheet('cp.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // add tooltips handler
     JHTML::_('behavior.tooltip');
     // add title
     $app =& JFactory::getApplication();
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText16::_('COM_SH404SEF_ANALYTICS_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $app->set('JComponentTitle', $title);
     // add a div to display our ajax-call-in-progress indicator
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     $html = '<div id="sh-progress-cpprogress"></div>';
     $bar->appendButton('custom', $html, 'sh-progress-button-cpprogress');
     // add quick control panel loader
     $js = 'window.addEvent(\'domready\', function(){  shSetupAnalytics({report:" ' . $options['report'] . '"});});';
     $document =& JFactory::getDocument();
     $document->addScriptDeclaration($js);
     // flag to know if we should display placeholder for ajax fillin
     $this->assign('isAjaxTemplate', true);
     parent::display($tpl = null);
 }
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
 /**
  * Create toolbar for 404 pages template
  *
  * @param midxed $params
  */
 private function _makeToolbarView404J2($params = null)
 {
     // Get the JComponent instance of JToolBar
     $bar = JToolBar::getInstance('toolbar');
     // and connect to our buttons
     $bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_404_MANAGER'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     JFactory::getApplication()->JComponentTitle = $title;
     // add edit button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 800, 'y' => 600);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=editurl&task=edit&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'edit', $url, JText::_('Edit'), $msg = '', $task = 'edit', $list = true, $hidemenu = true, $params);
     // add delete button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=editurl&task=confirmdelete404&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'delete', $url, JText::_('Delete'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'delete', $list = true, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // add import button
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 380);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=wizard&task=start&tmpl=component&optype=export&opsubject=view404';
     $bar->appendButton('Shpopuptoolbarbutton', 'export', $url, JText::_('Export'), $msg = '', $task = 'export', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
     // add purge and purge selected  buttons
     $params['class'] = 'modaltoolbar';
     $params['size'] = array('x' => 500, 'y' => 300);
     unset($params['onClose']);
     $url = 'index.php?option=com_sh404sef&c=urls&task=confirmpurge404&tmpl=component';
     $bar->appendButton('Shpopuptoolbarbutton', 'purge', $url, JText::_('COM_SH404SEF_PURGE'), $msg = JText::_('VALIDDELETEITEMS', true), $task = 'purge', $list = false, $hidemenu = true, $params);
     // separator
     JToolBarHelper::divider();
 }
Exemplo n.º 14
0
 /**
  * Create toolbar for current view
  *
  * @param midxed $params
  */
 private function _makeToolbarDefaultJ2($params = null)
 {
     // add confirmation phrase to toolbar
     $this->assign('toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_NOT_FOUND_SELECT_REDIRECT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));
     // Get the JComponent instance of JToolBar
     $bar = JToolBar::getInstance('toolbar');
     // add save button as an ajax call
     $bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
     $params['class'] = 'modalediturl';
     $params['id'] = 'modalediturlsave';
     $params['closewindow'] = 1;
     $bar->appendButton('Shajaxbutton', 'selectnfredirect', JText::_('COM_SH404SEF_NOT_FOUND_SELECT_REDIRECT'), "index.php?option=com_sh404sef&c=notfound&task=selectnfredirect&shajax=1&tmpl=component", $params);
     // other button are standards
     $bar->appendButton('Standard', 'back', JText::_('COM_SH404SEF_BACK_TO_NOT_FOUND'), 'backPopup', false, false);
     // push in to the view
     $this->assignRef('toolbar', $bar);
     return $bar;
 }
Exemplo n.º 15
0
  public function display( $tpl = null) {

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

    // now read meta for this url, using meta  model
    if ($existingUrl) {
      $metaModel = &JModel::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 = &JModel::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 = &JModel::getInstance( 'pageids', 'Sh404sefModel');
    $pageids = $pageidModel->getList( (object) array('newurl' => $url->get('newurl') ), $returnZeroElement = true );
    $this->assign( 'pageid', $pageids[0]);

    // push social seo data
    $this->_pushDataSocial_seo();
    
    // build the toolbar
    $toolBar = $this->_makeToolbar();
    $this->assignRef( 'toolbar', $toolBar);

    // 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 ($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');
    }
    $this->assign( 'toolbarTitle', Sh404sefHelperGeneral::makeToolbarTitle( $title, $icon = 'sh404sef', $class = 'sh404sef-toolbar-title'));

    // insert needed css files
    $this->_addCss();

    // link to  custom javascript
    JHtml::script( 'edit.js', Sh404sefHelperGeneral::getComponentUrl() .  '/assets/js/');

    // add domready event
    $document = & JFactory::getDocument();
    //$js = 'window.addEvent("domready", function(){ shAttachResizer();});';
    //$document->addScriptDeclaration( $js);

    // add tooltips
    JHTML::_('behavior.tooltip');

    // now display normally
    parent::display($tpl);

  }
Exemplo n.º 16
0
 /**
  * Attach css, js and create toolbar for Info view
  *
  * @param midxed $params
  */
 private function _makeViewInfo($params = null)
 {
     // add our own css
     JHtml::styleSheet(Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');
     // decide on help file language
     $languageCode = Sh404sefHelperLanguage::getFamily();
     $basePath = JPATH_ROOT . '/administrator/components/com_sh404sef/language/%s.readme.php';
     // fall back to english if language readme does not exist
     jimport('joomla.filesystem.file');
     if (!JFile::exists(sprintf($basePath, $languageCode))) {
         $languageCode = 'en';
     }
     $this->assign('readmeFilename', sprintf($basePath, $languageCode));
     if (version_compare(JVERSION, '3.0', 'ge')) {
         // render submenu sidebar
         $this->sidebar = JHtmlSidebar::render();
         // add modal css and js
         ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument());
         ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument());
         JToolbarHelper::title(JText::_('COM_SH404SEF_TITLE_SUPPORT'), 'sh404sef-toolbar-title');
     } else {
         // add title
         $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
         JFactory::getApplication()->JComponentTitle = $title;
     }
 }
Exemplo n.º 17
0
 /**
  * Attach css, js and create toolbar for Info view
  *
  * @param midxed $params
  */
 private function _makeViewInfo($params = null)
 {
     // add our own css
     JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // decide on help file language
     $languageCode = Sh404sefHelperLanguage::getFamily();
     $basePath = JPATH_ROOT . '/administrator/components/com_sh404sef/language/%s.readme.php';
     // fall back to english if language readme does not exist
     jimport('joomla.filesystem.file');
     if (!JFile::exists(sprintf($basePath, $languageCode))) {
         $languageCode = 'en';
     }
     $this->assign('readmeFilename', sprintf($basePath, $languageCode));
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_TITLE_SUPPORT'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     JFactory::getApplication()->set('JComponentTitle', $title);
 }
Exemplo n.º 18
0
 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);
 }