コード例 #1
0
ファイル: view.html.php プロジェクト: lautarodragan/ideary
 public function display($tpl = null)
 {
     // get model and update context with current
     $model =& $this->getModel();
     $context = $model->setContext($this->_context . '.' . $this->getLayout());
     // display type: simple for very large sites/slow slq servers
     $sefConfig =& Sh404sefFactory::getConfig();
     // if set for a slowServer, display simplified version of the url manager
     $this->assign('slowServer', $sefConfig->slowServer);
     // read data from model
     $list =& $model->getList((object) array('layout' => $this->getLayout(), 'simpleUrlList' => $this->slowServer, 'slowServer' => $sefConfig->slowServer));
     // and push it into the view for display
     $this->assign('items', $list);
     $this->assign('itemCount', count($this->items));
     $this->assign('pagination', $model->getPagination((object) array('layout' => $this->getLayout(), 'simpleUrlList' => $this->slowServer, 'slowServer' => $sefConfig->slowServer)));
     $options = $model->getDisplayOptions();
     $this->assign('options', $options);
     $this->assign('optionsSelect', $this->_makeOptionsSelect($options));
     // 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);
     // build the toolbar
     $toolbarMethod = '_makeToolbar' . ucfirst($this->getLayout());
     if (is_callable(array($this, $toolbarMethod))) {
         $this->{$toolbarMethod}($params);
     }
     // add our own css
     JHtml::styleSheet('urls.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // link to  custom javascript
     JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
コード例 #2
0
ファイル: view.html.php プロジェクト: justinlyon/scc
 public function display($tpl = null)
 {
     // get model and update context with current
     $model =& JModel::getInstance('urls', 'Sh404sefModel');
     $context = $model->setContext($this->_context . '.' . $this->getLayout());
     // store it
     $model =& $this->setModel($model, true);
     // read data from model
     $list =& $model->getList((object) array('layout' => $this->getLayout(), 'getPageId' => true));
     // and push it into the view for display
     $this->assign('items', $list);
     $this->assign('itemCount', count($this->items));
     $this->assign('pagination', $model->getPagination((object) array('layout' => $this->getLayout(), 'getPageId' => true)));
     $options = $model->getDisplayOptions();
     $this->assign('options', $options);
     $this->assign('optionsSelect', $this->_makeOptionsSelect($options));
     $this->assign('helpMessage', JText16::_('COM_SH404SEF_PAGEID_HELP'));
     // add behaviors and styles as needed
     $modalSelector = 'a.modalediturl';
     $js = '\\function(){shAlreadySqueezed = false;if(parent.shReloadModal) {parent.window.location=\'' . $this->defaultRedirectUrl . '\';parent.shReloadModal=true}}';
     $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js);
     Sh404sefHelperHtml::modal($modalSelector, $params);
     // build the toolbar
     $toolbarMethod = '_makeToolbar' . ucfirst($this->getLayout());
     if (is_callable(array($this, $toolbarMethod))) {
         $this->{$toolbarMethod}($params);
     }
     // add our own css
     JHtml::styleSheet('list.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // link to  custom javascript
     JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     JHtml::script('metas.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
コード例 #3
0
ファイル: view.html.php プロジェクト: lautarodragan/ideary
 /**
  * Attach css, js and create toolbar for default view
  *
  * @param midxed $params
  */
 private function _makeViewDefault($params = null)
 {
     $mainframe =& JFactory::getApplication();
     // prepare database stats, etc
     $this->_prepareControlPanelData();
     // add behaviors and styles as needed
     $modalSelector = 'a.modalediturl';
     $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) {parent.window.location=\'index.php?option=com_sh404sef\';window.parent.shReloadModal=true}}';
     $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js);
     Sh404sefHelperHtml::modal($modalSelector, $params);
     // add our javascript
     JHTML::script('cp.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // add analytics and other ajax calls loader
     $sefConfig =& Sh404sefFactory::getConfig();
     $analyticsBootstrap = $sefConfig->analyticsReportsEnabled ? 'shSetupAnalytics({report:"dashboard",showFilters:"no"});' : '';
     $js = 'window.addEvent(\'domready\', function(){ ' . $analyticsBootstrap . '  shSetupQuickControl(); shSetupSecStats(); shSetupUpdates();});';
     $document =& JFactory::getDocument();
     $document->addScriptDeclaration($js);
     // add our own css
     JHtml::styleSheet('cp.css', Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/');
     // import tabs
     jimport('joomla.html.pane');
     // add tooltips handler
     JHTML::_('behavior.tooltip');
     // add title
     $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_CONTROL_PANEL'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
     $mainframe->set('JComponentTitle', $title);
     // add space for our ajax progress indicator
     // Get the JComponent instance of JToolBar
     $bar =& JToolBar::getInstance('toolbar');
     // add a div to display our ajax-call-in-progress indicator
     $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes');
     $html = '<div id="sh-progress-cpprogress"></div>';
     $bar->appendButton('custom', $html, 'sh-progress-button-cpprogress');
 }
コード例 #4
0
ファイル: view.html.php プロジェクト: lautarodragan/ideary
 public function display($tpl = null)
 {
     // get model and update context with current
     $model =& $this->getModel();
     $context = $model->setContext($this->_context . '.' . $this->getLayout());
     // read data from model
     $list =& $model->getList((object) array('layout' => $this->getLayout()));
     // 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('helpMessage', JText::_('COM_SH404SEF_ALIASES_HELP_NEW_ALIAS'));
     // 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);
     // build the toolbar
     $toolBar = $this->_makeToolbar();
     // insert needed css files
     $this->_addCss();
     // link to  custom javascript
     JHtml::script('list.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/');
     // now display normally
     parent::display($tpl);
 }
コード例 #5
0
ファイル: view.html.php プロジェクト: alesconti/FF_2015
 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);
 }
コード例 #6
0
ファイル: view.html.php プロジェクト: alesconti/FF_2015
 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);
 }
コード例 #7
0
ファイル: view.html.php プロジェクト: alesconti/FF_2015
 /**
  * Attach css, js and create toolbar for default view
  *
  * @param midxed $params
  */
 private function _makeViewDefault($params = null)
 {
     // prepare database stats, etc
     $this->_prepareControlPanelData();
     // 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 = JHtmlSidebar::render();
         // add modal css and js
         ShlHtmlBs_helper::addBootstrapCss(JFactory::getDocument());
         ShlHtmlBs_helper::addBootstrapJs(JFactory::getDocument());
         // add title
         JToolbarHelper::title('sh404SEF: ' . JText::_('COM_SH404SEF_CONTROL_PANEL'), 'sh404sef-toolbar-title');
         // prepare configuration button
         $bar->addButtonPath(SHLIB_ROOT_PATH . 'toolbarbutton');
         $params = array();
         $params['class'] = 'modaltoolbar btn-success';
         $params['size'] = Sh404sefFactory::getPConfig()->windowSizes['configuration'];
         $params['buttonClass'] = 'btn-success btn btn-small modal';
         $params['iconClass'] = 'icon-options';
         $url = 'index.php?option=com_sh404sef&tmpl=component&c=configuration&view=configuration&component=com_sh404sef&hidemainmenu=1';
         $bar->appendButton('J3popuptoolbarbutton', 'configj3', JText::_('COM_SH404SEF_CONFIGURATION'), $url, $params['size']['x'], $params['size']['y'], $top = 0, $left = 0, $onClose = '', $title = '', $params);
         $html = '<div id="sh-progress-cpprogress"></div>';
         $bar->appendButton('custom', $html, 'sh-progress-button-cpprogress');
         // add analytics and other ajax calls loader
         $sefConfig = Sh404sefFactory::getConfig();
         $analyticsBootstrap = $sefConfig->analyticsReportsEnabled ? 'shSetupAnalytics({report:"dashboard",showFilters:"no"});' : '';
         $js = 'jQuery(document).ready(function(){ ' . $analyticsBootstrap . '  shSetupQuickControl(); shSetupSecStats(); shSetupUpdates();});';
         $document = JFactory::getDocument();
         $document->addScriptDeclaration($js);
     } else {
         // add behaviors and styles as needed
         $modalSelector = 'a.modalediturl';
         $js = '\\function(){window.parent.shAlreadySqueezed = false;if(window.parent.shReloadModal) {parent.window.location=\'index.php?option=com_sh404sef\';window.parent.shReloadModal=true}}';
         $params = array('overlayOpacity' => 0, 'classWindow' => 'sh404sef-popup', 'classOverlay' => 'sh404sef-popup', 'onClose' => $js);
         Sh404sefHelperHtml::modal($modalSelector, $params);
         // import tabs
         jimport('joomla.html.pane');
         // add tooltips handler
         JHTML::_('behavior.tooltip');
         // add title
         $title = Sh404sefHelperGeneral::makeToolbarTitle(JText::_('COM_SH404SEF_CONTROL_PANEL'), $icon = 'sh404sef', $class = 'sh404sef-toolbar-title');
         JFactory::getApplication()->JComponentTitle = $title;
         // add a div to display our ajax-call-in-progress indicator
         $bar->addButtonPath(JPATH_COMPONENT . '/' . 'classes');
         $html = '<div id="sh-progress-cpprogress"></div>';
         $bar->appendButton('custom', $html, 'sh-progress-button-cpprogress');
         // add modal handler for configuration
         JHTML::_('behavior.modal');
         $configbtn = '<a class="modal" href="index.php?option=com_sh404sef&tmpl=component&c=configuration&view=configuration&component=com_sh404sef&hidemainmenu=1" rel="{handler: \'iframe\', size: {x: window.getSize().x*0.90, y: window.getSize().y*0.90}, onClose: function() {}}"><span class="icon-32-options"></span>' . JText::_('COM_SH404SEF_CONFIGURATION') . '</a>';
         $bar->appendButton('custom', $configbtn, 'sh-configbutton-button');
         // add analytics and other ajax calls loader
         $sefConfig = Sh404sefFactory::getConfig();
         $analyticsBootstrap = $sefConfig->analyticsReportsEnabled ? 'shSetupAnalytics({report:"dashboard",showFilters:"no"});' : '';
         $js = 'window.addEvent(\'domready\', function(){ ' . $analyticsBootstrap . '  shSetupQuickControl(); shSetupSecStats(); shSetupUpdates();});';
         $document = JFactory::getDocument();
         $document->addScriptDeclaration($js);
     }
     // 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');
 }