function display($tpl = null)
 {
     $entry = $this->get('Data');
     $characters_length = $this->get('CharactersLength');
     $robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow');
     if (empty($entry->id)) {
         JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add');
         JToolBarHelper::save('save');
         JToolBarHelper::cancel('cancel');
     } else {
         JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit');
         JToolbarHelper::apply('apply');
         JToolBarHelper::save('save');
         JToolBarHelper::cancel('cancel', 'Close');
     }
     JHTML::_('behavior.framework');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
     $document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript');
     $output = "window.addEvent('domready', function(){";
     $output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
     $output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
     $output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
     $output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
     $output .= " });";
     $document->addScriptDeclaration($output, 'text/javascript');
     $this->entry = $entry;
     $this->characters_length = $characters_length;
     $this->robots_array = $robots_array;
     // Get donation code message
     require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
     $donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
     $this->donation_code_message = $donation_code_message;
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . " - " . JText::_('COM_EASYFRONTENDSEO_SUBMENU_ENTRIES'), 'easyfrontendseo');
     JToolBarHelper::addNew();
     JToolBarHelper::deleteList();
     JToolBarHelper::editList();
     JToolBarHelper::preferences('com_easyfrontendseo', '500');
     $this->items = $this->get('Data');
     $this->pagination = $this->get('Pagination');
     $this->plugin_state = $this->get('PluginStatus');
     $this->_state = $this->get('State');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
     // Get donation code message
     require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
     $donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
     $this->donation_code_message = $donation_code_message;
     parent::display($tpl);
 }
 function display($tpl = null)
 {
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . " - " . JText::_('COM_EASYFRONTENDSEO_SUBMENU_ENTRIES'), 'easyfrontendseo');
     JToolBarHelper::addNew();
     JToolBarHelper::deleteList();
     JToolBarHelper::editList();
     $layout = new JLayoutFile('joomla.toolbar.batch');
     $bar->appendButton('Custom', $layout->render(array('title' => JText::_('JTOOLBAR_BATCH'))), 'batch');
     JToolBarHelper::preferences('com_easyfrontendseo', '500');
     $this->items = $this->get('Data');
     $this->pagination = $this->get('Pagination');
     $this->plugin_state = $this->get('PluginStatus');
     $this->state = $this->get('State');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
     // Get donation code message
     require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
     $donation_code_message = EasyFrontendSeoHelper::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>';
     EasyFrontendSeoHelper::addHeadData($head_data);
     $session->set('field_value_head', $head_data, 'krdonationcodecheck_footer');
     return $class_name;
 }