Esempio n. 1
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->id;
     $isNew = $this->item->id == 0;
     $canDo = CeltawebtrafficHelper::getActions($this->item->id);
     JToolBarHelper::title($isNew ? JText::_('COM_CELTAWEBTRAFFIC_TITLE_NEW') : JText::_('COM_CELTAWEBTRAFFIC_TITLE_EDIT'), 'cwt-knownip');
     // Built the actions for new and existing records.
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('knownip.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('knownip.save', 'JTOOLBAR_SAVE');
             JToolBarHelper::custom('knownip.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         }
         JToolBarHelper::cancel('knownip.cancel', 'JTOOLBAR_CANCEL');
     } else {
         if ($canDo->get('core.edit')) {
             // We can save the new record
             JToolBarHelper::apply('knownip.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('knownip.save', 'JTOOLBAR_SAVE');
             // We can save this record, but check the create permission to see if we can return to make a new one.
             if ($canDo->get('core.create')) {
                 JToolBarHelper::custom('knownip.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
             }
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('knownip.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         }
         JToolBarHelper::cancel('knownip.cancel', 'JTOOLBAR_CLOSE');
     }
 }
Esempio n. 2
0
 function display($tpl = null)
 {
     $canDo = CeltawebtrafficHelper::getActions();
     $model =& $this->getModel();
     $countries =& $model->getCountries();
     $cities =& $model->getCities();
     // Is this the Professional release?
     jimport('joomla.filesystem.file');
     $isPro = COM_CELTAWEBTRAFFIC_PRO == 1;
     $this->assign('isPro', $isPro);
     $version = COM_CELTAWEBTRAFFIC_VERSION;
     $this->assign('version', $version);
     $releaseDate = COM_CELTAWEBTRAFFIC_DATE;
     $this->assign('release_date', $releaseDate);
     $this->assignRef('countries', $countries);
     $this->assignRef('cities', $cities);
     if (!$this->geodatExist('geoip')) {
         echo JText::_('COM_CELTAWEBTRAFFIC_NOGEO_CPANEL_MESSAGE');
     }
     JToolBarHelper::title(JText::_('COM_CELTAWEBTRAFFIC_TITLE_MAIN') . ' [ ' . JText::_('COM_CELTAWEBTRAFFIC_TITLE_CPANEL') . ' ]', 'cwt-cpanel');
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_celtawebtraffic');
     }
     $help_url = 'http://coalaweb.com/services/joomla-services-such-a-great-cms/joomla-docs/item/celtaweb-traffic-guide';
     JToolBarHelper::help('COM_CELTAWEBTRAFFIC_TITLE_HELP', false, $help_url);
     parent::display($tpl);
 }
Esempio n. 3
0
 /**
  * Method to display a view.
  *
  * @param	boolean
  * @param	array
  *
  * @return	JController
  * @since	1.5
  */
 function display($cachable = false)
 {
     require_once JPATH_COMPONENT . '/helpers/celtawebtraffic.php';
     // Load the submenu.
     CeltawebtrafficHelper::addSubmenu(JRequest::getCmd('view', 'Controlpanel'));
     $view = JRequest::getCmd('view', 'Controlpanel');
     $layout = JRequest::getCmd('layout', 'default');
     if ($view == 'knownip' && $layout == 'edit' && !$this->checkEditId('com_celtawebtraffic.edit.knownip', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_celtawebtraffic&view=knownips', false));
         return false;
     }
     parent::display();
     return $this;
 }
Esempio n. 4
0
 public function setToolbar()
 {
     $canDo = CeltawebtrafficHelper::getActions();
     JToolBarHelper::title(JText::_('COM_CELTAWEBTRAFFIC_TITLE_MAIN') . ' [ ' . JText::_('COM_CELTAWEBTRAFFIC_TITLE_GEO') . ' ]', 'cwt-geo');
     JToolBarHelper::back('COM_CELTAWEBTRAFFIC_TITLE_CPANEL', 'index.php?option=com_celtawebtraffic');
     if ($canDo->get('core.admin')) {
         if ($this->filesExist('archives')) {
             JToolBarHelper::divider();
             JToolBarHelper::custom('geoupload.unzip', 'cwt-extract', 'unzip', 'Unzip', false);
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_celtawebtraffic');
     }
     $help_url = 'http://coalaweb.com/services/joomla-services-such-a-great-cms/joomla-docs/item/celtaweb-traffic-guide';
     JToolBarHelper::help('COM_CELTAWEBTRAFFIC_TITLE_HELP', false, $help_url);
 }
Esempio n. 5
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = CeltawebtrafficHelper::getActions();
     $state = $this->get('State');
     JToolBarHelper::title(JText::_('COM_CELTAWEBTRAFFIC_TITLE_MAIN') . ' [ ' . JText::_('COM_CELTAWEBTRAFFIC_TITLE_VISITORS') . ' ]', 'cwt-visitors');
     JToolBarHelper::back('COM_CELTAWEBTRAFFIC_TITLE_CPANEL', 'index.php?option=com_celtawebtraffic');
     if ($canDo->get('core.delete')) {
         JToolBarHelper::divider();
         JToolBarHelper::deleteList('', 'visitors.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         $bar = JToolBar::getInstance('toolbar');
         $bar->appendButton('Link', 'export', 'COM_CELTAWEBTRAFFIC_TITLE_REPORT', 'index.php?option=com_celtawebtraffic&task=visitors.csvreport');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_celtawebtraffic');
     }
     $help_url = 'http://coalaweb.com/services/joomla-services-such-a-great-cms/joomla-docs/item/celtaweb-traffic-guide';
     JToolBarHelper::help('COM_CELTAWEBTRAFFIC_TITLE_HELP', false, $help_url);
 }
Esempio n. 6
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     $canDo = CeltawebtrafficHelper::getActions();
     JToolBarHelper::title(JText::_('COM_CELTAWEBTRAFFIC_TITLE_MAIN') . ' [ ' . JText::_('COM_CELTAWEBTRAFFIC_TITLE_KNOWNIPS') . ' ]', 'cwt-knownip');
     JToolBarHelper::back('COM_CELTAWEBTRAFFIC_TITLE_CPANEL', 'index.php?option=com_celtawebtraffic');
     JToolBarHelper::divider();
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNew('knownip.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editList('knownip.edit', 'JTOOLBAR_EDIT');
     }
     if ($canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'knownips.delete', 'JTOOLBAR_DELETE');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_celtawebtraffic');
     }
     $help_url = 'http://coalaweb.com/services/joomla-services-such-a-great-cms/joomla-docs/item/celtaweb-traffic-guide';
     JToolBarHelper::help('COM_CELTAWEBTRAFFIC_TITLE_HELP', false, $help_url);
 }
Esempio n. 7
0
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
JLoader::register('CeltawebtrafficHelper', dirname(__FILE__) . DS . 'helpers' . DS . 'celtawebtraffic.php');
// Check count plugin
if (JPluginHelper::isEnabled('system', 'cwtrafficcount', true) == false) {
    echo JText::_('COM_CELTAWEBTRAFFIC_NOCOUNTPLUGIN_GENERAL_MESSAGE');
}
// Check clean plugin
if (JPluginHelper::isEnabled('system', 'cwtrafficclean', true) == false) {
    echo JText::_('COM_CELTAWEBTRAFFIC_NOCLEANPLUGIN_GENERAL_MESSAGE');
}
// Lets get some style
JFactory::getDocument()->addStyleSheet("../media/com_celtawebtraffic/css/com-celtawebtraffic-base.css");
// Update countries and cities for visitors
CeltawebtrafficHelper::location_update();
// Load version.php
jimport('joomla.filesystem.file');
$version_php = JPATH_COMPONENT_ADMINISTRATOR . DS . 'version.php';
if (!defined('COM_CELTAWEBTRAFFIC_VERSION') && JFile::exists($version_php)) {
    require_once $version_php;
}
$controller = JControllerLegacy::getInstance('Celtawebtraffic');
$controller->execute(JRequest::getCmd('task'));
$controller->redirect();
?>
<div class="cwt-powerby-back">
    <span class="cwt-powerby-back">
        <?php 
echo JTEXT::_('COM_CELTAWEBTRAFFIC_POWEREDBY_MSG');
?>