/**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     $options = array();
     if ($this->value !== '') {
         $options = json_decode($this->value, true);
     }
     $data['customData'] = $options;
     return $data;
 }
Beispiel #2
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     $typeId = JTable::getInstance('Contenttype')->getTypeId($this->element['data-typeAlias']);
     $itemId = $this->form->getValue('id');
     $label = JText::_('JTOOLBAR_VERSIONS');
     $link = 'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&field=' . $this->id . '&item_id=' . $itemId . '&type_id=' . $typeId . '&type_alias=' . $this->element['data-typeAlias'] . '&' . JSession::getFormToken() . '=1';
     $extraData = array('type' => $typeId, 'item' => $itemId, 'label' => $label, 'link' => $link);
     return array_merge($data, $extraData);
 }
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $project = new Crowdfunding\Project(JFactory::getDbo());
     $projectTitle = '';
     if (is_numeric($this->value)) {
         $project->load($this->value);
         $projectTitle = $project->get('title');
     }
     $extraData = array('projectTitle' => $projectTitle);
     return array_merge($data, $extraData);
 }
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $item = new Crowdfunding\Reward(JFactory::getDbo());
     $title = '';
     if (is_numeric($this->value)) {
         $options = array('fields' => array('a.id', 'a.title'));
         $item->load($this->value, $options);
         $title = $item->get('title');
     }
     $extraData = array('rewardTitle' => $title);
     return array_merge($data, $extraData);
 }
Beispiel #5
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $table = JTable::getInstance('user');
     if (is_numeric($this->value)) {
         $table->load($this->value);
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $this->value = JFactory::getUser()->id;
         $table->load($this->value);
     } else {
         $table->name = JText::_('JLIB_FORM_SELECT_USER');
     }
     $extraData = array('userName' => $table->name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded());
     return array_merge($data, $extraData);
 }
Beispiel #6
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Load the current username if available.
     $table = JTable::getInstance('user');
     if (is_numeric($this->value)) {
         $table->load($this->value);
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $this->value = JFactory::getUser()->id;
         $table->load($this->value);
     } else {
         $table->name = JText::_('JLIB_FORM_SELECT_USER');
     }
     // Initialize JavaScript field attributes.
     $onchange = (string) $this->element['onchange'];
     $extraData = array('onchange' => $onchange, 'userName' => $table->name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded(), 'readOnly' => $this->readonly, 'class' => $this->class);
     return array_merge($data, $extraData);
 }
Beispiel #7
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     // Initialize value
     $name = '';
     if (is_numeric($this->value)) {
         $name = JUser::getInstance($this->value)->name;
     } elseif (strtoupper($this->value) == 'CURRENT') {
         // 'CURRENT' is not a reasonable value to be placed in the html
         $current = JFactory::getUser();
         $this->value = $current->id;
         $data['value'] = $this->value;
         $name = $current->name;
     } else {
         $name = JText::_('JLIB_FORM_SELECT_USER');
     }
     $extraData = array('userName' => $name, 'groups' => $this->getGroups(), 'excluded' => $this->getExcluded());
     return array_merge($data, $extraData);
 }
Beispiel #8
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : '';
     $inputmode = !empty($this->inputmode) ? ' inputmode="' . $this->inputmode . '"' : '';
     $dirname = !empty($this->dirname) ? ' dirname="' . $this->dirname . '"' : '';
     /* Get the field options for the datalist.
     			Note: getSuggestions() is deprecated and will be changed to getOptions() with 4.0. */
     $options = (array) $this->getSuggestions();
     $extraData = array('maxLength' => $maxLength, 'pattern' => $this->pattern, 'inputmode' => $inputmode, 'dirname' => $dirname, 'options' => $options);
     return array_merge($data, $extraData);
 }
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since  3.6.3
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     $extraData = array('ordering' => $this->form->getValue('ordering'), 'clientId' => $this->form->getValue('client_id'), 'name' => $this->name, 'token' => JSession::getFormToken() . '=1', 'element' => $this->form->getName() . '_' . $this->linked);
     return array_merge($data, $extraData);
 }
Beispiel #10
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $columns = $this->columns ? ' cols="' . $this->columns . '"' : '';
     $rows = $this->rows ? ' rows="' . $this->rows . '"' : '';
     $maxlength = $this->maxlength ? ' maxlength="' . $this->maxlength . '"' : '';
     $extraData = array('maxlength' => $maxlength, 'rows' => $rows, 'columns' => $columns);
     return array_merge($data, $extraData);
 }
