本文整理汇总了PHP中K2HelperHTML::state方法的典型用法代码示例。如果您正苦于以下问题:PHP K2HelperHTML::state方法的具体用法?PHP K2HelperHTML::state怎么用?PHP K2HelperHTML::state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类K2HelperHTML
的用法示例。
在下文中一共展示了K2HelperHTML::state方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFormFields
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;
}
示例2: setFormFields
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;
}