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


PHP eZPackage::languageInfoFromPackageList方法代码示例

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


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

示例1: init

 function init()
 {
     /*
     if( $this->hasKickstartData() )
     {
         $data = $this->kickstartData();
     
         return $this->kickstartContinueNextStep();
     }
     */
     //
     // Get all available languages
     //
     $languages = false;
     $defaultLanguage = false;
     $defaultExtraLanguages = false;
     eZSetupLanguageList($languages, $defaultLanguage, $defaultExtraLanguages);
     //
     // Get info about package and site languages
     //
     $siteLanguageLocaleList = $this->PersistenceList['regional_info']['languages'];
     $packageNameList = array();
     $packageLanguageLocaleList = array();
     $sitePackageName = $this->chosenSitePackage();
     $sitePackage = eZPackage::fetch($sitePackageName, false, false, false);
     if (is_object($sitePackage)) {
         $dependencies = $sitePackage->attribute('dependencies');
         $requirements = $dependencies['requires'];
         foreach ($requirements as $req) {
             $packageNameList[] = $req['name'];
         }
         $packageLanguageLocaleList = eZPackage::languageInfoFromPackageList($packageNameList, false);
     }
     // Explicitly add 'eng-GB' cause clean data is in 'eng-GB'.
     if (!in_array('eng-GB', $packageLanguageLocaleList)) {
         $packageLanguageLocaleList[] = 'eng-GB';
     }
     //
     // Exclude languages which exist both in packges and site.
     //
     $packageLanguageLocaleList = array_diff($packageLanguageLocaleList, $siteLanguageLocaleList);
     if (count($packageLanguageLocaleList) > 0) {
         //
         // Get language names
         //
         $siteLanguageList = array();
         $packageLanguageList = array();
         foreach ($languages as $language) {
             $locale = $language->attribute('locale_code');
             $name = $language->attribute('intl_language_name');
             if (in_array($locale, $siteLanguageLocaleList)) {
                 $siteLanguageList[] = array('locale' => $locale, 'name' => $name);
             }
             if (in_array($locale, $packageLanguageLocaleList)) {
                 $packageLanguageList[] = array('locale' => $locale, 'name' => $name);
             }
         }
         $this->MissedPackageLanguageList = $packageLanguageList;
         $this->SiteLanguageList = $siteLanguageList;
         return false;
     }
     // There are no language conflicts => proceed with next step
     return true;
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:64,代码来源:ezstep_package_language_options.php


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