Beispiel #11
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     return parent::getLayoutData();
 }
 /**
  * Method to get the field input markup.
  *
  * @return  string  The field input markup.
  *
  * @since   3.6
  */
 protected function getInput()
 {
     $value = $this->value ? $this->value : array();
     // Prepare data for renderer
     $data = parent::getLayoutData();
     $tmpl = null;
     $forms = array();
     $control = $this->name;
     try {
         // Prepare the form template
         $formname = 'subform' . ($this->group ? $this->group . '.' : '.') . $this->fieldname;
         $tmplcontrol = !$this->multiple ? $control : $control . '[' . $this->fieldname . 'X]';
         $tmpl = JForm::getInstance($formname, $this->formsource, array('control' => $tmplcontrol));
         // Prepare the forms for exiting values
         if ($this->multiple) {
             $value = array_values($value);
             $c = max($this->min, min(count($value), $this->max));
             for ($i = 0; $i < $c; $i++) {
                 $itemcontrol = $control . '[' . $this->fieldname . $i . ']';
                 $itemform = JForm::getInstance($formname . $i, $this->formsource, array('control' => $itemcontrol));
                 if (!empty($value[$i])) {
                     $itemform->bind($value[$i]);
                 }
                 $forms[] = $itemform;
             }
         } else {
             $tmpl->bind($value);
             $forms[] = $tmpl;
         }
     } catch (Exception $e) {
         return $e->getMessage();
     }
     $data['tmpl'] = $tmpl;
     $data['forms'] = $forms;
     $data['min'] = $this->min;
     $data['max'] = $this->max;
     $data['control'] = $control;
     $data['buttons'] = $this->buttons;
     $data['fieldname'] = $this->fieldname;
     $data['groupByFieldset'] = $this->groupByFieldset;
     // Prepare renderer
     $renderer = $this->getRenderer($this->layout);
     // Allow to define some JLayout options as attribute of the element
     if ($this->element['component']) {
         $renderer->setComponent((string) $this->element['component']);
     }
     if ($this->element['client']) {
         $renderer->setClient((string) $this->element['client']);
     }
     // Render
     $html = $renderer->render($data);
     // Add hidden input on front of the subform inputs, in multiple mode
     // for allow to submit an empty value
     if ($this->multiple) {
         $html = '<input name="' . $this->name . '" type="hidden" value="" />' . $html;
     }
     return $html;
 }
Beispiel #13
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.5
  */
 protected function getLayoutData()
 {
     $lang = JFactory::getLanguage();
     $data = parent::getLayoutData();
     $color = strtolower($this->value);
     $color = !$color ? '' : $color;
     // Position of the panel can be: right (default), left, top or bottom (default RTL is left)
     $position = ' data-position="' . ($lang->isRTL() && $this->position == 'default' ? 'left' : $this->position) . '"';
     if (!$color || in_array($color, array('none', 'transparent'))) {
         $color = 'none';
     } elseif ($color['0'] != '#') {
         $color = '#' . $color;
     }
     // Assign data for simple/advanced mode
     $controlModeData = $this->control === 'simple' ? $this->getSimpleModeLayoutData() : $this->getAdvancedModeLayoutData($lang);
     $extraData = array('color' => $color, 'format' => $this->format, 'keywords' => $this->keywords, 'position' => $position, 'validate' => $this->validate);
     return array_merge($data, $extraData, $controlModeData);
 }
Beispiel #14
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $extraData = array('maxLength' => $this->maxLength, 'meter' => $this->meter, 'threshold' => $this->threshold, 'meter' => $this->meter);
     return array_merge($data, $extraData);
 }
Beispiel #15
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.7
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     // Initialize some field attributes.
     $extraData = array('max' => $this->max, 'min' => $this->min, 'step' => $this->step, 'value' => $this->value);
     return array_merge($data, $extraData);
 }
Beispiel #16
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     // Get the basic field data
     $data = parent::getLayoutData();
     $asset = $this->asset;
     if ($asset == '') {
         $asset = JFactory::getApplication()->input->get('option');
     }
     if ($this->value && file_exists(JPATH_ROOT . '/' . $this->value)) {
         $this->folder = explode('/', $this->value);
         $this->folder = array_diff_assoc($this->folder, explode('/', JComponentHelper::getParams('com_media')->get('image_path', 'images')));
         array_pop($this->folder);
         $this->folder = implode('/', $this->folder);
     } elseif (file_exists(JPATH_ROOT . '/' . JComponentHelper::getParams('com_media')->get('image_path', 'images') . '/' . $this->directory)) {
         $this->folder = $this->directory;
     } else {
         $this->folder = '';
     }
     $extraData = array('asset' => $asset, 'authorField' => $this->authorField, 'authorId' => $this->form->getValue($this->authorField), 'folder' => $this->folder, 'link' => $this->link, 'preview' => $this->preview, 'previewHeight' => $this->previewHeight, 'previewWidth' => $this->previewWidth);
     return array_merge($data, $extraData);
 }
Beispiel #17
0
 /**
  * Method to get the data to be passed to the layout for rendering.
  *
  * @return  array
  *
  * @since 3.6
  */
 protected function getLayoutData()
 {
     $data = parent::getLayoutData();
     $extraData = array('accept' => $this->accept, 'multiple' => $this->multiple);
     return array_merge($data, $extraData);
 }
Beispiel #18
0
 /**
  * Get the data that is going to be passed to the layout
  *
  * @return  array
  */
 public function getLayoutData()
 {
     /* ##mygruz20160510204638 {
     		It was:
     		// Get the basic field data
     		$data = parent::getLayoutData();
     
     		// Load the current username if available.
     		$table = JTable::getInstance('user');
     
     		if (is_numeric($this->value))
     		{
     			$table->load($this->value);
     		}
     		// Handle the special case for "current".
     		elseif (strtoupper($this->value) == 'CURRENT')
     		{
     			// 'CURRENT' is not a reasonable value to be placed in the html
     			$this->value = JFactory::getUser()->id;
     			$table->load($this->value);
     		}
     		else
     		{
     			$table->name = JText::_('JLIB_FORM_SELECT_USER');
     		}
     		*
     		$extraData = array(
     				'userName'  => $table->name,
     				'groups'    => $this->getGroups(),
     				'excluded'  => $this->getExcluded()
     		);
     		It became: */
     $data = parent::getLayoutData();
     $extraData = array('groups' => $this->getGroups(), 'excluded' => $this->getExcluded());
     /* ##mygruz20160510204638 } */
     return array_merge($data, $extraData);
 }