function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . " - " . JText::_('COM_JOOMLABACKLINKCHECKER_SUBMENU_CATEGORIES'), 'joomlabacklinkchecker');
     if (JFactory::getUser()->authorise('joomlabacklinkchecker.categoriesnew', 'com_joomlabacklinkchecker')) {
         JToolBarHelper::addNew();
     }
     if (JFactory::getUser()->authorise('joomlabacklinkchecker.categoriesedit', 'com_joomlabacklinkchecker')) {
         JToolBarHelper::editList();
     }
     if (JFactory::getUser()->authorise('core.delete', 'com_joomlabacklinkchecker')) {
         JToolBarHelper::deleteList();
     }
     if (JFactory::getUser()->authorise('core.admin', 'com_joomlabacklinkchecker')) {
         JToolBarHelper::preferences('com_joomlabacklinkchecker', '500');
     }
     $items = $this->get('Categories');
     $pagination = $this->get('Pagination');
     $this->_state = $this->get('State');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     $donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
     $this->assignRef('donation_code_message', $donation_code_message);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $entry = $this->get('Data');
     // Get Categories for selection list
     $categories = $this->get('Categories', 'categories');
     if (empty($entry->id)) {
         JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_NEWENTRY'), 'joomlabacklinkchecker-add');
         JToolBarHelper::save('save');
         JToolBarHelper::cancel('cancel');
     } else {
         JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_EDITENTRY'), 'joomlabacklinkchecker-edit');
         JToolbarHelper::apply('apply');
         JToolBarHelper::save('save');
         JToolBarHelper::custom('checkselection', 'extension', 'extension', JText::_('COM_JOOMLABACKLINKCHECKER_SAVECHECK_BUTTON'), false);
         JToolBarHelper::cancel('cancel', 'Close');
     }
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
     $this->assignRef('entry', $entry);
     $this->assignRef('categories', $categories);
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     $donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
     $this->assignRef('donation_code_message', $donation_code_message);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . " - " . JText::_('COM_JOOMLABACKLINKCHECKER_SUBMENU_ABOUT'), 'joomlabacklinkchecker');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     $donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
     $this->assignRef('donation_code_message', $donation_code_message);
     parent::display($tpl);
 }
 function __construct()
 {
     parent::__construct();
     $this->_input = JFactory::getApplication()->input;
     $this->registerTask('add', 'edit');
     if (!$this->_input->getCmd('task', '')) {
         // Set submenu
         require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
         JoomlaBacklinkCheckerHelper::addSubmenu($this->_input->getCmd('view', 'joomlabacklinkchecker'));
     }
 }
 public function display($cachable = false, $urlparams = false)
 {
     // We need the category model also in the default view for the selection list
     $view = $this->getView('joomlabacklinkchecker', 'html');
     if ($model_categories = $this->getModel('categories')) {
         $view->setModel($model_categories, false);
     }
     // Set submenu
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     JoomlaBacklinkCheckerHelper::addSubmenu(JFactory::getApplication()->input->getCmd('view', 'joomlabacklinkchecker'));
     parent::display();
 }
 function __construct()
 {
     parent::__construct();
     $this->_input = JFactory::getApplication()->input;
     $this->registerTask('add', 'edit');
     if (!$this->_input->getCmd('task', '')) {
         $view = $this->getView('joomlabacklinkchecker', 'html');
         if ($model_categories = $this->getModel('categories')) {
             $view->setModel($model_categories, false);
         }
         // Set submenu
         require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
         JoomlaBacklinkCheckerHelper::addSubmenu($this->_input->getCmd('view', 'joomlabacklinkchecker'));
     }
 }
 function display($tpl = null)
 {
     $category = $this->get('Category');
     if (empty($category->id)) {
         JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_NEWCATEGORY'), 'joomlabacklinkchecker-add');
         JToolBarHelper::save('save');
         JToolBarHelper::cancel('cancel');
     } else {
         JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_EDITCATEGORY'), 'joomlabacklinkchecker-edit');
         JToolbarHelper::apply('apply');
         JToolBarHelper::save('save');
         JToolBarHelper::cancel('cancel', 'Close');
     }
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
     $this->assignRef('category', $category);
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     $donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
     $this->assignRef('donation_code_message', $donation_code_message);
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_RESULT'), 'joomlabacklinkchecker-add');
     JToolBarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_joomlabacklinkchecker');
     $check_result = JFactory::getApplication()->input->get('check_result', array(), 'ARRAY');
     $this->assignRef('check_result', $check_result);
     // Show the edit button?
     if (JFactory::getUser()->authorise('joomlabacklinkchecker.edit', 'com_joomlabacklinkchecker')) {
         $this->edit_allowed = true;
     }
     // Debug mode only if activated, task is checkselection, single entry is checked and debug output is available
     // Maybe could be changed in a further version with a popup display for each entry...
     $params = JComponentHelper::getParams('com_joomlabacklinkchecker');
     if ($params->get('debug', 0) and JFactory::getApplication()->input->get('task') == 'checkselection' and count($check_result) == 1 and !empty($check_result[0]['result_debug'])) {
         $this->assignRef('debug', $params->get('debug', 0));
     }
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
     require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
     $donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
     $this->assignRef('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>';
     JoomlaBacklinkCheckerHelper::addHeadData($head_data);
     $session->set('field_value_head', $head_data, 'krdonationcodecheck_footer');
     return $class_name;
 }