Example #1
0
 protected function getInput()
 {
     $this->value = str_replace('<br />', "\n", JText::_($this->value));
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return parent::getInput();
 }
Example #2
0
 public function getInput()
 {
     $result = "";
     $langs = JFactory::getLanguage()->getKnownLanguages();
     $oldId = $this->id;
     $oldName = $this->name;
     $oldValue = $this->value;
     $lt = json_decode($oldValue);
     if ($lt == null) {
         $lt = new stdClass();
         // added fallback logic in case the current value is not in JSON format
         // this might be because in older versions there where no multilanguage fields.
         if (!empty($this->value) && json_last_error() == JSON_ERROR_SYNTAX) {
             foreach ($langs as $tag => $lang) {
                 $lt->{$tag} = $this->value;
             }
         }
     }
     $defaultLanguageTag = JComponentHelper::getParams('com_languages')->get('site');
     $defaultLanguage = $langs[$defaultLanguageTag];
     if ($defaultLanguage != null) {
         unset($langs[$defaultLanguageTag]);
         $langs = array_merge(array($defaultLanguageTag => $defaultLanguage), $langs);
     }
     if (count($langs) > 1) {
         $result .= '<small>' . JText::_('COM_EVENTGALLERY_LOCALIZEDEDITOR_WARNING') . '</small>';
     }
     foreach ($langs as $tag => $lang) {
         $defaultLangMarker = $tag == $defaultLanguageTag ? "*" : "";
         $this->value = isset($lt->{$tag}) === true ? $lt->{$tag} : '';
         $this->id = $oldId . str_replace('-', '_', $tag);
         $this->name = $oldName . str_replace('-', '_', $tag);
         $result .= '<div style="clear:both">';
         $result .= "<h4 >{$tag} {$defaultLangMarker}</h4>";
         $result .= parent::getInput();
         $result .= '</div>';
     }
     $this->id = $oldId;
     $this->value = $oldValue;
     $this->name = $oldName;
     $hiddenField = '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"/>';
     return $result . $hiddenField;
 }
Example #3
0
 protected function getInput()
 {
     $this->value = str_replace('<br />', "\n", JText::_($this->value));
     return parent::getInput();
 }
Example #4
0
 /**
  * Method to get the field input markup for the editor area
  *
  * @return  string  The field input markup.
  *
  * @since   1.6
  */
 protected function getEditor($name, $value, $form)
 {
     $editor = new JFormFieldEditor();
     $editor->name = $name;
     $editor->value = $value;
     $editor->form = $form;
     return $editor->getInput();
 }