本文整理汇总了PHP中eZContentLanguage::fetchList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentLanguage::fetchList方法的具体用法?PHP eZContentLanguage::fetchList怎么用?PHP eZContentLanguage::fetchList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentLanguage
的用法示例。
在下文中一共展示了eZContentLanguage::fetchList方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFileListById
/**
* @desc settings local use in your site
* @author David LE RICHE <david.leriche@openwide.fr>
* @param array $fileTranslationList => translation's file list
* @return void
* @copyright 2012
* @version 1.1
*/
public function setFileListById($fileTranslationList)
{
$languageListe = eZContentLanguage::fetchList();
$localeOverride = eZINI::instance('owtranslate.ini')->variable('LocaleOverride', 'locale');
foreach ($languageListe as $language) {
$this->languageList[$language->ID] = array('locale' => array_key_exists($language->Locale, $localeOverride) ? $localeOverride[$language->Locale] : $language->Locale, 'name' => $language->Name);
}
foreach ($fileTranslationList as $fileKey => $file) {
foreach ($this->languageList as $key => $language) {
if (substr($fileKey, 0, 6) == substr($language['locale'], 0, 6)) {
$this->fileList[$key] = $file;
}
}
}
}
示例2: createSqlParts
function createSqlParts($params)
{
$sqlJoins = '';
if (isset($params['locales'])) {
$language_mask = 0;
$locales = eZContentLanguage::fetchList();
foreach ($locales as $locale) {
if (in_array($locale->attribute('locale'), $params['locales'])) {
$language_mask |= $locale->attribute('id');
}
}
if ($language_mask) {
$sqlJoins = " ezcontentobject.language_mask & {$language_mask} AND ";
}
}
return array('tables' => '', 'joins' => $sqlJoins, 'columns' => '');
}
示例3: attribute
function attribute($attr)
{
switch ($attr) {
case 'sections':
$sections = eZSection::fetchList(false);
foreach ($sections as $key => $section) {
$sections[$key]['Name'] = $section['name'];
$sections[$key]['value'] = $section['id'];
}
return $sections;
break;
case 'languages':
return eZContentLanguage::fetchList();
break;
}
return eZWorkflowEventType::attribute($attr);
}
示例4: array
return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
}
}
else
{
return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
}
$obj->cleanupInternalDrafts();
}
else
{
// No version so we investigate further.
$obj->cleanupInternalDrafts();
// Check number of languages
$languages = eZContentLanguage::fetchList();
// If there is only one language we choose it for the user and goes to version choice screen.
if ( count( $languages ) == 1 )
{
$firstLanguage = array_shift( $languages );
return $Module->redirectToView( 'edit', array( $ObjectID, 'f', $firstLanguage->attribute( 'locale' ) ) );
}
$canCreateLanguageList = $obj->attribute( 'can_create_languages' );
$canEditLanguageList = $obj->attribute( 'can_edit_languages' );
if ( count( $canCreateLanguageList ) == 0 && count( $canEditLanguageList ) == 1 )
{
$firstLanguage = array_shift( $canEditLanguageList );
return $Module->redirectToView( 'edit', array( $ObjectID, 'f', $firstLanguage->attribute( 'locale' ) ) );
}
示例5: allTranslations
/**
*
* @return array an array of eZContentObjectStateLanguage objects, representing all possible
* translations of this content object state
*/
public function allTranslations()
{
if (!is_array($this->AllTranslations)) {
$allTranslations = array();
foreach ($this->translations() as $translation) {
$languageID = $translation->attribute('language_id') & ~1;
$allTranslations[$languageID] = $translation;
}
$languages = eZContentLanguage::fetchList();
foreach ($languages as $language) {
$languageID = $language->attribute('id');
if (!array_key_exists($languageID, $allTranslations)) {
$row = array('language_id' => $languageID);
if (isset($this->ID)) {
$row['contentobject_state_id'] = $this->ID;
}
$allTranslations[$languageID] = new eZContentObjectStateLanguage($row);
}
}
ksort($allTranslations);
// array_values is needed here to reset keys, otherwise eZHTTPPersistence::fetch() won't work
$this->AllTranslations = array_values($allTranslations);
}
return $this->AllTranslations;
}
示例6: require_once
/**
* File containing the elevate view of the ezfind module.
*
* @package eZFind
*/
require_once( "kernel/common/template.php" );
$module = $Params['Module'];
$http = eZHTTPTool::instance();
$tpl = templateInit();
$feedback = array();
$wildcard = eZFindElevateConfiguration::WILDCARD;
$viewParameters = array();
$availableTranslations = eZContentLanguage::fetchList();
$thisUrl = '/ezfind/elevate';
// Elevation was triggered from the javascript menu ( content structure menu OR subitems menu )
if ( $http->hasPostVariable( 'ObjectIDFromMenu' ) and is_numeric( $http->postVariable( 'ObjectIDFromMenu' ) ) )
{
$elevatedObject = eZContentObject::fetch( $http->postVariable( 'ObjectIDFromMenu' ) );
$tpl->setVariable( 'back_from_browse', true );
$tpl->setVariable( 'elevatedObject', $elevatedObject );
$tpl->setVariable( 'elevateSearchQuery', '' );
}
// back from browse
else if (
$http->hasPostVariable( 'BrowseActionName' ) and
示例7: maskForRealLanguages
/**
* \return The bitmap mask containing all languages, i. e. the sum of the IDs of all languages. (The 0-th bit is set.)
*/
static function maskForRealLanguages()
{
if (!isset($GLOBALS['eZContentLanguageMask'])) {
eZContentLanguage::fetchList(true);
}
return $GLOBALS['eZContentLanguageMask'];
}
示例8: translationList
/**
* Returns an array with locale objects, these objects represents the languages the content objects are
* allowed to be translated into.
*
* The setting ContentSettings/TranslationList in site.ini determines the array.
*
* @return eZLocale[]
*/
static function translationList()
{
$translationList = array();
$languageList = eZContentLanguage::fetchList();
foreach ( $languageList as $language )
{
$translationList[] = $language->localeObject();
}
return $translationList;
}
示例9: attribute
function attribute($attr)
{
switch ($attr) {
case 'sections':
$sections = eZSection::fetchList(false);
foreach ($sections as $key => $section) {
$sections[$key]['Name'] = $section['name'];
$sections[$key]['value'] = $section['id'];
}
return $sections;
break;
case 'languages':
return eZContentLanguage::fetchList();
break;
case 'usergroups':
$groups = eZPersistentObject::fetchObjectList(eZContentObject::definition(), array('id', 'name'), array('contentclass_id' => 3, 'status' => eZContentObject::STATUS_PUBLISHED), null, null, false);
foreach ($groups as $key => $group) {
$groups[$key]['Name'] = $group['name'];
$groups[$key]['value'] = $group['id'];
}
return $groups;
break;
case 'contentclass_list':
$classes = eZContentClass::fetchList(eZContentClass::VERSION_STATUS_DEFINED, true, false, array('name' => 'asc'));
$classList = array();
for ($i = 0; $i < count($classes); $i++) {
$classList[$i]['Name'] = $classes[$i]->attribute('name');
$classList[$i]['value'] = $classes[$i]->attribute('id');
}
return $classList;
break;
case 'workflow_list':
$workflows = eZWorkflow::fetchList();
$workflowList = array();
for ($i = 0; $i < count($workflows); $i++) {
$workflowList[$i]['Name'] = $workflows[$i]->attribute('name');
$workflowList[$i]['value'] = $workflows[$i]->attribute('id');
}
return $workflowList;
break;
}
return eZWorkflowEventType::attribute($attr);
}
示例10: removeObject
/**
* Removes object $contentObject from the search database.
*
* @param eZContentObject $contentObject the content object to remove
* @param bool $commit Whether to commit after removing the object
* @return bool True if the operation succeed.
*/
function removeObject( $contentObject, $commit = null )
{
/*
* @since eZFind 2.2: allow delayed commits if explicitely set as configuration setting and
* the parameter $commit it is not set
* Default behaviour is as before
*/
if ( !isset( $commit ) && ( $this->FindINI->variable( 'IndexOptions', 'DisableDeleteCommits' ) === 'true' ) )
{
$commit = false;
}
elseif ( !isset( $commit ) )
{
$commit = true;
}
// 1: remove the assciated "elevate" configuration
eZFindElevateConfiguration::purge( '', $contentObject->attribute( 'id' ) );
//eZFindElevateConfiguration::synchronizeWithSolr();
$this->pushElevateConfiguration();
// @todo Remove if accepted. Optimize is bad on runtime.
$optimize = false;
if ( $commit && ( $this->FindINI->variable( 'IndexOptions', 'OptimizeOnCommit' ) === 'enabled' ) )
{
$optimize = true;
}
// 2: create a delete array with all the required infos, groupable by language
$languages = eZContentLanguage::fetchList();
foreach ( $languages as $language )
{
$languageCode = $language->attribute( 'locale' );
$docs[$languageCode] = $this->guid( $contentObject, $languageCode );
}
if ( $this->UseMultiLanguageCores === true )
{
foreach ( $docs as $languageCode => $doc )
{
$this->SolrLanguageShards[$languageCode]->deleteDocs( array( $doc ), false, $commit, $optimize );
}
}
else
{
return $this->Solr->deleteDocs( $docs, false, $commit, $optimize );
}
}
示例11: generateXML
/**
* @desc Generate xml file for all locale on your site with all translation found
* @author David LE RICHE <david.leriche@openwide.fr>
* @return bool
* @copyright 2012
* @version 1.1
*/
public function generateXML()
{
$this->languageList = eZContentLanguage::fetchList();
$directoryMainExtension = eZINI::instance('owtranslate.ini')->variable('MainExtension', 'directory');
$baseDirectory = eZExtension::baseDirectory() . '/' . $directoryMainExtension . '/translations';
$this->createLocaleDirIfNotExist($baseDirectory);
$localeOverride = eZINI::instance('owtranslate.ini')->variable('LocaleOverride', 'locale');
// verification file translation exist
foreach ($this->languageList as $language) {
$locale = array_key_exists($language->Locale, $localeOverride) ? $localeOverride[$language->Locale] : $language->Locale;
if (file_exists($baseDirectory . '/' . $locale . '/translation.ts')) {
$saveXml = $this->addTranslationIfNotExist($baseDirectory . '/' . $locale . '/translation.ts');
} else {
$saveXml = $this->addTranslationFile($baseDirectory . '/' . $locale . '/translation.ts');
}
}
return $saveXml;
}