public function display($tpl = null) { // 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 . '"; parent.SqueezeBox.close(); } '; $document =& JFactory::getDocument(); $document->addScriptDeclaration($js); // insert needed css files $this->_addCss(); } else { // get action $this->task = empty($this->task) ? 'delete' : $this->task; // build the toolbar $toolBar = $this->_makeToolbar(); $this->assignRef('toolbar', $toolBar); // add confirmation phrase to toolbar $this->assign('toolbarTitle', '<div class="headerconfirm" >' . JText16::_('COM_SH404SEF_CONFIRM_TITLE') . '</div>'); // insert needed css files $this->_addCss(); // link to custom javascript JHtml::script('edit.js', Sh404sefHelperGeneral::getComponentUrl() . '/assets/js/'); } // now display normally parent::display($tpl); }
/** * Save configuration to disk * from POST data or input array of data * * When config will be saved to db, most of the code in this * model will be removed and basemodel should handle everything * * @param array $dataArray an array holding data to save. If empty, $_POST is used * @return integer id of created or updated record */ public function save($dataArray = null) { // get current configuration object $sefConfig =& shRouter::shGetConfig(); // call the appropriate method for each // configuration settings set $methodName = '_save' . ucfirst($this->_layout); if (is_callable(array($this, $methodName))) { $status = true; $this->{$methodName}(); } else { $status = false; $this->setError('Internal error : method not defined : _save' . ucfirst($params['layout'])); } if ($status && !empty($_POST)) { foreach ($_POST as $key => $value) { $sefConfig->set($key, $value); $this->_advancedConfig($key, $value); } } // ask config class to save itself $status = $status && $sefConfig->saveConfig(); // store any error if (!$status) { $this->setError(JText16::_('COM_SH404SEF_ERR_CONFIGURATION_NOT_SAVED')); } return $status; }
public function confirmed($deleteDuplicates = false) { // Check for request forgeries JRequest::checkToken() or jexit('Invalid Token'); // find and store edited item id $cid = JRequest::getVar('cid', array(0), 'default', 'array'); // check invalid data if (!is_array($cid) || count($cid) < 1 || $cid[0] == 0) { $this->setRedirect($this->_getDefaultRedirect(), JText16::_('COM_SH404SEF_SELECT_ONE_URL')); } // now perform url deletion // get the model to do it, actually // Get/Create the model if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) { // store initial context in model $model->setContext($this->_context); // call the delete method on our list if ($deleteDuplicates) { $model->deleteByIdsWithDuplicates($cid); } else { $model->deleteByIds($cid); } // check errors and enqueue them for display if any $errors = $model->getErrors(); if (!empty($errors)) { $this->enqueuemessages($errors, 'error'); // clear success message, as we have just queued some error messages $status = ''; } } // send back response through default view $this->display(); }
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); }
public function makemainurl() { // Check for request forgeries JRequest::checkToken() or jexit('Invalid Token'); // find and store edited item id $cid = JRequest::getVar('cid', array(0), 'default', 'array'); // check invalid data if (!is_array($cid) || count($cid) != 1 || intval($cid[0]) == 0) { $redirect = array('c' => "duplicates", 'tmpl' => 'component', 'cid[]' => JRequest::getInt('mainurl_id')); $this->setRedirect($this->_getDefaultRedirect($redirect), JText16::_('COM_SH404SEF_SELECT_ONE_URL'), 'error'); // send back response through default view $this->display(); } // now make that url the main url // while also setting the previous // with this url current rank // get the model to do it, actually // Get/Create the model if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) { // store initial context in model $model->setContext($this->_context); // call the delete method on our list $model->makeMainUrl(intval($cid[0])); // check errors and enqueue them for display if any $errors = $model->getErrors(); if (!empty($errors)) { $this > enqueuemessages($errors, 'error'); } } // send back response through default view $this->display(); }
public function selectnfredirect() { // collect input data : which url needs to be redirected ? $notFoundUrlId = JRequest::getInt('notfound_url_id'); // which URL to redirect to? $cid = JRequest::getVar('cid', array(0), 'default', 'array'); JArrayHelper::toInteger($cid); if (count($cid) > 1) { // more than one target url selected, display error $this->setError(JText16::_('COM_SH404SEF_SELECT_ONLY_ONE_URL_TO_REDIRECT')); $this->display(); return; } // only one url, use it $targetUrlId = $cid[0]; if (empty($targetUrlId)) { // bad url, probably not an integer was passed $this->setError(JText16::_('COM_SH404SEF_INVALID_REDIRECT_TARGET_ID')); $this->display(); return; } // get model and ask it to do the job $model =& $this->getModel($this->_defaultModel); $model->redirectNotFoundUrl($notFoundUrlId, $targetUrlId); // check errors $error = $model->getError(); if (!empty($error)) { $this->setError($error); } // standard display $this->display(); }
/** * Display the view */ public function display($cachable = false) { // catch up any result message coming from an // ajax save for instance, and push that into // the application message queue $messageCode = JRequest::getCmd('sh404sefMsg'); if (!empty($messageCode)) { $msg = JText16::_($messageCode); if ($msg != $messageCode) { // if no language string exists, JText16 will // return the input string, so only display if // we have something to display $app =& JFactory::getApplication(); $app->enqueuemessage($msg); } } // get/create the view $document =& JFactory::getDocument(); $viewType = $document->getType(); $view =& $this->getView($this->_adapter->_stepsMap[$this->_adapter->_step]['view'], $viewType, '', array('base_path' => $this->_basePath)); // Set the layout $view->setLayout($this->_adapter->_stepsMap[$this->_adapter->_step]['layout']); // push button list into the view $view->assign('buttonsList', $this->_adapter->_buttonsList); $view->assign('visibleButtonsList', $this->_adapter->_visibleButtonsList); // push list of steps in to the view foreach ($this->_adapter->_buttonsList as $button) { $view->assign($button, $this->_adapter->_steps[$button]); } // push controller name into view $view->assign('actionController', $this->_defaultController); // push operation type and subject into the view $view->assign('opType', $this->_opType); $view->assign('opSubject', $this->_opSubject); // push title, main and hidden text $view->assign('pageTitle', $this->_pageTitle); $view->assign('mainText', $this->_mainText); $view->assign('hiddenText', $this->_hiddenText); $view->assign('setFormEncType', $this->_setFormEncType); // check if we are done, and need to set a redirect if (!empty($this->_redirectTo)) { $view->assign('redirectTo', $this->_redirectTo); } // check if we are continuein to another step, and need to set a redirect if (!empty($this->_continue)) { $view->assign('continue', $this->_continue); } if (!empty($this->_nextStart)) { $view->assign('nextstart', $this->_nextStart); } // push controller errors in the view $error = $this->getError(); if (!empty($error)) { $view->setError($error); } // Display the view $view->display(); }
/** * 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); }
/** * Save a list of aliases as entered by user in backend to the database * * @param string $aliasList data from an html textarea field * @param string $nonSefUrl the non sef url to which aliases are attached * * @return boolean true on success */ public function saveFromInput($aliasList, $nonSefUrl) { // split aliases from raw input data into an array $aliasList = explode("\n", $aliasList); // delete them all. We should do a transaction, but not worth it $query = 'DELETE from #__sh404sef_aliases where newurl = ' . $this->_db->Quote($nonSefUrl); $this->_db->setQuery($query); $this->_db->query(); // Write new aliases. if (!empty($aliasList[0])) { $baseQuery = 'INSERT INTO #__sh404sef_aliases (newurl, alias, type) VALUES __shValue__;'; $endOfLine = array("\r\n", "\n", "\r"); foreach ($aliasList as $alias) { // remove end of line chars $alias = str_replace($endOfLine, '', $alias); // if something left, try insert it into DB if (!empty($alias)) { // first check value is not invalid // either the alias already exists // or same SEF url already exists try { $count = Sh404sefHelperDb::count('#__sh404sef_aliases', 'id', 'oldurl = ? and newurl <> ?', array($alias, '')); if (empty($count)) { $count = Sh404sefHelperDb::count('#__sh404sef_aliases', '*', array('alias' => $alias)); } } catch (Sh404sefExceptionDefault $e) { $count = 0; } // if ok, insert into db if (empty($count)) { $value = '(' . $this->_db->Quote($nonSefUrl) . ', ' . $this->_db->Quote($alias) . ', ' . $this->_db->Quote(Sh404sefHelperGeneral::COM_SH404SEF_URLTYPE_ALIAS) . ')'; $query = str_replace('__shValue__', $value, $baseQuery); $this->_db->setQuery($query); $this->_db->query(); // check errors $error = $this->_db->getErrorNum(); if (!empty($error)) { $this->setError('Internal database error # ' . $query); } } else { // alias already exists either as an alias or a SEF url $this->setError(JText16::sprintf('COM_SH404SEF_ALIAS_ALREADY_EXISTS', $alias)); } } } } // return true if no error $error = $this->getError(); return empty($error); }
/** * Display the view */ public function display($cachable = false) { // catch up any result message coming from an // ajax save for instance, and push that into // the application message queue $messageCode = JRequest::getCmd('sh404sefMsg'); if (!empty($messageCode)) { $msg = JText16::_($messageCode); if ($msg != $messageCode) { // if no language string exists, JText16 will // return the input string, so only display if // we have something to display $app =& JFactory::getApplication(); $app->enqueuemessage($msg); } } // Set the default view name in case it's missing $viewName = JRequest::getWord('view'); if (empty($viewName)) { JRequest::setVar('view', $this->_defaultView); } $document =& JFactory::getDocument(); $viewType = $document->getType(); $viewName = JRequest::getCmd('view', $this->_defaultView); $viewLayout = JRequest::getCmd('layout', $this->_defaultLayout); $view =& $this->getView($viewName, $viewType, '', array('base_path' => $this->_basePath)); // Get/Create the model if ($model =& $this->getModel($viewName)) { // store initial context in model $model->setContext($this->_context); // Push the model into the view (as default) $view->setModel($model, true); // and push also the default redirect $view->assign('defaultRedirectUrl', $this->_getDefaultRedirect(array('layout' => $viewLayout))); } // Set the layout $view->setLayout($viewLayout); // push controller errors in the view $error = $this->getError(); if (!empty($error)) { $view->setError($error); } // Display the view $view->display(); }
/** * Create toolbar for current view * * @param midxed $params */ private function _makeToolbar($params = null) { // if redirect is set, no toolbar if (!empty($this->redirectTo)) { return; } // Get the JComponent instance of JToolBar $bar =& JToolBar::getInstance('toolbar'); // add path to our custom buttons $bar->addButtonPath(JPATH_COMPONENT . DS . 'classes'); // display all buttons we are supposed to display foreach ($this->visibleButtonsList as $button) { // we cannot use Joomla's buttons from a popup, as they use href="#" which causes the page to load in parallel with // closing of the popup. Need use href="javascript: void(0);" $bar->appendButton('Shpopupstandardbutton', $button, JText16::_($button), $task = $button, $list = false); } return $bar; }
protected function _getMessage($type) { switch ($type) { case 'success': $msg = JText16::_('COM_SH404SEF_ELEMENT_SAVED'); break; case 'failure': $msg = JText16::_('COM_SH404SEF_ELEMENT_NOT_SAVED'); break; case 'cancel': $msg = JText16::_('COM_SH404SEF_CANCELLED'); break; default: $msg = ''; break; } return $msg; }
/** * Creates a record in the database, based * on data read from import file * * @param array $header an array of fields, as built from the header line * @param string $line raw record obtained from import file */ protected function _createRecord($header, $line) { // extract the record $line = $this->_lineToArray($line); // get table object to store record jimport('joomla.database.table'); $table =& JTable::getInstance('pageids', 'Sh404sefTable'); // bind table to current record $record = array(); $record['newurl'] = $line[3]; if ($record['newurl'] == '__ Homepage __') { $record['newurl'] = sh404SEF_HOMEPAGE_CODE; } $record['pageid'] = $line[1]; $record['type'] = $line[4]; // save record if (!$table->save($record)) { throw new Sh404sefExceptionDefault(JText16::sprintf('COM_SH404SEF_IMPORT_ERROR_INSERTING_INTO_DB', $line[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); }
<input type="text" name="search_all" id="search_all" value="<?php echo $this->escape($this->options->search_all); ?> " size="35" maxlength="255" class="text_area" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit();" /> <button onclick="document.adminForm.limitstart.value=0;this.form.submit();"><?php echo JText::_('Go'); ?> </button> <button onclick="document.adminForm.limitstart.value=0;document.getElementById('search_all').value='';this.form.submit();"><?php echo JText::_('Reset'); ?> </button> </td> <td align="left" nowrap="nowrap"> <?php echo JText16::_('COM_SH404SEF_PAGE_ID'); ?> : <input type="text" name="search_pageid" id="search_pageid" value="<?php echo $this->escape($this->options->search_pageid); ?> " size="20" maxlength="255" class="text_area" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit();" /> <button onclick="document.adminForm.limitstart.value=0;this.form.submit();"><?php echo JText::_('Go'); ?> </button> <button onclick="document.adminForm.limitstart.value=0;document.getElementById('search_pageid').value='';this.form.submit();"><?php echo JText::_('Reset'); ?> </button> </td>
$linkData = array('c' => 'editnotfound', 'notfound_url_id' => $url->id, 'task' => 'newredirect', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT_TITLE'), 'class' => 'modalediturl', 'anchor' => JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT')); $modalOptions = array('size' => array('x' => '\\window.getSize().scrollSize.x*.7', 'y' => '\\window.getSize().size.y*.5')); echo Sh404sefHelperHtml::makeLink($this, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); ?> </td> </tr> <?php $k = 1 - $k; } } else { ?> <tr> <td align="center" colspan="6"> <?php echo JText16::_('COM_SH404SEF_NO_URL'); ?> </td> </tr> <?php } ?> </tbody> </table> <input type="hidden" name="c" value="urls" /> <input type="hidden" name="view" value="urls" /> <input type="hidden" name="layout" value="view404" /> <input type="hidden" name="option" value="com_sh404sef" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @version $Id: default_visits.php 1559 2010-08-23 10:01:15Z silianacom-svn $ */ // Security check to ensure this file is being included by a parent file. if (!defined('_JEXEC')) { die('Direct Access to this location is not allowed.'); } switch ($this->sefConfig->analyticsDashboardDataType) { case 'ga:visits': $title = JText16::_('COM_SH404SEF_ANALYTICS_DATA_VISITS_DESC_RAW'); break; case 'ga:visitors': $title = JText16::_('COM_SH404SEF_ANALYTICS_DATA_VISITORS_DESC_RAW'); break; case 'ga:pageviews': $title = JText16::_('COM_SH404SEF_ANALYTICS_GLOBAL_PAGEVIEWS_DESC_RAW'); break; default: $title = ''; break; } $title = Sh404sefHelperAnalytics::getDataTypeTitle() . (empty($title) ? '' : '::' . $title); ?> <div class="hasAnalyticsTip" title="<?php echo $title; ?> " > <fieldset>
$x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_CONTENT_TITLE_SHOW_CAT'), JText16::_('COM_SH404SEF_TT_CONTENT_TITLE_SHOW_CAT'), $this->lists['ContentTitleShowCat']); $x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_CONTENT_TITLE_USE_CAT_ALIAS'), JText16::_('COM_SH404SEF_TT_CONTENT_TITLE_USE_CAT_ALIAS'), $this->lists['ContentTitleUseCatAlias']); ?> </table><?php // end of params for meta tags management --> echo $pane->endPanel(); echo $pane->startPanel(JText16::_('COM_SH404SEF_MOBILE_CONFIG'), 'mobileconfig'); // params for mobile template configuration --> ?> <table class="adminlist"><tr><?php $x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_MOBILE_SWITCH_ENABLED'), JText16::_('COM_SH404SEF_TT_MOBILE_SWITCH_ENABLED'), $this->lists['mobile_switch_enabled']); $x++; Sh404sefViewHelperConfig::shTextParamHTML($x, JText16::_('COM_SH404SEF_MOBILE_SWITCH_TEMPLATE'), JText16::_('COM_SH404SEF_TT_MOBILE_SWITCH_TEMPLATE'), 'mobile_template', $this->lists['mobile_template'], 30, 30); ?> </table> <?php echo $pane->endPanel(); echo $pane->endPane(); ?> <!-- end of configuration html --> <input type="hidden" name="c" value="config" /> <input type="hidden" name="view" value="config" /> <input type="hidden" name="layout" value="seo" /> <input type="hidden" name="format" value="raw" /> <input type="hidden" name="option" value="com_sh404sef" />
<div class="sh404sef-popup" id="sh404sef-popup"> <div id="content-box"> <div class="border"> <div id="toolbar-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <div class="sh404sef-toolbar-title icon-48-sh404sef"> <?php echo JText16::_('COM_SH404SEF_CONFIRM_BOX_TITLE'); ?> </div> <div class="clr"></div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <div class="clr"></div> <div class="clr"></div> <div class="clr"></div> </div>
/** * Return html for any option that could * be presented to the user on the last * page of the wizard (like clean temp files) * for instance. This will be displayed just after * the mainText text, as prepared by the main * part of this controller */ protected function _getTerminateOptions() { $options = JText16::_('COM_SH404SEF_IMPORT_URLS_WARNING'); return $options; }
</div> </dd> </dl> <div id="content-box"> <div class="border"> <div id="toolbar-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <div class="mainurl"><?php echo '<small>' . JText16::_('COM_SH404SEF_NOT_FOUND_ENTER_REDIRECT_FOR') . '</small> ' . $this->escape($this->url->get('oldurl')); ?> </div> <div class="clr"></div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <div class="clr"></div> <div class="clr"></div> <div class="clr"></div> </div> </div>
<tr> <?php if (!empty($output)) { echo $output; } if ($this->sefConfig->debugToLogFile) { echo '<tr><th class="cpanel" colspan="3" >DEBUG to log file : ACTIVATED <small>at ' . date('Y-m-d H:i:s', $this->sefConfig->debugStartedAt) . '</small></th></tr>'; } ?> </tr> </table> <table class="adminform" width="100%"> <tr> <th class="cpanel" colspan="8"> <?php echo JText16::_('COM_SH404SEF_URLS_STATS'); ?> </th> </tr> <tr> <td width="8%"><?php echo COM_SH404SEF_REDIR_TOTAL . ':'; ?> </td> <td align="left" width="12%" style="font-weight: bold"><?php echo $this->sefCount + $this->Count404 + $this->customCount; ?> </td> <td width="8%"><?php echo COM_SH404SEF_REDIR_SEF . ':'; ?>
/** * prepare html filters to allow user to select the way she likes * to view reports */ protected function _prepareFilters() { // array to hold various filters $filters = array(); // find if we must display all filters. On dashboard, only a reduced set $allFilters = $this->_options['showFilters'] == 'yes'; // select account to retrieve data for (or rather, profile $customSubmit = ' onchange="shSetupAnalytics({' . ($allFilters ? '' : 'showFilters:\'no\'') . '});"'; $select = Sh404sefHelperHtml::buildSelectList($this->_accounts, $this->_options['accountId'], 'accountId', $autoSubmit = false, $addSelectAll = false, $selectAllTitle = '', $customSubmit); $filters[] = JText16::_('COM_SH404SEF_ANALYTICS_ACCOUNT') . ': ' . $select; // dashboard only has account selection, no room for anything else // only shows main selection drop downs on analytics view if ($allFilters) { // select start date $select = JHTML::_('calendar', $this->_options['startDate'], 'startDate', 'startDate', '%Y-%m-%d', 'class="textinput"'); $filters[] = ' ' . JText16::_('COM_SH404SEF_ANALYTICS_START_DATE') . ': ' . $select; // select end date $select = JHTML::_('calendar', $this->_options['endDate'], 'endDate', 'endDate', '%Y-%m-%d', 'class="textinput"'); $filters[] = ' ' . JText16::_('COM_SH404SEF_ANALYTICS_END_DATE') . ': ' . $select; // select groupBy (day, week, month) $select = Sh404sefHelperAnalytics::buildAnalyticsGroupBySelectList($this->_options['groupBy'], 'groupBy', $autoSubmit = false, $addSelectAll = false, $selectAllTitle = '', $customSubmit); $filters[] = ' ' . JText16::_('COM_SH404SEF_ANALYTICS_GROUP_BY') . ': ' . $select; // add a click to update link $filters[] = ' <a href="javascript: void(0);" onclick="javascript: shSetupAnalytics({forced:1' . ($allFilters ? '' : ',showFilters:\'no\'') . '});" > [' . Jtext16::_('COM_SH404SEF_CHECK_ANALYTICS') . ']</a>'; } else { // on dashboard, there is no date select, so we must display the date range $filters[] = ' ' . JText16::_('COM_SH404SEF_ANALYTICS_DATE_RANGE') . ' <div class="largertext">' . $this->_options['startDate'] . ' >> ' . $this->_options['endDate'] . '</div>'; } return $filters; }
protected function _getTerminateOptions() { $options = '<br /><br />'; $options .= '<input type="checkbox" name="purge_temp_files" value="1" checked="checked" >'; $options .= JText16::_('COM_SH404SEF_PURGE_TEMP_FILES'); $options .= '<br />'; return $options; }
$x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_INSERT_IJOOMLA_MAG_ARTICLE_ID'), JText16::_('COM_SH404SEF_TT_INSERT_IJOOMLA_MAG_ARTICLE_ID'), $this->lists['shInsertIJoomlaMagArticleId']); ?> </table><?php // end of params for iJoomla magazine --> echo $pane->endPanel(); echo $pane->startPanel('iJoomla News', 'ijoomlanewsp'); // params for iJoomla NewsPortal --> ?> <table class="adminlist"><?php $x = 1; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_INSERT_IJOOMLA_NEWSP_NAME'), COM_SH404SEF_TT_INSERT_IJOOMLA_NEWSP_NAME . JText16::_('COM_SH404SEF_TT_NAME_BY_COMP'), $this->lists['shInsertNewsPName']); $x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_INSERT_IJOOMLA_NEWSP_CAT_ID'), JText16::_('COM_SH404SEF_TT_INSERT_IJOOMLA_NEWSP_CAT_ID'), $this->lists['shNewsPInsertCatId']); $x++; echo Sh404sefViewHelperConfig::shYesNoParamHTML($x, JText16::_('COM_SH404SEF_INSERT_IJOOMLA_NEWSP_SECTION_ID'), JText16::_('COM_SH404SEF_TT_INSERT_IJOOMLA_NEWSP_SECTION_ID'), $this->lists['shNewsPInsertSecId']); ?> </table><?php // end of params for iJoomla NewsPortal --> echo $pane->endPanel(); echo $pane->endPane(); ?> <!-- end of configuration html --> <input type="hidden" name="c" value="config" /> <input type="hidden" name="view" value="config" /> <input type="hidden" name="layout" value="ext" /> <input type="hidden" name="format" value="raw" /> <input type="hidden" name="option" value="com_sh404sef" /> <input type="hidden" name="task" value="" />
/** * Returns html to display a main control panel icon * * @param string $function name of function performed by icon */ public function getCPImage($function) { switch ($function) { case 'config_base': $img = ' <img src=\'components/com_sh404sef/assets/images/icon-48-cpanel.png\'/>'; $linkData = array('c' => 'config', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_CONFIG_DESC'), 'class' => 'modalediturl', 'anchor' => $img . '<span>' . JText16::_('COM_SH404SEF_CONFIG') . '</span>'); $modalOptions = array('size' => array('x' => '\\window.getSize().scrollSize.x*.9', 'y' => '\\window.getSize().size.y*.9')); $link = Sh404sefHelperHtml::makeLink(null, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); break; case 'config_ext': $img = ' <img src=\'components/com_sh404sef/assets/images/icon-48-ext.png\'/>'; $linkData = array('c' => 'config', 'layout' => 'ext', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_CONFIG_EXT_DESC'), 'class' => 'modalediturl', 'anchor' => $img . '<span>' . JText16::_('COM_SH404SEF_CONFIG_EXT') . '</span>'); $modalOptions = array('size' => array('x' => '\\window.getSize().scrollSize.x*.9', 'y' => '\\window.getSize().size.y*.9')); $link = Sh404sefHelperHtml::makeLink(null, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); break; case 'config_error_page': $img = ' <img src=\'components/com_sh404sef/assets/images/icon-48-errorpage.png\'/>'; $linkData = array('c' => 'config', 'layout' => 'errordocs', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_CONFIG_ERROR_PAGE_DESC'), 'class' => 'modalediturl', 'anchor' => $img . '<span>' . JText16::_('COM_SH404SEF_CONFIG_ERROR_PAGE') . '</span>'); $modalOptions = array('size' => array('x' => '\\window.getSize().scrollSize.x*.9', 'y' => '\\window.getSize().size.y*.9')); $link = Sh404sefHelperHtml::makeLink(null, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); break; case 'config_seo': $img = ' <img src=\'components/com_sh404sef/assets/images/icon-48-seo.png\'/>'; $linkData = array('c' => 'config', 'layout' => 'seo', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_CONFIG_SEO_DESC'), 'class' => 'modalediturl', 'anchor' => $img . '<span>' . JText16::_('COM_SH404SEF_CONFIG_SEO') . '</span>'); $modalOptions = array('size' => array('x' => 700, 'y' => '\\window.getSize().size.y*.7')); $link = Sh404sefHelperHtml::makeLink(null, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); break; case 'config_sec': $img = ' <img src=\'components/com_sh404sef/assets/images/icon-48-sec.png\'/>'; $linkData = array('c' => 'config', 'layout' => 'sec', 'tmpl' => 'component'); $urlData = array('title' => JText16::_('COM_SH404SEF_CONFIG_SEC_DESC'), 'class' => 'modalediturl', 'anchor' => $img . '<span>' . JText16::_('COM_SH404SEF_CONFIG_SEC') . '</span>'); $modalOptions = array('size' => array('x' => 700, 'y' => '\\window.getSize().size.y*.9')); $link = Sh404sefHelperHtml::makeLink(null, $linkData, $urlData, $modal = true, $modalOptions, $hasTip = false, $extra = ''); break; case 'urlmanager': $img = 'icon-48-sefmanager.png'; $title = JText16::_('COM_SH404SEF_VIEWURLDESC'); $anchor = JText16::_('COM_SH404SEF_VIEWURL'); $link = 'index.php?option=com_sh404sef&c=urls&layout=default&view=urls'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; case '404manager': $img = 'icon-48-404log.png'; $title = JText16::_('COM_SH404SEF_VIEW404DESC'); $anchor = JText16::_('COM_SH404SEF_404_MANAGER'); $link = 'index.php?option=com_sh404sef&c=urls&layout=view404&view=urls'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; case 'aliasesmanager': $img = 'icon-48-aliases.png'; $title = JText16::_('COM_SH404SEF_ALIASES_HELP'); $anchor = JText16::_('COM_SH404SEF_ALIASES_MANAGER'); $link = 'index.php?option=com_sh404sef&c=aliases&layout=default&view=aliases'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; case 'pageidmanager': $img = 'icon-48-pageid.png'; $title = JText16::_('COM_SH404SEF_PAGEID_HELP'); $anchor = JText16::_('COM_SH404SEF_PAGEID_MANAGER'); $link = 'index.php?option=com_sh404sef&c=pageids&layout=default&view=pageids'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; case 'metamanager': $img = 'icon-48-metas.png'; $title = JText16::_('COM_SH404SEF_META_TAGS_DESC'); $anchor = JText16::_('COM_SH404SEF_META_TAGS'); $link = 'index.php?option=com_sh404sef&c=metas&layout=default&view=metas'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; case 'doc': $img = 'icon-48-doc.png'; $title = JText16::_('COM_SH404SEF_INFODESC'); $anchor = JText16::_('COM_SH404SEF_INFO'); $link = 'index.php?option=com_sh404sef&layout=info&view=default&task=info'; $link = Sh404sefHelperHtml::_doLinkCPImage($img, $title, $anchor, $link); break; } return $link; }
/** * Redirect to a confirmation page showing in * a popup window */ private function _doConfirmPurge($type = 'auto') { // Set the view name and create the view object $viewName = 'confirm'; $document =& JFactory::getDocument(); $viewType = $document->getType(); $viewLayout = JRequest::getCmd('layout', $this->_defaultLayout); $view =& $this->getView($viewName, $viewType, '', array('base_path' => $this->_basePath)); // and who's gonna handle the request $view->assign('actionController', $this->_defaultController); // Get/Create the model if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) { // store context of the main url view in the model $model->setContext('com_sh404sef.aliases.aliases.default'); // Push the model into the view (as default) $view->setModel($model, true); } // tell it what to display // we purge aliases, count them first $numberOfAliases = $model->getAliasesCount($type); // if nothing to do, say so and return to main page if (empty($numberOfAliases)) { $view->assign('redirectTo', $this->_getDefaultRedirect()); $view->assign('message', JText16::_('COM_SH404SEF_NORECORDS')); } else { // calculate the message and some hidden data to be passed // through the confirmation box switch ($type) { case 'selected': $mainText = JText16::sprintf('COM_SH404SEF_CONFIRM_PURGE_ALIASES_SELECTED', $numberOfAliases); break; case 'auto': $mainText = JText16::sprintf('COM_SH404SEF_CONFIRM_PURGE_ALIASES', $numberOfAliases); default: break; } $hiddenText = '<input type="hidden" name="delete_type" value="' . $type . '" />'; // push that into the view $view->assign('mainText', $mainText); $view->assign('hiddenText', $hiddenText); } // Set the layout $view->setLayout($viewLayout); // Display the view $view->display(); }
private function _makeOptionsSelect($options) { $selects = new StdClass(); // component list $current = $options->filter_component; $name = 'filter_component'; $selectAllTitle = JText16::_('COM_SH404SEF_ALL_COMPONENTS'); $selects->components = Sh404sefHelperHtml::buildComponentsSelectList($current, $name, $autoSubmit = true, $addSelectAll = true, $selectAllTitle); // language list $current = $options->filter_language; $name = 'filter_language'; $selectAllTitle = JText16::_('COM_SH404SEF_ALL_LANGUAGES'); $selects->languages = Sh404sefHelperHtml::buildLanguagesSelectList($current, $name, $autoSubmit = true, $addSelectAll = true, $selectAllTitle); // select custom $current = $options->filter_url_type; $name = 'filter_url_type'; $selectAllTitle = JText16::_('COM_SH404SEF_ALL_URL_TYPES'); $data = array(array('id' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_CUSTOM, 'title' => JText16::_('COM_SH404SEF_ONLY_CUSTOM')), array('id' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_AUTO, 'title' => JText16::_('COM_SH404SEF_ONLY_AUTO'))); $selects->filter_url_type = Sh404sefHelperHtml::buildSelectList($data, $current, $name, $autoSubmit = true, $addSelectAll = true, $selectAllTitle); // select title $current = $options->filter_title; $name = 'filter_title'; $selectAllTitle = JText16::_('COM_SH404SEF_ALL_TITLE'); $data = array(array('id' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_TITLE, 'title' => JText16::_('COM_SH404SEF_ONLY_TITLE')), array('id' => Sh404sefHelperGeneral::COM_SH404SEF_NO_TITLE, 'title' => JText16::_('COM_SH404SEF_NO_TITLE'))); $selects->filter_title = Sh404sefHelperHtml::buildSelectList($data, $current, $name, $autoSubmit = true, $addSelectAll = true, $selectAllTitle); // select description $current = $options->filter_desc; $name = 'filter_desc'; $selectAllTitle = JText16::_('COM_SH404SEF_ALL_DESC'); $data = array(array('id' => Sh404sefHelperGeneral::COM_SH404SEF_ONLY_DESC, 'title' => JText16::_('COM_SH404SEF_ONLY_DESC')), array('id' => Sh404sefHelperGeneral::COM_SH404SEF_NO_DESC, 'title' => JText16::_('COM_SH404SEF_NO_DESC'))); $selects->filter_desc = Sh404sefHelperHtml::buildSelectList($data, $current, $name, $autoSubmit = true, $addSelectAll = true, $selectAllTitle); // return set of select lists return $selects; }
} ?> </table> <?php echo $pane->endPanel(); echo $pane->startPanel(JText16::_('COM_SH404SEF_DEFAULT_PARAMS_TITLE'), 'default_params'); ?> <table class="adminform"> <tr> <td colspan="3" align="left"> <div style="border: 1px solid #FF0000; margin: 5px; padding: 5px; background-color: #FFEFEF"> <?php echo JText16::_('COM_SH404SEF_DEFAULT_PARAMS_WARNING'); ?> </div> </td> </tr> <tr> <td width="450"><textarea name="defaultParamList" cols="100" rows="30"><?php echo $this->lists['defaultParamList']; ?> </textarea> </td> </tr> </table> <?php echo $pane->endPanel(); echo $pane->endPane();
?> " > <?php echo JText16::_('COM_SH404SEF_ANALYTICS_TOP5_PAGEVIEWS_PERCENT'); ?> </th> <?php $t = JText16::_('COM_SH404SEF_ANALYTICS_TOP5_AVG_TIME_ON_PAGE') . '::' . JText16::_('COM_SH404SEF_ANALYTICS_TT_AVG_TIME_ON_PAGE_DESC'); ?> <th class="title hasAnalyticsTip" title="<?php echo $t; ?> " > <?php echo JText16::_('COM_SH404SEF_ANALYTICS_TOP5_AVG_TIME_ON_PAGE'); ?> </th> </tr> </thead> <tbody> <?php $k = 0; $i = 1; foreach ($this->analytics->analyticsData->top5urls as $entry) { ?> <tr class="<?php