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


PHP cmsFramework::language方法代码示例

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


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

示例1: onDisplay

 function onDisplay($field, $showImage = true, $value = false, $return = false)
 {
     if (empty($field)) {
         return null;
     }
     $values = array();
     $option = $value ? 'value' : 'text';
     foreach ($field[$option] as $key => $text) {
         switch ($field['type']) {
             case 'date':
                 $format = Sanitize::getString($field['properties'], 'date_format');
                 $text = $this->Time->nice($text, $format, 0);
                 break;
             case 'integer':
                 $text = Sanitize::getInt($field['properties'], 'curr_format') ? number_format($text) : $text;
                 break;
             case 'decimal':
                 $text = Sanitize::getInt($field['properties'], 'curr_format') ? number_format($text, 2, __l('DECIMAL_SEPARATOR', true), __l('THOUSANDS_SEPARATOR', true)) : round($text, 2);
                 break;
             case 'email':
                 break;
             case 'website':
                 $text = S2ampReplace($text);
                 break;
             case 'code':
                 $text = stripslashes($text);
                 break;
             case 'textarea':
             case 'text':
                 if (!Sanitize::getBool($field['properties'], 'allow_html')) {
                     $text = nl2br($text);
                 }
                 break;
             case 'selectmultiple':
             case 'checkboxes':
             case 'select':
             case 'radiobuttons':
                 $imgSrc = '';
                 if ($showImage && isset($field['image'][$key]) && $field['image'][$key] != '') {
                     if ($imgSrc = $this->locateThemeFile('theme_images', cmsFramework::language() . '.' . $field['image'][$key], '', true)) {
                         $imgSrc = pathToUrl($imgSrc);
                     } elseif ($imgSrc = $this->locateThemeFile('theme_images', $field['image'][$key], '', true)) {
                         $imgSrc = pathToUrl($imgSrc);
                     }
                     if ($imgSrc != '') {
                         $text = '<img src="' . $imgSrc . '" title="' . $text . '" alt="' . $text . '" border="0" />';
                     }
                 }
                 break;
             default:
                 $text = stripslashes($text);
                 break;
         }
         $values[] = $text;
         $this->output[] = $text;
     }
     if ($return) {
         return $values;
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:60,代码来源:custom_fields.php

示例2: getTree

 /**
  * Joomla 1.5 only method
  * 
  * @param string $dir_id
  * @param mixed $module
  * @return string
  */
 function getTree($dir_id, $module = false)
 {
     // Clean $dir_id string
     $cleaned = array();
     $section_count = null;
     $bits = explode(',', $dir_id);
     foreach ($bits as $bit) {
         if (is_numeric($bit)) {
             $cleaned[] = $bit;
         }
     }
     $dir_id = implode(',', $cleaned);
     $Config = Configure::read('JreviewsSystem.Config');
     $Access = Configure::read('JreviewsSystem.Access');
     $aid = $Access->getAccessId();
     $module and $Config->dir_category_limit = '';
     // Ignore category limit setting in dir module
     # Check for cached version
     $cache_prefix = 'directory_mode_gettree';
     $cache_key = array(func_get_args(), $aid, cmsFramework::language());
     if ($cache = S2cacheRead($cache_prefix, $cache_key)) {
         return $cache;
     }
     # First get list of sections for current dir
     $query = "\n            SELECT \n                Category.section AS `Section.section_id`,\n                JreviewsCategory.dirid AS `Directory.dir_id`\n            FROM \n                #__jreviews_categories AS JreviewsCategory                             \n            LEFT JOIN \n                #__jreviews_directories AS Directory ON Directory.id = JreviewsCategory.dirid\n            RIGHT JOIN \n                #__categories AS Category ON Category.id = JreviewsCategory.id\n            LEFT JOIN \n                #__sections AS Section ON Category.section = Section.id\n            WHERE \n                Section.published = 1\n                AND Section.access <= {$aid}" . ($dir_id ? " AND JreviewsCategory.dirid IN ({$dir_id}) " : '') . "\n            AND JreviewsCategory.`option` = 'com_content'\n            ORDER BY \n                Directory.`desc` ASC \n            ";
     $query = $this->_db->setQuery($query);
     $tmp_key = $this->primaryKey;
     $this->primaryKey = 'Section.section_id';
     $sections = $this->_db->loadObjectList();
     $sections = $this->__reformatArray($sections);
     $this->primaryKey = $tmp_key;
     $section_ids = array_keys($sections);
     // Get listing count for sections
     $Config->dir_section_num_entries = $Config->dir_cat_num_entries;
     if ($Config->dir_section_num_entries || $Config->dir_category_hide_empty) {
         $query = '
             SELECT  
                 Listing.sectionid AS `Section.section_id`, 
                 COUNT(Listing.id) AS `Section.listing_count` 
             FROM 
                 #__content AS Listing
             INNER JOIN
                 #__jreviews_categories AS JreviewsCategory ON JreviewsCategory.id = Listing.catid AND JreviewsCategory.`option` = "com_content"
             WHERE 
                 Listing.sectionid IN (' . implode(',', $section_ids) . ')  
                 AND Listing.state = 1
                 AND Listing.access <= ' . $aid . '
                 AND ( Listing.publish_up = "' . NULL_DATE . '" OR Listing.publish_up <= "' . _CURRENT_SERVER_TIME . '" ) 
                 AND ( Listing.publish_down = "' . NULL_DATE . '" OR Listing.publish_down >= "' . _CURRENT_SERVER_TIME . '" )
             GROUP BY Listing.sectionid
          ';
         $this->_db->setQuery($query);
         //prx($this->_db->getQuery());
         $tmp_key = $this->primaryKey;
         $this->primaryKey = 'Section.section_id';
         $section_count = $this->_db->loadObjectList();
         $section_count = $this->__reformatArray($section_count);
         $this->primaryKey = $tmp_key;
     }
     # If category limit is zero then don't query the categories
     if ($Config->dir_category_limit === '0') {
         $tmp_key = $this->primaryKey;
         $this->primaryKey = 'Category.cat_id';
         $query = '
             SELECT 
                 Directory.id AS `Directory.dir_id`,
                 Directory.`desc` AS `Directory.title`,
                 Directory.title AS `Directory.slug`,                    
                 Section.id AS `Section.section_id`,
                 Section.name  AS `Section.name`,
                 Section.title AS `Section.title`,
                 Section.image AS `Section.image`,
                 Section.published AS `Section.published`,
                 Section.access AS `Section.access`,
                 Section.alias AS `Section.slug`,   
                 Section.ordering AS `Section.ordering`   
             FROM
                 #__jreviews_categories AS JreviewsCategory 
             RIGHT JOIN    
                  #__categories AS Category USING(id)
             LEFT JOIN
                 #__sections AS Section ON Section.id = Category.section
             LEFT JOIN
                 #__jreviews_directories AS Directory ON JreviewsCategory.dirid = Directory.id
             WHERE 
                 Category.published = 1
                 AND Section.access <= ' . $aid . '
                 AND Category.access <= ' . $aid . '
                 AND Category.section IN (' . implode(',', $section_ids) . ')         
                 AND JreviewsCategory.`option` = "com_content"                    
             GROUP BY
                 Category.section
             ORDER BY 
//.........这里部分代码省略.........
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:101,代码来源:directory.php


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