本文整理汇总了PHP中flexicontent_html::buildlanguageslist方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html::buildlanguageslist方法的具体用法?PHP flexicontent_html::buildlanguageslist怎么用?PHP flexicontent_html::buildlanguageslist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flexicontent_html
的用法示例。
在下文中一共展示了flexicontent_html::buildlanguageslist方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
//initialise variables
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$user = JFactory::getUser();
//$authorparams = flexicontent_db::getUserConfig($user->id);
//add css/js to document
flexicontent_html::loadFramework('select2');
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css');
if (FLEXI_J30GE) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css');
} else {
if (FLEXI_J16GE) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/j25.css');
}
}
//create the toolbar
JToolBarHelper::title(JText::_('FLEXI_EDIT_FILE'), 'fileedit');
JToolBarHelper::apply('filemanager.apply');
JToolBarHelper::save('filemanager.save');
JToolBarHelper::cancel('filemanager.cancel');
//Get data from the model
$model = $this->getModel();
$form = $this->get('Form');
$row = $this->get('File');
// fail if checked out not by 'me'
if ($row->id) {
if ($model->isCheckedOut($user->get('id'))) {
JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
$app->redirect('index.php?option=com_flexicontent&view=filemanager');
}
}
//build access level list
$lists['access'] = JHTML::_('access.assetgrouplist', 'access', $row->access, $config = array('class' => 'use_select2_lib'));
// Build languages list
//$allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed',null);
//$allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs);
$allowed_langs = null;
$lists['language'] = flexicontent_html::buildlanguageslist('language', ' class="use_select2_lib" ', $row->language, 2, $allowed_langs, $published_only = false);
//clean data
JFilterOutput::objectHTMLSafe($row, ENT_QUOTES);
//assign data to template
$this->assignRef('form', $form);
$this->assignRef('row', $row);
$this->assignRef('lists', $lists);
$this->assignRef('document', $document);
parent::display($tpl);
}
示例2: _buildEditLists
//.........这里部分代码省略.........
$skip_subtrees = $featured_cats_parent ? array($featured_cats_parent) : array();
$lists['cid'] = ($enable_cid_selector ? '' : '<label class="label" style="float:none; margin:0 6px 0 0 !important;">locked</label>') . flexicontent_cats::buildcatselect($cid_tree, $fieldname, $selectedcats, false, $attribs, true, true, $actions_allowed, $require_all = true, $skip_subtrees, $disable_subtrees = array(), $custom_options = array(), $disabled_cats);
} else {
if (count($selectedcats) > 1) {
foreach ($selectedcats as $catid) {
$cat_titles[$catid] = $globalcats[$catid]->title;
}
$lists['cid'] .= implode(', ', $cat_titles);
} else {
$lists['cid'] = false;
}
}
// Main category form field
$class = 'scat use_select2_lib';
if ($perms['multicat']) {
$class .= ' validate-catid';
} else {
$class .= ' required';
}
$attribs = 'class="' . $class . '"';
$fieldname = 'jform[catid]';
$enable_catid_selector = $isnew && !$params->get('catid_default') || !$isnew && empty($item->catid) || $perms['canchange_cat'];
if ($params->get('catid_allowed_parent')) {
$catid_tree = flexicontent_cats::getCategoriesTree($published_only = 1, $parent_id = $params->get('catid_allowed_parent'), $depth_limit = 0);
$disabled_cats = $params->get('catid_allowed_parent_disable', 1) ? array($params->get('catid_allowed_parent')) : array();
} else {
$catid_tree =& $categories;
$disabled_cats = array();
}
$lists['catid'] = false;
if (!empty($catid_tree)) {
$disabled = $enable_catid_selector ? '' : ' disabled="disabled"';
$attribs .= $disabled;
$lists['catid'] = ($enable_catid_selector ? '' : '<label class="label" style="float:none; margin:0 6px 0 0 !important;">locked</label>') . flexicontent_cats::buildcatselect($catid_tree, $fieldname, $item->catid, 2, $attribs, true, true, $actions_allowed, $require_all = true, $skip_subtrees = array(), $disable_subtrees = array(), $custom_options = array(), $disabled_cats, $empty_errmsg = JText::_('FLEXI_FORM_NO_MAIN_CAT_ALLOWED'));
} else {
if (!$isnew && $item->catid) {
$lists['catid'] = $globalcats[$item->catid]->title;
}
}
//buid types selectlist
$class = 'required use_select2_lib';
$attribs = 'class="' . $class . '"';
$fieldname = 'jform[type_id]';
$elementid = 'jform_type_id';
$lists['type'] = flexicontent_html::buildtypesselect($types, $fieldname, $typesselected->id, 1, $attribs, $elementid, $check_perms = true);
// build version approval list
if ($params->get('allowdisablingcomments_fe')) {
// Set to zero if disabled or to "" (aka use default) for any other value. THIS WILL FORCE comment field use default Global/Category/Content Type setting or disable it,
// thus a per item commenting system cannot be selected. This is OK because it makes sense to have a different commenting system per CONTENT TYPE by not per Content Item
$isdisabled = !$params->get('comments') && strlen($params->get('comments'));
$fieldvalue = $isdisabled ? 0 : "";
$fieldname = 'jform[attribs][comments]';
$elementid = 'jform_attribs_comments';
/*
$options = array();
$options[] = JHTML::_('select.option', "", JText::_( 'FLEXI_DEFAULT_BEHAVIOR' ) );
$options[] = JHTML::_('select.option', 0, JText::_( 'FLEXI_DISABLE' ) );
$attribs = FLEXI_J16GE ? ' style ="float:none!important;" ' : '';
$lists['disable_comments'] = JHTML::_('select.radiolist', $options, $fieldname, $attribs, 'value', 'text', $fieldvalue, $elementid);
*/
$classes = !$prettycheckable_added ? '' : ' use_prettycheckable ';
$attribs = ' class="' . $classes . '" ';
$i = 1;
$options = array("" => JText::_('FLEXI_DEFAULT_BEHAVIOR'), 0 => JText::_('FLEXI_DISABLE'));
$lists['disable_comments'] = '';
foreach ($options as $option_id => $option_label) {
$checked = $option_id === $fieldvalue ? ' checked="checked"' : '';
$elementid_no = $elementid . '_' . $i;
if (!$prettycheckable_added) {
$lists['disable_comments'] .= '<label class="fccheckradio_lbl" for="' . $elementid_no . '">';
}
$extra_params = !$prettycheckable_added ? '' : ' data-labeltext="' . JText::_($option_label) . '" data-labelPosition="right" data-customClass="fcradiocheck"';
$lists['disable_comments'] .= ' <input type="radio" id="' . $elementid_no . '" data-element-grpid="' . $elementid . '" name="' . $fieldname . '" ' . $attribs . ' value="' . $option_id . '" ' . $checked . $extra_params . ' />';
if (!$prettycheckable_added) {
$lists['disable_comments'] .= ' ' . JText::_($option_label) . '</label>';
}
$i++;
}
}
// find user's allowed languages
$allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed', null);
$allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs);
if (!$isnew && $allowed_langs) {
$allowed_langs[] = $item->language;
}
// find globaly or per content type disabled languages
$disable_langs = $params->get('disable_languages_fe', array());
// Build languages list
if (FLEXI_J16GE || FLEXI_FISH) {
$item_lang = $item->language;
// Model has already set default language according to parameters
$langdisplay = $params->get('langdisplay_fe', 2);
$langconf = array();
$langconf['flags'] = $params->get('langdisplay_flags_fe', 1);
$langconf['texts'] = $params->get('langdisplay_texts_fe', 1);
$field_attribs = $langdisplay == 2 ? 'class="use_select2_lib"' : '';
$lists['languages'] = flexicontent_html::buildlanguageslist('jform[language]', $field_attribs, $item->language, $langdisplay, $allowed_langs, $published_only = 1, $disable_langs, $add_all = true, $langconf);
}
return $lists;
}
示例3: display
//.........这里部分代码省略.........
$fieldname = 'jform[catid]';
$enable_catid_selector = $isnew && !$tparams->get('catid_default') || !$isnew && empty($item->catid) || $perms['canchange_cat'];
if ($tparams->get('catid_allowed_parent')) {
$catid_tree = flexicontent_cats::getCategoriesTree($published_only = 1, $parent_id = $tparams->get('catid_allowed_parent'), $depth_limit = 0);
$disabled_cats = $tparams->get('catid_allowed_parent_disable', 1) ? array($tparams->get('catid_allowed_parent')) : array();
} else {
$catid_tree =& $categories;
$disabled_cats = array();
}
$lists['catid'] = false;
if (!empty($catid_tree)) {
$disabled = $enable_catid_selector ? '' : ' disabled="disabled"';
$attribs .= $disabled;
$lists['catid'] = ($enable_catid_selector ? '' : '<label class="label" style="float:none; margin:0 6px 0 0 !important;">locked</label>') . flexicontent_cats::buildcatselect($catid_tree, $fieldname, $item->catid, 2, $attribs, true, true, $actions_allowed, $require_all = true, $skip_subtrees = array(), $disable_subtrees = array(), $custom_options = array(), $disabled_cats);
} else {
if (!$isnew && $item->catid) {
$lists['catid'] = $globalcats[$item->catid]->title;
}
}
//buid types selectlist
$class = 'required use_select2_lib';
$attribs = 'class="' . $class . '"';
$fieldname = 'jform[type_id]';
$elementid = 'jform_type_id';
$lists['type'] = flexicontent_html::buildtypesselect($types, $fieldname, $typesselected->id, 1, $attribs, $elementid, $check_perms = true);
//build languages list
$allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed', null);
$allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs);
if (!$isnew && $allowed_langs) {
$allowed_langs[] = $item->language;
}
// We will not use the default getInput() function of J1.6+ since we want to create a radio selection field with flags
// we could also create a new class and override getInput() method but maybe this is an overkill, we may do it in the future
$lists['languages'] = flexicontent_html::buildlanguageslist('jform[language]', 'class="use_select2_lib"', $item->language, 2, $allowed_langs);
// Label for current item state: published, unpublished, archived etc
switch ($item->state) {
case 0:
$published = JText::_('FLEXI_UNPUBLISHED');
break;
case 1:
$published = JText::_('FLEXI_PUBLISHED');
break;
case -1:
$published = JText::_('FLEXI_ARCHIVED');
break;
case -3:
$published = JText::_('FLEXI_PENDING');
break;
case -5:
$published = JText::_('FLEXI_IN_PROGRESS');
break;
case -4:
default:
$published = JText::_('FLEXI_TO_WRITE');
break;
}
// **************************************************************
// Handle Item Parameters Creation and Load their values for J1.5
// In J1.6+ we declare them in the item form XML file
// **************************************************************
if (JHTML::_('date', $item->publish_down, 'Y') <= 1969 || $item->publish_down == $db->getNullDate() || empty($item->publish_down)) {
$form->setValue('publish_down', null, '');
// Setting to text will break form date element
}
// ****************************
// Handle Template related work
示例4:
</label></td>
<td>
<input type="text" id="copynr" name="copynr" value="1" size="3" />
</td>
</tr>
<?php
if (FLEXI_FISH || FLEXI_J16GE) {
?>
<tr valign="top">
<td class="key"><label class="fckey"><?php
echo JText::_('NEW') . " " . JText::_('FLEXI_LANGUAGE');
?>
</label></td>
<td>
<?php
echo flexicontent_html::buildlanguageslist('language', '', $this->rows[0]->lang, $type = $copy_behaviour != 'translate' ? 5 : 4);
?>
</td>
</tr>
<?php
}
?>
<tr valign="top">
<td class="key"><label class="fckey"><?php
echo JText::_('FLEXI_STATE');
?>
</label></td>
<td>
<?php
echo flexicontent_html::buildstateslist('state', '', '');
?>
示例5: _displayCopyMove
function _displayCopyMove($tpl = null, $cid = array(), $behaviour = 'copy/move')
{
global $globalcats;
$app = JFactory::getApplication();
// Initialise variables
$user = JFactory::getUser();
$document = JFactory::getDocument();
// Add css to document
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VERSION);
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VERSION);
// Add js to document
JHTML::_('behavior.tooltip');
flexicontent_html::loadFramework('select2');
$document->addScriptVersion(JURI::base(true) . '/components/com_flexicontent/assets/js/copymove.js', FLEXI_VERSION);
// Add js function to overload the joomla submitform validation
JHTML::_('behavior.formvalidation');
// load default validation JS to make sure it is overriden
$document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/admin.js', FLEXI_VERSION);
$document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/validate.js', FLEXI_VERSION);
// Create document/toolbar titles
if ($behaviour == 'translate') {
$doc_title = JText::_('FLEXI_TRANSLATE_ITEM');
} else {
$doc_title = JText::_('FLEXI_BATCH');
}
$site_title = $document->getTitle();
JToolBarHelper::title($doc_title, 'itemadd');
$document->setTitle($doc_title . ' - ' . $site_title);
// Create the toolbar
JToolBarHelper::save('items.copymove');
JToolBarHelper::cancel('items.cancel');
//Get data from the model
$rows = $this->get('Data');
$itemCats = $this->get('ItemCats');
$categories = $globalcats;
// build the main category select list
$lists['maincat'] = flexicontent_cats::buildcatselect($categories, 'maincat', '', JText::_('FLEXI_DO_NOT_CHANGE'), 'class="use_select2_lib" size="10"', false, false);
// build the secondary categories select list
$lists['seccats'] = flexicontent_cats::buildcatselect($categories, 'seccats[]', '', 0, 'class="use_select2_lib" multiple="multiple" size="10"', false, false);
// build language selection
$lists['language'] = flexicontent_html::buildlanguageslist('language', '', '', $type = $behaviour != 'translate' ? JText::_('FLEXI_NOCHANGE_LANGUAGE') : 7, $allowed_langs = null, $published_only = true, $disable_langs = null, $add_all = true, array('required' => 1));
// build state selection
$selected_state = 0;
// use unpublished as default state of new items, (instead of '' which means do not change)
$lists['state'] = flexicontent_html::buildstateslist('state', 'class="use_select2_lib"', $selected_state);
// build types selection
$types = flexicontent_html::getTypesList();
$lists['type_id'] = flexicontent_html::buildtypesselect($types, 'type_id', '', JText::_('FLEXI_DO_NOT_CHANGE'), 'class="use_select2_lib" size="1" style="vertical-align:top;"', 'type_id');
// build access level filter
$levels = JHtml::_('access.assetgroups');
array_unshift($levels, JHtml::_('select.option', '', 'FLEXI_DO_NOT_CHANGE'));
$fieldname = $elementid = 'access';
$attribs = 'class="use_select2_lib"';
$lists['access'] = JHTML::_('select.genericlist', $levels, $fieldname, $attribs, 'value', 'text', $value = '', $elementid, $translate = true);
//assign data to template
$this->assignRef('lists', $lists);
$this->assignRef('rows', $rows);
$this->assignRef('itemCats', $itemCats);
$this->assignRef('cid', $cid);
$this->assignRef('user', $user);
$this->assignRef('behaviour', $behaviour);
parent::display($tpl);
}
示例6: display
//.........这里部分代码省略.........
foreach ($dates as $i => $v) {
$_dates[] = JHTML::_('select.option', $i, $v);
}
$lists['date'] = JHTML::_('select.radiolist', $_dates, 'date', 'size="1" class="inputbox"', 'value', 'text', $date );*/
$lists['date'] = '';
foreach ($dates as $i => $v) {
$checked = $date == $i ? ' checked="checked" ' : '';
$lists['date'] .= '<input type="radio" onchange="submitform();" class="inputbox" ' . $checked . ' value="' . $i . '" id="date' . $i . '" name="date" />';
$lists['date'] .= '<label class="" id="date' . $i . '-lbl" for="date' . $i . '">' . $v . '</label>';
}
$lists['startdate'] = JHTML::_('calendar', $startdate, 'startdate', 'startdate', '%Y-%m-%d', array('class' => 'inputbox', 'size' => '11', 'maxlength' => '20'));
$lists['enddate'] = JHTML::_('calendar', $enddate, 'enddate', 'enddate', '%Y-%m-%d', array('class' => 'inputbox', 'size' => '11', 'maxlength' => '20'));
// search filter
$bind_limits = array();
$bind_limits[] = JHTML::_('select.option', 250, '250 ' . JText::_('FLEXI_ITEMS'));
$bind_limits[] = JHTML::_('select.option', 500, '500 ' . JText::_('FLEXI_ITEMS'));
$bind_limits[] = JHTML::_('select.option', 750, '750 ' . JText::_('FLEXI_ITEMS'));
$bind_limits[] = JHTML::_('select.option', 1000, '1000 ' . JText::_('FLEXI_ITEMS'));
$bind_limits[] = JHTML::_('select.option', 1500, '1500 ' . JText::_('FLEXI_ITEMS'));
$bind_limits[] = JHTML::_('select.option', 2000, '2000 ' . JText::_('FLEXI_ITEMS'));
$lists['bind_limits'] = JHTML::_('select.genericlist', $bind_limits, 'bind_limit', 'size="1" class="use_select2_lib"', 'value', 'text', $bind_limit, 'bind_limit');
// search filter
$lists['search'] = $search;
// search id
$lists['filter_id'] = $filter_id;
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// filter ordering
if (!$filter_order_type) {
$ordering = $lists['order'] == 'i.ordering';
} else {
$ordering = $lists['order'] == 'catsordering';
}
if (FLEXI_FISH || FLEXI_J16GE) {
//build languages filter
$lists['filter_lang'] = flexicontent_html::buildlanguageslist('filter_lang', 'class="use_select2_lib" onchange="submitform();" size="1" ', $filter_lang, 2);
}
// filter by item usage a specific file
if ($fileid_to_itemids && count($fileid_to_itemids)) {
$files_data = $model->getFileData(array_keys($fileid_to_itemids));
$file_options = array();
$file_options[] = JHTML::_('select.option', '', ' -- ' . JText::_('FLEXI_SELECT') . ' ' . JText::_('FLEXI_FILE') . ' -- ');
foreach ($files_data as $_file) {
$file_options[] = JHTML::_('select.option', $_file->id, $_file->altname);
}
flexicontent_html::loadFramework('select2');
$lists['filter_fileid'] = JHTML::_('select.genericlist', $file_options, 'filter_fileid', 'size="1" class="use_select2_lib" onchange="submitform();"', 'value', 'text', $filter_fileid);
}
//assign data to template
$this->assignRef('count_filters', $count_filters);
$this->assignRef('filter_stategrp', $filter_stategrp);
$this->assignRef('filter_catsinstate', $filter_catsinstate);
$this->assignRef('db', $db);
$this->assignRef('lists', $lists);
$this->assignRef('rows', $rows);
$this->assignRef('itemCats', $itemCats);
$this->assignRef('extra_fields', $extraCols);
if ($enable_translation_groups) {
$this->assignRef('lang_assocs', $langAssocs);
}
if (FLEXI_FISH || FLEXI_J16GE) {
$this->assignRef('langs', $langs);
}
$this->assignRef('cid', $cid);
$this->assignRef('pagination', $pagination);
$this->assignRef('ordering', $ordering);
$this->assignRef('CanOrder', $CanOrder);
$this->assignRef('CanCats', $CanCats);
$this->assignRef('CanAccLvl', $CanAccLvl);
$this->assignRef('unassociated', $unassociated);
$this->assignRef('badcatitems', $badcatitems);
// filters
$this->assignRef('filter_id', $filter_id);
$this->assignRef('filter_state', $filter_state);
$this->assignRef('filter_authors', $filter_authors);
$this->assignRef('filter_type', $filter_type);
$this->assignRef('filter_cats', $filter_cats);
$this->assignRef('filter_subcats', $filter_subcats);
$this->assignRef('filter_catsinstate', $filter_catsinstate);
$this->assignRef('filter_order_type', $filter_order_type);
$this->assignRef('filter_order', $filter_order);
$this->assignRef('filter_lang', $filter_lang);
$this->assignRef('filter_fileid', $filter_fileid);
$this->assignRef('inline_ss_max', $inline_ss_max);
$this->assignRef('scope', $scope);
$this->assignRef('search', $search);
$this->assignRef('date', $date);
$this->assignRef('startdate', $startdate);
$this->assignRef('enddate', $enddate);
$print_logging_info = $cparams->get('print_logging_info');
if ($print_logging_info) {
global $fc_run_times;
$start_microtime = microtime(true);
}
parent::display($tpl);
if ($print_logging_info) {
@($fc_run_times['template_render'] += round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10);
}
}
示例7: display
function display($tpl = null)
{
global $globalcats;
$app = JFactory::getApplication();
$user = JFactory::getUser();
$db = JFactory::getDBO();
$option = JRequest::getVar('option');
$view = JRequest::getVar('view');
$document = JFactory::getDocument();
// Get model
$model = $this->getModel();
//JHTML::_('behavior.tooltip');
JHTML::_('behavior.modal');
$assocs_id = JRequest::getInt('assocs_id', 0);
$language = !$assocs_id ? JRequest::getCmd('language') : $app->getUserStateFromRequest($option . '.' . $view . '.language', 'language', '', 'string');
$created_by = !$assocs_id ? JRequest::getCmd('created_by') : $app->getUserStateFromRequest($option . '.' . $view . '.created_by', 'created_by', 0, 'int');
if ($assocs_id) {
$assocanytrans = $user->authorise('flexicontent.assocanytrans', 'com_flexicontent');
if (!$assocanytrans && !$created_by) {
$created_by = $user->id;
}
}
// get filter values
$filter_order = $app->getUserStateFromRequest($option . '.' . $view . '.filter_order', 'filter_order', 'c.lft', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest($option . '.' . $view . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
$filter_state = $app->getUserStateFromRequest($option . '.' . $view . '.filter_state', 'filter_state', '', 'cmd');
$filter_cats = $app->getUserStateFromRequest($option . '.' . $view . '.filter_cats', 'filter_cats', 0, 'int');
$filter_level = $app->getUserStateFromRequest($option . '.' . $view . '.filter_level', 'filter_level', 0, 'int');
$filter_access = $app->getUserStateFromRequest($option . '.' . $view . '.filter_access', 'filter_access', '', 'string');
$filter_lang = $app->getUserStateFromRequest($option . '.' . $view . '.filter_lang', 'filter_lang', '', 'cmd');
$filter_author = $app->getUserStateFromRequest($option . '.' . $view . '.filter_author', 'filter_author', '', 'cmd');
$search = $app->getUserStateFromRequest($option . '.' . $view . '.search', 'search', '', 'string');
$search = $db->escape(trim(JString::strtolower($search)));
// Prepare the document: set title, add css files, etc
$document->setTitle(JText::_('FLEXI_SELECTITEM'));
if ($app->isSite()) {
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontent.css', FLEXI_VHASH);
} else {
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VHASH);
}
flexicontent_html::loadFramework('select2');
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VHASH);
// Include backend CSS template CSS file , access to backend folder may not be allowed but ...
//$template = $app->isSite() ? (!FLEXI_J16GE ? 'khepri' : (FLEXI_J30GE ? 'hathor' : 'bluestork')) : $app->getTemplate();
//$document->addStyleSheet(JURI::base(true).'/templates/'.$template.(FLEXI_J16GE ? '/css/template.css': '/css/general.css'));
//Get data from the model
$rows = $this->get('Items');
$authors = $this->get('Authorslist');
$pagination = $this->get('Pagination');
// Ordering active FLAG
$ordering = $filter_order == 'c.lft';
// Parse configuration for every category
foreach ($rows as $cat) {
$cat->config = new JRegistry($cat->config);
}
// *******************
// Create Form Filters
// *******************
// filter search word
$lists['search'] = $search;
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// build the categories select list
$categories = $globalcats;
$lists['filter_cats'] = '<label class="label">' . JText::_('FLEXI_CATEGORY') . '</label>' . flexicontent_cats::buildcatselect($categories, 'filter_cats', $filter_cats, '-', 'class="use_select2_lib fcfilter_be" size="1" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()"', $check_published = true, $check_perms = false);
// filter depth level
$depths = array();
$depths[] = JHtml::_('select.option', '', '-');
for ($i = 1; $i <= 10; $i++) {
$depths[] = JHtml::_('select.option', $i, $i);
}
$fieldname = $elementid = 'filter_level';
$attribs = ' class="use_select2_lib fcfilter_be" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()" ';
$lists['filter_level'] = '<label class="label">' . JText::_('FLEXI_MAX_DEPTH') . '</label>' . JHTML::_('select.genericlist', $depths, $fieldname, $attribs, 'value', 'text', $filter_level, $elementid, $translate = true);
// build author select list
$lists['filter_author'] = '<label class="label">' . JText::_('FLEXI_AUTHOR') . '</label>' . ($assocs_id && $created_by ? '<span class="badge badge-info">' . JFactory::getUser($created_by)->name . '</span>' : flexicontent_html::buildauthorsselect($authors, 'filter_author', $filter_author, '-', 'class="use_select2_lib fcfilter_be" size="3" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()"'));
// build publication state filter
$states = JHtml::_('jgrid.publishedOptions');
array_unshift($states, JHtml::_('select.option', '', '-'));
$fieldname = $elementid = 'filter_state';
$attribs = ' class="use_select2_lib fcfilter_be" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()" ';
$lists['filter_state'] = '<label class="label">' . JText::_('FLEXI_STATE') . '</label>' . JHTML::_('select.genericlist', $states, $fieldname, $attribs, 'value', 'text', $filter_state, $elementid, $translate = true);
// build access level filter
$levels = JHtml::_('access.assetgroups');
array_unshift($levels, JHtml::_('select.option', '', '-'));
$fieldname = $elementid = 'filter_access';
$attribs = ' class="use_select2_lib fcfilter_be" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()" ';
$lists['filter_access'] = '<label class="label">' . JText::_('FLEXI_ACCESS') . '</label>' . JHTML::_('select.genericlist', $levels, $fieldname, $attribs, 'value', 'text', $filter_access, $elementid, $translate = true);
// build language filter
$lists['filter_lang'] = '<label class="label">' . JText::_('FLEXI_LANGUAGE') . '</label>' . ($assocs_id && $language ? '<span class="badge badge-info">' . $language . '</span>' : flexicontent_html::buildlanguageslist('filter_lang', 'class="use_select2_lib fcfilter_be" onchange="document.adminForm.limitstart.value=0; Joomla.submitform()"', $filter_lang, '-'));
// assign data to template
$this->assignRef('assocs_id', $assocs_id);
$this->assignRef('lists', $lists);
$this->assignRef('rows', $rows);
$this->assignRef('ordering', $ordering);
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
示例8: display
//.........这里部分代码省略.........
$pagination = $this->get('Pagination');
//$users = $this->get('Users');
// Get item using at least one file (-of- the currently listed files)
/*$items_single = $model->getItemsSingleprop( array('file','minigallery') );
$items_multi = $model->getItemsMultiprop ( $field_props=array('image'=>'originalname'), $value_props=array('image'=>'filename') );
$items = array();
foreach ($items_single as $item_id => $_item) $items[$item_id] = $_item;
foreach ($items_multi as $item_id => $_item) $items[$item_id] = $_item;
ksort($items);*/
$fname = $model->getFieldName($fieldid);
$files_selected = $model->getItemFiles($u_item_id);
$formfieldname = FLEXI_J16GE ? 'custom[' . $fname . '][]' : $fname . '[]';
//add js to document
if ($folder_mode) {
$js = "\n\t\t\t\n\t\t\twindow.addEvent('domready', function() {\n\n\t\t function closest (obj, el) {\n\t\t var find = obj.getElement(el);\n\t\t var self = obj;\n\t\t \n\t\t while (self && !find) {\n\t\t self = self.getParent();\n\t\t find = self ? self.getElement(el) : null;\n\t\t }\n\t\t return find;\n\t\t }\n\n\t\t\t\tvar delfilename = '" . $delfilename . "';\n\t\t\t\tvar remove_existing_files_from_list = 0;\n\t\t\t\tvar remove_new_files_from_list = 0;\n\t\t\t\toriginal_objs = \$(window.parent.document.body).getElement('#container_fcfield_" . $fieldid . "').getElements('.originalname');\n\t\t\t\texisting_objs = \$(window.parent.document.body).getElement('#container_fcfield_" . $fieldid . "').getElements('.existingname');\n\t\t\t\t\n\t\t\t\tvar imgobjs = Array();\n\t\t\t\tfor(i=0,n=original_objs.length; i<n; i++) {\n\t\t\t\t\tif (original_objs[i].value) imgobjs.push(original_objs[i].value);\n\t\t\t\t\tif ( delfilename!='' && original_objs[i].value == delfilename)\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.parent.deleteField" . $fieldid . "( original_objs[i].getParent() );\n\t\t\t\t\t\tremove_existing_files_from_list = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(i=0,n=existing_objs.length; i<n; i++) {\n\t\t\t\t\tif ( existing_objs[i].value) imgobjs.push(existing_objs[i].value);\n\t\t\t\t\tif ( delfilename!='' && existing_objs[i].value == delfilename)\n\t\t\t\t\t{\n\t\t\t\t\t\twindow.parent.deleteField" . $fieldid . "(\n\t\t\t\t\t\t\t(MooTools.version>='1.2.4') ? existing_objs[i].getParent('.img_value_props') : closest (existing_objs[i] , '.img_value_props')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tremove_new_files_from_list = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( remove_existing_files_from_list || remove_new_files_from_list ) {\n\t\t\t\t\tmssg = '" . JText::_('FLEXI_DELETE_FILE_IN_LIST_WINDOW_MUST_CLOSE') . "';\n\t\t\t\t\tmssg = mssg + '\\n' + (remove_existing_files_from_list ? '" . JText::_('FLEXI_EXISTING_FILE_REMOVED_SAVE_RECOMMENEDED', true) . "' : '');\n\t\t\t\t\talert( mssg );\n\t\t\t\t\t(MooTools.version>='1.2.4') ? window.parent.SqueezeBox.close() : window.parent.document.getElementById('sbox-window').close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(i=0,n=imgobjs.length; i<n; i++) {\n\t\t\t\t\tvar rows = \$(document.body).getElements('a[rel='+ imgobjs[i] +']');\n\t\t\t\t\trows.addClass('striketext');\n\t\t\t\t\t\n\t\t\t\t\t//if( (typeof rows) != 'undefined' && rows != null) {\n\t\t\t\t\t\t//alert(rows[0]);\n\t\t\t\t\t\t//row.className = 'striketext';\n\t\t\t\t\t//}\n\t\t\t\t}\n\t\t\t\t" . ($autoassign && $newfilename ? "window.parent.qmAssignFile" . $fieldid . "('" . $targetid . "', '" . $newfilename . "', '" . $thumb . "');" : "") . "\n\t\t\t});\n\t\t\t";
} else {
$js = "\n\t\t\tfunction qffileselementadd(obj, id, file) {\n\t\t\t\tvar result = window.parent.qfSelectFile" . $fieldid . "(id, file);\n\t\t\t\tif ((typeof result) != 'undefined' && result == 'cancel') return;\n\t\t\t\tobj.className = 'striketext';\n\t\t\t\tdocument.adminForm.file.value=id;\n\t\t\t}\n\t\t\twindow.addEvent('domready', function() {\n\t\t\t\tfileobjs = window.parent.document.getElementsByName('{$formfieldname}');\n\t\t\t\tfor(i=0,n=fileobjs.length; i<n; i++) {\n\t\t\t\t\trow = document.getElementById('file'+fileobjs[i].value);\n\t\t\t\t\tif( (typeof row) != 'undefined' && row != null) {\n\t\t\t\t\t\trow.className = 'striketext';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t" . ($autoselect && $newfileid ? "qffileselementadd( document.getElementById('file" . $newfileid . "'), '" . $newfileid . "', '" . $newfilename . "');" : "") . "\n\t\t\t});\n\t\t\t";
}
$document->addScriptDeclaration($js);
if ($autoselect && $newfileid) {
$app->enqueueMessage(JText::_('FLEXI_UPLOADED_FILE_WAS_SELECTED'), 'message');
}
/*****************
** BUILD LISTS **
*****************/
$lists = array();
// ** FILE UPLOAD FORM **
// Build languages list
//$allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed',null);
//$allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs);
$display_file_lang_as = $params->get('display_file_lang_as', 3);
$allowed_langs = null;
if (FLEXI_FISH || FLEXI_J16GE) {
$lists['file-lang'] = flexicontent_html::buildlanguageslist('file-lang', '', '*', $display_file_lang_as, $allowed_langs, $published_only = false);
} else {
$lists['file-lang'] = flexicontent_html::getSiteDefaultLang() . '<input type="hidden" name="file-lang" value="' . flexicontent_html::getSiteDefaultLang() . '" />';
}
/*************
** FILTERS **
*************/
// language filter
$lists['language'] = flexicontent_html::buildlanguageslist('filter_lang', 'class="use_select2_lib" onchange="submitform();" size="1" ', $filter_lang, 2);
// search
$lists['search'] = $search;
//search filter
$filters = array();
$filters[] = JHTML::_('select.option', '1', JText::_('FLEXI_FILENAME'));
$filters[] = JHTML::_('select.option', '2', JText::_('FLEXI_FILE_TITLE'));
$lists['filter'] = JHTML::_('select.genericlist', $filters, 'filter', 'size="1" class="use_select2_lib"', 'value', 'text', $filter);
//build url/file filterlist
$url = array();
$url[] = JHTML::_('select.option', '', '- ' . JText::_('FLEXI_ALL_FILES') . ' -');
$url[] = JHTML::_('select.option', 'F', JText::_('FLEXI_FILE'));
$url[] = JHTML::_('select.option', 'U', JText::_('FLEXI_URL'));
$lists['url'] = JHTML::_('select.genericlist', $url, 'filter_url', 'class="use_select2_lib" size="1" onchange="submitform( );"', 'value', 'text', $filter_url);
//item lists
/*$items_list = array();
$items_list[] = JHTML::_('select.option', '', '- '. JText::_( 'FLEXI_FILTER_BY_ITEM' ) .' -' );
foreach($items as $item) {
$items_list[] = JHTML::_('select.option', $item->id, JText::_( $item->title ) . ' (#' . $item->id . ')' );
}
$lists['item_id'] = JHTML::_('select.genericlist', $items_list, 'item_id', 'size="1" class="use_select2_lib" onchange="submitform( );"', 'value', 'text', $filter_item );*/
$lists['item_id'] = '<input type="text" name="item_id" size="1" class="inputbox" onchange="submitform( );" value="' . $filter_item . '" />';
//build secure/media filterlist
$secure = array();
$secure[] = JHTML::_('select.option', '', '- ' . JText::_('FLEXI_ALL_DIRECTORIES') . ' -');
示例9: htmlspecialchars
' : ((!$multiple || $is_ingroup) && $required_class ? '<br/><div class="alert alert-info fc-small fc-iblock">' . JText::_('FLEXI_FIELD_' . $FT . '_REQUIRED_UPLOAD_NEW_TO_REPLACE') . '</div>' : '')) . '
</div>' . ($iform_title ? '
<div class="nowrap_box inlinefile-title-box">
<label class="label inlinefile-title-lbl ' . $tip_class . '" title="' . flexicontent_html::getToolTip('FLEXI_FILE_DISPLAY_TITLE', 'FLEXI_FILE_DISPLAY_TITLE_DESC', 1, 1) . '" id="' . $elementid_n . '_file-title-lbl" for="' . $elementid_n . '_file-title">
' . JText::_('FLEXI_FILE_DISPLAY_TITLE') . '
</label>
<span class="inlinefile-title-data">
<input type="text" id="' . $elementid_n . '_file-title" size="44" name="' . $fieldname_n . '[file-title]" value="' . htmlspecialchars(!isset($form_data[$file_id]) ? $file_data->altname : $form_data[$file_id]['file-title'], ENT_COMPAT, 'UTF-8') . '" class="fc_filetitle ' . $required_class . '" />
</span>
</div>' : '') . ($iform_lang ? '
<div class="nowrap_box inlinefile-lang-box">
<label class="label inlinefile-lang-lbl ' . $tip_class . '" title="' . flexicontent_html::getToolTip('FLEXI_LANGUAGE', 'FLEXI_FILE_LANGUAGE_DESC', 1, 1) . '" id="' . $elementid_n . '_file-lang-lbl" for="' . $elementid_n . '_file-lang">
' . JText::_('FLEXI_LANGUAGE') . '
</label>
<span class="inlinefile-lang-data">
' . flexicontent_html::buildlanguageslist($fieldname_n . '[file-lang]', 'class="fc_filelang use_select2_lib"', !isset($form_data[$file_id]) ? $file_data->language : $form_data[$file_id]['file-lang'], 1) . '
</span>
</div>' : '') . ($iform_desc ? '
<div class="nowrap_box inlinefile-desc-box">
<label class="label inlinefile-desc-lbl ' . $tip_class . '" title="' . flexicontent_html::getToolTip('FLEXI_DESCRIPTION', 'FLEXI_FILE_DESCRIPTION_DESC', 1, 1) . '" id="' . $elementid_n . '_file-desc-lbl" for="' . $elementid_n . '_file-desc">
' . JText::_('FLEXI_DESCRIPTION') . '
</label>
<span class="inlinefile-desc-data">
<textarea id="' . $elementid_n . '_file-desc" cols="24" rows="3" name="' . $fieldname_n . '[file-desc]" class="fc_filedesc">' . (!isset($form_data[$file_id]) ? $file_data->description : $form_data[$file_id]['file-desc']) . '</textarea>
</span>
</div>' : '') . ($iform_dir ? '
<div class="nowrap_box inlinefile-secure-box">
<label class="label inlinefile-secure-lbl ' . $tip_class . '" data-placement="top" title="' . flexicontent_html::getToolTip('FLEXI_URL_SECURE', 'FLEXI_URL_SECURE_DESC', 1, 1) . '" id="' . $elementid_n . '_secure-lbl">
' . JText::_('FLEXI_URL_SECURE') . '
</label>
' . ($has_values ? '