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


PHP FLEXIUtilities::getlanguageslist方法代码示例

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


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

示例1: 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

示例2: 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

示例3: getLanguages

 /**
  * Method to build an array of languages hashed by id or by language code
  *
  * @return object
  * @since 1.5
  */
 static function getLanguages($hash = 'code', $published_only = false)
 {
     static $langs = array();
     static $languages;
     if (isset($langs[$hash])) {
         return $langs[$hash];
     }
     if (!$languages) {
         $languages = FLEXIUtilities::getlanguageslist($published_only);
     }
     $langs[$hash] = new stdClass();
     foreach ($languages as $language) {
         $langs[$hash]->{$language->{$hash}} = $language;
     }
     return $langs[$hash];
 }
开发者ID:nettdotkomm,项目名称:flexicontent-cck,代码行数:22,代码来源:flexicontent.helper.php

示例4: _loadItem


//.........这里部分代码省略.........
                 // Check for SQL error
                 if ($db->getErrorNum()) {
                     if (FLEXI_J16GE) {
                         throw new Exception($db->getErrorMsg(), 500);
                     } else {
                         JError::raiseError(500, $db->getErrorMsg());
                     }
                 }
                 //print_r($data); exit;
                 if (!$data) {
                     return false;
                 }
                 // item not found, return
                 if ($version && !$data->version_id) {
                     JError::raiseNotice(10, JText::sprintf('NOTICE: Requested item version %d was not found', $version));
                 }
                 $item =& $data;
             }
             // -- Create the description field called 'text' by appending introtext + readmore + fulltext
             $item->text = $item->introtext;
             $item->text .= JString::strlen(trim($item->fulltext)) ? '<hr id="system-readmore" />' . $item->fulltext : "";
             //echo "<br/>Current version (Frontend Active): " . $item->version;
             //echo "<br/>Version to load: ".$version;
             //echo "<br/><b> *** db title:</b> ".$item->title;
             //echo "<br/><b> *** db text:</b> ".$item->text;
             //echo "<pre>*** item data: "; print_r($item); echo "</pre>"; exit;
             // Set number of loaded version, IMPORTANT: zero means load unversioned data
             JRequest::setVar('version', $version);
             // *************************************************************************************************
             // -- Retrieve all active site languages, and create empty item translation objects for each of them
             // *************************************************************************************************
             $nn_content_tbl = FLEXI_J16GE ? 'falang_content' : 'jf_content';
             if (FLEXI_FISH) {
                 $site_languages = FLEXIUtilities::getlanguageslist();
                 $item_translations = new stdClass();
                 foreach ($site_languages as $lang_id => $lang_data) {
                     if (!$lang_id && $item->language != '*') {
                         continue;
                     }
                     $lang_data->fields = new stdClass();
                     $item_translations->{$lang_id} = $lang_data;
                 }
             }
             // **********************************
             // Retrieve and prepare JoomFish data
             // **********************************
             if (FLEXI_FISH && $task == 'edit' && $option == 'com_flexicontent') {
                 // -- Try to retrieve all joomfish data for the current item
                 $query = "SELECT jfc.language_id, jfc.reference_field, jfc.value, jfc.published " . " FROM #__" . $nn_content_tbl . " as jfc " . " WHERE jfc.reference_table='content' AND jfc.reference_id = {$this->_id} ";
                 $db->setQuery($query);
                 $translated_fields = $db->loadObjectList();
                 if ($editjf_translations == 0 && $translated_fields) {
                     // 1:disable without warning about found translations
                     $app->enqueueMessage("3rd party Joom!Fish/Falang translations detected for current item." . " You can either enable editing them or disable this message in FLEXIcontent component configuration", 'message');
                 } else {
                     if ($editjf_translations == 2) {
                         if ($db->getErrorNum()) {
                             JFactory::getApplication()->enqueueMessage(__FUNCTION__ . '(): SQL QUERY ERROR:<br/>' . nl2br($db->getErrorMsg()), 'error');
                         }
                         // -- Parse translation data according to their language
                         if ($translated_fields) {
                             // Add retrieved translated item properties
                             foreach ($translated_fields as $field_data) {
                                 $item_translations->{$field_data->language_id}->fields->{$field_data->reference_field} = new stdClass();
                                 $item_translations->{$field_data->language_id}->fields->{$field_data->reference_field}->value = $field_data->value;
                                 $found_languages[$field_data->language_id] = $item_translations->{$field_data->language_id}->name;
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:67,代码来源:parentclassitem.php


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