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


PHP eZContentLanguage::languagesByMask方法代码示例

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


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

示例1: attributeDecoder

    function attributeDecoder( $event, $attr )
    {
        switch ( $attr )
        {
            case 'selected_sections':
            {
                $attributeValue = trim( $event->attribute( 'data_text1' ) );
                $returnValue = empty( $attributeValue ) ? array( -1 ) : explode( ',', $attributeValue );
            }break;

            case 'approve_users':
            {
                $attributeValue = trim( $event->attribute( 'data_text3' ) );
                $returnValue = empty( $attributeValue ) ? array() : explode( ',', $attributeValue );
            }break;

            case 'approve_groups':
            {
                $attributeValue = trim( $event->attribute( 'data_text4' ) );
                $returnValue = empty( $attributeValue ) ? array() : explode( ',', $attributeValue );
            }break;

            case 'selected_usergroups':
            {
                $attributeValue = trim( $event->attribute( 'data_text2' ) );
                $returnValue = empty( $attributeValue ) ? array() : explode( ',', $attributeValue );
            }break;

            case 'language_list':
            {
                $returnValue = array();
                $attributeValue = $event->attribute( 'data_int2' );
                if ( $attributeValue != 0 )
                {
                    $languages = eZContentLanguage::languagesByMask( $attributeValue );
                    foreach ( $languages as $language )
                    {
                        $returnValue[$language->attribute( 'id' )] = $language->attribute( 'name' );
                    }
                }
            }break;

            case 'version_option':
            {
                $returnValue = eZApproveType::VERSION_OPTION_ALL & $event->attribute( 'data_int3' );
            }break;

            default:
                $returnValue = null;
        }
        return $returnValue;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:52,代码来源:ezapprovetype.php

示例2: allLanguages

 /**
  * @return eZContentLanguage[]|array
  */
 function allLanguages()
 {
     $languages = isset( $this->LanguageMask ) ? eZContentLanguage::languagesByMask( $this->LanguageMask ) : array();
     return $languages;
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:8,代码来源:ezcontentobject.php

示例3: copyTranslations

 public static function copyTranslations($objectID, $versionNum)
 {
     $object = eZContentObject::fetch($objectID);
     $publishedVersionNum = $object->attribute('current_version');
     if (!$publishedVersionNum) {
         return;
     }
     $publishedVersion = $object->version($publishedVersionNum);
     $publishedVersionTranslations = $publishedVersion->translations();
     $publishedLanguages = eZContentLanguage::languagesByMask($object->attribute('language_mask'));
     $publishedLanguageCodes = array_keys($publishedLanguages);
     $version = $object->version($versionNum);
     $versionTranslationList = $version->translationList(false, false);
     foreach ($publishedVersionTranslations as $translation) {
         if (in_array($translation->attribute('language_code'), $versionTranslationList) || !in_array($translation->attribute('language_code'), $publishedLanguageCodes)) {
             continue;
         }
         $contentObjectAttributes = $translation->objectAttributes();
         foreach ($contentObjectAttributes as $attribute) {
             $clonedAttribute = $attribute->cloneContentObjectAttribute($versionNum, $publishedVersionNum, $objectID);
             $clonedAttribute->sync();
         }
     }
     $version->updateLanguageMask();
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:25,代码来源:ezcontentoperationcollection.php

示例4: copyTranslations

 public static function copyTranslations($objectID, $versionNum)
 {
     $object = eZContentObject::fetch($objectID);
     if (!$object instanceof eZContentObject) {
         return array('status' => eZModuleOperationInfo::STATUS_CANCELLED);
     }
     $publishedVersionNum = $object->attribute('current_version');
     if (!$publishedVersionNum) {
         return;
     }
     $publishedVersion = $object->version($publishedVersionNum);
     $publishedVersionTranslations = $publishedVersion->translations();
     $publishedLanguages = eZContentLanguage::languagesByMask($object->attribute('language_mask'));
     $publishedLanguageCodes = array_keys($publishedLanguages);
     $version = $object->version($versionNum);
     $versionTranslationList = array_keys(eZContentLanguage::languagesByMask($version->attribute('language_mask')));
     foreach ($publishedVersionTranslations as $translation) {
         $translationLanguageCode = $translation->attribute('language_code');
         if (in_array($translationLanguageCode, $versionTranslationList) || !in_array($translationLanguageCode, $publishedLanguageCodes)) {
             continue;
         }
         foreach ($translation->objectAttributes() as $attribute) {
             $clonedAttribute = $attribute->cloneContentObjectAttribute($versionNum, $publishedVersionNum, $objectID);
             $clonedAttribute->sync();
         }
     }
     $version->updateLanguageMask();
 }
开发者ID:ezsystems,项目名称:ezpublish-legacy,代码行数:28,代码来源:ezcontentoperationcollection.php


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