• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP FLEXIUtilities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: display

 function display($tpl = null)
 {
     $user = JFactory::getUser();
     $dispatcher = JDispatcher::getInstance();
     // Initialize some variables
     $item =& $this->get('Item');
     $params =& $item->parameters;
     $fields =& $this->get('Extrafields');
     $tags =& $item->tags;
     $categories =& $item->categories;
     $favourites = $item->favourites;
     $favoured = $item->favoured;
     // process the new plugins
     JPluginHelper::importPlugin('content', 'image');
     if (!FLEXI_J16GE) {
         $dispatcher->trigger('onPrepareContent', array(&$item, &$params, 0));
     } else {
         $dispatcher->trigger('onContentPrepare', array('com_content.article', &$item, &$params, 0));
     }
     $document = JFactory::getDocument();
     // set document information
     $document->setTitle($item->title);
     $document->setName($item->alias);
     $document->setDescription($item->metadesc);
     $document->setMetaData('keywords', $item->metakey);
     // prepare header lines
     $document->setHeader($this->_getHeaderText($item, $params));
     $pdf_format_fields = trim($params->get("pdf_format_fields"));
     $pdf_format_fields = !$pdf_format_fields ? array() : preg_split("/[\\s]*,[\\s]*/", $pdf_format_fields);
     $methodnames = array();
     foreach ($pdf_format_fields as $pdf_format_field) {
         @(list($fieldname, $methodname) = preg_split("/[\\s]*:[\\s]*/", $pdf_format_field));
         $methodnames[$fieldname] = empty($methodname) ? 'display' : $methodname;
     }
     // IF no fields set then just print the item's description text
     if (!count($pdf_format_fields)) {
         echo $item->text;
         return;
     }
     foreach ($fields as $field) {
         if (!isset($methodnames[$field->name])) {
             continue;
         }
         if ($field->iscore) {
             FlexicontentFields::loadFieldConfig($field, $item);
             //$results = $dispatcher->trigger('onDisplayCoreFieldValue', array( &$field, $item, &$params, $tags, $categories, $favourites, $favoured ));
             FLEXIUtilities::call_FC_Field_Func('core', 'onDisplayCoreFieldValue', array(&$field, $item, &$params, $tags, $categories, $favourites, $favoured));
         } else {
             //$results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $item ));
             FLEXIUtilities::call_FC_Field_Func($field->field_type, 'onDisplayFieldValue', array(&$field, $item));
         }
         if (@$field->display) {
             echo '<b>' . $field->label . '</b>: ';
             echo $field->display . '<br /><br />';
         }
     }
 }
开发者ID:jakesyl,项目名称:flexicontent,代码行数:57,代码来源:view.pdf.php


