protected function setFormFields(&$form, $row) { $form->state = K2HelperHTML::state('state', $row->state, false, false, 'radio', true); $form->group = K2HelperHTML::extraFieldsGroups('group', $row->group); $form->type = K2HelperHTML::extraFieldsTypes('type', $row->type, 'K2_SELECT_TYPE'); $definitions = K2HelperExtraFields::getDefinitions(); if ($row->id) { $definitions[$row->type] = $row->getDefinition(); } $form->definitions = $definitions; }
protected function setFormFields(&$form, $row) { require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/html.php'; $form->state = K2HelperHTML::state('state', $row->state, false, false, 'radio', true); require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/extrafields.php'; $form->extraFields = K2HelperExtraFields::getTagExtraFieldsGroups($row->extra_fields); }
protected function setFormFields(&$form, $row) { $form->state = K2HelperHTML::state('state', $row->state, false, true, 'radio', true); $form->language = K2HelperHTML::language('language', $row->language); $form->access = JHtml::_('access.level', 'access', $row->access, '', false); $form->category = K2HelperHTML::categories('catid', $row->catid, 'K2_SELECT_CATEGORY'); require_once JPATH_ADMINISTRATOR . '/components/com_k2/classes/editor.php'; $config = JFactory::getConfig(); $editor = K2Editor::getInstance($config->get('editor')); $params = JComponentHelper::getParams('com_k2'); if ($params->get('mergeEditors')) { $value = trim($row->fulltext) != '' ? $row->introtext . '<hr id="system-readmore" />' . $row->fulltext : $row->introtext; $form->text = $editor->display('text', $value, '100%', '300', '40', '5'); } else { $form->introtext = $editor->display('introtext', $row->introtext, '100%', '300', '40', '5', array('readmore')); $form->fulltext = $editor->display('fulltext', $row->fulltext, '100%', '300', '40', '5', array('readmore')); } require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/extrafields.php'; $form->extraFields = K2HelperExtraFields::getItemExtraFieldsGroups($row->catid, $row->extra_fields); $form->mediaProviders = K2HelperHtml::mediaProviders(); // Associations $associations = new stdClass(); $associations->enabled = JLanguageAssociations::isEnabled(); $associations->languages = array(); if ($associations->enabled) { $languages = JLanguageHelper::getLanguages('lang_code'); foreach ($languages as $tag => $language) { if (empty($row->language) || $tag != $row->language) { $lang = new stdClass(); $lang->title = $language->title; $lang->code = $language->lang_code; $lang->associated = new stdClass(); $lang->associated->title = ''; $lang->associated->id = ''; if (isset($row->associations) && is_array($row->associations) && isset($row->associations[$language->lang_code])) { $associated = $row->associations[$language->lang_code]; $lang->associated->title = $associated->title; $lang->associated->id = (int) $associated->id; } $associations->languages[] = $lang; } } } $form->associations = $associations; }
protected function setFormFields(&$form, $row) { require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/html.php'; $form->state = K2HelperHTML::state('state', $row->state, false, false, 'radio', true); }
protected function setFormFields(&$form, $row) { $form->state = K2HelperHTML::state('state', $row->state, false, true, 'radio', true); $form->language = K2HelperHTML::language('language', $row->language); $form->access = JHtml::_('access.level', 'access', $row->access, '', false); $form->parent = K2HelperHTML::categories('parent_id', $row->parent_id, 'K2_NONE', $row->id); $form->inheritance = K2HelperHTML::categories('inheritance', $row->inheritance, 'K2_NONE', $row->id, '', false, 'id', true); $form->template = K2HelperHTML::template('template', $row->template); require_once JPATH_ADMINISTRATOR . '/components/com_k2/classes/editor.php'; $config = JFactory::getConfig(); $editor = K2Editor::getInstance($config->get('editor')); $form->description = $editor->display('description', $row->description, '100%', '300', '40', '5'); require_once JPATH_ADMINISTRATOR . '/components/com_k2/helpers/extrafields.php'; $form->extraFields = K2HelperExtraFields::getCategoryExtraFieldsGroups($row->extra_fields); // Associations $associations = new stdClass(); $associations->enabled = JLanguageAssociations::isEnabled(); $associations->languages = array(); if ($associations->enabled) { $languages = JLanguageHelper::getLanguages('lang_code'); foreach ($languages as $tag => $language) { if (empty($row->language) || $tag != $row->language) { $lang = new stdClass(); $lang->title = $language->title; $lang->code = $language->lang_code; $lang->associated = new stdClass(); $lang->associated->title = ''; $lang->associated->id = ''; if (isset($row->associations) && is_array($row->associations) && isset($row->associations[$language->lang_code])) { $associated = $row->associations[$language->lang_code]; $lang->associated->title = $associated->title; $lang->associated->id = (int) $associated->id; } $associations->languages[] = $lang; } } } $form->associations = $associations; }