當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。