当前位置: 首页>>代码示例>>PHP>>正文


PHP flexicontent_html::escapeJsText方法代码示例

本文整理汇总了PHP中flexicontent_html::escapeJsText方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html::escapeJsText方法的具体用法?PHP flexicontent_html::escapeJsText怎么用?PHP flexicontent_html::escapeJsText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在flexicontent_html的用法示例。


在下文中一共展示了flexicontent_html::escapeJsText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createFilter


//.........这里部分代码省略.........
                 $results[$i]->text .= ' (' . $results[$i]->found . ')';
             }
         }
     } else {
         $faceted_filter = 0;
         // clear faceted filter flag
     }
     // Prepend Field's Label to filter HTML
     // Commented out because it was moved in to form template file
     //$filter->html = $label_filter==1 ? $filter->label.': ' : '';
     $filter->html = '';
     // *** Create the form field(s) used for filtering
     switch ($display_filter_as) {
         case 0:
         case 2:
         case 6:
             // 0: Select (single value selectable), 2: Dual select (value range), 6: Multi Select (multiple values selectable)
             $options = array();
             // MULTI-select does not has an internal label a drop-down list option
             if ($display_filter_as != 6) {
                 $first_option_txt = $label_filter == 2 ? $filter->label : JText::_('FLEXI_ANY');
                 $options[] = JHTML::_('select.option', '', '- ' . $first_option_txt . ' -');
             }
             // Make use of select2 lib
             flexicontent_html::loadFramework('select2');
             $classes = " use_select2_lib";
             $extra_param = '';
             // MULTI-select: special label and prompts
             if ($display_filter_as == 6) {
                 $classes .= ' fc_label_internal fc_prompt_internal';
                 // Add field's LABEL internally or click to select PROMPT (via js)
                 $_inner_lb = $label_filter == 2 ? $filter->label : JText::_('FLEXI_CLICK_TO_LIST');
                 // Add type to filter PROMPT (via js)
                 $extra_param = ' data-fc_label_text="' . flexicontent_html::escapeJsText($_inner_lb, 's') . '"';
                 $extra_param .= ' fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
             }
             // Create HTML tag attributes
             $attribs_str = ' class="fc_field_filter' . $classes . '" ' . $extra_param;
             $attribs_str .= $display_filter_as == 6 ? ' multiple="multiple" size="20" ' : '';
             //$attribs_str .= ($display_filter_as==0 || $display_filter_as==6) ? ' onchange="document.getElementById(\''.$formName.'\').submit();"' : '';
             foreach ($results as $result) {
                 if (!strlen($result->value)) {
                     continue;
                 }
                 $options[] = JHTML::_('select.option', $result->value, $result->text, 'value', 'text', $disabled = $faceted_filter == 2 && !$result->found);
             }
             if ($display_filter_as == 6 && $combine_tip) {
                 $filter->html .= ' <span class="fc_filter_tip_inline">' . JText::_(!$require_all ? 'FLEXI_ANY_OF' : 'FLEXI_ALL_OF') . '</span> ';
             }
             if ($display_filter_as == 0 || $display_filter_as == 6) {
                 $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[]', $attribs_str, 'value', 'text', $value, $filter_ffid);
             } else {
                 $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[1]', $attribs_str, 'value', 'text', @$value[1], $filter_ffid . '1');
                 $filter->html .= '<span class="fc_range"></span>';
                 $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[2]', $attribs_str, 'value', 'text', @$value[2], $filter_ffid . '2');
             }
             break;
         case 1:
         case 3:
             // (TODO: autocomplete) ... 1: Text input, 3: Dual text input (value range), both of these can be JS date calendars
             $_inner_lb = $label_filter == 2 ? $filter->label : JText::_($isdate ? 'FLEXI_CLICK_CALENDAR' : 'FLEXI_TYPE_TO_LIST');
             $_inner_lb = flexicontent_html::escapeJsText($_inner_lb, 's');
             $attribs_str = ' class="fc_field_filter fc_label_internal fc_iscalendar" data-fc_label_text="' . $_inner_lb . '"';
             $attribs_arr = array('class' => 'fc_field_filter fc_label_internal fc_iscalendar', 'data-fc_label_text' => $_inner_lb);
             if ($display_filter_as == 1) {
                 if ($isdate) {
开发者ID:jakesyl,项目名称:flexicontent,代码行数:67,代码来源:flexicontent.fields.php

示例2: onDisplayFilter

 function onDisplayFilter(&$filter, $value = '', $formName = 'adminForm', $isSearchView = 0)
 {
     if ($filter->iscore != 1) {
         return;
     }
     // performance check
     $db = JFactory::getDBO();
     $formfieldname = 'filter_' . $filter->id;
     $_s = $isSearchView ? '_s' : '';
     $display_filter_as = $filter->parameters->get('display_filter_as' . $_s, 0);
     // Filter Type of Display
     $faceted_filter = $filter->parameters->get('faceted_filter' . $_s, 0);
     // Filter Type of Display
     $disable_keyboardinput = $filter->parameters->get('disable_keyboardinput', 0);
     $filter_as_range = in_array($display_filter_as, array(2, 3, 8));
     // Create first prompt option of drop-down select
     $label_filter = $filter->parameters->get('display_label_filter' . $_s, 2);
     $first_option_txt = $label_filter == 2 ? $filter->label : JText::_('FLEXI_ALL');
     // Prepend Field's Label to filter HTML
     //$filter->html = $label_filter==1 ? $filter->label.': ' : '';
     $filter->html = '';
     switch ($filter->field_type) {
         case 'title':
             $_inner_lb = $label_filter == 2 ? $filter->label : JText::_('FLEXI_TYPE_TO_LIST');
             $_inner_lb = flexicontent_html::escapeJsText($_inner_lb, 's');
             $attribs_str = ' class="fc_field_filter fc_label_internal" data-fc_label_text="' . $_inner_lb . '"';
             $filter_ffname = 'filter_' . $filter->id;
             $filter_ffid = $formName . '_' . $filter->id . '_val';
             $filter->html .= '<input id="' . $filter_ffid . '" name="' . $filter_ffname . '" ' . $attribs_str . ' type="text" size="20" value="' . $value . '" />';
             break;
         case 'createdby':
             // Authors
             // WARNING: we can not use column alias in from, join, where, group by, can use in having (some DB e.g. mysql) and in order-by
             // partial SQL clauses
             $filter->filter_valuesselect = ' i.created_by AS value, CASE WHEN usr.name IS NULL THEN CONCAT(\'' . JText::_('FLEXI_NOT_ASSIGNED') . ' ID:\', i.created_by) ELSE usr.name END AS text';
             $filter->filter_valuesjoin = ' JOIN #__users AS usr ON usr.id = i.created_by';
             $filter->filter_valueswhere = ' AND i.created_by <> 0';
             // full SQL clauses
             $filter->filter_groupby = ' GROUP BY i.created_by ';
             $filter->filter_having = null;
             // this indicates to use default, space is use empty
             $filter->filter_orderby = ' ORDER by text';
             // default will order by value and not by label
             FlexicontentFields::createFilter($filter, $value, $formName);
             break;
         case 'modifiedby':
             // Modifiers
             // WARNING: we can not use column alias in from, join, where, group by, can use in having (some DB e.g. mysql) and in order-by
             // partial SQL clauses
             $filter->filter_valuesselect = ' i.modified_by AS value, CASE WHEN usr.name IS NULL THEN CONCAT(\'' . JText::_('FLEXI_NOT_ASSIGNED') . ' ID:\', i.modified_by) ELSE usr.name END AS text';
             $filter->filter_valuesjoin = ' JOIN #__users AS usr ON usr.id = i.modified_by';
             $filter->filter_valueswhere = ' AND i.modified_by <> 0';
             // full SQL clauses
             $filter->filter_groupby = ' GROUP BY i.modified_by ';
             $filter->filter_having = null;
             // this indicates to use default, space is use empty
             $filter->filter_orderby = ' ORDER by text';
             // default will order by value and not by label
             FlexicontentFields::createFilter($filter, $value, $formName);
             break;
         case 'type':
             // Document Type
             // WARNING: we can not use column alias in from, join, where, group by, can use in having (some DB e.g. mysql) and in order-by
             // partial SQL clauses
             $filter->filter_valuesselect = ' ict.id AS value, ict.name AS text';
             $filter->filter_valuesjoin = '' . ' JOIN #__flexicontent_items_ext AS iext ON iext.item_id = i.id' . ' JOIN #__flexicontent_types AS ict ON iext.type_id = ict.id';
             $filter->filter_valueswhere = ' ';
             // ... a space, (indicates not needed and prevents using default)
             // full SQL clauses
             $filter->filter_groupby = ' GROUP BY ict.id';
             $filter->filter_having = null;
             // this indicates to use default, space is use empty
             $filter->filter_orderby = ' ORDER by text';
             // default will order by value and not by label
             FlexicontentFields::createFilter($filter, $value, $formName);
             break;
         case 'state':
             $options = array();
             $options[] = JHTML::_('select.option', '', '- ' . $first_option_txt . ' -');
             $options[] = JHTML::_('select.option', 'P', JText::_('FLEXI_PUBLISHED'));
             $options[] = JHTML::_('select.option', 'U', JText::_('FLEXI_UNPUBLISHED'));
             $options[] = JHTML::_('select.option', 'PE', JText::_('FLEXI_PENDING'));
             $options[] = JHTML::_('select.option', 'OQ', JText::_('FLEXI_TO_WRITE'));
             $options[] = JHTML::_('select.option', 'IP', JText::_('FLEXI_IN_PROGRESS'));
             $options[] = JHTML::_('select.option', 'A', JText::_('FLEXI_ARCHIVED'));
             //$options[] = JHTML::_('select.option',  'T', JText::_( 'FLEXI_TRASHED' ) );
             break;
         case 'categories':
             // Initialize options
             $options = array();
             // MULTI-select does not has an internal label a drop-down list option
             if ($display_filter_as != 6) {
                 $first_option_txt = $label_filter == 2 ? $filter->label : JText::_('FLEXI_ANY');
                 $options[] = JHTML::_('select.option', '', '- ' . $first_option_txt . ' -');
             }
             // Get categories
             global $globalcats;
             $rootcatid = $filter->parameters->get('rootcatid', '');
             $option = JRequest::getVar('option', '');
             $view = JRequest::getVar('view', '');
//.........这里部分代码省略.........
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:101,代码来源:core.php

示例3: sprintf

                $actions_arr[] = ($filename_shown && $link_filename ? $icon . ' ' : '') . '<a href="' . $dl_link . '" class="' . $file_classes . ' fcfile_downloadFile" title="' . $downloadsinfo . '" >' . ($filename_shown && $link_filename ? $name_str : $downloadstext) . '</a>';
            }
            if ($authorized && $allowview && !$file_data->url) {
                $actions_arr[] = '
				<a href="' . $dl_link . '?method=view" class="fancybox ' . $file_classes . ' fcfile_viewFile" data-fancybox-type="iframe" title="' . $viewinfo . '" >
					' . $viewtext . '
				</a>';
                $fancybox_needed = 1;
            }
            // ADD TO CART: the link will add file to download list (tree) (handled via a downloads manager module)
            if ($authorized && $allowaddtocart && !$file_data->url) {
                // CSS class to anchor downloads list adding function
                $addtocart_classes = $file_classes . ($file_classes ? ' ' : '') . 'fcfile_addFile';
                $attribs = ' class="' . $addtocart_classes . '"';
                $attribs .= ' title="' . $addtocartinfo . '"';
                $attribs .= ' filename="' . flexicontent_html::escapeJsText($_filetitle, 's') . '"';
                $attribs .= ' fieldid="' . $field->id . '"';
                $attribs .= ' contentid="' . $item->id . '"';
                $attribs .= ' fileid="' . $file_data->id . '"';
                $actions_arr[] = '<a href="javascript:;" ' . $attribs . ' >' . $addtocarttext . '</a>';
            }
            // SHARE FILE VIA EMAIL: open a popup or inline email form ...
            if ($is_public && $allowshare && !$com_mailto_found) {
                // skip share popup form button if com_mailto is missing
                $str .= ' com_mailto component not found, please disable <b>download link sharing parameter</b> in this file field';
            } else {
                if ($is_public && $allowshare) {
                    $send_onclick = 'window.open(\'%s\',\'win2\',\'' . $status . '\'); return false;';
                    $send_form_url = 'index.php?option=com_flexicontent&tmpl=component' . '&task=call_extfunc&exttype=plugins&extfolder=flexicontent_fields&extname=file&extfunc=share_file_form' . '&file_id=' . $file_id . '&content_id=' . $item->id . '&field_id=' . $field->id;
                    $actions_arr[] = '<a href="javascript:;" class="fcfile_shareFile" onclick="' . sprintf($send_onclick, JRoute::_($send_form_url)) . '" title="' . $shareinfo . '">' . $sharetext . '</a>';
                }
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:31,代码来源:value_InlineBoxes.php

示例4: display


//.........这里部分代码省略.........
             }
         } else {
             foreach ($filters_tmp as $filter) {
                 $filters[$filter->id] = $filter;
                 // index by filter_id in this case too (for consistency, although we do not use the array index ?)
             }
         }
         unset($filters_tmp);
     }
     // If configured filters were not found/invalid for the current content type(s)
     // then retrieve all fields marked as filterable for the give content type(s) this is useful to list per content type filters automatically, even when not set or misconfigured
     if (empty($filters)) {
         if (!empty($contenttypes)) {
             $filters = FlexicontentFields::getSearchFields($key = 'id', $indexer = 'advanced', null, $contenttypes, $load_params = true, 0, 'filter');
         } else {
             $filters = array();
         }
     }
     // ****************************************
     // Create Form Elements (the 'lists' array)
     // ****************************************
     $lists = array();
     // *** Selector of Content Types
     if ($canseltypes) {
         $types = array();
         if ($show_filters) {
             $types[] = JHTML::_('select.option', '', JText::_('FLEXI_PLEASE_SELECT'));
         }
         foreach ($typeData as $type) {
             $types[] = JHTML::_('select.option', $type->id, JText::_($type->name));
         }
         $multiple_param = $show_filters ? ' onchange="adminFormPrepare(this.form); this.form.submit();" ' : ' multiple="multiple" ';
         $attribs = $multiple_param . ' size="5" class="fc_field_filter use_select2_lib fc_label_internal fc_prompt_internal"';
         $attribs .= ' data-fc_label_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_CLICK_TO_LIST'), 's') . '"';
         $attribs .= ' data-fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
         $lists['contenttypes'] = JHTML::_('select.genericlist', $types, 'contenttypes[]', $attribs, 'value', 'text', empty($form_contenttypes) ? '' : $form_contenttypes, 'contenttypes');
         /*
         $checked = !count($form_contenttypes) || !strlen($form_contenttypes[0]);
         $checked_attr = $checked ? 'checked="checked"' : '';
         $checked_class = $checked ? 'fc_highlight' : '';
         
         $lists['contenttypes']  = '<ul class="fc_field_filter fc_checkradio_group">';
         $lists['contenttypes'] .= ' <li class="fc_checkradio_option fc_checkradio_special">';
         $lists['contenttypes'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\', 1);" ';
         $lists['contenttypes'] .= '    id="_contenttypes_0" type="checkbox" name="contenttypes[0]" ';
         $lists['contenttypes'] .= '    value="" '.$checked_attr.' class="fc_checkradio" />';
         $lists['contenttypes'] .= '  <label class="'.$checked_class.'" for="_contenttypes_0">';
         $lists['contenttypes'] .= '   -'.JText::_('FLEXI_ALL').'-';
         $lists['contenttypes'] .= '  </label>';
         $lists['contenttypes'] .= ' </li>';
         foreach($typeData as $type) {
         	$checked = in_array($type->value, $form_contenttypes);
         	$checked_attr = $checked ? 'checked=checked' : '';
         	$checked_class = $checked ? ' fc_highlight' : '';
         	$lists['contenttypes'] .= ' <li class="fc_checkradio_option">';
         	$lists['contenttypes'] .= '  <input href="javascript:;" onclick="fc_toggleClass(this, \'fc_highlight\');" ';
         	$lists['contenttypes'] .= '    id="_contenttypes_'.$type->value.'" type="checkbox" name="contenttypes[]" ';
         	$lists['contenttypes'] .= '    value="'.$type->value.'" '.$checked_attr.' class="fc_checkradio" />';
         	$lists['contenttypes'] .= '  <label class="'.$checked_class.'" for="_contenttypes_'.$type->value.'">';
         	$lists['contenttypes'] .= '   '.JText::_($type->text);
         	$lists['contenttypes'] .= '  </label>';
         	$lists['contenttypes'] .= ' </li>';
         }
         $lists['contenttypes'] .= '</ul>';
         */
     }
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:67,代码来源:view.html.php

