本文整理汇总了PHP中flexicontent_html类的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_html类的具体用法?PHP flexicontent_html怎么用?PHP flexicontent_html使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了flexicontent_html类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: onDisplayField
function onDisplayField(&$field, &$item)
{
// execute the code only if the field type match the plugin type
if ( !in_array($field->field_type, self::$field_types) ) return;
$field->label = JText::_($field->label);
// some parameter shortcuts
$sql_mode = $field->parameters->get( 'sql_mode', 0 ) ;
$field_elements = $field->parameters->get( 'field_elements' ) ;
$default_value = $field->parameters->get( 'default_value', '' ) ;
$firstoptiontext = $field->parameters->get( 'firstoptiontext', 'FLEXI_SELECT' ) ;
$usefirstoption = $field->parameters->get( 'usefirstoption', 1 ) ;
$required = $field->parameters->get( 'required', 0 ) ;
$required = $required ? ' required' : '';
// initialise property
if (!$field->value && $default_value!=='') {
$field->value = array();
$field->value[0] = $default_value;
} else if (!$field->value) {
$field->value = array();
$field->value[0] = '';
}
$fieldname = FLEXI_J16GE ? 'custom['.$field->name.']' : $field->name;
$elementid = FLEXI_J16GE ? 'custom_'.$field->name : $field->name;
// Get indexed element values
$elements = FlexicontentFields::indexedField_getElements($field, $item, self::$extra_props);
if ( !$elements ) {
if ($sql_mode)
$field->html = JText::_('FLEXI_FIELD_INVALID_QUERY');
else
$field->html = JText::_('FLEXI_FIELD_INVALID_ELEMENTS');
return;
}
static $select2_added = false;
if ( !$select2_added )
{
$select2_added = true;
flexicontent_html::loadFramework('select2');
}
$classes = ' use_select2_lib ';
$classes .= $required;
$attribs = ' class="'.$classes.'"';
// Create field's HTML display for item form
// Display as drop-down select
$options = array();
if ($usefirstoption) $options[] = JHTML::_('select.option', '', JText::_($firstoptiontext));
foreach ($elements as $element) {
$options[] = JHTML::_('select.option', $element->value, JText::_($element->text));
}
$field->html = JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', $field->value, $elementid);
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:60,代码来源:select.php
示例2: save
function save($key = NULL, $urlVar = NULL)
{
parent::save();
if (JRequest::getVar('fc_doajax_submit')) {
JFactory::getApplication()->enqueueMessage(JText::_('FLEXI_ITEM_SAVED'), 'message');
echo flexicontent_html::get_system_messages_html();
exit;
// Ajax submit, do not rerender the view
}
}
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:10,代码来源:category.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: 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);
}
}
开发者ID:jakesyl,项目名称:flexicontent,代码行数:11,代码来源:filters.php
示例5: display
function display($tpl = null)
{
//initialise variables
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$user = JFactory::getUser();
//$authorparams = flexicontent_db::getUserConfig($user->id);
//add css/js to document
flexicontent_html::loadFramework('select2');
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontentbackend.css');
if (FLEXI_J30GE) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/j3x.css');
} else {
if (FLEXI_J16GE) {
$document->addStyleSheet(JURI::base(true) . '/components/com_flexicontent/assets/css/j25.css');
}
}
//create the toolbar
JToolBarHelper::title(JText::_('FLEXI_EDIT_FILE'), 'fileedit');
JToolBarHelper::apply('filemanager.apply');
JToolBarHelper::save('filemanager.save');
JToolBarHelper::cancel('filemanager.cancel');
//Get data from the model
$model = $this->getModel();
$form = $this->get('Form');
$row = $this->get('File');
// fail if checked out not by 'me'
if ($row->id) {
if ($model->isCheckedOut($user->get('id'))) {
JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
$app->redirect('index.php?option=com_flexicontent&view=filemanager');
}
}
//build access level list
$lists['access'] = JHTML::_('access.assetgrouplist', 'access', $row->access, $config = array('class' => 'use_select2_lib'));
// Build languages list
//$allowed_langs = !$authorparams ? null : $authorparams->get('langs_allowed',null);
//$allowed_langs = !$allowed_langs ? null : FLEXIUtilities::paramToArray($allowed_langs);
$allowed_langs = null;
$lists['language'] = flexicontent_html::buildlanguageslist('language', ' class="use_select2_lib" ', $row->language, 2, $allowed_langs, $published_only = false);
//clean data
JFilterOutput::objectHTMLSafe($row, ENT_QUOTES);
//assign data to template
$this->assignRef('form', $form);
$this->assignRef('row', $row);
$this->assignRef('lists', $lists);
$this->assignRef('document', $document);
parent::display($tpl);
}
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:49,代码来源:view.html.php
示例6:
<?php
}
?>
<!-- EOF Print handling -->
<?php
} else {
?>
<?php
$pdfbutton = flexicontent_html::pdfbutton($item, $this->params);
$mailbutton = flexicontent_html::mailbutton(FLEXI_ITEMVIEW, $this->params, $item->categoryslug, $item->slug, 0, $item);
$printbutton = flexicontent_html::printbutton($this->print_link, $this->params);
$editbutton = flexicontent_html::editbutton($item, $this->params);
$statebutton = flexicontent_html::statebutton($item, $this->params);
$approvalbutton = flexicontent_html::approvalbutton($item, $this->params);
?>
<?php
if ($pdfbutton || $mailbutton || $printbutton || $editbutton || $statebutton || $approvalbutton) {
?>
<!-- BOF buttons -->
<div class="buttons">
<?php
echo $pdfbutton;
?>
<?php
echo $mailbutton;
?>
<?php
echo $printbutton;
开发者ID:jakesyl,项目名称:flexicontent,代码行数:31,代码来源:modular.php
示例7: array
$custom4 = $params->get('custom4');
$custom5 = $params->get('custom5');
// Create Item List Data
$list_arr = modFlexicontentHelper::getList($params);
// Get comments for the items (if enabled), NOTE !! TODO: modify templates and XML file so that this used
$comments_arr = modFlexicontentHelper::getComments($params, $list_arr);
$mod_fc_run_times['category_data_retrieval'] = $modfc_jprof->getmicrotime();
// Get Category List Data
$catdata_arr = modFlexicontentHelper::getCategoryData($params);
$catdata_arr = $catdata_arr ? $catdata_arr : array(false);
$mod_fc_run_times['category_data_retrieval'] = $modfc_jprof->getmicrotime() - $mod_fc_run_times['category_data_retrieval'];
$mod_fc_run_times['rendering_template'] = $modfc_jprof->getmicrotime();
// Load needed JS libs & CSS styles
FLEXI_J30GE ? JHtml::_('behavior.framework', true) : JHTML::_('behavior.mootools');
flexicontent_html::loadFramework('jQuery');
flexicontent_html::loadFramework('flexi_tmpl_common');
// Add tooltips
if ($add_tooltips) {
JHTML::_('behavior.tooltip');
}
// Add css
if ($add_ccs && $layout) {
if ($caching && !FLEXI_J16GE) {
// Work around for caching bug in J1.5
if (file_exists(dirname(__FILE__) . DS . 'tmpl' . DS . $layout . DS . $layout . '.css')) {
// active layout css
echo '<link rel="stylesheet" href="' . JURI::base(true) . '/modules/mod_flexicontent/tmpl/' . $layout . '/' . $layout . '.css">';
}
echo '<link rel="stylesheet" href="' . JURI::base(true) . '/modules/mod_flexicontent/tmpl_common/module.css">';
echo '<link rel="stylesheet" href="' . JURI::base(true) . '/components/com_flexicontent/assets/css/flexicontent.css">';
//allow css override
开发者ID:jakesyl,项目名称:flexicontent,代码行数:31,代码来源:mod_flexicontent.php
示例8: if
$legend_tip .= $use_search ? '<b>'.JText::_('FLEXI_TEXT_SEARCH').'</b><br/>'.JText::_('FLEXI_TEXT_SEARCH_INFO') : '';
$legend_tip .= ($use_search || $use_filters) ? '<br/><br/>' : '';
$legend_tip .= $use_filters ? '<b>'.JText::_('FLEXI_FIELD_FILTERS').'</b><br/>'.JText::_('FLEXI_FIELD_FILTERS_INFO') : '';
} else if ($filter_instructions == 2) {
$legend_inline ='';
$legend_inline .= $use_search ? '<strong>'.JText::_('FLEXI_TEXT_SEARCH').'</strong><br/>'.JText::_('FLEXI_TEXT_SEARCH_INFO') : '';
$legend_inline .= ($use_search || $use_filters) ? '<br/><br/>' : '';
$legend_inline .= $use_filters ? '<strong>'.JText::_('FLEXI_FIELD_FILTERS').'</strong><br/>'.JText::_('FLEXI_FIELD_FILTERS_INFO') : '';
}
?>
<?php if ( $use_search || $use_filters ) : /* BOF search and filters block */ ?>
<?php
$searchphrase_selector = flexicontent_html::searchphrase_selector($params, $form_name);
?>
<div id="<?php echo $form_id; ?>_filter_box" class="fc_filter_box floattext">
<fieldset class="fc_filter_set">
<?php if ($filter_instructions == 1) : ?>
<legend>
<span class="fc_legend_text" >
<span class="">Поиск препарата</span>
</span>
</legend>
<?php endif; ?>
<?php if ($filter_instructions == 2) :?>
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:filters_old.php
示例9: onBeforeSaveField
function onBeforeSaveField(&$field, &$post, &$file, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
$use_ingroup = $field->parameters->get('use_ingroup', 0);
if (!is_array($post) && !strlen($post) && !$use_ingroup) {
return;
}
$is_importcsv = JRequest::getVar('task') == 'importcsv';
// Server side validation
$validation = $field->parameters->get('validation', 2);
$use_html = $field->parameters->get('use_html', 0);
$maxlength = (int) $field->parameters->get('maxlength', 0);
$maxlength = $use_html ? 0 : $maxlength;
// Make sure posted data is an array
$post = !is_array($post) ? array($post) : $post;
// Reformat the posted data
$newpost = array();
$new = 0;
foreach ($post as $n => $v) {
// support for basic CSV import / export
if ($is_importcsv && !is_array($v)) {
if (@unserialize($v) !== false || $v === 'b:0;') {
// support for exported serialized data)
$v = unserialize($v);
} else {
$v = array('title' => $v, 'text' => '');
}
}
// **************************************************************
// Validate data, skipping values that are empty after validation
// **************************************************************
$title = flexicontent_html::dataFilter($v['title'], $maxlength, 'HTML', 0);
// Skip empty value, but if in group increment the value position
if (!strlen($title)) {
if ($use_ingroup) {
$newpost[$new++] = null;
}
continue;
}
$newpost[$new] = array();
$newpost[$new]['title'] = $title;
$newpost[$new]['text'] = flexicontent_html::dataFilter($v['text'], $maxlength, $validation, 0);
$new++;
}
$post = $newpost;
// Serialize multi-property data before storing them into the DB,
// null indicates to increment valueorder without adding a value
foreach ($post as $i => $v) {
if ($v !== null) {
$post[$i] = serialize($v);
}
}
/*if ($use_ingroup) {
$app = JFactory::getApplication();
$app->enqueueMessage( print_r($post, true), 'warning');
}*/
}
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:59,代码来源:termlist.php
示例10: decideLayout
/**
* Method to decide which item layout to use
*
* @access public
* @param int item identifier
*/
function decideLayout(&$params)
{
// *********************************************************************************
// Get category layout from configuration if not already set (e.g. via HTTP Request)
// *********************************************************************************
//echo "decideLayout: ". $this->_clayout ."<br/>";
$clayout = $this->_clayout;
if (!$clayout) {
// Decide to use mobile or normal category template layout
$useMobile = $params->get('use_mobile_layouts', 0);
if ($useMobile) {
$force_desktop_layout = $params->get('force_desktop_layout', 0);
$mobileDetector = flexicontent_html::getMobileDetector();
$isMobile = $mobileDetector->isMobile();
$isTablet = $mobileDetector->isTablet();
$useMobile = $force_desktop_layout ? $isMobile && !$isTablet : $isMobile;
}
$desktop_clayout = $params->get('clayout', 'blog');
$clayout = !$useMobile ? $desktop_clayout : $params->get('clayout_mobile', $desktop_clayout);
}
// Get cached template data, without loading language file, (this will be done at the view)
$themes = flexicontent_tmpl::getTemplates(null);
// *********************************
// Verify the category layout exists
// *********************************
if (!isset($themes->category->{$clayout})) {
$cat_default_layout = 'blog';
// Layout default
$fixed_clayout = isset($themes->category->{$cat_default_layout}) ? $cat_default_layout : 'default';
JFactory::getApplication()->enqueueMessage("<small>Current category Layout (template) is '{$clayout}' does not exist<br/>- Please correct this in the URL or in Content Type configuration.<br/>- Using Template Layout: '{$fixed_clayout}'</small>", 'notice');
$clayout = $fixed_clayout;
FLEXIUtilities::loadTemplateLanguageFile($clayout);
// Manually load Template-Specific language file of back fall clayout
}
// *****************************************************************************************
// Finally set the clayout (template name) into model / category's parameters / HTTP Request
// *****************************************************************************************
$this->setCatLayout($clayout);
$params->set('clayout', $clayout);
JRequest::setVar('clayout', $clayout);
}
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:47,代码来源:category.php
示例11: onDisplayFieldValue
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;
}
// Get isMobile / isTablet Flags
static $isMobile = null;
static $isTablet = null;
static $useMobile = null;
if ($useMobile === null) {
$cparams = JComponentHelper::getParams('com_flexicontent');
$force_desktop_layout = $cparams->get('force_desktop_layout', 0);
//$start_microtime = microtime(true);
$mobileDetector = flexicontent_html::getMobileDetector();
$isMobile = $mobileDetector->isMobile();
$isTablet = $mobileDetector->isTablet();
$useMobile = $force_desktop_layout ? $isMobile && !$isTablet : $isMobile;
//$time_passed = round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10;
//printf('<br/>-- [Detect Mobile: %.3f s] ', $time_passed/1000000);
}
$field->label = JText::_($field->label);
// some parameter shortcuts
$target = $field->parameters->get('targetblank', 0);
$target_param = $target ? ' target="_blank"' : '';
$display_hits = $field->parameters->get('display_hits', 0);
$add_hits_img = $display_hits == 1 || $display_hits == 3;
$add_hits_txt = $display_hits == 2 || $display_hits == 3 || $isMobile;
$rel_nofollow = $field->parameters->get('add_rel_nofollow', 0) ? ' rel="nofollow"' : '';
// This is field 's MAIN value property
$link_usage = $field->parameters->get('link_usage', 0);
$default_link = $link_usage == 2 ? $field->parameters->get('default_value_link', '') : '';
// Optional value properties
$usetitle = $field->parameters->get('use_title', 0);
$title_usage = $field->parameters->get('title_usage', 0);
$default_title = $title_usage == 2 ? JText::_($field->parameters->get('default_value_title', '')) : '';
// Get field values
$values = $values ? $values : $field->value;
// DO NOT terminate yet if value is empty since a default value on empty may have been defined
// Handle default value loading, instead of empty value
if (empty($values) && !strlen($default_link)) {
$field->{$prop} = '';
return;
} else {
if (empty($values) && strlen($default_link)) {
$values = array();
$values[0]['link'] = JText::_($default_link);
$values[0]['title'] = JText::_($default_title);
$values[0]['hits'] = 0;
$values[0] = serialize($values[0]);
}
}
// Value handling parameters
$multiple = $field->parameters->get('allow_multiple', 1);
// Prefix - Suffix - Separator parameters, replacing other field values if found
$remove_space = $field->parameters->get('remove_space', 0);
$pretext = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('pretext', ''), 'pretext');
$posttext = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('posttext', ''), 'posttext');
$separatorf = $field->parameters->get('separatorf', 1);
$opentag = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('opentag', ''), 'opentag');
$closetag = FlexicontentFields::replaceFieldValue($field, $item, $field->parameters->get('closetag', ''), 'closetag');
if ($pretext) {
$pretext = $remove_space ? $pretext : $pretext . ' ';
}
if ($posttext) {
$posttext = $remove_space ? $posttext : ' ' . $posttext;
}
switch ($separatorf) {
case 0:
$separatorf = ' ';
break;
case 1:
$separatorf = '<br />';
break;
case 2:
$separatorf = ' | ';
break;
case 3:
$separatorf = ', ';
break;
case 4:
$separatorf = $closetag . $opentag;
break;
case 5:
$separatorf = '';
break;
default:
$separatorf = ' ';
break;
}
// Optimization, do some stuff outside the loop
static $hits_icon = null;
if ($hits_icon === null && ($display_hits == 1 || $display_hits == 3)) {
$_attribs = $display_hits == 1 ? 'class="hasTip" title=":: %s ' . JText::_('FLEXI_HITS', true) . '"' : '';
$hits_icon = FLEXI_J16GE ? JHTML::image('components/com_flexicontent/assets/images/' . 'user.png', JText::_('FLEXI_HITS'), $_attribs) : JHTML::_('image.site', 'user.png', 'components/com_flexicontent/assets/images/', NULL, NULL, JText::_('FLEXI_HITS'), $_attribs);
}
// needed for backend display
//if ($display_hits)
// $isAdmin = JFactory::getApplication()->isAdmin();
// initialise property
//.........这里部分代码省略.........
开发者ID:jakesyl,项目名称:flexicontent,代码行数:101,代码来源:weblink.php
示例12: onBeforeSaveField
function onBeforeSaveField(&$field, &$post, &$file, &$item)
{
if (!in_array($field->field_type, self::$field_types)) {
return;
}
$use_ingroup = $field->parameters->get('use_ingroup', 0);
if (!is_array($post) && !strlen($post) && !$use_ingroup) {
return;
}
// Make sure posted data is an array
//echo "<pre>"; print_r($post); exit;
$post = !is_array($post) ? array($post) : $post;
//echo "<pre>"; print_r($post);
// Get configuration
$inputmode = (int) $field->parameters->get('inputmode', 1);
$is_importcsv = JRequest::getVar('task') == 'importcsv';
$import_docs_folder = JRequest::getVar('import_docs_folder');
$iform_allowdel = $field->parameters->get('iform_allowdel', 1);
$iform_title = $inputmode == 1 ? 0 : $field->parameters->get('iform_title', 1);
$iform_desc = $inputmode == 1 ? 0 : $field->parameters->get('iform_desc', 1);
$iform_lang = $inputmode == 1 ? 0 : $field->parameters->get('iform_lang', 0);
$iform_dir = $inputmode == 1 ? 0 : $field->parameters->get('iform_dir', 0);
// Execute once
static $initialized = null;
static $srcpath_original = '';
if (!$initialized) {
$initialized = 1;
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.path');
$srcpath_original = JPath::clean(JPATH_SITE . DS . $import_docs_folder . DS);
}
$newpost = array();
$new = 0;
foreach ($post as $n => $v) {
if (empty($v)) {
if ($use_ingroup) {
// empty value for group
$newpost[$new] = '';
$new++;
}
continue;
}
// support for basic CSV import / export
if ($is_importcsv) {
if (!is_numeric($v)) {
$filename = basename($v);
$sub_folder = dirname($v);
$sub_folder = $sub_folder && $sub_folder != '.' ? DS . $sub_folder : '';
$fman = new FlexicontentControllerFilemanager();
$Fobj = new stdClass();
$Fobj->return_url = null;
$Fobj->file_dir_path = DS . $import_docs_folder . $sub_folder;
$Fobj->file_filter_re = preg_quote($filename);
$Fobj->secure = 0;
$Fobj->keep = 1;
$file_ids = $fman->addlocal($Fobj);
$v = !empty($file_ids) ? reset($file_ids) : false;
// Get fist element
//$_filetitle = key($file_ids); this is the cleaned up filename, currently not needed
}
} else {
$file_id = isset($v['file-id']) ? (int) $v['file-id'] : $v;
$file_id = is_numeric($file_id) ? (int) $file_id : 0;
// if $v is not an array
$err_code = $_FILES["custom"]["error"][$field->name][$n]['file-data'];
$new_file = $err_code == 0;
if ($err_code && $err_code != UPLOAD_ERR_NO_FILE) {
$err_msg = array(UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini', UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded', UPLOAD_ERR_NO_FILE => 'No file was uploaded', UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder', UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk', UPLOAD_ERR_EXTENSION => 'A PHP extension stopped the file upload');
JFactory::getApplication()->enqueueMessage("FILE FIELD: " . $err_msg[$err_code], 'warning');
continue;
}
// validate data or empty/set default values
$v['file-del'] = !$iform_allowdel ? 0 : (int) @$v['file-del'];
$v['file-title'] = !$iform_title ? '' : flexicontent_html::dataFilter($v['file-title'], 1000, 'STRING', 0);
$v['file-desc'] = !$iform_desc ? '' : flexicontent_html::dataFilter($v['file-desc'], 10000, 'STRING', 0);
$v['file-lang'] = !$iform_lang ? '' : flexicontent_html::dataFilter($v['file-lang'], 9, 'STRING', 0);
$v['secure'] = !$iform_dir ? 0 : ((int) $v['secure'] ? 1 : 0);
// UPDATE existing file
if (!$new_file && $file_id) {
$dbdata = array();
$dbdata['id'] = $file_id;
if ($iform_title) {
$dbdata['altname'] = $v['file-title'];
}
if ($iform_desc) {
$dbdata['description'] = $v['file-desc'];
}
if ($iform_lang) {
$dbdata['language'] = $v['file-lang'];
}
// !! Do not change folder for existing files
//if ($iform_dir) { $dbdata['secure'] = $v['secure'];
// Load file data from DB
$row = JTable::getInstance('flexicontent_files', '');
$row->load($file_id);
$_filename = $row->filename_original ? $row->filename_original : $row->filename;
$dbdata['secure'] = $row->secure ? 1 : 0;
// !! Do not change media/secure -folder- for existing files
// Security concern, check file is assigned to current item
$isAssigned = $this->checkFileAssignment($field, $file_id, $item);
//.........这里部分代码省略.........
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:101,代码来源:minigallery.php
示例13:
echo $orderby_selector;
?>
</span>
</span>
<?php
}
?>
<?php
if ($orderby_selector_2nd) {
?>
<span class="fc_orderby_box <?php
echo $tooltip_class;
?>
" title="<?php
echo flexicontent_html::getToolTip('FLEXI_ORDERBY', 'FLEXI_ORDERBY_INFO', 1, 1);
?>
">
<span class="fc_orderby_selector"><?php
echo $orderby_selector_2nd;
?>
</span>
</span>
<?php
}
?>
<span class="fc_pages_counter">
<span class="label"><?php
echo $this->pageNav->getPagesCounter();
?>
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:31,代码来源:listings_filter_form_body_html5.php
示例14: 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;
}
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:68,代码来源:fields.php
示例15: display
/**
* Creates the RSS for the View
*
* @since 1.0
*/
function display($tpl = null)
{
$db = JFactory::getDBO();
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$params = $this->get('Params');
$doc->link = JRoute::_('index.php?option=com_flexicontent&view=flexicontent&rootcat=' . (int) $params->get('rootcat', FLEXI_J16GE ? 1 : 0));
JRequest::setVar('limit', $params->get('feed_limit'));
// Force a specific limit, this will be moved to the model
$cats = $this->get('Feed');
//$feed_summary = $params->get('feed_summary', 0);
$feed_summary_cut = $params->get('feed_summary_cut', 200);
$feed_use_image = $params->get('feed_use_image', 1);
$feed_image_source = $params->get('feed_image_source', '');
$feed_link_image = $params->get('feed_link_image', 1);
$feed_image_method = $params->get('feed_image_method', 1);
$feed_image_width = $params->get('feed_image_width', 100);
$feed_image_height = $params->get('feed_image_height', 80);
// Retrieve default image for the image field
if ($feed_use_image && $feed_image_source) {
$query = 'SELECT attribs, name FROM #__flexicontent_fields WHERE id = ' . (int) $feed_image_source;
$db->setQuery($query);
$image_dbdata = $db->loadObject();
//$image_dbdata->params = FLEXI_J16GE ? new JRegistry($image_dbdata->params) : new JParameter($image_dbdata->params);
$img_size_map = array('l' => 'large', 'm' => 'medium', 's' => 'small', '' => '');
$img_field_size = $img_size_map[$image_size];
$img_field_name = $image_dbdata->name;
}
foreach ($cats as $cat) {
// strip html from feed item title
$title = $this->escape($cat->title);
$title = html_entity_decode($title);
// url link to article
// & used instead of & as this is converted by feed creator
$link = JRoute::_(FlexicontentHelperRoute::getCategoryRoute($cat->slug));
// strip html from feed item description text
$description = $cat->description;
//$feed_summary ? $cat->description : '';
$description = flexicontent_html::striptagsandcut($description, $feed_summary_cut);
if ($feed_use_image) {
// feed image is enabled
// Get some variables
$joomla_image_path = $app->getCfg('image_path', FLEXI_J16GE ? '' : 'images' . DS . 'stories');
$joomla_image_url = str_replace(DS, '/', $joomla_image_path);
$joomla_image_path = $joomla_image_path ? $joomla_image_path . DS : '';
$joomla_image_url = $joomla_image_url ? $joomla_image_url . '/' : '';
// **************
// CATEGORY IMAGE
// **************
// category image params
$show_cat_image = $params->get('show_description_image', 0);
// we use different name for variable
$cat_image_source = $params->get('cat_image_source', 2);
// 0: extract, 1: use param, 2: use both
$cat_link_image = $params->get('cat_link_image', 1);
$cat_image_method = $params->get('cat_image_method', 1);
$cat_image_width = $params->get('cat_image_width', 80);
$cat_image_height = $params->get('cat_image_height', 80);
$cat =& $category;
$thumb = "";
if ($cat->id && $show_cat_image) {
$cat->image = FLEXI_J16GE ? $params->get('image') : $cat->image;
$thumb = "";
$cat->introtext =& $cat->description;
$cat->fulltext = "";
if ($cat_image_source && $cat->image && JFile::exists(JPATH_SITE . DS . $joomla_image_path . $cat->image)) {
$src = JURI::base(true) . "/" . $joomla_image_url . $cat->image;
$h = '&h=' . $cat_image_height;
$w = '&w=' . $cat_image_width;
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $cat_image_method ? '&zc=' . $cat_image_method : '';
$ext = pathinfo($src, PATHINFO_EXTENSION);
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
$conf = $w . $h . $aoe . $q . $zc . $f;
$thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
} else {
if ($cat_image_source != 1 && ($src = flexicontent_html::extractimagesrc($cat))) {
$h = '&h=' . $feed_image_height;
$w = '&w=' . $feed_image_width;
$aoe = '&aoe=1';
$q = '&q=95';
$zc = $feed_image_method ? '&zc=' . $feed_image_method : '';
$ext = pathinfo($src, PATHINFO_EXTENSION);
$f = in_array($ext, array('png', 'ico', 'gif')) ? '&f=' . $ext : '';
$conf = $w . $h . $aoe . $q . $zc . $f;
$base_url = !preg_match("#^http|^https|^ftp|^/#i", $src) ? JURI::base(true) . '/' : '';
$src = $base_url . $src;
$thumb = JURI::base(true) . '/components/com_flexicontent/librairies/phpthumb/phpThumb.php?src=' . $src . $conf;
}
}
}
if ($thumb) {
$description = "<a href='" . $link . "'><img src='" . $thumb . "' alt='" . $title . "' title='" . $title . "' align='left'/></a><p>" . $description . "</p>";
}
//.........这里部分代码省略.........
开发者ID:noxidsoft,项目名称:flexicontent-cck,代码行数:101,代码来源:view.feed.php
示例16: display
/**
* Creates the page's display
*
* @since 1.0
*/
function display($tpl = null)
{
//initialize variables
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$menus = $app->getMenu();
$menu = $menus->getActive();
$uri = JFactory::getURI();
$view = JRequest::getCmd('view');
// Get view
|
请发表评论