示例#1
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_EASYJOOMLABACKUP') . " - " . JText::_('COM_EASYJOOMLABACKUP_SUBMENU_ENTRIES'), 'easyjoomlabackup');
     if (JFactory::getUser()->authorise('easyjoomlabackup.fullbackup', 'com_easyjoomlabackup')) {
         JToolBarHelper::custom('fullbackup', 'new', 'new', JText::_('COM_EASYJOOMLABACKUP_FULLBACKUP'), false);
     }
     if (JFactory::getUser()->authorise('easyjoomlabackup.databasebackup', 'com_easyjoomlabackup')) {
         JToolBarHelper::custom('databasebackup', 'new', 'new', JText::_('COM_EASYJOOMLABACKUP_DATABASEBACKUP'), false);
     }
     if (JFactory::getUser()->authorise('easyjoomlabackup.filebackup', 'com_easyjoomlabackup')) {
         JToolBarHelper::custom('filebackup', 'new', 'new', JText::_('COM_EASYJOOMLABACKUP_FILEBACKUP'), false);
     }
     if (JFactory::getUser()->authorise('easyjoomlabackup.discover', 'com_easyjoomlabackup')) {
         JToolBarHelper::custom('discover', 'refresh', 'refresh', JText::_('COM_EASYJOOMLABACKUP_DISCOVER'), false);
     }
     if (JFactory::getUser()->authorise('core.delete', 'com_easyjoomlabackup')) {
         JToolBarHelper::deleteList();
     }
     if (JFactory::getUser()->authorise('core.admin', 'com_easyjoomlabackup')) {
         JToolBarHelper::preferences('com_easyjoomlabackup', '500');
     }
     if (JFactory::getUser()->authorise('easyjoomlabackup.download', 'com_easyjoomlabackup')) {
         $download_allowed = true;
     } else {
         $download_allowed = false;
     }
     $items = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->plugin_state = $this->get('PluginStatus');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_easyjoomlabackup/css/easyjoomlabackup.css');
     $this->items = $items;
     $this->pagination = $pagination;
     $this->download_allowed = $download_allowed;
     // Check for database type
     $db_type = JFactory::getConfig()->get('dbtype');
     $this->db_type = $db_type;
     // Get donation code message
     require_once JPATH_COMPONENT . '/helpers/easyjoomlabackup.php';
     $donation_code_message = EasyJoomlaBackupHelper::getDonationCodeMessage();
     $this->donation_code_message = $donation_code_message;
     parent::display($tpl);
 }
示例#2
0
 function display($tpl = null)
 {
     $task = JFactory::getApplication()->input->get('task');
     if ($task == 'fullbackup') {
         JToolBarHelper::title(JText::_('COM_EASYJOOMLABACKUP') . ' - ' . JText::_('COM_EASYJOOMLABACKUP_CREATEBACKUP_FULLBACKUP'), 'easyjoomlabackup-add');
     } elseif ($task == 'databasebackup') {
         JToolBarHelper::title(JText::_('COM_EASYJOOMLABACKUP') . ' - ' . JText::_('COM_EASYJOOMLABACKUP_CREATEBACKUP_DATABASEBACKUP'), 'easyjoomlabackup-add');
     } elseif ($task == 'filebackup') {
         JToolBarHelper::title(JText::_('COM_EASYJOOMLABACKUP') . ' - ' . JText::_('COM_EASYJOOMLABACKUP_CREATEBACKUP_FILEBACKUP'), 'easyjoomlabackup-add');
     }
     JToolBarHelper::custom('backup_create_' . JFactory::getApplication()->input->get('task'), 'new', 'new', JText::_('COM_EASYJOOMLABACKUP_CREATEBACKUP_BUTTON'), false);
     JToolBarHelper::cancel('cancel');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_easyjoomlabackup/css/easyjoomlabackup.css');
     // Get donation code message
     require_once JPATH_COMPONENT . '/helpers/easyjoomlabackup.php';
     $donation_code_message = EasyJoomlaBackupHelper::getDonationCodeMessage();
     $this->donation_code_message = $donation_code_message;
     parent::display($tpl);
 }
 /**
  * Creates a valid, random name for the class selector
  *
  * @param JSession $session
  *
  * @return string
  */
 private static function randomClassName($session)
 {
     $characters = range('a', 'z');
     $class_name = $characters[mt_rand(0, count($characters) - 1)];
     $class_name_length = mt_rand(6, 12);
     $class_name .= @JUserHelper::genRandomPassword($class_name_length);
     $head_data = '<style type="text/css">div.' . $class_name . '{text-align: center; border: 1px solid #DD87A2; border-radius: 2px; padding: 5px; background-color: #F9CAD9; font-size: 120%; margin: 10px 0;}</style>';
     EasyJoomlaBackupHelper::addHeadData($head_data);
     $session->set('field_value_head', $head_data, 'krdonationcodecheck_footer');
     return $class_name;
 }