示例5: createFilter


//.........这里部分代码省略.........
                if ($display_filter_as != 6) {
                    if ($label_filter == -1) {
                        // *** e.g. BACKEND ITEMS MANAGER custom filter
                        $filter->html = '<span class="' . $filter->parameters->get('label_filter_css' . $_s, 'label') . '">' . $filter->label . '</span>';
                        $first_option_txt = '';
                    } else {
                        if ($label_filter == 2) {
                            $first_option_txt = $filter->label;
                        } else {
                            $first_option_txt = $filter->parameters->get('filter_usefirstoption' . $_s, 0) ? $filter->parameters->get('filter_firstoptiontext' . $_s, 'FLEXI_ALL') : 'FLEXI_ANY';
                            $first_option_txt = JText::_($first_option_txt);
                        }
                    }
                    $options[] = JHTML::_('select.option', '', !$first_option_txt ? '-' : '- ' . $first_option_txt . ' -');
                }
                foreach ($results as $result) {
                    if (!strlen($result->value)) {
                        continue;
                    }
                    $options[] = JHTML::_('select.option', $result->value, $result->text, 'value', 'text', $disabled = $faceted_filter == 2 && !$result->found);
                }
                // Make use of select2 lib
                flexicontent_html::loadFramework('select2');
                $classes = " use_select2_lib";
                $extra_param = '';
                // MULTI-select: special label and prompts
                if ($display_filter_as == 6) {
                    //$classes .= ' fc_label_internal fc_prompt_internal';
                    $classes .= ' fc_prompt_internal';
                    // Add field's LABEL internally or click to select PROMPT (via js)
                    $_inner_lb = $label_filter == 2 ? $filter->label : JText::_('FLEXI_CLICK_TO_LIST');
                    // Add type to filter PROMPT (via js)
                    //$extra_param  = ' data-fc_label_text="'.flexicontent_html::escapeJsText($_inner_lb,'s').'"';
                    $extra_param = ' placeholder="' . flexicontent_html::escapeJsText($_inner_lb, 's') . '"';
                    $extra_param .= ' data-fc_prompt_text="' . flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'), 's') . '"';
                }
                // Create HTML tag attributes
                $attribs_str = ' class="fc_field_filter' . $classes . '" ' . $extra_param;
                $attribs_str .= $display_filter_as == 6 ? ' multiple="multiple" size="20" ' : '';
                if ($extra_attribs = $filter->parameters->get('filter_extra_attribs' . $_s, '')) {
                    $attribs_str .= $extra_attribs;
                }
                //$attribs_str .= ($display_filter_as==0 || $display_filter_as==6) ? ' onchange="document.getElementById(\''.$formName.'\').submit();"' : '';
                if ($display_filter_as == 6 && $combine_tip) {
                    $filter->html .= ' <span class="fc_filter_tip_inline badge badge-info">' . JText::_(!$require_all_param ? 'FLEXI_ANY_OF' : 'FLEXI_ALL_OF') . '</span> ';
                }
                if ($display_filter_as == 0) {
                    $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname, $attribs_str, 'value', 'text', $value, $filter_ffid);
                } else {
                    if ($display_filter_as == 6) {
                        $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[]', $attribs_str, 'value', 'text', $value, $filter_ffid);
                    } else {
                        $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[1]', $attribs_str, 'value', 'text', @$value[1], $filter_ffid . '1');
                        $filter->html .= '<span class="fc_range"></span>';
                        $filter->html .= JHTML::_('select.genericlist', $options, $filter_ffname . '[2]', $attribs_str, 'value', 'text', @$value[2], $filter_ffid . '2');
                    }
                }
                break;
            case 1:
            case 3:
            case 7:
            case 8:
                // (TODO: autocomplete) ... 1: Text input, 3: Dual text input (value range), both of these can be JS date calendars, 7: Slider, 8: Slider range
                if (!$isSlider) {
                    $_inner_lb = $label_filter == 2 ? $filter->label : JText::_($isDate ? 'FLEXI_CLICK_CALENDAR' : '');
                    $_inner_lb = flexicontent_html::escapeJsText($_inner_lb, 's');
开发者ID:benediktharter,项目名称:flexicontent-cck,代码行数:67,代码来源:flexicontent.fields.php

示例6: onDisplayFieldValue


//.........这里部分代码省略.........
                // intro-full image values, these are relative paths up to the site root, must be calculated later !!
                $orig_urlpath = str_replace('\\', '/', dirname($image_by_params['image_path']));
            } else {
                if ($image_source > 0) {
                    // various folder-mode(s)
                    $orig_urlpath = $thumb_urlpath . '/original';
                } else {
                    // db-mode
                    $cparams = JComponentHelper::getParams('com_flexicontent');
                    $orig_urlpath = str_replace('\\', '/', JPath::clean($cparams->get('file_path', 'components/com_flexicontent/uploads')));
                }
            }
        }
        $i = -1;
        $field->{$prop} = array();
        $field->thumbs_src['backend'] = array();
        $field->thumbs_src['small'] = array();
        $field->thumbs_src['medium'] = array();
        $field->thumbs_src['large'] = array();
        $field->thumbs_src['original'] = array();
        foreach ($values as $val) {
            // Unserialize value's properties and check for empty original name property
            $value = unserialize($val);
            $image_name = trim(@$value['originalname']);
            if (!strlen($image_name)) {
                continue;
            }
            $i++;
            // Create thumbnails urls, note thumbnails have already been verified above
            $wl = $field->parameters->get('w_l', 800);
            $hl = $field->parameters->get('h_l', 600);
            $title = @$value['title'] ? $value['title'] : '';
            $alt = @$value['alt'] ? $value['alt'] : flexicontent_html::striptagsandcut($item->title, 60);
            $alt = flexicontent_html::escapeJsText($alt, 's');
            $desc = @$value['desc'] ? $value['desc'] : '';
            $srcb = $thumb_urlpath . '/b_' . $extra_prefix . $image_name;
            // backend
            $srcs = $thumb_urlpath . '/s_' . $extra_prefix . $image_name;
            // small
            $srcm = $thumb_urlpath . '/m_' . $extra_prefix . $image_name;
            // medium
            $srcl = $thumb_urlpath . '/l_' . $extra_prefix . $image_name;
            // large
            $srco = $orig_urlpath . '/' . $image_name;
            // original image
            // Create a popup url link
            $urllink = @$value['urllink'] ? $value['urllink'] : '';
            if ($urllink && false === strpos($urllink, '://')) {
                $urllink = 'http://' . $urllink;
            }
            // Create a popup tooltip (legend)
            $tip = $title . '::' . $desc;
            $tip = flexicontent_html::escapeJsText($tip, 's');
            $legend = $uselegend && (!empty($title) || !empty($desc)) ? ' class="hasTip" title="' . $tip . '"' : '';
            // Create a unique id for the link tags, and a class name for image tags
            $uniqueid = $field->item_id . '_' . $field->id . '_' . $i;
            $class_img_field = 'fc_field_image';
            // Decide thumbnail to use
            $thumb_size = 0;
            if ($isItemsManager) {
                $thumb_size = -1;
            } else {
                if ($view == 'category') {
                    $thumb_size = $field->parameters->get('thumbincatview', 1);
                } else {
                    if ($view == FLEXI_ITEMVIEW) {
开发者ID:jakesyl,项目名称:flexicontent,代码行数:67,代码来源:image.php

示例7: onDisplayFieldValue


//.........这里部分代码省略.........
                        $sizeinfo .= '(' . number_format($file_data->size / 1073741824, 2) . '&nbsp;' . JTEXT::_('FLEXI_GBS') . ')';
                    }
                }
                $sizeinfo .= '</span>';
            }
            // d. HITS: either as icon or as inline text or both
            $hits = '';
            if ($display_hits) {
                $hits = '<span class="fcfile_hits">';
                if ($add_hits_img && @$hits_icon) {
                    $hits .= sprintf($hits_icon, $file_data->hits);
                }
                if ($add_hits_txt) {
                    $hits .= '(' . $file_data->hits . '&nbsp;' . JTEXT::_('FLEXI_HITS') . ')';
                }
                $hits .= '</span>';
            }
            // e. FILENAME / TITLE: decide whether to show it (if we do not use button, then displaying of filename is forced)
            $_filetitle = $file_data->altname ? $file_data->altname : $file_data->filename;
            if ($lowercase_filename) {
                $_filetitle = mb_strtolower($_filetitle, "UTF-8");
            }
            $filename_original = $file_data->filename_original ? $file_data->filename_original : $file_data->filename;
            ${$filename_original} = str_replace(array("'", "\""), array("\\'", ""), $filename_original);
            $filename_original = htmlspecialchars($filename_original, ENT_COMPAT, 'UTF-8');
            $name_str = $display_filename == 2 ? $filename_original : $_filetitle;
            $name_classes = $file_classes . ($file_classes ? ' ' : '') . 'fcfile_title';
            $name_html = '<span class="' . $name_classes . '">' . $name_str . '</span>';
            // f. DESCRIPTION: either as tooltip or as inline text
            $descr_tip = $descr_inline = $descr_icon = '';
            if (!empty($file_data->description)) {
                if (!$authorized) {
                    if ($noaccess_display != 2) {
                        $descr_tip = flexicontent_html::escapeJsText($name_str . '::' . $file_data->description, 's');
                        $descr_icon = '<img src="components/com_flexicontent/assets/images/comment.png" class="hasTip" title="' . $descr_tip . '"/>';
                        $descr_inline = '';
                    }
                } else {
                    if ($display_descr == 1 || $prop == 'namelist') {
                        // As tooltip
                        $descr_tip = flexicontent_html::escapeJsText($name_str . '::' . $file_data->description, 's');
                        $descr_icon = '<img src="components/com_flexicontent/assets/images/comment.png" class="hasTip" title="' . $descr_tip . '"/>';
                        $descr_inline = '';
                    } else {
                        if ($display_descr == 2) {
                            // As inline text
                            $descr_inline = ' <span class="fcfile_descr_inline fc-mssg fc-caption" style="max-wdith">' . nl2br($file_data->description) . '</span>';
                        }
                    }
                }
                if ($descr_icon) {
                    $descr_icon = ' <span class="fcfile_descr_tip">' . $descr_icon . '</span>';
                }
            }
            // *****************************
            // Create field's displayed html
            // *****************************
            // [1]: either create the download link -or- use no authorized link ...
            if (!$authorized) {
                $dl_link = $noaccess_url;
                if ($noaccess_msg) {
                    $str = '<span class="fcfile_noauth_msg fc-mssg-inline fc-noauth">' . $noaccess_msg . '</span> ';
                }
            } else {
                $dl_link = JRoute::_('index.php?option=com_flexicontent&id=' . $file_id . '&cid=' . $field->item_id . '&fid=' . $field->id . '&task=download');
                $str = '';
开发者ID:jakesyl,项目名称:flexicontent,代码行数:67,代码来源:file.php

示例8: onDisplayFilter

	function onDisplayFilter(&$filter, $value='', $formName='adminForm')
	{
		if ( !in_array($filter->field_type, self::$field_types) ) return;
		
		$db = JFactory::getDBO();
		$formfieldname = 'filter_'.$filter->id;
		
		$display_filter_as = $filter->parameters->get( 'display_filter_as', 0 );  // Filter Type of Display
		$filter_as_range = in_array($display_filter_as, array(2,3,)) ;
		
		// Create first prompt option of drop-down select
		$label_filter = $filter->parameters->get( 'display_label_filter', 2 ) ;
		$first_option_txt = $label_filter==2 ? $filter->label : JText::_('FLEXI_ALL');
		
		// Prepend Field's Label to filter HTML
		//$filter->html = $label_filter==1 ? $filter->label.': ' : '';
		$filter->html = '';
		
		$props_type = $filter->parameters->get('props_type');
		switch ($props_type)
		{
			case 'language':     // Authors
				// WARNING: we can not use column alias in from, join, where, group by, can use in having (mysql) and in order by
				// partial SQL clauses
				if (!FLEXI_J16GE) break;
				$filter->filter_valuesselect = ' i.language AS value, CONCAT_WS(\': \', lg.title, lg.title_native) AS text';
				$filter->filter_valuesjoin   = ' JOIN #__languages AS lg ON i.language = lg.lang_code';
				$filter->filter_valueswhere  = ' AND lg.published <> 0';
				// full SQL clauses
				$filter->filter_groupby = ' GROUP BY i.language ';
				$filter->filter_having  = null;   // this indicates to use default, space is use empty
				$filter->filter_orderby = ' ORDER BY lg.title ASC ';
				
				FlexicontentFields::createFilter($filter, $value, $formName);
			break;
			
			default:
				$filter->html	.= 'CORE property field of type: '.$props_type.' can not be used as search filter';
			break;
		}
		
		// a. If field filter has defined a custom SQL query to create filter (drop-down select) options, execute it and then create the options
		if ( !empty($query) ) {
			$db->setQuery($query);
			$lists = $db->loadObjectList();
			$options = array();
			$options[] = JHTML::_('select.option', '', '- '.$first_option_txt.' -');
			foreach ($lists as $list) $options[] = JHTML::_('select.option', $list->value, $list->text . ($count_column ? ' ('.$list->found.')' : '') );
		}
		
		// b. If field filter has defined drop-down select options the create the drop-down select form field
		if ( !empty($options) ) {
			// Make use of select2 lib
			flexicontent_html::loadFramework('select2');
			$classes  = " use_select2_lib". @ $extra_classes;
			$extra_param = '';
			
			// MULTI-select: special label and prompts
			if ($display_filter_as == 6) {
				$classes .= ' fc_label_internal fc_prompt_internal';
				// Add field's LABEL internally or click to select PROMPT (via js)
				$_inner_lb = $label_filter==2 ? $filter->label : JText::_('FLEXI_CLICK_TO_LIST');
				// Add type to filter PROMPT (via js)
				$extra_param  = ' data-fc_label_text="'.flexicontent_html::escapeJsText($_inner_lb,'s').'"';
				$extra_param .= ' data-fc_prompt_text="'.flexicontent_html::escapeJsText(JText::_('FLEXI_TYPE_TO_FILTER'),'s').'"';
			}
			
			// Create HTML tag attributes
			$attribs_str  = ' class="fc_field_filter'.$classes.'" '.$extra_param;
			$attribs_str .= $display_filter_as==6 ? ' multiple="multiple" size="20" ' : '';
			//$attribs_str .= ($display_filter_as==0 || $display_filter_as==6) ? ' onchange="document.getElementById(\''.$formName.'\').submit();"' : '';
			
			// Filter name and id
			$filter_ffname = 'filter_'.$filter->id;
			$filter_ffid   = $formName.'_'.$filter->id.'_val';
			
			// Create filter
			$filter->html	.= JHTML::_('select.genericlist', $options, $filter_ffname.'[]', $attribs_str, 'value', 'text', $value, $filter_ffid);
		}
		
		// Special CASE 'categories' filter, replace some tags in filter HTML ...
		//if ( $props_type == 'alias') $filter->html = str_replace('_', ' ', $filter->html);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:83,代码来源:coreprops.php


注:本文中的flexicontent_html::escapeJsText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。