本文整理汇总了PHP中flexicontent_html::buildfieldtypeslist方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html::buildfieldtypeslist方法的具体用法?PHP flexicontent_html::buildfieldtypeslist怎么用?PHP flexicontent_html::buildfieldtypeslist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flexicontent_html
的用法示例。
在下文中一共展示了flexicontent_html::buildfieldtypeslist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
//initialise variables
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$cparams = JComponentHelper::getParams('com_flexicontent');
$user = JFactory::getUser();
//add css to document
$document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/flexicontentbackend.css');
if (FLEXI_J30GE) {
$document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j3x.css');
} else {
if (FLEXI_J16GE) {
$document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j25.css');
} else {
$document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j15.css');
}
}
//add js function to overload the joomla submitform
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
JHTML::_('behavior.tooltip');
flexicontent_html::loadFramework('jQuery');
flexicontent_html::loadFramework('select2');
$document->addScript(JURI::root() . 'components/com_flexicontent/assets/js/admin.js');
$document->addScript(JURI::root() . 'components/com_flexicontent/assets/js/validate.js');
//Load pane behavior
jimport('joomla.html.pane');
//Import File system
jimport('joomla.filesystem.file');
//Get data from the model
$model = $this->getModel();
$row = $this->get('Field');
if (FLEXI_J16GE) {
$form = $this->get('Form');
}
$types = $this->get('Typeslist');
$typesselected = $this->get('Typesselected');
//create the toolbar
if ($row->id) {
JToolBarHelper::title(JText::_('FLEXI_EDIT_FIELD'), 'fieldedit');
} else {
JToolBarHelper::title(JText::_('FLEXI_ADD_FIELD'), 'fieldadd');
}
$ctrl = FLEXI_J16GE ? 'fields.' : '';
JToolBarHelper::apply($ctrl . 'apply');
JToolBarHelper::save($ctrl . 'save');
JToolBarHelper::custom($ctrl . 'saveandnew', 'savenew.png', 'savenew.png', 'FLEXI_SAVE_AND_NEW', false);
JToolBarHelper::cancel($ctrl . 'cancel');
// Import Joomla plugin that implements the type of current flexi field
JPluginHelper::importPlugin('flexicontent_fields', $row->iscore ? 'core' : $row->field_type);
// load plugin's english language file then override with current language file
$extension_name = 'plg_flexicontent_fields_' . ($row->iscore ? 'core' : $row->field_type);
JFactory::getLanguage()->load($extension_name, JPATH_ADMINISTRATOR, 'en-GB', true);
JFactory::getLanguage()->load($extension_name, JPATH_ADMINISTRATOR, null, true);
//check which properties are supported by current field
$ft_support = FlexicontentFields::getPropertySupport($row->field_type, $row->iscore);
$supportsearch = $ft_support->supportsearch;
$supportadvsearch = $ft_support->supportadvsearch;
$supportfilter = $ft_support->supportfilter;
$supportadvfilter = $ft_support->supportadvfilter;
$supportuntranslatable = $ft_support->supportuntranslatable;
$supportvalueseditable = $ft_support->supportvalueseditable;
$supportformhidden = $ft_support->supportformhidden;
$supportedithelp = $ft_support->supportedithelp;
//build selectlists, (for J1.6+ most of these are defined via XML file and custom form field classes)
$lists = array();
//build field_type list
if (!$row->field_type) {
$row->field_type = 'text';
}
if ($row->iscore == 1) {
$class = 'disabled="disabled"';
} else {
$class = '';
$_field_id = '#' . (FLEXI_J16GE ? 'jform_' : '') . 'field_type';
$_row_id = FLEXI_J16GE ? $form->getValue("id") : $row->id;
$_ctrl_task = FLEXI_J16GE ? 'task=fields.getfieldspecificproperties' : 'controller=fields&task=getfieldspecificproperties';
$document->addScriptDeclaration("\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tjQuery('" . $_field_id . "').on('change', function() {\n\t\t\t\t\t\tjQuery('#fieldspecificproperties').html('<p class=\"centerimg\"><img src=\"components/com_flexicontent/assets/images/ajax-loader.gif\" align=\"center\"></p>');\n\t\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\turl: 'index.php?option=com_flexicontent&" . $_ctrl_task . "&cid=" . $_row_id . "&field_type='+this.value+'&format=raw',\n\t\t\t\t\t\t\tsuccess: function(str) {\n\t\t\t\t\t\t\t\tjQuery('#fieldspecificproperties').html(str);\n\t\t\t\t\t\t\t\tvar JTooltips = new Tips(jQuery('#fieldspecificproperties .hasTip'), { maxTitleChars: 50, fixed: false});\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjQuery('#field_typename').html(jQuery('" . $_field_id . "').val());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t");
}
//build field select list
$lists['field_type'] = flexicontent_html::buildfieldtypeslist('field_type', $class, $row->field_type, $group = true);
//build type select list
$attribs = 'class="use_select2_lib" multiple="multiple" size="6"';
$attribs .= $row->iscore ? ' disabled="disabled"' : '';
$types_fieldname = FLEXI_J16GE ? 'jform[tid][]' : 'tid[]';
$lists['tid'] = flexicontent_html::buildtypesselect($types, $types_fieldname, $typesselected, false, $attribs);
// **************************************************************************
// Create fields for J1.5 (J2.5+ uses JForm XML file for most of form fields)
// **************************************************************************
if (!FLEXI_J16GE) {
//build formhidden selector
$formhidden[] = JHTML::_('select.option', 0, JText::_('FLEXI_NO'));
$formhidden[] = JHTML::_('select.option', 1, JText::_('FLEXI_FRONTEND'));
$formhidden[] = JHTML::_('select.option', 2, JText::_('FLEXI_BACKEND'));
$formhidden[] = JHTML::_('select.option', 3, JText::_('FLEXI_BOTH'));
$formhidden_fieldname = FLEXI_J16GE ? 'jform[formhidden]' : 'formhidden';
$lists['formhidden'] = JHTML::_('select.radiolist', $formhidden, $formhidden_fieldname, '', 'value', 'text', $row->formhidden);
if (FLEXI_ACCESS) {
$valueseditable[] = JHTML::_('select.option', 0, JText::_('FLEXI_ANY_EDITOR'));
$valueseditable[] = JHTML::_('select.option', 1, JText::_('FLEXI_USE_ACL_PERMISSION'));
//.........这里部分代码省略.........
示例2: display
function display($tpl = null)
{
// Initialise variables
$app = JFactory::getApplication();
$option = JRequest::getVar('option');
$db = JFactory::getDBO();
$document = JFactory::getDocument();
$user = JFactory::getUser();
$use_jquery_sortable = true;
$type = JRequest::getVar('type', 'items', '', 'word');
$folder = JRequest::getVar('folder', 'default', '', 'cmd');
$ismodal = JRequest::getVar('ismodal', 'default', '', 'int');
FLEXIUtilities::loadTemplateLanguageFile($folder);
//Get data from the model
$layout = $this->get('Data');
$conf = $this->get('LayoutConf');
$fields = $this->get('Fields');
$fbypos = $this->get('FieldsByPositions');
$used = $this->get('UsedFields');
$contentTypes = $this->get('TypesList');
//$fieldTypes = $this->get( 'FieldTypesList' );
$fieldTypes = flexicontent_db::getFieldTypes($_grouped = true, $_usage = false, $_published = false);
// Field types with content type ASSIGNMENT COUNTING
// Create CONTENT TYPE SELECTOR
foreach ($fields as $field) {
$field->type_ids = !empty($field->reltypes) ? explode(",", $field->reltypes) : array();
}
$options = array();
$options[] = JHTML::_('select.option', '', JText::_('FLEXI_ALL'));
foreach ($contentTypes as $contentType) {
$options[] = JHTML::_('select.option', $contentType->id, JText::_($contentType->name));
}
$fieldname = $elementid = 'content_type__au__';
$attribs = ' onchange="filterFieldList(\'%s\', \'%s\', \'%s\');" class="use_select2_lib" ';
$content_type_select = JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', '', $elementid);
// Create FIELD TYPE SELECTOR
$ALL = mb_strtoupper(JText::_('FLEXI_ALL'), 'UTF-8') . ' : ';
$fftypes = array();
$fftypes[] = array('value' => '', 'text' => JText::_('FLEXI_ALL'));
//$fftypes[] = array('value'=>'BV', 'text'=>$ALL . JText::_( 'FLEXI_BACKEND_FIELDS' ) );
//$fftypes[] = array('value'=>'C', 'text'=>$ALL . JText::_( 'FLEXI_CORE_FIELDS' ) );
//$fftypes[] = array('value'=>'NC', 'text'=>$ALL . JText::_( 'FLEXI_NON_CORE_FIELDS' ));
foreach ($fieldTypes as $field_group => $ft_types) {
$fftypes[] = $field_group;
foreach ($ft_types as $field_type => $ftdata) {
$fftypes[] = array('value' => $ftdata->field_type, 'text' => $ftdata->friendly);
}
$fftypes[] = '';
}
$fieldname = $elementid = 'field_type__au__';
$attribs = ' class="use_select2_lib" onchange="filterFieldList(\'%s\', \'%s\', \'%s\');"';
$field_type_select = flexicontent_html::buildfieldtypeslist($fftypes, $fieldname, '', $_grouped ? 1 : 0, $attribs, $elementid);
if (isset($layout->positions)) {
$sort = array();
$jssort = array();
$idsort = array();
$sort[0] = 'sortablecorefields';
$sort[1] = 'sortableuserfields';
$i = 2;
$count = -1;
foreach ($layout->positions as $pos) {
$count++;
if (isset($layout->attributes[$count]) && isset($layout->attributes[$count]['readonly'])) {
continue;
}
$sort[$i] = 'sortable-' . $pos;
$idsort[$i] = $pos;
$i++;
}
foreach ($idsort as $k => $v) {
if ($k > 1) {
$jssort[] = 'storeordering(jQuery("#sortable-' . $v . '"))';
}
}
$positions = implode(',', $idsort);
$jssort = implode("; ", $jssort);
$sortable_ids = "#" . implode(",#", $sort);
$js = "\n\t\t\tjQuery(function() {\n\t\t\t\tmy = jQuery( \"{$sortable_ids}\" ).sortable({\n\t\t\t\t\tconnectWith: \"" . $sortable_ids . "\",\n\t\t\t\t\tupdate: function(event, ui) {\n\t\t\t\t\t\tif(ui.sender) {\n\t\t\t\t\t\t\tstoreordering(jQuery(ui.sender));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tstoreordering(jQuery(ui.item).parent());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tinitordering();\n\t\t\t});\n\t\t\tfunction storeordering(parent_element) {\n\t\t\t\thidden_id = '#'+jQuery.trim(parent_element.attr('id').replace('sortable-',''));\n\t\t\t\tfields = new Array();\n\t\t\t\ti = 0;\n\t\t\t\tparent_element.children('li').each(function(){\n\t\t\t\t\tfields[i++] = jQuery(this).attr('id').replace('field_', '');\n\t\t\t\t});\n\t\t\t\tjQuery(hidden_id).val(fields.join(','))\n\t\t\t}\n\t\t\t";
$js .= '
var fieldListFilters = new Array( "content_type", "field_type" );
function filterFieldList (containerID, method, group)
{
var needed_classes = "";
for (i=0; i<fieldListFilters.length; i++)
{
filter_name = fieldListFilters[i];
var filter_val = jQuery("#" + filter_name + "_" + group).val();
if (filter_val) {
needed_classes += "."+filter_name+"_"+filter_val;
}
}
if (needed_classes) {
(method=="hide") ?
jQuery("#"+containerID).find("li").show().filter(":not("+needed_classes+")").hide() :
jQuery("#"+containerID).find("li").css({"color":"red"}).filter(":not("+needed_classes+")").css({"color":"black"});
} else {
(method=="hide") ?
jQuery("#"+containerID).find("li").show() :
//.........这里部分代码省略.........
示例3: display
//.........这里部分代码省略.........
$supportsearch = $ft_support->supportsearch;
$supportadvsearch = $ft_support->supportadvsearch;
$supportfilter = $ft_support->supportfilter;
$supportadvfilter = $ft_support->supportadvfilter;
$supportuntranslatable = $ft_support->supportuntranslatable;
$supportvalueseditable = $ft_support->supportvalueseditable;
$supportformhidden = $ft_support->supportformhidden;
$supportedithelp = $ft_support->supportedithelp;
//build selectlists, (for J1.6+ most of these are defined via XML file and custom form field classes)
$lists = array();
//build field_type list
if (!$row->field_type) {
$row->field_type = 'text';
}
$_attribs = ' class="use_select2_lib fc_skip_highlight" ';
if ($row->iscore == 1) {
$_attribs .= ' disabled="disabled" ';
} else {
$_field_id = 'jform_field_type';
$_row_id = $form->getValue("id");
$_ctrl_task = 'task=fields.getfieldspecificproperties';
$document->addScriptDeclaration("\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tjQuery('#" . $_field_id . "').on('change', function() {\n\t\t\t\t\t\tjQuery('#fieldspecificproperties').html('<p class=\"centerimg\"><img src=\"components/com_flexicontent/assets/images/ajax-loader.gif\" align=\"center\"></p>');\n\t\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\turl: 'index.php?option=com_flexicontent&" . $_ctrl_task . "&cid=" . $_row_id . "&field_type='+this.value+'&format=raw',\n\t\t\t\t\t\t\tsuccess: function(str) {\n\t\t\t\t\t\t\t\tjQuery('#fieldspecificproperties').html(str);\n\t\t\t\t\t\t\t\t" . (FLEXI_J30GE ? "\n\t\t\t\t\t\t\t\t\tjQuery('.hasTooltip').tooltip({'html': true,'container': jQuery('#fieldspecificproperties')});\n\t\t\t\t\t\t\t\t" : "\n\t\t\t\t\t\t\t\tvar tipped_elements = jQuery('#fieldspecificproperties .hasTip');\n\t\t\t\t\t\t\t\ttipped_elements.each(function() {\n\t\t\t\t\t\t\t\t\tvar title = this.get('title');\n\t\t\t\t\t\t\t\t\tif (title) {\n\t\t\t\t\t\t\t\t\t\tvar parts = title.split('::', 2);\n\t\t\t\t\t\t\t\t\t\tthis.store('tip:title', parts[0]);\n\t\t\t\t\t\t\t\t\t\tthis.store('tip:text', parts[1]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tvar ajax_JTooltips = new Tips(\$('fieldspecificproperties').getElements('.hasTip'), { maxTitleChars: 50, fixed: false});\n\t\t\t\t\t\t\t\t") . "\n\t\t\t\t\t\t\t\ttabberAutomatic(tabberOptions, 'fieldspecificproperties');\n\t\t\t\t\t\t\t\tfc_bindFormDependencies('#fieldspecificproperties', 0, '');\n\t\t\t\t\t\t\t\tjQuery('#field_typename').html(jQuery('#" . $_field_id . "').val());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t");
}
//build field select list
$fieldtypes = flexicontent_db::getFieldTypes($_grouped = true, $_usage = false, $_published = true);
$fftypes = array();
foreach ($fieldtypes as $field_group => $ft_types) {
$fftypes[] = $field_group;
foreach ($ft_types as $field_type => $ftdata) {
$fftypes[] = array('value' => $ftdata->field_type, 'text' => $ftdata->friendly);
}
$fftypes[] = '';
}
$lists['field_type'] = flexicontent_html::buildfieldtypeslist($fftypes, 'jform[field_type]', $row->field_type, $_grouped ? 1 : 0, $_attribs);
//build type select list
$attribs = 'class="use_select2_lib" multiple="multiple" size="6"';
$attribs .= $row->iscore ? ' disabled="disabled"' : '';
$types_fieldname = FLEXI_J16GE ? 'jform[tid][]' : 'tid[]';
$lists['tid'] = flexicontent_html::buildtypesselect($types, $types_fieldname, $typesselected, false, $attribs);
// **************************************************************************
// Create fields for J1.5 (J2.5+ uses JForm XML file for most of form fields)
// **************************************************************************
if (!FLEXI_J16GE) {
//build formhidden selector
$formhidden[] = JHTML::_('select.option', 0, JText::_('FLEXI_NO'));
$formhidden[] = JHTML::_('select.option', 1, JText::_('FLEXI_FRONTEND'));
$formhidden[] = JHTML::_('select.option', 2, JText::_('FLEXI_BACKEND'));
$formhidden[] = JHTML::_('select.option', 3, JText::_('FLEXI_BOTH'));
$formhidden_fieldname = FLEXI_J16GE ? 'jform[formhidden]' : 'formhidden';
$lists['formhidden'] = JHTML::_('select.radiolist', $formhidden, $formhidden_fieldname, '', 'value', 'text', $row->formhidden);
if (FLEXI_ACCESS) {
$valueseditable[] = JHTML::_('select.option', 0, JText::_('FLEXI_ANY_EDITOR'));
$valueseditable[] = JHTML::_('select.option', 1, JText::_('FLEXI_USE_ACL_PERMISSION'));
$valueseditable_fieldname = FLEXI_J16GE ? 'jform[valueseditable]' : 'valueseditable';
$lists['valueseditable'] = JHTML::_('select.radiolist', $valueseditable, $valueseditable_fieldname, '', 'value', 'text', $row->valueseditable);
}
$edithelp[] = JHTML::_('select.option', 0, JText::_('FLEXI_EDIT_HELP_NONE'));
$edithelp[] = JHTML::_('select.option', 1, JText::_('FLEXI_EDIT_HELP_LABEL_TOOLTIP'));
$edithelp[] = JHTML::_('select.option', 2, JText::_('FLEXI_EDIT_HELP_LABEL_TOOLTIP_WICON'));
$edithelp[] = JHTML::_('select.option', 3, JText::_('FLEXI_EDIT_HELP_INLINE'));
$edithelp_fieldname = FLEXI_J16GE ? 'jform[edithelp]' : 'edithelp';
$lists['edithelp'] = JHTML::_('select.radiolist', $edithelp, $edithelp_fieldname, '', 'value', 'text', $row->edithelp);
// build the html select list for ordering
$query = 'SELECT ordering AS value, label AS text' . ' FROM #__flexicontent_fields' . ' WHERE published >= 0' . ' ORDER BY ordering';
$row->ordering = @$row->ordering;
$lists['ordering'] = $row->id ? JHTML::_('list.specificordering', $row, $row->id, $query) : JHTML::_('list.specificordering', $row, '', $query);