示例2: getInput

 function getInput()
 {
     $doc = JFactory::getDocument();
     $db = JFactory::getDBO();
     // Get field configuration
     if (FLEXI_J16GE) {
         $node =& $this->element;
         $attributes = get_object_vars($node->attributes());
         $attributes = $attributes['@attributes'];
     } else {
         $attributes =& $node->_attributes;
     }
     // Get values
     $values = FLEXI_J16GE ? $this->value : $value;
     if (empty($values)) {
         $values = array();
     } else {
         if (!is_array($values)) {
             $values = !FLEXI_J16GE ? array($values) : explode("|", $values);
         }
     }
     // Field name and HTML tag id
     $fieldname = FLEXI_J16GE ? $this->name : $control_name . '[' . $name . ']';
     $element_id = FLEXI_J16GE ? $this->id : $control_name . $name;
     // Create options
     $langs = array();
     // Add 'use global' (no value option)
     if (@$attributes['use_global']) {
         $langs[] = JHTML::_('select.option', '', JText::_('FLEXI_USE_GLOBAL'));
     }
     // Add 'please select' (no value option)
     if (@$attributes['please_select']) {
         $langs[] = JHTML::_('select.option', '', JText::_('FLEXI_PLEASE_SELECT'));
     }
     $languages = FLEXIUtilities::getlanguageslist();
     foreach ($languages as $lang) {
         $langs[] = JHTML::_('select.option', $lang->code, $lang->name);
     }
     // Create HTML tag parameters
     $attribs = ' style="float:left;" ';
     if (@$attributes['multiple'] == 'multiple' || @$attributes['multiple'] == 'true') {
         $attribs .= ' multiple="multiple" ';
         $attribs .= @$attributes['size'] ? ' size="' . @$attributes['size'] . '" ' : ' size="6" ';
         $fieldname .= !FLEXI_J16GE ? "[]" : "";
         // NOTE: this added automatically in J2.5
         $maximize_link = "<a style='display:inline-block;" . (FLEXI_J16GE ? 'float:left; margin: 6px 0px 0px 18px;' : 'margin:0px 0px 6px 12px') . "' href='javascript:;' onclick='{$element_id} = document.getElementById(\"{$element_id}\"); if ({$element_id}.size<16) { {$element_id}_oldsize={$element_id}.size; {$element_id}.size=16;} else { {$element_id}.size={$element_id}_oldsize; } ' >Maximize/Minimize</a>";
     } else {
         $attribs .= 'class="inputbox"';
         $maximize_link = '';
     }
     if ($onchange = @$attributes['onchange']) {
         $attribs .= ' onchange="' . $onchange . '"';
     }
     // Render the field's HTML
     $html = JHTML::_('select.genericlist', $langs, $fieldname, $attribs, 'value', 'text', $values, $element_id);
     return $html . $maximize_link;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:57,代码来源:fclanguage.php


示例3: display

 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $option = JRequest::getVar('option');
     //initialise variables
     $db = JFactory::getDBO();
     $document = JFactory::getDocument();
     $template = $mainframe->getTemplate();
     $dispatcher = JDispatcher::getInstance();
     $rev = JRequest::getInt('version', '', 'request');
     $codemode = JRequest::getInt('codemode', 0);
     $cparams = JComponentHelper::getParams('com_flexicontent');
     FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
     flexicontent_html::loadFramework('jQuery');
     JHTML::_('behavior.tooltip');
     JHTML::_('behavior.modal');
     //a trick to avoid loosing general style in modal window
     $css = 'body, td, th { font-size: 11px; } .novalue { color: gray; font-style: italic; }';
     $document->addStyleDeclaration($css);
     //Get data from the model
     $model = $this->getModel();
     $row = $this->get('Item');
     $fields = $this->get('Extrafields');
     $versions = $this->get('VersionList');
     $tparams = $this->get('Typeparams');
     // Create the type parameters
     $tparams = FLEXI_J16GE ? new JRegistry($tparams) : new JParameter($tparams);
     // Add html to field object trought plugins
     foreach ($fields as $field) {
         if ($field->value) {
             //$results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $row ));
             $fieldname = $field->iscore ? 'core' : $field->field_type;
             FLEXIUtilities::call_FC_Field_Func($fieldname, 'onDisplayFieldValue', array(&$field, $row));
         } else {
             $field->display = '<span class="novalue">' . JText::_('FLEXI_NO_VALUE') . '</span>';
         }
         if ($field->version) {
             //$results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $row, $field->version, 'displayversion' ));
             $fieldname = $field->iscore ? 'core' : $field->field_type;
             FLEXIUtilities::call_FC_Field_Func($fieldname, 'onDisplayFieldValue', array(&$field, $row, $field->version, 'displayversion'));
         } else {
             $field->displayversion = '<span class="novalue">' . JText::_('FLEXI_NO_VALUE') . '</span>';
         }
     }
     //assign data to template
     $this->assignRef('document', $document);
     $this->assignRef('row', $row);
     $this->assignRef('fields', $fields);
     $this->assignRef('versions', $versions);
     $this->assignRef('rev', $rev);
     $this->assignRef('tparams', $tparams);
     $this->assignRef('cparams', $cparams);
     $this->assignRef('codemode', $codemode);
     parent::display($tpl);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:55,代码来源:view.html.php


示例4: getInput

 function getInput()
 {
     $doc = JFactory::getDocument();
     $db = JFactory::getDBO();
     // Get field configuration
     $node =& $this->element;
     $attributes = get_object_vars($node->attributes());
     $attributes = $attributes['@attributes'];
     // Get values
     $values = $this->value;
     if (empty($values)) {
         $values = array();
     } else {
         if (!is_array($values)) {
             $values = explode("|", $values);
         }
     }
     // Field name and HTML tag id
     $fieldname = $this->name;
     $element_id = $this->id;
     // Create options
     $langs = array();
     // Add 'use global' (no value option)
     if (@$attributes['use_global']) {
         $langs[] = JHTML::_('select.option', '', JText::_('FLEXI_USE_GLOBAL'));
     }
     // Add 'please select' (no value option)
     if (@$attributes['please_select']) {
         $langs[] = JHTML::_('select.option', '', JText::_('FLEXI_PLEASE_SELECT'));
     }
     foreach ($node->children() as $option) {
         $val = $option->attributes()->value;
         $text = JText::_(FLEXI_J30GE ? $option->__toString() : $option->data());
         $langs[] = JHTML::_('select.option', $val, $text);
     }
     $languages = FLEXIUtilities::getlanguageslist();
     foreach ($languages as $lang) {
         $langs[] = JHTML::_('select.option', $lang->code, $lang->name);
     }
     // Create HTML tag parameters
     $attribs = '';
     $classes = 'use_select2_lib';
     if (@$attributes['multiple'] == 'multiple' || @$attributes['multiple'] == 'true') {
         $attribs .= ' multiple="multiple" ';
         $attribs .= @$attributes['size'] ? ' size="' . @$attributes['size'] . '" ' : ' size="6" ';
     }
     if ($onchange = @$attributes['onchange']) {
         $attribs .= ' onchange="' . $onchange . '"';
     }
     $attribs .= ' class="' . $classes . '" ';
     // Render the field's HTML
     return JHTML::_('select.genericlist', $langs, $fieldname, $attribs, 'value', 'text', $values, $element_id);
 }
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:53,代码来源:fclanguage.php


示例5: onDisplayFieldValue

	public function onDisplayFieldValue(&$field, $item, $values=null, $prop='display')
	{
		// execute the code only if the field type match the plugin type
		if ( !in_array($field->field_type, self::$field_types) ) return;
		
		static $all_langs = null;
		
		$props_type = $field->parameters->get('props_type');
		if ($props_type == 'language')
		{
			if ($all_langs===null) {
				$all_langs= FLEXIUtilities::getLanguages($hash='code');
			}
			$lang_data = $all_langs->{$item->language};
			
			$field->{$prop} = @$lang_data->title_native ? $lang_data->title_native : $lang_data->name;
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:18,代码来源:coreprops.php


示例6: onDisplayFieldValue

 public function onDisplayFieldValue(&$field, $item, $values = null, $prop = 'display')
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     static $all_langs = null;
     $props_type = $field->parameters->get('props_type');
     if ($props_type == 'language') {
         if ($all_langs === null) {
             $all_langs = FLEXIUtilities::getLanguages($hash = 'code');
         }
         $lang_data = $all_langs->{$item->language};
         $field->{$prop} = @$lang_data->title_native ? $lang_data->title_native : $lang_data->name;
     } else {
         if ($props_type == 'alias') {
             $field->{$prop} = $item->{$props_type};
         } else {
             $field->{$prop} = $props_type;
         }
     }
 }
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:21,代码来源:coreprops.php


示例7: _getFiltered

 /**
  * Method to get the active filter result
  * 
  * @access private
  * @return string
  * @since 1.5
  */
 function _getFiltered(&$filter, $value, $return_sql = true)
 {
     $field_type = $filter->field_type;
     // Sanitize filter values as integers for field that use integer values
     if (in_array($field_type, array('createdby', 'modifiedby', 'type', 'categories', 'tags'))) {
         $values = is_array($value) ? $value : array($value);
         foreach ($values as $i => $v) {
             $values[$i] = (int) $v;
         }
     }
     switch ($field_type) {
         case 'createdby':
             $filter_query = ' AND i.created_by IN (' . implode(",", $values) . ')';
             // no db quoting needed since these were typecasted to ints
             break;
         case 'modifiedby':
             $filter_query = ' AND i.modified_by IN (' . implode(",", $values) . ')';
             // no db quoting needed since these were typecasted to ints
             break;
         case 'type':
             //$filter_query = ' AND ie.type_id IN ('. implode(",", $values) .')';   // no db quoting needed since these were typecasted to ints
             $query = 'SELECT item_id' . ' FROM #__flexicontent_items_ext' . ' WHERE type_id IN (' . implode(",", $values) . ')';
             //$filter_query = ' AND i.id IN (' . $query . ')';
             break;
         case 'state':
             $stateids = array('PE' => -3, 'OQ' => -4, 'IP' => -5, 'P' => 1, 'U' => 0, 'A' => FLEXI_J16GE ? 2 : -1, 'T' => -2);
             $values = is_array($value) ? $value : array($value);
             $filt_states = array();
             foreach ($values as $i => $v) {
                 if (isset($stateids[$v])) {
                     $filt_states[] = $stateids[$v];
                 }
             }
             $filter_query = !count($values) ? ' AND 0 ' : ' AND i.state IN (' . implode(",", $filt_states) . ')';
             // no db quoting needed since these were typecasted to ints
             break;
         case 'categories':
             //$filter_query = ' AND rel.catid IN ('. implode(",", $values) .')';
             global $globalcats;
             $cparams = $this->_params;
             $display_subcats = $cparams->get('display_subcategories_items', 2);
             // include subcategory items
             $query_catids = array();
             foreach ($values as $id) {
                 $query_catids[$id] = 1;
                 if ($display_subcats == 2 && !empty($globalcats[$id]->descendantsarray)) {
                     foreach ($globalcats[$id]->descendantsarray as $subcatid) {
                         $query_catids[$subcatid] = 1;
                     }
                 }
             }
             $query_catids = array_keys($query_catids);
             $query = 'SELECT itemid' . ' FROM #__flexicontent_cats_item_relations' . ' WHERE catid IN (' . implode(",", $query_catids) . ')';
             //$filter_query = ' AND i.id IN (' . $query . ')';
             break;
         case 'tags':
             $query = 'SELECT itemid' . ' FROM #__flexicontent_tags_item_relations' . ' WHERE tid IN (' . implode(",", $values) . ')';
             //$filter_query = ' AND i.id IN (' . $query . ')';
             break;
         default:
             // Make sure plugin file of current file is loaded and then check if custom filtering function exists
             $field_type_file = $filter->iscore ? 'core' : $field_type;
             $path = JPATH_ROOT . DS . 'plugins' . DS . 'flexicontent_fields' . DS . strtolower($field_type_file) . (FLEXI_J16GE ? DS . strtolower($field_type_file) : "") . '.php';
             if (file_exists($path)) {
                 require_once $path;
                 $method_exists = method_exists("plgFlexicontent_fields{$field_type_file}", "getFiltered");
             }
             // Use custom field filtering if 'getFiltered' plugin method exists, otherwise try to use our default filtering function
             $filtered = !@$method_exists ? FlexicontentFields::getFiltered($filter, $value, $return_sql) : FLEXIUtilities::call_FC_Field_Func($field_type_file, 'getFiltered', array(&$filter, &$value, &$return_sql));
             break;
     }
     if (!isset($filter_query)) {
         if (isset($filtered)) {
             // nothing to do
         } else {
             if (!isset($query)) {
                 $filtered = '';
                 echo "Unhandled case for filter: " . $field->name . " in 'FlexicontentModelCategory::getFiltered()', query variable not set<br/>\n";
             } else {
                 if (!$return_sql) {
                     //echo "<br>GET FILTERED Items (cat model) -- [".$filter->name."] using in-query ids :<br>". $query."<br>\n";
                     $db = JFactory::getDBO();
                     $db->setQuery($query);
                     $filtered = $db->loadColumn();
                     if ($db->getErrorNum()) {
                         JFactory::getApplication()->enqueueMessage(__FUNCTION__ . '(): SQL QUERY ERROR:<br/>' . nl2br($db->getErrorMsg()), 'error');
                     }
                 } else {
                     if ($return_sql === 2) {
                         $db = JFactory::getDBO();
                         static $iids_tblname = array();
                         if (!isset($iids_tblname[$filter->id])) {
                             $iids_tblname[$filter->id] = 'fc_filter_iids_' . $filter->id;
//.........这里部分代码省略.........
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:101,代码来源:category.php


示例8: access

 /**
  * Logic to set the access level of the Items
  *
  * @access public
  * @return void
  * @since 1.5
  */
 function access()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     $user = JFactory::getUser();
     $cid = JRequest::getVar('cid', array(0), 'post', 'array');
     $id = (int) $cid[0];
     $task = JRequest::getVar('task');
     // Decide / Retrieve new access level
     $accesses = JRequest::getVar('access', array(0), 'post', 'array');
     $access = $accesses[$id];
     $model = $this->getModel('item');
     $canEdit = $model->getItemAccess()->get('access-edit');
     // Check if user can edit the item
     if (!$canEdit) {
         $msg_noauth = JText::_('FLEXI_CANNOT_CHANGE_ACCLEVEL_ASSETS');
         $msg_noauth .= ": " . implode(',', $non_auth_cid) . " - " . JText::_('FLEXI_REASON_NO_PUBLISH_PERMISSION');
     }
     if ($msg_noauth) {
         JError::raiseNotice(500, $msg_noauth);
         $this->setRedirect('index.php?option=com_flexicontent&view=items', '');
         return;
     }
     $model = $this->getModel('items');
     if (!$model->saveaccess($id, $access)) {
         $msg = JText::_('FLEXI_ERROR_SETTING_ITEM_ACCESS_LEVEL');
         JError::raiseWarning(500, $msg . " " . $model->getError());
         $msg = '';
     } else {
         $cache = FLEXIUtilities::getCache($group = '', 0);
         $cache->clean('com_flexicontent_items');
         $cache->clean('com_flexicontent_filters');
         $cache = FLEXIUtilities::getCache($group = '', 1);
         $cache->clean('com_flexicontent_items');
         $cache->clean('com_flexicontent_filters');
     }
     $this->setRedirect('index.php?option=com_flexicontent&view=items');
 }
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:45,代码来源:items.php


示例9: onDisplayField

    function onDisplayField(&$field, &$item)
    {
        if (!in_array($field->field_type, self::$field_types)) {
            return;
        }
        // Check max allowed version
        $manifest_path = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_flexicontent' . DS . 'manifest.xml';
        $com_xml = JApplicationHelper::parseXMLInstallFile($manifest_path);
        if (version_compare(str_replace(' ', '.', $com_xml['version']), str_replace(' ', '.', self::$prior_to_version), '>=')) {
            echo '
			<span class="fc-note fc-nobgimage fc-mssg">
				Warning: installed version of Field: \'<b>' . $field->field_type . '</b>\' was meant for FLEXIcontent versions prior to: v' . self::$prior_to_version . ' <br/> It may or may not work properly in later versions<br/>
			</span>';
        }
        $field->label = JText::_($field->label);
        $use_ingroup = 0;
        // Field grouped should not be recursively grouped
        if ($use_ingroup) {
            $field->formhidden = 3;
        }
        if ($use_ingroup && empty($field->ingroup)) {
            return;
        }
        $compact_edit = $field->parameters->get('compact_edit', 0);
        // initialize framework objects and other variables
        $document = JFactory::getDocument();
        $db = JFactory::getDBO();
        $tooltip_class = FLEXI_J30GE ? 'hasTooltip' : 'hasTip';
        // ****************
        // Number of values
        // ****************
        $multiple = $use_ingroup || (int) $field->parameters->get('allow_multiple', 0);
        $max_values = $use_ingroup ? 0 : (int) $field->parameters->get('max_values', 0);
        $required = $field->parameters->get('required', 0);
        $required = $required ? ' required' : '';
        $add_position = (int) $field->parameters->get('add_position', 3);
        // **************
        // Value handling
        // **************
        // Get fields belonging to this field group
        $grouped_fields = $this->getGroupFields($field);
        // Get values of fields making sure that also empty values are created too
        $max_count = 1;
        $this->getGroupFieldsValues($grouped_fields, $item, $max_count);
        // Render Form HTML of the field
        foreach ($grouped_fields as $field_id => $grouped_field) {
            for ($n = count($grouped_field->value); $n < $max_count; $n++) {
                $grouped_field->value[$n] = null;
            }
            $grouped_field->ingroup = 1;
            $grouped_field->item_id = $item->id;
            FLEXIUtilities::call_FC_Field_Func($grouped_field->field_type, 'onDisplayField', array(&$grouped_field, &$item));
            unset($grouped_field->ingroup);
        }
        $js = "";
        $css = "";
        if ($multiple) {
            // Add the drag and drop sorting feature
            if (!$use_ingroup) {
                $js .= "\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\tjQuery('#sortables_" . $field->id . "').sortable({\n\t\t\t\t\thandle: '.fcfield-drag-handle',\n\t\t\t\t\tcontainment: 'parent',\n\t\t\t\t\ttolerance: 'pointer'\n\t\t\t\t});\n\t\t\t});\n\t\t\t";
            }
            $js .= "\n\t\t\tjQuery(document).ready(function(){" . ($compact_edit == 2 ? "jQuery('#sortables_" . $field->id . "').find('.toggle_group_down').trigger('click');" : "") . ($compact_edit == 1 ? "jQuery('#sortables_" . $field->id . "').find('.toggle_group_up').trigger('click');" : "") . "});\n\t\t\t";
            if ($max_values) {
                FLEXI_J16GE ? JText::script("FLEXI_FIELD_MAX_ALLOWED_VALUES_REACHED", true) : fcjsJText::script("FLEXI_FIELD_MAX_ALLOWED_VALUES_REACHED", true);
            }
            $js .= "\n\t\t\tvar uniqueRowNum" . $field->id . "\t= " . $max_count . ";  // Unique row number incremented only\n\t\t\tvar rowCount" . $field->id . "\t= " . $max_count . ";      // Counts existing rows to be able to limit a max number of values\n\t\t\tvar maxValues" . $field->id . " = " . $max_values . ";\n\t\t\t";
            // Create function call for add/deleting Field values
            $addField_pattern = "\n\t\t\t\tvar fieldval_box = groupval_box.find('.fcfieldval_container__GRP_FID_');\n\t\t\t\tfieldval_box.find('.invalid').removeClass('invalid').attr('aria-invalid', 'false');\n\t\t\t\tvar newSubLabel = fieldval_box.prev('label.sub_label');\n\t\t\t\tvar newLabelFor = 'custom_%s_'+uniqueRowNum" . $field->id . ";\n\t\t\t\tnewSubLabel.attr('for', newLabelFor);\n\t\t\t\tnewSubLabel.attr('for_bck', newLabelFor);\n\t\t\t\tfcflabels[ newLabelFor ] = newSubLabel;\n\t\t\t\taddField_GRP_FID_(null, groupval_box, groupval_box.find('.fcfieldval_container__GRP_FID_'), add_params);";
            $delField_pattern = "\n\t\t\t\tif(rowCount" . $field->id . " == 1)\n\t\t\t\t{\n\t\t\t\t\t// We need to update the current grouped label of the field if this was the last element being re-added\n\t\t\t\t\tvar fieldval_box = groupval_box.find('.fcfieldval_container__GRP_FID_');\n\t\t\t\t\tfieldval_box.find('.invalid').removeClass('invalid').attr('aria-invalid', 'false');\n\t\t\t\t\tvar newSubLabel = fieldval_box.prev('label.sub_label');\n\t\t\t\t\tvar newLabelFor = 'custom_%s_'+uniqueRowNum" . $field->id . ";\n\t\t\t\t\tnewSubLabel.attr('for', newLabelFor);\n\t\t\t\t\tnewSubLabel.attr('for_bck', newLabelFor);\n\t\t\t\t\tfcflabels[ newLabelFor ] = newSubLabel;\n\t\t\t\t}\n\t\t\t\tdeleteField_GRP_FID_(null, groupval_box, groupval_box.find('.fcfieldval_container__GRP_FID_'));\n\t\t\t\t";
            $addField_funcs = $delField_funcs = '';
            foreach ($grouped_fields as $field_id => $grouped_field) {
                $addField_funcs .= str_replace("_GRP_FID_", $grouped_field->id, sprintf($addField_pattern, $grouped_field->name));
                $delField_funcs .= str_replace("_GRP_FID_", $grouped_field->id, sprintf($delField_pattern, $grouped_field->name));
            }
            $js .= "\n\t\t\tfunction addField" . $field->id . "(el, groupval_box, fieldval_box, params)\n\t\t\t{\n\t\t\t\tvar insert_before   = (typeof params!== 'undefined' && typeof params.insert_before   !== 'undefined') ? params.insert_before   : 0;\n\t\t\t\tvar remove_previous = (typeof params!== 'undefined' && typeof params.remove_previous !== 'undefined') ? params.remove_previous : 0;\n\t\t\t\tvar scroll_visible  = (typeof params!== 'undefined' && typeof params.scroll_visible  !== 'undefined') ? params.scroll_visible  : 1;\n\t\t\t\tvar animate_visible = (typeof params!== 'undefined' && typeof params.animate_visible !== 'undefined') ? params.animate_visible : 1;\n\t\t\t\t\n\t\t\t\tif((rowCount" . $field->id . " >= maxValues" . $field->id . ") && (maxValues" . $field->id . " != 0)) {\n\t\t\t\t\talert(Joomla.JText._('FLEXI_FIELD_MAX_ALLOWED_VALUES_REACHED') + maxValues" . $field->id . ");\n\t\t\t\t\treturn 'cancel';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Find last container of fields and clone it to create a new container of fields\n\t\t\t\tvar lastField = fieldval_box ? fieldval_box : jQuery(el).prev().children().last();\n\t\t\t\tvar newField  = lastField.clone();\n\t\t\t\t\n\t\t\t\t// Need to at least change FORM field names and HTML tag IDs before adding the container to the DOM\n\t\t\t\tvar theSet = newField.find('input, select');\n\t\t\t\tvar nr = 0;\n\t\t\t\ttheSet.each(function() {\n\t\t\t\t\tvar elem = jQuery(this);\n\t\t\t\t\telem.attr('name', '_duplicated_" . $field->id . "_'+uniqueRowNum" . $field->id . "+'_'+nr);\n\t\t\t\t\telem.attr('id', '_duplicated_" . $field->id . "_'+uniqueRowNum" . $field->id . "+'_'+nr);\n\t\t\t\t\tnr++;\n\t\t\t\t});\n\t\t\t\t";
            // Add new field to DOM
            $js .= "\n\t\t\t\tlastField ?\n\t\t\t\t\t(insert_before ? newField.insertBefore( lastField ) : newField.insertAfter( lastField ) ) :\n\t\t\t\t\tnewField.appendTo( jQuery('#sortables_" . $field->id . "') ) ;\n\t\t\t\t";
            // Add new element to sortable objects (if field not in group)
            if (!$use_ingroup) {
                $js .= "\n\t\t\t\tjQuery('#sortables_" . $field->id . "').sortable({\n\t\t\t\t\thandle: '.fcfield-drag-handle',\n\t\t\t\t\tcontainment: 'parent',\n\t\t\t\t\ttolerance: 'pointer'\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Add new values for each field\n\t\t\t\tvar groupval_box = newField;\n\t\t\t\tvar add_params = {remove_previous: 1, scroll_visible: 0, animate_visible: 0};\n\t\t\t\t" . $addField_funcs . "\n\t\t\t\t";
            }
            // Readd prettyCheckable and remove previous if so requested
            $js .= "\n\t\t\t\tif (remove_previous) lastField.remove();\n\t\t\t\t";
            // Show new field, increment counters
            $js .= "\n\t\t\t\t//newField.fadeOut({ duration: 400, easing: 'swing' }).fadeIn({ duration: 200, easing: 'swing' });\n\t\t\t\tif (scroll_visible) fc_scrollIntoView(newField, 1);\n\t\t\t\tif (animate_visible) newField.css({opacity: 0.1}).animate({ opacity: 1 }, 800);\n\t\t\t\t\n\t\t\t\t// Enable tooltips on new element\n\t\t\t\tnewField.find('.hasTooltip').tooltip({'html': true,'container': newField});\n\t\t\t\t\n\t\t\t\trowCount" . $field->id . "++;       // incremented / decremented\n\t\t\t\tuniqueRowNum" . $field->id . "++;   // incremented only\n\t\t\t}\n\n\t\t\tfunction deleteField" . $field->id . "(el)\n\t\t\t{\n\t\t\t\tvar row = jQuery(el).closest('li');\n\t\t\t\t\n\t\t\t\t// Do cleanup by calling the deleteField of each individual field, these functions will re-add last element as empty if needed\n\t\t\t\tvar groupval_box = jQuery(el).closest('li');\n\t\t\t\t" . $delField_funcs . "\n\t\t\t\tif(rowCount" . $field->id . " == 1)\n\t\t\t\t{\n\t\t\t\t\tuniqueRowNum" . $field->id . "++;   // increment unique row id, since last group was re-added\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Also remove the group field values container if not last one\n\t\t\t\tif(rowCount" . $field->id . " > 1) {\n\t\t\t\t\t// Destroy the remove/add/etc buttons, so that they are not reclicked, while we do the hide effect (before DOM removal of field value)\n\t\t\t\t\trow.find('.fcfield-delvalue').remove();\n\t\t\t\t\trow.find('.fcfield-insertvalue').remove();\n\t\t\t\t\trow.find('.fcfield-drag-handle').remove();\n\t\t\t\t\t// Do hide effect then remove from DOM\n\t\t\t\t\trow.fadeOut(420, function(){ this.remove(); });\n\t\t\t\t\trowCount" . $field->id . "--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t";
            $css .= '';
            $remove_button = '<span class="fcfield-delvalue" title="' . JText::_('FLEXI_REMOVE_VALUE') . '" onclick="deleteField' . $field->id . '(this);"></span>';
            $move2 = '<span class="fcfield-drag-handle" title="' . JText::_('FLEXI_CLICK_TO_DRAG') . '"></span>';
            $add_here = '';
            $add_here .= $add_position == 2 || $add_position == 3 ? '<span class="fcfield-insertvalue fc_before" onclick="addField' . $field->id . '(null, jQuery(this).closest(\'ul\'), jQuery(this).closest(\'li\'), {insert_before: 1});" title="' . JText::_('FLEXI_ADD_BEFORE') . '"></span> ' : '';
            $add_here .= $add_position == 1 || $add_position == 3 ? '<span class="fcfield-insertvalue fc_after"  onclick="addField' . $field->id . '(null, jQuery(this).closest(\'ul\'), jQuery(this).closest(\'li\'), {insert_before: 0});" title="' . JText::_('FLEXI_ADD_AFTER') . '"></span> ' : '';
            if ($compact_edit) {
                $add_here .= '
				<button class="toggle_group_down btn btn-small btn-success" style="' . ($compact_edit == 2 ? 'display:none;' : '') . ' min-width: 120px;" onclick="fc_toggle_box_via_btn(jQuery(this).closest(\'li\').find(\'.fcfieldval_container_outer:not(.fcAlwaysVisibleField)\'), this, \'\', jQuery(this).next(), 1); return false;">
					<i class="icon-downarrow"></i>' . JText::_('FLEXI_FIELD_GROUP_EDIT_DETAILS') . '
				</button>
				<button class="toggle_group_up   btn btn-small" style="' . ($compact_edit == 1 ? 'display:none;' : '') . ' min-width: 120px;" onclick="fc_toggle_box_via_btn(jQuery(this).closest(\'li\').find(\'.fcfieldval_container_outer:not(.fcAlwaysVisibleField)\'), this, \'\', jQuery(this).prev(), 0); return false;">
					<i class="icon-uparrow"></i>' . JText::_('FLEXI_FIELD_GROUP_HIDE_DETAILS') . '
				</button>
			';
//.........这里部分代码省略.........
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:101,代码来源:fieldgroup.php


示例10: onContentSearch


//.........这里部分代码省略.........
         $andaccess .= ' AND  c.access IN (0,' . $aid_list . ')';
         $andaccess .= ' AND  i.access IN (0,' . $aid_list . ')';
         $select_access .= ', 1 AS has_access';
     } else {
         // Access Flags for: content type, main category, item
         $aid_arr = JAccess::getAuthorisedViewLevels($user->id);
         $aid_list = implode(",", $aid_arr);
         $select_access .= ', ' . ' CASE WHEN ' . '  ty.access IN (' . $aid_list . ') AND ' . '   c.access IN (' . $aid_list . ') AND ' . '   i.access IN (' . $aid_list . ') ' . ' THEN 1 ELSE 0 END AS has_access';
     }
     // **********************************************************************************************************************************************************
     // Create WHERE clause part for filtering by current active language, and current selected contend types ( !! although this is possible via a filter too ...)
     // **********************************************************************************************************************************************************
     $andlang = '';
     if ($app->isSite() && (FLEXI_FISH || FLEXI_J16GE && $app->getLanguageFilter()) && $filter_lang) {
         $andlang .= ' AND ( ie.language LIKE ' . $db->Quote($lang . '%') . (FLEXI_J16GE ? ' OR ie.language="*" ' : '') . ' ) ';
     }
     // Filter by currently selected content types
     $andcontenttypes = count($contenttypes) ? ' AND ie.type_id IN (' . implode(",", $contenttypes) . ') ' : '';
     // ***********************************************************************
     // Create the AND-WHERE clause parts for the currentl active Field Filters
     // ***********************************************************************
     $return_sql = 2;
     $filters_where = array();
     foreach ($filters as $field) {
         // Get value of current filter, and SKIP it if value is EMPTY
         $filtervalue = JRequest::getVar('filter_' . $field->id, '');
         $empty_filtervalue_array = is_array($filtervalue) && !strlen(trim(implode('', $filtervalue)));
         $empty_filtervalue_string = !is_array($filtervalue) && !strlen(trim($filtervalue));
         if ($empty_filtervalue_array || $empty_filtervalue_string) {
             continue;
         }
         // Call field filtering of advanced search to find items matching the field filter (an SQL SUB-QUERY is returned)
         $field_filename = $field->iscore ? 'core' : $field->field_type;
         $filtered = FLEXIUtilities::call_FC_Field_Func($field_filename, 'getFilteredSearch', array(&$field, &$filtervalue, &$return_sql));
         // An empty return value means no matching values were found
         $filtered = empty($filtered) ? ' AND 0 ' : $filtered;
         // A string mean a subquery was returned, while an array means that item ids we returned
         $filters_where[$field->id] = is_array($filtered) ? ' AND i.id IN (' . implode(',', $filtered) . ')' : $filtered;
         /*if ($filters_where[$field->id]) {
         			echo "\n<br/>Filter:". $field->name ." : ";   print_r($filtervalue);
         			echo "<br>".$filters_where[$field->id]."<br/>";
         		}*/
     }
     //echo "\n<br/><br/>Filters Active: ". count($filters_where)."<br/>";
     //echo "<pre>"; print_r($filters_where);
     //exit;
     // ******************************************************
     // Create Filters JOIN clauses and AND-WHERE clause parts
     // ******************************************************
     // JOIN clause - USED - to limit returned 'text' to the text of TEXT-SEARCHABLE only fields ... (NOT shared with filters)
     if (!$txtmode) {
         $onBasic_textsearch = $text_where;
         $onAdvanced_textsearch = '';
         $join_textsearch = '';
         $join_textfields = '';
     } else {
         $onBasic_textsearch = '';
         $onAdvanced_textsearch = $text_where;
         $join_textsearch = ' JOIN #__flexicontent_advsearch_index as ts ON ts.item_id = i.id ' . (count($fields_text) ? 'AND ts.field_id IN (' . implode(',', array_keys($fields_text)) . ')' : '');
         $join_textfields = ' JOIN #__flexicontent_fields as f ON f.id=ts.field_id';
     }
     // JOIN clauses ... (shared with filters)
     $join_clauses = '' . ' JOIN #__categories AS c ON c.id = i.catid' . ' JOIN #__flexicontent_items_ext AS ie ON ie.item_id = i.id' . ' JOIN #__flexicontent_types AS ty ON ie.type_id = ty.id';
     $join_clauses_with_text = '' . ' JOIN #__categories AS c ON c.id = i.catid' . ' JOIN #__flexicontent_items_ext AS ie ON ie.item_id = i.id' . $onBasic_textsearch . ' JOIN #__flexicontent_types AS ty ON ie.type_id = ty.id' . ($text_where ? $join_textsearch . $onAdvanced_textsearch . $join_textfields : '');
     // AND-WHERE sub-clauses ... (shared with filters)
     $where_conf = ' WHERE 1 ' . ' AND i.state IN (1,-5' . ($search_archived ? ',' . (FLEXI_J16GE ? 2 : -1) : '') . ') ' . ' AND c.published = 1 ' . ' AND ( i.publish_up = ' . $db->Quote($nullDate) . ' OR i.publish_up <= ' . $_nowDate . ' )' . ' AND ( i.publish_down = ' . $db->Quote($nullDate) . ' OR i.publish_down >= ' . $_nowDate . ' )' . $andaccess . $andlang . $andcontenttypes;
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:67,代码来源:flexiadvsearch.php


示例11: display

    function display($tpl = null)
    {
        // Initialise variables
        $app = JFactory::getApplication();
        $option = JRequest::getVar('option');
        $db = JFactory::getDBO();
        $document = JFactory::getDocument();
        $user = JFactory::getUser();
        $use_jquery_sortable = true;
        $type = JRequest::getVar('type', 'items', '', 'word');
        $folder = JRequest::getVar('folder', 'default', '', 'cmd');
        $ismodal = JRequest::getVar('ismodal', 'default', '', 'int');
        FLEXIUtilities::loadTemplateLanguageFile($folder);
        //Get data from the model
        $layout = $this->get('Data');
        $conf = $this->get('LayoutConf');
        $fields = $this->get('Fields');
        $fbypos = $this->get('FieldsByPositions');
        $used = $this->get('UsedFields');
        $contentTypes = $this->get('TypesList');
        //$fieldTypes = $this->get( 'FieldTypesList' );
        $fieldTypes = flexicontent_db::getFieldTypes($_grouped = true, $_usage = false, $_published = false);
        // Field types with content type ASSIGNMENT COUNTING
        // Create CONTENT TYPE SELECTOR
        foreach ($fields as $field) {
            $field->type_ids = !empty($field->reltypes) ? explode(",", $field->reltypes) : array();
        }
        $options = array();
        $options[] = JHTML::_('select.option', '', JText::_('FLEXI_ALL'));
        foreach ($contentTypes as $contentType) {
            $options[] = JHTML::_('select.option', $contentType->id, JText::_($contentType->name));
        }
        $fieldname = $elementid = 'content_type__au__';
        $attribs = ' onchange="filterFieldList(\'%s\', \'%s\', \'%s\');" class="use_select2_lib" ';
        $content_type_select = JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', '', $elementid);
        // Create FIELD TYPE SELECTOR
        $ALL = mb_strtoupper(JText::_('FLEXI_ALL'), 'UTF-8') . ' : ';
        $fftypes = array();
        $fftypes[] = array('value' => '', 'text' => JText::_('FLEXI_ALL'));
        //$fftypes[] = array('value'=>'BV', 'text'=>$ALL . JText::_( 'FLEXI_BACKEND_FIELDS' ) );
        //$fftypes[] = array('value'=>'C',  'text'=>$ALL . JText::_( 'FLEXI_CORE_FIELDS' ) );
        //$fftypes[] = array('value'=>'NC', 'text'=>$ALL . JText::_( 'FLEXI_NON_CORE_FIELDS' ));
        foreach ($fieldTypes as $field_group => $ft_types) {
            $fftypes[] = $field_group;
            foreach ($ft_types as $field_type => $ftdata) {
                $fftypes[] = array('value' => $ftdata->field_type, 'text' => $ftdata->friendly);
            }
            $fftypes[] = '';
        }
        $fieldname = $elementid = 'field_type__au__';
        $attribs = ' class="use_select2_lib" onchange="filterFieldList(\'%s\', \'%s\', \'%s\');"';
        $field_type_select = flexicontent_html::buildfieldtypeslist($fftypes, $fieldname, '', $_grouped ? 1 : 0, $attribs, $elementid);
        if (isset($layout->positions)) {
            $sort = array();
            $jssort = array();
            $idsort = array();
            $sort[0] = 'sortablecorefields';
            $sort[1] = 'sortableuserfields';
            $i = 2;
            $count = -1;
            foreach ($layout->positions as $pos) {
                $count++;
                if (isset($layout->attributes[$count]) && isset($layout->attributes[$count]['readonly'])) {
                    continue;
                }
                $sort[$i] = 'sortable-' . $pos;
                $idsort[$i] = $pos;
                $i++;
            }
            foreach ($idsort as $k => $v) {
                if ($k > 1) {
                    $jssort[] = 'storeordering(jQuery("#sortable-' . $v . '"))';
                }
            }
            $positions = implode(',', $idsort);
            $jssort = implode("; ", $jssort);
            $sortable_ids = "#" . implode(",#", $sort);
            $js = "\n\t\t\tjQuery(function() {\n\t\t\t\tmy = jQuery( \"{$sortable_ids}\" ).sortable({\n\t\t\t\t\tconnectWith: \"" . $sortable_ids . "\",\n\t\t\t\t\tupdate: function(event, ui) {\n\t\t\t\t\t\tif(ui.sender) {\n\t\t\t\t\t\t\tstoreordering(jQuery(ui.sender));\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tstoreordering(jQuery(ui.item).parent());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tinitordering();\n\t\t\t});\n\t\t\tfunction storeordering(parent_element) {\n\t\t\t\thidden_id = '#'+jQuery.trim(parent_element.attr('id').replace('sortable-',''));\n\t\t\t\tfields = new Array();\n\t\t\t\ti = 0;\n\t\t\t\tparent_element.children('li').each(function(){\n\t\t\t\t\tfields[i++] = jQuery(this).attr('id').replace('field_', '');\n\t\t\t\t});\n\t\t\t\tjQuery(hidden_id).val(fields.join(','))\n\t\t\t}\n\t\t\t";
            $js .= '
			var fieldListFilters = new Array( "content_type", "field_type" );
			function filterFieldList (containerID, method, group)
			{
				var needed_classes = "";
				for (i=0; i<fieldListFilters.length; i++)
				{
					filter_name = fieldListFilters[i];
					
					var filter_val = jQuery("#" + filter_name + "_" + group).val();
					if (filter_val) {
						needed_classes += "."+filter_name+"_"+filter_val;
					}
				}
				
				if (needed_classes) {
					(method=="hide") ?
						jQuery("#"+containerID).find("li").show().filter(":not("+needed_classes+")").hide() :
						jQuery("#"+containerID).find("li").css({"color":"red"}).filter(":not("+needed_classes+")").css({"color":"black"});
				} else {
					(method=="hide") ?
						jQuery("#"+containerID).find("li").show() :
//.........这里部分代码省略.........
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:101,代码来源:view.html.php


示例12: display

    function display($tpl = null)
    {
        // ********************
        // Initialise variables
        // ********************
        $app = JFactory::getApplication();
        $jinput = $app->input;
        $option = $jinput->get('option', '', 'cmd');
        $view = $jinput->get('view', '', 'cmd');
        $task = $jinput->get('task', '', 'cmd');
        $cparams = JComponentHelper::getParams('com_flexicontent');
        $user = JFactory::getUser();
        $db = JFactory::getDBO();
        $document = JFactory::getDocument();
        $session = JFactory::getSession();
        // Get model
        $model = $this->getModel();
        // Some flags
        $has_zlib = function_exists("zlib_encode");
        //version_compare(PHP_VERSION, '5.4.0', '>=');
        // Get session information
        $conf = $session->get('csvimport_config', "", 'flexicontent');
        $conf = unserialize($conf ? $has_zlib ? zlib_decode(base64_decode($conf)) : base64_decode($conf) : "");
        $lineno = $session->get('csvimport_lineno', 999999, 'flexicontent');
        $session->set('csvimport_parse_log', null, 'flexicontent');
        // This is the flag if CSV file has been parsed (import form already submitted), thus to display the imported data
        // **************************
        // Add css and js 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);
        // Add JS frameworks
        flexicontent_html::loadFramework('select2');
        $prettycheckable_added = 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);
        // *****************************
        // Get user's global permissions
        // *****************************
        $perms = FlexicontentHelperPerm::getPerm();
        // ************************
        // Create Submenu & Toolbar
        // ************************
        // Create Submenu (and also check access to current view)
        FLEXISubmenu('CanImport');
        // Create document/toolbar titles
        $doc_title = JText::_('FLEXI_IMPORT');
        $site_title = $document->getTitle();
        JToolBarHelper::title($doc_title, 'import');
        $document->setTitle($doc_title . ' - ' . $site_title);
        // Create the toolbar
        $toolbar = JToolBar::getInstance('toolbar');
        if (!empty($conf)) {
            if ($task != 'processcsv') {
                $ctrl_task = 'import.processcsv';
      

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP FOFFormFieldList类代码示例发布时间:2022-05-23
下一篇:
PHP FLEA类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap