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


PHP JoomFishManager::getLanguages方法代码示例

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


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

示例1: define

    //Global definitions
    if (!defined('DS')) {
        define('DS', DIRECTORY_SEPARATOR);
    }
    if (!defined('JOOMFISH_PATH')) {
        define('JOOMFISH_PATH', JPATH_SITE . 'components' . DS . 'com_joomfish');
        define('JOOMFISH_ADMINPATH', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomfish');
        define('JOOMFISH_LIBPATH', JOOMFISH_ADMINPATH . DS . 'libraries');
        define('JOOMFISH_LANGPATH', JOOMFISH_PATH . DS . 'language');
        define('JOOMFISH_URL', '/components/com_joomfish');
    }
    //	require_once( JOOMFISH_LIBPATH .DS. 'joomla' .DS. 'language.php' );
    //	require_once( JOOMFISH_LIBPATH .DS. 'joomla' .DS. 'registry.php' );
    $lang = JFactory::getLanguage();
    $lang->load('com_joomfish');
    $langActive = JoomFishManager::getLanguages(true);
    $langOptions[] = JHTML::_('select.option', -1, JText::_("SELECT LANGUAGE"));
    if (count($langActive) > 0) {
        foreach ($langActive as $language) {
            $langOptions[] = JHTML::_('select.option', $language->id, $language->name);
        }
    }
    $langlist = JHTML::_('select.genericlist', $langOptions, 'select_language_id', 'id="select_language_id" class="inputbox"  size="1" onChange="translateItem();"', 'value', 'text', -1);
    //$langActive[0]->id );
    // I also need to trap component specific actions e.g. pony gallery uses
    ?>
<span class='modtranslate'>
<script language="JavaScript" type="text/javascript">
function translateItem(){
	var langCode=document.getElementById('select_language_id').value;
	var option="<?php 
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:mod_translate.php

示例2: getActiveLanguages

 /** Creates an array with all the active languages for the JoomFish
  *
  * @return	Array of languages
  */
 function getActiveLanguages()
 {
     /* if signed in as Manager or above include inactive languages too */
     $user =& JFactory::getUser();
     if (isset($this) && $this->getCfg("frontEndPreview") && isset($user) && (strtolower($user->usertype) == "manager" || strtolower($user->usertype) == "administrator" || strtolower($user->usertype) == "super administrator")) {
         if (isset($this) && isset($this->allLanguagesCache)) {
             return $this->allLanguagesCache;
         }
     } else {
         if (isset($this) && isset($this->activeLanguagesCache)) {
             return $this->activeLanguagesCache;
         }
     }
     return JoomFishManager::getLanguages(true);
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:19,代码来源:JoomfishManager.class.php


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