getActiveLanguages() 공개 정적인 메소드

Get the active languages
public static getActiveLanguages ( ) : array
리턴 array
예제 #1
0
 /**
  * Get the active languages
  *
  * @deprecated
  *
  * @return array
  */
 public static function getActiveLanguages()
 {
     trigger_error('Backend\\Core\\Engine\\Language is deprecated.
          It has been moved to Backend\\Core\\Language\\Language', E_USER_DEPRECATED);
     return parent::getActiveLanguages();
 }
예제 #2
0
 /**
  * Convert a var into a URL
  * syntax: {{ geturl:<action>[:<module>] }}
  *
  * @param string $action The action to build the URL for.
  * @param string $module The module to build the URL for.
  * @param string $suffix A string to append.
  * @param string $language A language code
  *
  * @return string
  */
 public static function getURL($action = null, $module = null, $suffix = null, $language = null)
 {
     if (!in_array($language, BackendLanguage::getActiveLanguages())) {
         $language = BackendLanguage::getWorkingLanguage();
     }
     $action = $action !== null ? (string) $action : null;
     $module = $module !== null ? (string) $module : null;
     return BackendModel::createURLForAction($action, $module, $language) . $suffix;
 }
예제 #3
0
파일: Model.php 프로젝트: forkcms/forkcms
 /**
  * Install a module.
  *
  * @param string $module   The name of the module to be installed.
  */
 public static function installModule($module)
 {
     $class = 'Backend\\Modules\\' . $module . '\\Installer\\Installer';
     $variables = array();
     // run installer
     $installer = new $class(BackendModel::getContainer()->get('database'), BL::getActiveLanguages(), array_keys(BL::getInterfaceLanguages()), false, $variables);
     $installer->install();
     // clear the cache so locale (and so much more) gets rebuilt
     self::clearCache();
 }
예제 #4
0
파일: Api.php 프로젝트: forkcms/forkcms
 /**
  * Get info about the site.
  *
  * @return array
  */
 public static function getInfo()
 {
     trigger_error('The api is deprecated and will be removed in version 5', E_USER_DEPRECATED);
     if (BaseAPI::isAuthorized()) {
         $info = array();
         // get all languages
         $languages = BackendLanguage::getActiveLanguages();
         $default = Model::get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);
         // loop languages
         foreach ($languages as $language) {
             // create array
             $var = array();
             // set attributes
             $var['language']['@attributes']['language'] = $language;
             if ($language == $default) {
                 $var['language']['@attributes']['is_default'] = 'true';
             }
             // set attributes
             $var['language']['title'] = Model::get('fork.settings')->get('Core', 'site_title_' . $language);
             $var['language']['url'] = SITE_URL . '/' . $language;
             // add
             $info['languages'][] = $var;
         }
         return $info;
     }
 }