本文整理匯總了PHP中flexicontent_db::getfieldtypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP flexicontent_db::getfieldtypes方法的具體用法?PHP flexicontent_db::getfieldtypes怎麽用?PHP flexicontent_db::getfieldtypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類flexicontent_db
的用法示例。
在下文中一共展示了flexicontent_db::getfieldtypes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildfieldtypeslist
/**
* Method to build the list for types when performing an edit action
*
* @return array
* @since 1.5
*/
static function buildfieldtypeslist($name, $class, $selected, $group=false)
{
$field_types = flexicontent_db::getfieldtypes($group);
if (!$group) {
// This should not be neccessary as, it was already done in DB query above
foreach($field_types as $field_type) {
$field_type->text = preg_replace("/FLEXIcontent[ \t]*-[ \t]*/i", "", $field_type->text);
$field_arr[$field_type->text] = $field_type;
}
ksort( $field_arr, SORT_STRING );
$list = JHTML::_('select.genericlist', $field_arr, $name, $class, 'value', 'text', $selected );
} else {
$fftype = array();
foreach ($field_types as $field_group => $ft_types) {
$fftype[] = JHTML::_('select.optgroup', $field_group );
foreach ($ft_types as $field_type => $ftdata) {
$field_friendlyname = preg_replace("/FLEXIcontent[ \t]*-[ \t]*/i", "", $ftdata->text);
$fftype[] = JHTML::_('select.option', $field_type, $field_friendlyname);
}
$fftype[] = JHTML::_('select.optgroup', '' );
}
$fieldname = FLEXI_J16GE ? 'jform[field_type]' : 'field_type';
$elementid = FLEXI_J16GE ? 'jform_field_type' : 'field_type';
$list = JHTML::_('select.genericlist', $fftype, $fieldname, 'class="inputbox" size="1"', 'value', 'text', $selected, $elementid );
if (!FLEXI_J16GE) $list = str_replace('<optgroup label="">', '</optgroup>', $list);
}
return $list;
}