本文整理汇总了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;
}
示例2: allLanguages
/**
* @return eZContentLanguage[]|array
*/
function allLanguages()
{
$languages = isset( $this->LanguageMask ) ? eZContentLanguage::languagesByMask( $this->LanguageMask ) : array();
return $languages;
}
示例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();
}
示例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();
}