本文整理汇总了PHP中flexicontent_html::loadJQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html::loadJQuery方法的具体用法?PHP flexicontent_html::loadJQuery怎么用?PHP flexicontent_html::loadJQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flexicontent_html
的用法示例。
在下文中一共展示了flexicontent_html::loadJQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_css_js
function add_css_js()
{
$css = "\n\t\tdiv.pane-sliders ul.adminformlist li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:132px; font-weight: bold;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\tdiv.pane-sliders ul.adminformlist li ul#rules label.hasTip {\n\t\t\tdisplay:inherit; padding: inherit; margin: inherit; text-align: inherit;\twidth: inherit; font-weight: inherit;\n\t\t\tbackground-color: inherit; border-width: 0px; color: inherit;\n\t\t}\n\t\tdiv.pane-sliders ul.adminformlist li select { margin-bottom: 0px;}\n\t\tdiv.pane-sliders ul.adminformlist li fieldset { margin: 0; padding: 0; }\n\t\t\n\t\tdiv.current ul.config-option-list li .fcsep_level3 {\n\t\t\tleft: 232px !important;\n\t\t}\n\t\t/*div.controls input, div.controls textarea {\n\t\t\tmin-width: 56%;\n\t\t}*/\n\t\tdiv.control-group div.control-label label.hasTooltip,\n\t\tdiv.current ul.config-option-list li label.hasTooltip,\n\t\tdiv.current ul.config-option-list li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:220px; font-weight: normal; font-size: 12px;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\tdiv.current ul.config-option-list li ul#rules label.hasTip {\n\t\t\tdisplay:inherit; padding: inherit; margin: inherit; text-align: inherit;\twidth: inherit; font-weight: inherit;\n\t\t\tbackground-color: inherit; border-width: 0px; color: inherit;\n\t\t}\n\t\tform#item-form div.pane-sliders ul.adminformlist li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:160px; font-weight: bold;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\t\n\t\t/*div.current fieldset.radio label {\n\t\t\tmin-width:10px!important; padding: 0px 16px 0px 0px!important; margin: 2px 0px 0px 1px!important;\n\t\t}\n\t\tdiv fieldset.adminform fieldset.radio label, div fieldset.panelform fieldset.radio label {\n\t\t\tmin-width:10px!important; padding: 0px 10px 0px 0px!important; margin: 4px 0px 0px 1px!important;\n\t\t}*/\n\t\t\n\t\t/*div fieldset input, div fieldset textarea, div fieldset img, div fieldset button { margin:5px 2px 2px 0px; }*/\n\t\tdiv fieldset select { margin:0px; }\n\t\t\t\t\t\n\t\tdiv.current ul.config-option-list li select { margin-bottom: 0px; font-size:12px;}\n\t\tdiv.current ul.config-option-list li fieldset { margin: 0; padding: 0; }\n\t\t\n\t\t.tool-tip { }\n\t\t.tip-title { }\n\t\t";
$document = JFactory::getDocument();
$document->addStyleDeclaration($css);
if (FLEXI_J30GE) {
$jinput = JFactory::getApplication()->input;
}
$option = FLEXI_J30GE ? $jinput->get('option', '', 'string') : JRequest::getVar('option');
$view = FLEXI_J30GE ? $jinput->get('view', '', 'string') : JRequest::getVar('view');
$controller = FLEXI_J30GE ? $jinput->get('controller', '', 'string') : JRequest::getVar('controller');
$component = FLEXI_J30GE ? $jinput->get('component', '', 'string') : JRequest::getVar('component');
// NOTE: this is imported by main Frontend/Backend CSS file
// so import these only if it is not a flexicontent view
if ($option != 'com_flexicontent') {
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/flexi_form.css');
// NOTE: this is imported by main Frontend/Backend CSS file
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/flexi_shared.css');
// NOTE: this is imported by main Frontend/Backend CSS file
// Add flexicontent specific TABBing to non-flexicontent views
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/tabber.css');
$document->addScript(JURI::root(true) . '/components/com_flexicontent/assets/js/tabber-minimized.js');
$document->addScriptDeclaration(' document.write(\'<style type="text/css">.fctabber{display:none;}<\\/style>\'); ');
}
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'classes' . DS . 'flexicontent.helper.php';
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery();
// 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);
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VERSION);
}
示例2: add_css_js
function add_css_js()
{
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'classes' . DS . 'flexicontent.helper.php';
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery();
$document = JFactory::getDocument();
$js = "\n\t\t\tvar sorttable_fcfield_lists = '';\n\t\t\t\n\t\t\t/* unused to be removed */\n\t\t\tfunction fcfield_add2list(list_tagid, selector){\n\t\t\t\tvar list = jQuery('#'+list_tagid);\n\t\t\t\tvar sep = list.val().trim() ? ', ' : '';\n\t\t\t\tval = list.val() + sep + jQuery(selector).val();\n\t\t\t\tlist.val(val);\n\t\t\t}\n\t\t\t\n\t\t\tfunction fcfield_del_sortable_element(obj){\n\t\t\t\tvar element = jQuery(obj).parent();\n\t\t\t\tvar parent_element = jQuery(element.parent());\n\t\t\t\telement.remove();\n\t\t\t\tstoreordering( parent_element );\n\t\t\t}\n\t\t\t\n\t\t\tfunction fcfield_add_sortable_element(selector){\n\t\t\t\tvar selobj = jQuery(selector);\n\t\t\t\tvar tagid = selobj.attr('id').replace('_selector','');\n\t\t\t\tvar container = 'sortable-' + tagid;\n\t\t\t\t\n\t\t\t\tvar val = selobj.val();\n\t\t\t\tif (!val) return;\n\t\t\t\tvar lbl = selobj.find('option:selected').text();\n\t\t\t\tjQuery('#'+container).append('<li id=\"field_'+val+'\" class=\"fields delfield\">'+lbl+\n\t\t\t\t'<a title=\"" . JText::_('FLEXI_REMOVE') . "\" align=\"right\" onclick=\"javascript:fcfield_del_sortable_element(this);\" class=\"deletetag\" href=\"javascript:;\"></a>'+\n\t\t\t\t'</li>');\n\t\t\t\t\n\t\t\t\tvar field_list = jQuery('#'+tagid).val();\n\t\t\t\tfield_list += field_list ? ','+val : val;\n\t\t\t\tjQuery('#'+tagid).val(field_list);\n\t\t\t\tselobj.prop('selectedIndex',0);\n\t\t\t}\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\n\t\t\tjQuery(document).ready(function() {\n\t\t\t\n\t\t\t\tjQuery( sorttable_fcfield_lists ).each(function(index, value) {\n\t\t\t\t\tstoreordering(jQuery(this));\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tjQuery( sorttable_fcfield_lists ).sortable({\n\t\t\t\t\tconnectWith: sorttable_fcfield_lists,\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\t\n\t\t\t});\n\t\t";
if ($js) {
$document->addScriptDeclaration($js);
}
}
示例3: loadFramework
/**
* Utility function to load each JS Frameworks once
*
* @param string $text
* @param int $nb
* @return string
* @since 1.5
*/
static function loadFramework($framework, $mode = '')
{
// Detect already loaded framework
static $_loaded = array();
if (isset($_loaded[$framework])) {
return $_loaded[$framework];
}
$_loaded[$framework] = false;
// Get frameworks that are configured to be loaded manually in frontend (e.g. via the Joomla template)
$app = JFactory::getApplication();
static $load_frameworks = null;
static $load_jquery = null;
if (!isset($load_frameworks[$framework])) {
$flexiparams = JComponentHelper::getParams('com_flexicontent');
//$load_frameworks = $flexiparams->get('load_frameworks', array('jQuery','image-picker','masonry','select2','inputmask','prettyCheckable','fancybox'));
//$load_frameworks = FLEXIUtilities::paramToArray($load_frameworks);
//$load_frameworks = array_flip($load_frameworks);
//$load_jquery = isset($load_frameworks['jQuery']) || !$app->isSite();
if ($load_jquery === null) {
$load_jquery = $flexiparams->get('loadfw_jquery', 1) == 1 || !$app->isSite();
}
$load_framework = $flexiparams->get('loadfw_' . strtolower(str_replace('-', '_', $framework)), 1);
$load_frameworks[$framework] = $load_framework == 1 || $load_framework == 2 && !$app->isSite();
}
// Set loaded flag
$_loaded[$framework] = $load_frameworks[$framework];
// Do not progress further if it is disabled
if (!$load_frameworks[$framework]) {
return false;
}
// Load Framework
$document = JFactory::getDocument();
$lib_path = '/components/com_flexicontent/librairies';
$js = "";
$css = "";
switch ($framework) {
case 'jQuery':
if ($load_jquery) {
flexicontent_html::loadJQuery();
}
break;
case 'mCSB':
if ($load_jquery) {
flexicontent_html::loadJQuery();
}
$framework_path = JURI::root(true) . $lib_path . '/mCSB';
$document->addScript($framework_path . '/jquery.mCustomScrollbar.min.js');
$document->addStyleSheet($framework_path . '/jquery.mCustomScrollbar.css');
$js .= "\n\t\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\t\tjQuery('.fc_add_scroller').mCustomScrollbar({\n\t\t\t\t\t\t\ttheme:'dark-thick',\n\t\t\t\t\t\t\tadvanced:{updateOnContentResize: true}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tjQuery('.fc_add_scroller_horizontal').mCustomScrollbar({\n\t\t\t\t\t\t\ttheme:'dark-thick',\n\t\t\t\t\t\t\thorizontalScroll:true,\n\t\t\t\t\t\t\tadvanced:{updateOnContentResize: true}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t";
break;
case 'image-picker':
if ($load_jquery) {
flexicontent_html::loadJQuery();
}
$framework_path = JURI::root(true) . $lib_path . '/image-picker';
$document->addScript($framework_path . '/image-picker.min.js');
$document->addStyleSheet($framework_path . '/image-picker.css');
break;
case 'masonry':
$framework_path = JURI::root(true) . $lib_path . '/masonry';
$document->addScript($framework_path . '/masonry.pkgd.min.js');
break;
case 'select2':
if ($load_jquery) {
flexicontent_html::loadJQuery();
}
// Replace chosen function (if loaded)
//JHtml::_('formbehavior.chosen', '#_some_iiidddd_');
$js .= "\n\t\t\t\tif (typeof jQuery.fn.chosen == 'function') { \n\t\t\t\t\tjQuery.fn.chosen_fc = jQuery.fn.chosen;\n\t\t\t\t\tjQuery.fn.chosen = function(){\n\t\t\t\t\t\tvar args = arguments;\n\t\t\t\t\t\tjQuery(this).each(function() {\n\t\t\t\t\t\t\tif (jQuery(this).hasClass('use_select2_lib')) return;\n\t\t\t\t\t\t\tjQuery(this).chosen_fc(args);\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t";
$ver = '3.5.4';
$framework_path = JURI::root(true) . $lib_path . '/select2';
$framework_folder = JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'librairies' . DS . 'select2';
$document->addScriptVersion($framework_path . '/select2.min.js', $ver);
$document->addStyleSheetVersion($framework_path . '/select2.css', $ver);
$lang_code = flexicontent_html::getUserCurrentLang();
if ($lang_code && $lang_code != 'en') {
// Try language shortcode
if (file_exists($framework_folder . DS . 'select2_locale_' . $lang_code . '.js')) {
$document->addScriptVersion($framework_path . '/select2_locale_' . $lang_code . '.js', $ver);
} else {
$country_code = flexicontent_html::getUserCurrentLang($short_tag = false);
if ($country_code && file_exists($framework_folder . DS . 'select2_locale_' . $country_code . '.js')) {
$document->addScriptVersion($framework_path . '/select2_locale_' . $country_code . '.js', $ver);
}
}
}
$js .= "\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t" . "\n\t\t\t\t\t\tjQuery('select.use_select2_lib').select2({\n\t\t\t\t\t\t\t/*hideSelectionFromResult: function(selectedObject) { selectedObject.removeClass('select2-result-selectable').addClass('select2-result-unselectable').addClass('select2-disabled'); return false; },*/\n\t\t\t\t\t\t\tminimumResultsForSearch: 10\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tjQuery('div.use_select2_lib').each(function() {\n\t\t\t\t\t\t\tvar el_container = jQuery(this);\n\t\t\t\t\t\t\tvar el_select = el_container.next('select');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tvar fc_label_text = el_select.attr('data-fc_label_text');\n\t\t\t\t\t\t\tif (!fc_label_text) fc_label_text = el_select.attr('fc_label_text');\n\t\t\t\t\t\t\tif (fc_label_text) {\n\t\t\t\t\t\t\t\tvar _label = (fc_label_text.length >= 30) ? fc_label_text.substring(0, 28) + '...' : fc_label_text;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjQuery('<span/>', {\n\t\t\t\t\t\t\t\t\t'class': 'fc_has_inner_label fc_has_inner_label_select2',\n\t\t\t\t\t\t\t\t\t'text': _label\n\t\t\t\t\t\t\t\t}).prependTo(el_container.find('.select2-search-field'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tvar fc_prompt_text = el_select.attr('data-fc_prompt_text');\n\t\t\t\t\t\t\tif (!fc_prompt_text) fc_prompt_text = el_select.attr('fc_prompt_text');\n\t\t\t\t\t\t\tif (fc_prompt_text) {\n\t\t\t\t\t\t\t\tvar _prompt = (fc_prompt_text.length >= 30) ? fc_prompt_text.substring(0, 28) + '...' : fc_prompt_text;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tjQuery('<span/>', {\n\t\t\t\t\t\t\t\t\t'class': 'fc_has_inner_prompt fc_has_inner_prompt_select2',\n\t\t\t\t\t\t\t\t\t'text': _prompt\n\t\t\t\t\t\t\t\t}).prependTo(el_container.find('.select2-search-field')).hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tif ( ! el_select.attr('multiple') && !el_select.hasClass('fc_skip_highlight') ) {\n\t\t\t\t\t\t\t\tvar el = el_container.find('.select2-choice');\n\t\t\t\t\t\t\t\tvar val = el_select.val();\n\t\t\t\t\t\t\t\tif (val === null) {\n\t\t\t\t\t\t\t\t\t//el.addClass('fc_highlight_disabled');\n\t\t\t\t\t\t\t\t} else if (!!val && val.length) {\n\t\t\t\t\t\t\t\t\tel.addClass('fc_highlight');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tel.removeClass('fc_highlight');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t" . "\n\t\t\t\t\t\tjQuery('select.use_select2_lib').on('select2-open', function() {\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tvar el_container = jQuery(this).parent();\n\t\t\t\t\t\t\tvar el = jQuery(this).parent().find('.select2-input');\n\t\t\t\t\t\t\tvar el_label = el.prevAll('.fc_has_inner_label');\n\t\t\t\t\t\t\tif (el_label) el_label.hide();\n\t\t\t\t\t\t\tvar el_prompt = el.prevAll('.fc_has_inner_prompt');\n\t\t\t\t\t\t\tif (el_prompt) el_prompt.show();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tif (jQuery(this).hasClass('select2_list_selected')) {\n\t\t\t\t\t\t\t\tvar els = jQuery('#select2-drop').find('.select2-selected');\n\t\t\t\t\t\t\t\tels.addClass('select2-selected-highlight').addClass('select2-disabled').removeClass('select2-selected').removeClass('select2-result-selectable');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).on('select2-close', function() {\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tvar el_container = jQuery(this).parent();\n\t\t\t\t\t\t\tvar el = jQuery(this).parent().find('.select2-input');\n\t\t\t\t\t\t\tvar el_label = el.prevAll('.fc_has_inner_label');\n\t\t\t\t\t\t\tif (el_label) el_label.show();\n\t\t\t\t\t\t\tvar el_prompt = el.prevAll('.fc_has_inner_prompt');\n\t\t\t\t\t\t\tif (el_prompt) el_prompt.hide();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t" . "\n\t\t\t\t\t\t\tif (jQuery(this).hasClass('select2_list_selected')) {\n\t\t\t\t\t\t\t\tvar els = jQuery('#select2-drop').find('.select2-selected-highlight');\n\t\t\t\t\t\t\t\tels.removeClass('select2-selected-highlight').removeClass('select2-disabled').addClass('select2-result-selectable');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}).on\n\t\t\t\t\t\t\n\t\t\t\t\t\t" . "\n\t\t\t\t\t\t('change', function() {\n\t\t\t\t\t\t\tvar el_select = jQuery(this);\n\t\t\t\t\t\t\tif ( ! el_select.attr('multiple') && !el_select.hasClass('fc_skip_highlight') ) {\n\t\t\t\t\t\t\t\tvar el = jQuery(this).prev('div').find('.select2-choice');\n\t\t\t\t\t\t\t\tvar val = el_select.val();\n\t\t\t\t\t\t\t\tif (!!val && val.length) {\n\t\t\t\t\t\t\t\t\tel.addClass('fc_highlight');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tel.removeClass('fc_highlight');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t" . "\n\t\t\t\t\t\tjQuery('div.use_select2_lib.select2-container-multi input').on('keydown', function() {\n\t\t\t\t\t\t\tvar el = jQuery(this);\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tvar val = el.val();\n\t\t\t\t\t\t\t\tif (!!val && val.length) {\n\t\t\t\t\t\t\t\t\tvar el_prompt = el.prevAll('.fc_has_inner_prompt');\n\t\t\t\t\t\t\t\t\tif (el_prompt) el_prompt.hide();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tvar el_prompt = el.prevAll('.fc_has_inner_prompt');\n\t\t\t\t\t\t\t\t\tif (el_prompt) el_prompt.show();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t" . "\n\t\t\t\t\t\tjQuery('select.use_select2_lib').on('loaded open', function() {\n\t\t\t\t\t\t\tvar ul = jQuery('#select2-drop ul.select2-results');\n\t\t\t\t\t\t\tvar needsScroll= ul.prop('scrollHeight') > ul.prop('clientHeight');\n\t\t\t\t\t\t\tif (needsScroll) ul.css('overflow-y', 'scroll');\n\t\t\t\t\t\t\telse ul.css('overflow-y', 'auto');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t";
break;
case 'inputmask':
if ($load_jquery) {
flexicontent_html::loadJQuery();
}
//.........这里部分代码省略.........
示例4: display
/**
* Creates the Fileselement view
*
* @since 1.0
*/
function display($tpl = null)
{
// Check for request forgeries
JRequest::checkToken('request') or jexit('Invalid Token');
//initialise variables
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$option = JRequest::getCmd('option');
$view = JRequest::getVar('view');
$layout = JRequest::getVar('layout', 'default');
$db = JFactory::getDBO();
$user = JFactory::getUser();
$cparams = JComponentHelper::getParams('com_flexicontent');
//$authorparams = flexicontent_db::getUserConfig($user->id);
$langs = FLEXIUtilities::getLanguages('code');
$fieldid = JRequest::getVar('field', null, 'request', 'int');
$client = $app->isAdmin() ? '../' : '';
flexicontent_html::loadJQuery();
flexicontent_html::loadFramework('select2');
JHTML::_('behavior.tooltip');
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
// Get filters
$_view = $view . $fieldid;
$folder_mode = $app->getUserStateFromRequest($option . '.' . $_view . '.folder_mode', 'folder_mode', 0, 'int');
// Get User's Global Permissions
$perms = FlexicontentHelperPerm::getPerm();
// Get model
$model = $this->getModel();
$count_filters = 0;
$filter_order = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_order', 'filter_order', 'f.filename', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_lang = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_lang', 'filter_lang', '', 'string');
$filter_url = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_url', 'filter_url', '', 'word');
$filter_secure = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_secure', 'filter_secure', '', 'word');
$target_dir = 2;
if (!$folder_mode) {
$field_params = $model->getFieldParams();
$target_dir = $field_params->get('target_dir', '');
// Clear secure/media filter if field is not configured to use specific
if (!strlen($target_dir) || $target_dir != 2) {
$filter_secure = '';
}
}
$filter_ext = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_ext', 'filter_ext', '', 'alnum');
$filter_uploader = $app->getUserStateFromRequest($option . '.' . $_view . '.filter_uploader', 'filter_uploader', '', 'int');
$filter_item = $app->getUserStateFromRequest($option . '.' . $_view . '.item_id', 'item_id', '', 'int');
if ($layout != 'image') {
if ($filter_lang) {
$count_filters++;
}
if ($filter_url) {
$count_filters++;
}
if ($filter_secure) {
$count_filters++;
}
}
if ($filter_ext) {
$count_filters++;
}
//if ($perms->CanViewAllFiles && $filter_uploader) $count_filters++;
if ($filter_item) {
$count_filters++;
}
$u_item_id = $app->getUserStateFromRequest($option . '.' . $_view . '.u_item_id', 'u_item_id', 0, 'string');
//if ($u_item_id && (int)$u_item_id = $u_item_id) $filter_item = $u_item_id; // DO NOT SET it prevents listing and selecting files !!
if (!$u_item_id && $filter_item) {
$u_item_id = $filter_item;
}
$autoselect = $app->getUserStateFromRequest($option . '.' . $_view . '.autoselect', 'autoselect', 0, 'int');
$autoassign = $app->getUserStateFromRequest($option . '.' . $_view . '.autoassign', 'autoassign', 0, 'int');
$folder_param = $app->getUserStateFromRequest($option . '.' . $_view . '.folder_param', 'folder_param', 'dir', 'string');
$append_item = $app->getUserStateFromRequest($option . '.' . $_view . '.append_item', 'append_item', 1, 'int');
$append_field = $app->getUserStateFromRequest($option . '.' . $_view . '.append_field', 'append_field', 1, 'int');
$targetid = $app->getUserStateFromRequest($option . '.' . $_view . '.targetid', 'targetid', '', 'string');
$thumb_w = $app->getUserStateFromRequest($option . '.' . $_view . '.thumb_w', 'thumb_w', 120, 'int');
$thumb_h = $app->getUserStateFromRequest($option . '.' . $_view . '.thumb_h', 'thumb_h', 90, 'int');
$scope = $app->getUserStateFromRequest($option . '.' . $_view . '.scope', 'scope', 1, 'int');
$search = $app->getUserStateFromRequest($option . '.' . $_view . '.search', 'search', '', 'string');
$search = $db->escape(trim(JString::strtolower($search)));
$filter_uploader = $filter_uploader ? $filter_uploader : '';
$filter_item = $filter_item ? $filter_item : '';
$newfileid = JRequest::getInt('newfileid');
$newfilename = base64_decode(JRequest::getVar('newfilename', ''));
$delfilename = base64_decode(JRequest::getVar('delfilename', ''));
// Add custom css and js to document
if ($app->isSite()) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontent.css');
} else {
$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 {
//.........这里部分代码省略.........
示例5: display
function display($tpl = null)
{
//initialise variables
$mainframe = JFactory::getApplication();
$option = JRequest::getVar('option');
$db = JFactory::getDBO();
$document = JFactory::getDocument();
$user = JFactory::getUser();
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
$use_jquery_sortable = true;
//FLEXI_J16GE ? true : false;
if ($use_jquery_sortable) {
flexicontent_html::loadJQuery();
} else {
// mootools sortable
$document->addScript(JURI::base() . 'components/com_flexicontent/assets/js/sortables.js');
}
$type = JRequest::getVar('type', 'items', '', 'word');
$folder = JRequest::getVar('folder', 'default', '', 'cmd');
if (FLEXI_FISH || FLEXI_J16GE) {
FLEXIUtilities::loadTemplateLanguageFile($folder);
}
//Get data from the model
$layout = $this->get('Data');
$fields = $this->get('Fields');
$fbypos = $this->get('FieldsByPositions');
$used = $this->get('UsedFields');
$contentTypes = $this->get('ContentTypesList');
$fieldTypes = $this->get('FieldTypesList');
// 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="fcfield_selectval" ';
$content_type_select = JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', '', $elementid);
// Create FIELD TYPE SELECTOR
$options = array();
$options[] = JHTML::_('select.option', '', JText::_('FLEXI_ALL'));
foreach ($fieldTypes as $fieldType) {
$options[] = JHTML::_('select.option', $fieldType->type_name, $fieldType->field_name);
}
$fieldname = $elementid = 'field_type__au__';
$attribs = ' onchange="filterFieldList(\'%s\', \'%s\', \'%s\');" class="fcfield_selectval" ';
$field_type_select = JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', '', $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[] = $use_jquery_sortable ? 'storeordering(jQuery("#sortable-' . $v . '"))' : 'results(' . $k . ',\'' . $v . '\')';
}
}
$positions = implode(',', $idsort);
$jssort = implode("; ", $jssort);
$sortable_ids = "#" . implode(",#", $sort);
if ($use_jquery_sortable) {
$js = "\n\t\t\t\tjQuery(function() {\n\t\t\t\t\tmy = jQuery( \"{$sortable_ids}\" ).sortable({\n\t\t\t\t\t\tconnectWith: \"" . $sortable_ids . "\",\n\t\t\t\t\t\tupdate: function(event, ui) {\n\t\t\t\t\t\t\tif(ui.sender) {\n\t\t\t\t\t\t\t\tstoreordering(jQuery(ui.sender));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tstoreordering(jQuery(ui.item).parent());\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\tinitordering();\n\t\t\t\t});\n\t\t\t\tfunction storeordering(parent_element) {\n\t\t\t\t\thidden_id = '#'+jQuery.trim(parent_element.attr('id').replace('sortable-',''));\n\t\t\t\t\tfields = new Array();\n\t\t\t\t\ti = 0;\n\t\t\t\t\tparent_element.children('li').each(function(){\n\t\t\t\t\t\tfields[i++] = jQuery(this).attr('id').replace('field_', '');\n\t\t\t\t\t});\n\t\t\t\t\tjQuery(hidden_id).val(fields.join(','))\n\t\t\t\t}\n\t\t\t\t";
} else {
$js = "\n\t\t\t\tvar my = '';\n\t\t\t\twindow.addEvent('domready', function(){\n\t\t\t\t\tvar mySortables = new Sortables('.positions', {\n\t\t\t\t\t\tconstrain: false,\n\t\t\t\t\t\tclone: false,\n\t\t\t\t\t\trevert: true,\n\t\t\t\t\t\tonComplete: storeordering\n\t\t\t\t\t});\n\t\t\t\t\tmy = mySortables;\n\t\t\t\t\tstoreordering();\n\n\t\t\t\t\tvar slideaccess = new Fx.Slide('propvisible');\n\t\t\t\t\tvar slidenoaccess = new Fx.Slide('propnovisible');\n\t\t\t\t\tvar legend = \$\$('fieldset.tmplprop legend');\n\t\t\t\t\tslidenoaccess.hide();\n\t\t\t\t\tlegend.addEvent('click', function(ev) {\n\t\t\t\t\t\tlegend.toggleClass('open');\n\t\t\t\t\t\tslideaccess.toggle();\n\t\t\t\t\t\tslidenoaccess.toggle();\n\t\t\t\t\t});\n\n\n\t\t\t\t});\n\n\t\t\t\tfunction results(i, field) {\n\t\t\t\t\tvar res = my.serialize(i, function(element, index){\n\t\t\t\t\treturn element.getProperty('id').replace('field_','');\n\t\t\t\t}).join(',');\n\t\t\t\t\t\$(field).value = res;\n\t\t\t\t}\n\t\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 {
//.........这里部分代码省略.........
示例6: getInput
//.........这里部分代码省略.........
// Get the database object and a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Get the client id.
$clientId = $this->element['client_id'];
if (is_null($clientId) && $this->form instanceof JForm) {
$clientId = $this->form->getValue('client_id');
}
$clientId = (int) $clientId;
$client = JApplicationHelper::getClientInfo($clientId);
// Get the module.
$module = (string) $this->element['module'];
if (empty($module) && $this->form instanceof JForm) {
$module = $this->form->getValue('module');
}
$module = preg_replace('#\\W#', '', $module);
// Get the template.
$template = (string) $this->element['template'];
$template = preg_replace('#\\W#', '', $template);
// Get the style.
if ($this->form instanceof JForm) {
$template_style_id = $this->form->getValue('template_style_id');
}
$template_style_id = preg_replace('#\\W#', '', $template_style_id);
// Build the query.
$query->select('element, name')->from('#__extensions as e')->where('e.client_id = ' . (int) $clientId)->where('e.type = ' . $db->quote('template'))->where('e.enabled = 1');
if ($template) {
$query->where('e.element = ' . $db->quote($template));
}
if ($template_style_id) {
$query->join('LEFT', '#__template_styles as s on s.template=e.element')->where('s.id=' . (int) $template_style_id);
}
// Set the query and load the templates.
$db->setQuery($query);
$templates = $db->loadObjectList('element');
// Load language file
$lang = JFactory::getLanguage();
$lang->load($module . '.sys', $client->path, null, false, true) || $lang->load($module . '.sys', $client->path . '/modules/' . $module, null, false, true);
// Loop on all templates
if ($templates) {
foreach ($templates as $template) {
// Load language file
$lang->load('tpl_' . $template->element . '.sys', $client->path, null, false, true) || $lang->load('tpl_' . $template->element . '.sys', $client->path . '/templates/' . $template->element, null, false, true);
$template_path = JPath::clean($client->path . '/templates/' . $template->element . '/html/' . $module);
// Add the layout options from the template path.
if (is_dir($template_path) && ($files = JFolder::files($template_path, '^[^_]*\\.php$'))) {
foreach ($files as $i => $file) {
// Remove layout that already exist in component ones
if (in_array(basename($file, '.php'), $module_layouts)) {
unset($files[$i]);
}
}
if (count($files)) {
// Create the group for the template
$groups[$template->element] = array();
$groups[$template->element]['id'] = $this->id . '_' . $template->element;
$groups[$template->element]['text'] = JText::sprintf('JOPTION_FROM_TEMPLATE', $template->name);
$groups[$template->element]['items'] = array();
foreach ($files as $file) {
// Add an option to the template group
$value = basename($file, '.php');
$text = $lang->hasKey($key = strtoupper('TPL_' . $template->element . '_' . $module . '_LAYOUT_' . $value)) ? JText::_($key) : $value;
$groups[$template->element]['items'][] = JHtml::_('select.option', $template->element . ':' . $value, $text);
}
}
}
}
}
// END custom templates
}
// Element name and id
$_name = $this->fieldname;
$fieldname = $this->name;
$element_id = $this->id;
// Add tag attributes
$attribs = '';
if (@$attributes['multiple'] == 'multiple' || @$attributes['multiple'] == 'true') {
$attribs .= ' multiple="multiple" ';
$attribs .= @$attributes['size'] ? ' size="' . @$attributes['size'] . '" ' : ' size="6" ';
} else {
$attribs .= 'class="inputbox"';
}
$attribs .= ' onchange="fc_getLayout(this);"';
// Container of parameters
$tmpl_container = (string) @$attributes['tmpl_container'];
// Add JS code to display parameters, either via 'file' or 'inline'
// For modules we can not use method 'file' (external xml file), because J2.5+ does form validation on the XML file ...
$params_source = (string) @$attributes['params_source'];
$container_sx = FLEXI_J16GE ? '-options' : '-page';
flexicontent_html::loadJQuery();
if (!@$attributes['skipparams']) {
$doc = JFactory::getDocument();
$js = "\n\n" . ($params_source == "file" ? "\n\nfunction fc_getLayout(el)\n{\n\tvar container = jQuery('#" . $tmpl_container . $container_sx . "');\n \tvar container2 = jQuery('a[href=\"#attrib-" . $tmpl_container . "\"]');\n \t\n // *** Hide layout container\n\t//if (container) container.parent().css('display', 'none');\n \t//if (container2) container2.parent().css('display', 'none');\n\t\n\tvar panel;\n\tvar panel_name;\n\tvar panel_header = container;\n\tif (panel_header) {\n\t\tpanel_name = '" . $tmpl_container . $container_sx . "';\n\t\tpanel = panel_header.next();\n\t}\n\t\n\tif (panel_header.length==0 && container2.length>0) {\n\t\tpanel_header = container2;\n\t\tpanel_name = 'attrib-" . $tmpl_container . "';\n\t\tpanel = jQuery('#'+panel_name);\n\t}\n\t\n\tvar layout_name = el.value;\n\tvar _loading_img = '<img src=\"components/com_flexicontent/assets/images/ajax-loader.gif\" align=\"center\">';\n\tpanel_header.html(_loading_img);\n\tpanel_header.html('<a href=\"javascript:void(0);\"><span>Layout: '+_loading_img+'</span></a>');\n\tpanel.html('');\n\tjQuery.ajax({\n\t\ttype: 'GET',\n\t\turl: 'index.php?option=com_flexicontent&task=templates.getlayoutparams&ext_view=" . $view . "&ext_option=" . $option . "&ext_id=" . $pk . "&directory=" . $directory . "&layout_name='+layout_name+'&format=raw',\n\t\tsuccess: function(str) {\n\t\t\tpanel_header.html('<a href=\"javascript:void(0);\"><span>Layout: '+layout_name+'</span></a>');\n\t\t \tpanel_header.parent().css('display', '');\n\t\t\tpanel.html(str);\n\t\t\tjQuery('.hasTooltip').tooltip({'html': true,'container': panel});\n\t\t\t//tabberAutomatic(tabberOptions, panel_name);\n\t\t\tfc_bindFormDependencies('#'+panel_name, 0, '');\n\t\t}\n\t});\n}\n\n" : "\n\nfunction fc_getLayout(el)\n{\n // *** Hide default container\n\tvar container = \$('" . $tmpl_container . $container_sx . "');\n\tif (container) container.getParent().setStyle('display', 'none');\n\t\n\t" . (FLEXI_J30GE ? "\n \tvar container = jQuery('a[href=\"#attrib-" . $tmpl_container . "\"]');\n \tif (container) container.parent().css('display', 'none');\n \t" : "") . "\n\t\n // *** Hide ALL containers\n var layout_name = el.value;\n\tvar layouts = new Array('" . implode("','", $module_layouts) . "');\n\tfor (i=0; i<layouts.length; i++) {\n\t\tif (layouts[i] == layout_name) continue;\n\t\t\n\t\tvar container = \$('" . $tmpl_container . "_' + layouts[i] + '" . $container_sx . "');\n\t\tif (container) container.getParent().setStyle('display', 'none');\n\t\t\n\t\t" . (FLEXI_J30GE ? "\n \tvar container = jQuery('a[href=\"#attrib-" . $tmpl_container . "_' + layouts[i] + '\"]');\n \tif (container) {container.parent().css('display', 'none');}\n \t" : "") . "\n }\n\t\n\t// *** Show current container\n var container = \$('" . $tmpl_container . "_' + layout_name + '" . $container_sx . "');\n if (container) container.getParent().setStyle('display', '');\n \n\t" . (FLEXI_J30GE ? "\n\tvar container = jQuery('a[href=\"#attrib-" . $tmpl_container . "_' + layout_name + '\"]');\n\tif (container) container.parent().css('display', '');\n \t" : "") . "\n}\n\n") . "\n\nwindow.addEvent('domready', function(){\n\tfc_getLayout(\$('jform_" . ($view == 'field' ? "attribs_" : "params_") . $_name . "'));\n});\n\n";
$doc->addScriptDeclaration($js);
}
// Compute the current selected values
$selected = array($this->value);
// Create form element
return JHTML::_('select.groupedlist', $groups, $fieldname, array('id' => $element_id, 'group.id' => 'id', 'list.attr' => $attribs, 'list.select' => $selected));
}
示例7: add_css_js
function add_css_js()
{
$css = "\n\t\tdiv.pane-sliders ul.adminformlist li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:132px; font-weight: bold;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\tdiv.pane-sliders ul.adminformlist li ul#rules label.hasTip {\n\t\t\tdisplay:inherit; padding: inherit; margin: inherit; text-align: inherit;\twidth: inherit; font-weight: inherit;\n\t\t\tbackground-color: inherit; border-width: 0px; color: inherit;\n\t\t}\n\t\tdiv.pane-sliders ul.adminformlist li select { margin-bottom: 0px;}\n\t\tdiv.pane-sliders ul.adminformlist li fieldset { margin: 0; padding: 0; }\n\t\t\n\t\tdiv.current ul.config-option-list li .fcsep_level3 {\n\t\t\tleft: 232px !important;\n\t\t}\n\t\tdiv.controls input, div.controls textarea {\n\t\t\tmin-width: 56%;\n\t\t}\n\t\tdiv.control-group div.control-label label.hasTooltip,\n\t\tdiv.current ul.config-option-list li label.hasTooltip,\n\t\tdiv.current ul.config-option-list li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:220px; font-weight: normal; font-size: 12px;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\tdiv.current ul.config-option-list li ul#rules label.hasTip {\n\t\t\tdisplay:inherit; padding: inherit; margin: inherit; text-align: inherit;\twidth: inherit; font-weight: inherit;\n\t\t\tbackground-color: inherit; border-width: 0px; color: inherit;\n\t\t}\n\t\tform#item-form div.pane-sliders ul.adminformlist li label.hasTip {\n\t\t\tdisplay:inline-block; padding: 4px; margin: 1px 6px 0px 1px; text-align: right;\twidth:160px; font-weight: bold;\n\t\t\tbackground-color: #F6F6F6; border-bottom: 1px solid #E9E9E9; border-right: 1px solid #E9E9E9; color: #666666;\n\t\t}\n\t\t\n\t\t/*div.current fieldset.radio label {\n\t\t\tmin-width:10px!important; padding: 0px 16px 0px 0px!important; margin: 2px 0px 0px 1px!important;\n\t\t}\n\t\tdiv fieldset.adminform fieldset.radio label, div fieldset.panelform fieldset.radio label {\n\t\t\tmin-width:10px!important; padding: 0px 10px 0px 0px!important; margin: 4px 0px 0px 1px!important;\n\t\t}*/\n\t\t\n\t\t/*div fieldset input, div fieldset textarea, div fieldset img, div fieldset button { margin:5px 2px 2px 0px; }*/\n\t\tdiv fieldset select { margin:0px; }\n\t\t\t\t\t\n\t\tdiv.current ul.config-option-list li select { margin-bottom: 0px; font-size:12px;}\n\t\tdiv.current ul.config-option-list li fieldset { margin: 0; padding: 0; }\n\t\t\n\t\t.tool-tip { }\n\t\t.tip-title { }\n\t\t";
$document = JFactory::getDocument();
$document->addStyleDeclaration($css);
// WORKAROUNDs of for 2 issues in com_config: slow chosen JS and PHP 5.3.9+ 'max_input_vars' limit
if (FLEXI_J30GE) {
$jinput = JFactory::getApplication()->input;
}
$option = FLEXI_J30GE ? $jinput->get('option', '', 'string') : JRequest::getVar('option');
$view = FLEXI_J30GE ? $jinput->get('view', '', 'string') : JRequest::getVar('view');
$controller = FLEXI_J30GE ? $jinput->get('controller', '', 'string') : JRequest::getVar('controller');
$component = FLEXI_J30GE ? $jinput->get('component', '', 'string') : JRequest::getVar('component');
// NOTE: this is imported by main Frontend/Backend CSS file
// so import these only if it is not a flexicontent view
if ($option != 'com_flexicontent') {
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/flexi_form.css');
// NOTE: this is imported by main Frontend/Backend CSS file
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/flexi_shared.css');
// NOTE: this is imported by main Frontend/Backend CSS file
// Add flexicontent specific TABBing to non-flexicontent views
$document->addStyleSheet(JURI::root(true) . '/components/com_flexicontent/assets/css/tabber.css');
$document->addScript(JURI::root(true) . '/components/com_flexicontent/assets/js/tabber-minimized.js');
$document->addScriptDeclaration(' document.write(\'<style type="text/css">.fctabber{display:none;}<\\/style>\'); ');
}
$js = '';
if ($option == 'com_config' && ($view == 'component' || ($controller = 'component')) && $component == 'com_flexicontent') {
if (FLEXI_J30GE) {
// Make sure chosen JS file is loaded before our code
JHtml::_('formbehavior.chosen', '#_some_iiidddd_');
// replace chosen function
$js .= "\n\t\t\t\t\tjQuery.fn.chosen = function(){};\n\t\t\t\t";
}
if (FLEXI_J16GE) {
/*$js .= "
function fc_prepare_config_form(){
jQuery('#jform_fcdata_serialized').val( '' );
jQuery('#jform_fcdata_serialized').val( JSON.stringify(jQuery('#component-form').serializeArray()) );
jQuery('#component-form select').attr('disabled', true);
jQuery('#component-form textarea').attr('disabled', true);
jQuery('#component-form input[type=text], #component-form input[type=checkbox], #component-form input[type=radio]').attr('disabled', true);
}
jQuery(document).ready(function() {
jQuery('#component-form').attr('onsubmit', \"fc_prepare_config_form();\");
})
";*/
}
}
if ($js) {
$document->addScriptDeclaration($js);
}
if (FLEXI_J16GE) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'classes' . DS . 'flexicontent.helper.php';
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery();
// Add js function to overload the joomla submitform validation
JHTML::_('behavior.formvalidation');
// load default validation JS to make sure it is overriden
$document->addScript(JURI::root(true) . '/components/com_flexicontent/assets/js/admin.js');
$document->addScript(JURI::root(true) . '/components/com_flexicontent/assets/js/validate.js');
//if (!FLEXI_J30GE) $document->addStyleSheet(JURI::base(true).'/components/com_flexicontent/assets/css/j25.css');
if (FLEXI_J30GE) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css');
}
}
}
示例8: display
//.........这里部分代码省略.........
$types = $model->getTypeslist();
$typesselected = $model->getTypesselected();
// Get and merge type parameters
$tparams = $this->get('Typeparams');
$tparams = new JRegistry($tparams);
$params->merge($tparams);
// Apply type configuration if it type is set
// Get user allowed permissions on the item ... to be used by the form rendering
// Also hide parameters panel if user can not edit parameters
$perms = $this->_getItemPerms($item);
if (!$perms['canparams']) {
$document->addStyleDeclaration('#details-options {display:none;}');
}
// *****************
// Load JS/CSS files
// *****************
// Add css to document
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VHASH);
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VHASH);
// Fields common CSS
$document->addStyleSheetVersion(JURI::root(true) . '/components/com_flexicontent/assets/css/flexi_form_fields.css', FLEXI_VHASH);
// Add JS frameworks
$has_J2S = false;
foreach ($fields as $field) {
$has_J2S = $has_J2S || $field->field_type == 'j2store';
if ($has_J2S) {
break;
}
}
$_params = new JRegistry();
$_params->set('load-ui-dialog', 1);
$_params->set('load-ui-menu', $has_J2S ? 0 : 1);
$_params->set('load-ui-autocomplete', $has_J2S ? 0 : 1);
flexicontent_html::loadJQuery($add_jquery = 1, $add_jquery_ui = 1, $add_jquery_ui_css = 1, $add_remote = 1, $_params);
//flexicontent_html::loadFramework('jQuery');
flexicontent_html::loadFramework('select2');
flexicontent_html::loadFramework('prettyCheckable');
flexicontent_html::loadFramework('flexi-lib');
// 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_VHASH);
$document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/validate.js', FLEXI_VHASH);
// Add js function for custom code used by FLEXIcontent item form
$document->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/itemscreen.js', FLEXI_VHASH);
// ******************
// Create the toolbar
// ******************
$toolbar = JToolBar::getInstance('toolbar');
$tip_class = FLEXI_J30GE ? ' hasTooltip' : ' hasTip';
// SET toolbar title
if ($cid) {
JToolBarHelper::title(JText::_('FLEXI_EDIT_ITEM'), 'itemedit');
// Editing existing item
} else {
JToolBarHelper::title(JText::_('FLEXI_NEW_ITEM'), 'itemadd');
// Creating new item
}
// **************
// Common Buttons
// **************
// Applying new item type is a special case that has not loaded custom fieds yet
JToolBarHelper::apply($item->type_id ? 'items.apply' : 'items.apply_type', !$isnew ? 'FLEXI_APPLY' : ($typesselected->id ? 'FLEXI_ADD' : 'FLEXI_APPLY_TYPE'), false);
/*if (!$isnew || $item->version) flexicontent_html::addToolBarButton(
'FLEXI_FAST_APPLY', $btn_name='apply_ajax', $full_js="Joomla.submitbutton('items.apply_ajax')", $msg_alert='', $msg_confirm='',
$btn_task='items.apply_ajax', $extra_js='', $btn_list=false, $btn_menu=true, $btn_confirm=false, $btn_class="".$tip_class, $btn_icon="icon-loop",
示例9: loadFramework
/**
* Utility function to load each JS Frameworks once
*
* @param string $text
* @param int $nb
* @return string
* @since 1.5
*/
static function loadFramework( $framework, $mode='' )
{
// Detect already loaded framework
static $_loaded = array();
if ( isset($_loaded[$framework]) ) return $_loaded[$framework];
$_loaded[$framework] = false;
// Get frameworks that are configured to be loaded manually in frontend (e.g. via the Joomla template)
$app = JFactory::getApplication();
static $load_frameworks = null;
static $load_jquery = null;
if ( !isset($load_frameworks[$framework]) ) {
$flexiparams = JComponentHelper::getParams('com_flexicontent');
//$load_frameworks = $flexiparams->get('load_frameworks', array('jQuery','image-picker','masonry','select2','inputmask','prettyCheckable','fancybox'));
//$load_frameworks = FLEXIUtilities::paramToArray($load_frameworks);
//$load_frameworks = array_flip($load_frameworks);
//$load_jquery = isset($load_frameworks['jQuery']) || !$app->isSite();
if ( $load_jquery===null ) $load_jquery = $flexiparams->get('loadfw_jquery', 1)==1 || !$app->isSite();
$load_framework = $flexiparams->get( 'loadfw_'.strtolower(str_replace('-','_',$framework)), 1 );
$load_frameworks[$framework] = $load_framework==1 || ($load_framework==2 && !$app->isSite());
}
// Set loaded flag
$_loaded[$framework] = $load_frameworks[$framework];
// Do not progress further if it is disabled
if ( !$load_frameworks[$framework] ) return false;
// Load Framework
$document = JFactory::getDocument();
$js = "";
$css = "";
switch ( $framework )
{
case 'jQuery':
if ($load_jquery) flexicontent_html::loadJQuery();
break;
case 'mCSB':
if ($load_jquery) flexicontent_html::loadJQuery();
$framework_path = JURI::root(true).'/components/com_flexicontent/librairies/mCSB';
$document->addScript($framework_path.'/jquery.mCustomScrollbar.min.js');
$document->addStyleSheet($framework_path.'/jquery.mCustomScrollbar.css');
$js .= "
jQuery(document).ready(function(){
jQuery('.fc_add_scroller').mCustomScrollbar({
theme:'dark-thick',
advanced:{updateOnContentResize: true}
});
jQuery('.fc_add_scroller_horizontal').mCustomScrollbar({
theme:'dark-thick',
horizontalScroll:true,
advanced:{updateOnContentResize: true}
});
});
";
break;
case 'image-picker':
if ($load_jquery) flexicontent_html::loadJQuery();
$framework_path = JURI::root(true).'/components/com_flexicontent/librairies/image-picker';
$document->addScript($framework_path.'/image-picker.min.js');
$document->addStyleSheet($framework_path.'/image-picker.css');
break;
case 'masonry':
$framework_path = JURI::root(true).'/components/com_flexicontent/librairies/masonry';
$document->addScript($framework_path.'/masonry.pkgd.min.js');
break;
case 'select2':
if ($load_jquery) flexicontent_html::loadJQuery();
$framework_path = JURI::root(true).'/components/com_flexicontent/librairies/select2';
$framework_folder = JPATH_SITE .DS.'components'.DS.'com_flexicontent'.DS.'librairies'.DS.'select2';
$document->addScript($framework_path.'/select2.min.js');
$document->addStyleSheet($framework_path.'/select2.css');
$user_lang = flexicontent_html::getUserCurrentLang();
if ( $user_lang && $user_lang!='en' )
{
// Try language shortcode
$framework_folder.DS.'select2_locale_'.$user_lang.'.js';
if ( file_exists($framework_folder.DS.'select2_locale_'.$user_lang.'.js') ) {
$document->addScript($framework_path.'/select2_locale_'.$user_lang.'.js');
}
// Try coutry language code
else {
$languages = FLEXIUtilities::getLanguages($hash='shortcode');
$lang_code = isset($languages->$user_lang->code) ? $languages->$user_lang->code : false;
//.........这里部分代码省略.........
示例10: display
/**
* Creates the Filemanagerview
*
* @since 1.0
*/
function display($tpl = null)
{
flexicontent_html::loadJQuery();
flexicontent_html::loadFramework('select2');
JHTML::_('behavior.tooltip');
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
//initialise variables
$app = JFactory::getApplication();
$option = JRequest::getVar('option');
$document = JFactory::getDocument();
$db = JFactory::getDBO();
$user = JFactory::getUser();
$params = JComponentHelper::getParams('com_flexicontent');
//$authorparams = flexicontent_db::getUserConfig($user->id);
$langs = FLEXIUtilities::getLanguages('code');
//get vars
$filter_order = $app->getUserStateFromRequest($option . '.filemanager.filter_order', 'filter_order', 'f.filename', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest($option . '.filemanager.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter = $app->getUserStateFromRequest($option . '.filemanager.filter', 'filter', 1, 'int');
$filter_lang = $app->getUserStateFromRequest($option . '.filemanager.filter_lang', 'filter_lang', '', 'string');
$filter_uploader = $app->getUserStateFromRequest($option . '.filemanager.filter_uploader', 'filter_uploader', 0, 'int');
$filter_url = $app->getUserStateFromRequest($option . '.filemanager.filter_url', 'filter_url', '', 'word');
$filter_secure = $app->getUserStateFromRequest($option . '.filemanager.filter_secure', 'filter_secure', '', 'word');
$filter_ext = $app->getUserStateFromRequest($option . '.filemanager.filter_ext', 'filter_ext', '', 'alnum');
$search = $app->getUserStateFromRequest($option . '.filemanager.search', 'search', '', 'string');
$filter_item = $app->getUserStateFromRequest($option . '.filemanager.item_id', 'item_id', 0, 'int');
$folder_mode = 0;
$search = FLEXI_J16GE ? $db->escape(trim(JString::strtolower($search))) : $db->getEscaped(trim(JString::strtolower($search)));
//add css and submenu 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');
}
}
// Get User's Global Permissions
$perms = FlexicontentHelperPerm::getPerm();
// **************************
// Create Submenu and toolbar
// **************************
FLEXISubmenu('CanFiles');
// Create document/toolbar titles
$doc_title = JText::_('FLEXI_FILEMANAGER');
$site_title = $document->getTitle();
JToolBarHelper::title($doc_title, 'files');
$document->setTitle($doc_title . ' - ' . $site_title);
// Create the toolbar
if (FLEXI_J16GE) {
JToolBarHelper::deleteList('Are you sure?', 'filemanager.remove');
} else {
JToolBarHelper::deleteList();
}
if ($perms->CanConfig) {
JToolBarHelper::divider();
JToolBarHelper::spacer();
$session = JFactory::getSession();
$fc_screen_width = (int) $session->get('fc_screen_width', 0, 'flexicontent');
$_width = $fc_screen_width && $fc_screen_width - 84 > 940 ? $fc_screen_width - 84 > 1400 ? 1400 : $fc_screen_width - 84 : 940;
$fc_screen_height = (int) $session->get('fc_screen_height', 0, 'flexicontent');
$_height = $fc_screen_height && $fc_screen_height - 128 > 550 ? $fc_screen_height - 128 > 1000 ? 1000 : $fc_screen_height - 128 : 550;
JToolBarHelper::preferences('com_flexicontent', $_height, $_width, 'Configuration');
}
// ***********************
// Get data from the model
// ***********************
$model = $this->getModel();
if (!$folder_mode) {
$rows = $this->get('Data');
} else {
// TODO MORE ...
}
$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);*/
$assigned_fields_labels = array('image' => 'image/gallery', 'file' => 'file', 'minigallery' => 'minigallery');
$assigned_fields_icons = array('image' => 'picture_link', 'file' => 'page_link', 'minigallery' => 'film_link');
/*****************
** 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);
//.........这里部分代码省略.........
示例11: indexer
function indexer($tpl)
{
$document = JFactory::getDocument();
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery();
parent::display($tpl);
}
示例12: _displayForm
//.........这里部分代码省略.........
// Load permissions (used by form template)
$perms = $this->_getItemPerms($item);
// Create submit configuration (for new items) into the session, this is needed before creating the item form
$submitConf = $this->_createSubmitConf($item, $perms);
// Most core field are created via calling methods of the form (J2.5)
$form = $this->get('Form');
// is new item and ownership Flags
$isnew = !$item->id;
$isOwner = $item->created_by == $user->get('id');
// *****************
// Type related data
// *****************
// Get available types and the currently selected/requested type
$types = $model->getTypeslist();
$typesselected = $model->getTypesselected();
// Get type parameters, these are needed besides the 'merged' item parameters, e.g. to get Type's default layout
$tparams = $this->get('Typeparams');
$tparams = new JRegistry($tparams);
// *****************
// Load JS/CSS files
// *****************
$has_J2S = false;
foreach ($fields as $field) {
$has_J2S = $has_J2S || $field->field_type == 'j2store';
if ($has_J2S) {
break;
}
}
$_params = new JRegistry();
$_params->set('load-ui-dialog', 1);
$_params->set('load-ui-menu', $has_J2S ? 0 : 1);
$_params->set('load-ui-autocomplete', $has_J2S ? 0 : 1);
//FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery($add_jquery = 1, $add_jquery_ui = 1, $add_jquery_ui_css = 1, $add_remote = 1, $_params);
//flexicontent_html::loadFramework('jQuery');
flexicontent_html::loadFramework('select2');
flexicontent_html::loadFramework('prettyCheckable');
flexicontent_html::loadFramework('flexi-lib');
// Load custom behaviours: form validation, popup tooltips
JHTML::_('behavior.formvalidation');
// load default validation JS to make sure it is overriden
FLEXI_J30GE ? JHtml::_('bootstrap.tooltip') : JHTML::_('behavior.tooltip');
//JHTML::_('script', 'joomla.javascript.js', 'includes/js/');
// Add css files to the document <head> section (also load CSS joomla template override)
$document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/flexicontent.css', FLEXI_VHASH);
//$document->addCustomTag('<!--[if IE]><style type="text/css">.floattext {zoom:1;}</style><![endif]-->');
if (file_exists(JPATH_SITE . DS . 'templates' . DS . $app->getTemplate() . DS . 'css' . DS . 'flexicontent.css')) {
$document->addStyleSheetVersion($this->baseurl . '/templates/' . $app->getTemplate() . '/css/flexicontent.css', FLEXI_VHASH);
}
// Fields common CSS
$document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/flexi_form_fields.css', FLEXI_VHASH);
// Load backend / frontend shared and Joomla version specific CSS (different for frontend / backend)
FLEXI_J30GE ? $document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VHASH) : $document->addStyleSheetVersion($this->baseurl . '/components/com_flexicontent/assets/css/j25.css', FLEXI_VHASH);
// Add js function to overload the joomla submitform
$document->addScriptVersion($this->baseurl . '/components/com_flexicontent/assets/js/admin.js', FLEXI_VHASH);
$document->addScriptVersion($this->baseurl . '/components/com_flexicontent/assets/js/validate.js', FLEXI_VHASH);
// Add js function for custom code used by FLEXIcontent item form
$document->addScriptVersion($this->baseurl . '/components/com_flexicontent/assets/js/itemscreen.js', FLEXI_VHASH);
// *********************************************************************************************************
// Get language stuff, and also load Template-Specific language file to override or add new language strings
// *********************************************************************************************************
if ($enable_translation_groups) {
$langAssocs = $params->get('uselang_fe') == 1 ? $this->get('LangAssocs') : false;
}
$langs = FLEXIUtilities::getLanguages('code');
FLEXIUtilities::loadTemplateLanguageFile($params->get('ilayout', 'default'));
示例13:
JFactory::getLanguage()->load('com_flexicontent', JPATH_ADMINISTRATOR, 'en-GB', true);
JFactory::getLanguage()->load('com_flexicontent', JPATH_ADMINISTRATOR, null, true);
// Load language overrides, just before executing the component (DONE manually for J1.5)
$overrideDir = JPATH_ADMINISTRATOR . DS . 'languages' . DS . 'overrides' . DS;
if (!FLEXI_J16GE) {
JFactory::getLanguage()->load('override', $overrideDir, 'en-GB', true);
JFactory::getLanguage()->load('override', $overrideDir, null, true);
}
// ********************************
// Load common js libs / frameworks
// ********************************
if (JRequest::getWord('format') != 'raw') {
// Load mootools
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
// Load jquery Framework
flexicontent_html::loadJQuery();
// Load J2.5 (non-bootstrap tooltips) tooltips, we still need regardless of using J3.x, since some code may still use them
JHTML::_('behavior.tooltip');
// J3.0+ tooltips (bootstrap based)
if (FLEXI_J30GE) {
JHtml::_('bootstrap.tooltip');
}
// Add flexi-lib JS
JFactory::getDocument()->addScriptVersion(JURI::root(true) . '/components/com_flexicontent/assets/js/flexi-lib.js', FLEXI_VERSION);
// Frontend/backend script
JFactory::getDocument()->addScriptVersion(JURI::base(true) . '/components/com_flexicontent/assets/js/flexi-lib.js', FLEXI_VERSION);
// Backend only script
}
// ***********************************
// PREPARE Calling the controller task
// ***********************************
示例14: add_css_js
function add_css_js()
{
$css = "\n\t\tdiv table td.paramlist_value {\n\t\t\tpadding-left:8px;\n\t\t}\n\t\tdiv .paramlist_value label {\n\t\t\tmin-width:10px!important; padding: 0px 10px 0px 0px!important; margin: 4px 0px 0px 1px!important;\n\t\t}\n\t\tdiv .paramlist_value input, div .paramlist_value textarea, div .paramlist_value img, div .paramlist_value button { margin:5px 0px 2px 0px; }\n\t\tdiv .paramlist_value select { margin:0px; }\n\t\tfieldset.radio { margin: 0; padding: 0; }\n\t\t\n\t\t.tool-tip { }\n\t\t.tip-title { }\n\t\t";
$document = JFactory::getDocument();
$document->addStyleDeclaration($css);
$document->addStyleSheet(JURI::root() . 'components/com_flexicontent/assets/css/flexi_form.css');
// WORKAROUNDs of for 2 issues in com_config: slow chosen JS and PHP 5.3.9+ 'max_input_vars' limit
if (FLEXI_J30GE) {
$jinput = JFactory::getApplication()->input;
}
$option = FLEXI_J30GE ? $jinput->get('option', '', 'string') : JRequest::getVar('option');
$view = FLEXI_J30GE ? $jinput->get('view', '', 'string') : JRequest::getVar('view');
$controller = FLEXI_J30GE ? $jinput->get('controller', '', 'string') : JRequest::getVar('controller');
$component = FLEXI_J30GE ? $jinput->get('component', '', 'string') : JRequest::getVar('component');
//if ($option=='com_config' || $option=='com_menus' || $option=='com_modules') {
$document->addStyleSheet(JURI::root() . 'components/com_flexicontent/assets/css/flexi_shared.css');
//}
$js = '';
if ($option == 'com_config' && ($view == 'component' || ($controller = 'component')) && $component == 'com_flexicontent') {
$document->addStyleSheet(JURI::root() . 'components/com_flexicontent/assets/css/tabber.css');
$document->addScript(JURI::root() . 'components/com_flexicontent/assets/js/tabber-minimized.js');
$document->addScriptDeclaration(' document.write(\'<style type="text/css">.fctabber{display:none;}<\\/style>\'); ');
if (FLEXI_J30GE) {
// Make sure chosen JS file is loaded before our code
JHtml::_('formbehavior.chosen', '#_some_iiidddd_');
// replace chosen function
$js .= "\n\t\t\t\t\tjQuery.fn.chosen = function(){};\n\t\t\t\t";
}
if (FLEXI_J16GE) {
/*$js .= "
function fc_prepare_config_form(){
jQuery('#jform_fcdata_serialized').val( '' );
jQuery('#jform_fcdata_serialized').val( JSON.stringify(jQuery('#component-form').serializeArray()) );
jQuery('#component-form select').attr('disabled', true);
jQuery('#component-form textarea').attr('disabled', true);
jQuery('#component-form input[type=text], #component-form input[type=checkbox], #component-form input[type=radio]').attr('disabled', true);
}
jQuery(document).ready(function() {
jQuery('#component-form').attr('onsubmit', \"fc_prepare_config_form();\");
})
";*/
}
}
if ($js) {
$document->addScriptDeclaration($js);
}
if (FLEXI_J16GE) {
require_once JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'classes' . DS . 'flexicontent.helper.php';
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadJQuery();
$document->addScript(JURI::root() . 'components/com_flexicontent/assets/js/admin.js');
$document->addScript(JURI::root() . 'components/com_flexicontent/assets/js/validate.js');
//if (!FLEXI_J30GE) $document->addStyleSheet(JURI::base().'components/com_flexicontent/assets/css/j25.css');
if (FLEXI_J30GE) {
$document->addStyleSheet(JURI::base() . 'components/com_flexicontent/assets/css/j3x.css');
}
}
}
示例15: selectsearchflag
/**
* Method to select new state for many items
*
* @since 1.5
*/
function selectsearchflag()
{
$user = JFactory::getUser();
$document = JFactory::getDocument();
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css', FLEXI_VHASH);
$document->addStyleSheetVersion(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css', FLEXI_VHASH);
// Load jquery Framework
flexicontent_html::loadJQuery();
JHtml::_('bootstrap.framework');
JHtml::_('bootstrap.tooltip');
$btn_class = 'hasTooltip btn btn-small';
$state['issearch'] = array('name' => 'FLEXI_TOGGLE_TEXT_SEARCHABLE', 'desc' => 'FLEXI_FIELD_CONTENT_LIST_TEXT_SEARCHABLE_DESC', 'icon' => 'search', 'btn_class' => 'btn-success', 'clear' => true);
$state['isfilter'] = array('name' => 'FLEXI_TOGGLE_FILTERABLE', 'desc' => 'FLEXI_FIELD_CONTENT_LIST_FILTERABLE_DESC', 'icon' => 'filter', 'btn_class' => 'btn-success', 'clear' => true);
$state['isadvsearch'] = array('name' => 'FLEXI_TOGGLE_ADV_TEXT_SEARCHABLE', 'desc' => 'FLEXI_FIELD_ADVANCED_TEXT_SEARCHABLE_DESC', 'icon' => 'search', 'btn_class' => 'btn-info', 'clear' => true);
$state['isadvfilter'] = array('name' => 'FLEXI_TOGGLE_ADV_FILTERABLE', 'desc' => 'FLEXI_FIELD_ADVANCED_FILTERABLE_DESC', 'icon' => 'filter', 'btn_class' => 'btn-info', 'clear' => true);
?>
<div id="flexicontent" class="flexicontent" style="padding-top:5%;"><?php
foreach ($state as $shortname => $statedata) {
$css = "width:216px; margin:0px 24px 12px 0px; text-align: left;";
$link = JURI::base(true) . "/index.php?option=com_flexicontent&task=fields.toggleprop&propname=" . $shortname . "&" . (FLEXI_J30GE ? JSession::getFormToken() : JUtility::getToken()) . "=1";
$icon = $statedata['icon'];
if ($shortname == 'issearch') {
echo '<br/><span class="label">' . JText::_('FLEXI_TOGGLE') . '</span> ' . JText::_('Content Lists') . '<br/>';
} else {
if ($shortname == 'isadvsearch') {
echo '<br/><span class="label">' . JText::_('FLEXI_TOGGLE') . '</span> ' . JText::_('Search View') . '<br/>';
}
}
?>
<span style="<?php
echo $css;
?>
" class="<?php
echo $btn_class . ' ' . $statedata['btn_class'];
?>
" title="<?php
echo JText::_($statedata['desc']);
?>
" data-placement="right"
onclick="window.parent.document.adminForm.propname.value='<?php
echo $shortname;
?>
'; window.parent.document.adminForm.boxchecked.value==0 ? alert('<?php
echo JText::_('FLEXI_NO_ITEMS_SELECTED');
?>
') : window.parent.Joomla.submitbutton('fields.toggleprop')"
>
<span class="icon-<?php
echo $icon;
?>
"></span><?php
echo JText::_($statedata['name']);
?>
</span>
<?php
if (isset($statedata['clear'])) {
echo '<div class="fcclear"></div>';
}
}
?>
</div><?php
return;
}