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


PHP eZPreferences::value方法代码示例

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


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

示例1: modify

 function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement)
 {
     switch ($operatorName) {
         case 'ezpreference':
             $name = $namedParameters['name'];
             $value = eZPreferences::value($name);
             $operatorValue = $value;
             break;
         default:
             eZDebug::writeError("Unknown kernel operator: {$operatorName}");
             break;
     }
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:13,代码来源:ezkerneloperator.php

示例2: instantiate

 function instantiate($userID = false, $sectionID = 0, $versionNumber = false, $languageCode = false, $versionStatus = eZContentObjectVersion::STATUS_INTERNAL_DRAFT)
 {
     $attributes = $this->fetchAttributes();
     if ($userID === false) {
         $user = eZUser::currentUser();
         $userID = $user->attribute('contentobject_id');
     }
     if ($languageCode == false) {
         $languageCode = eZContentObject::defaultLanguage();
     }
     $object = eZContentObject::create(ezpI18n::tr("kernel/contentclass", "New %1", null, array($this->name($languageCode))), $this->attribute("id"), $userID, $sectionID, 1, $languageCode);
     if ($this->attribute('always_available')) {
         $object->setAttribute('language_mask', (int) $object->attribute('language_mask') | 1);
     }
     $db = eZDB::instance();
     $db->begin();
     $object->store();
     $object->assignDefaultStates();
     $object->setName(ezpI18n::tr("kernel/contentclass", "New %1", null, array($this->name($languageCode))), false, $languageCode);
     if (!$versionNumber) {
         $version = $object->createInitialVersion($userID, $languageCode);
     } else {
         $version = eZContentObjectVersion::create($object->attribute("id"), $userID, $versionNumber, $languageCode);
     }
     if ($versionStatus !== false) {
         $version->setAttribute('status', $versionStatus);
     }
     $version->store();
     foreach ($attributes as $attribute) {
         $attribute->instantiate($object->attribute('id'), $languageCode);
     }
     if (isset($user) && $user instanceof eZUser && $user->isAnonymous()) {
         $createdObjectIDList = eZPreferences::value('ObjectCreationIDList');
         if (!$createdObjectIDList) {
             $createdObjectIDList = array($object->attribute('id'));
         } else {
             $createdObjectIDList = unserialize($createdObjectIDList);
             $createdObjectIDList[] = $object->attribute('id');
         }
         eZPreferences::setValue('ObjectCreationIDList', serialize($createdObjectIDList));
     }
     $db->commit();
     return $object;
 }
开发者ID:nlenardou,项目名称:ezpublish,代码行数:44,代码来源:ezcontentclass.php

示例3: array

$conds = array();
//$conds['user_id'] =  $userID;
$conds['status'] = array(array(eZWorkflow::STATUS_DEFERRED_TO_CRON, eZWorkflow::STATUS_FETCH_TEMPLATE, eZWorkflow::STATUS_REDIRECT, eZWorkflow::STATUS_WAITING_PARENT));
$db = eZDB::instance();
if ($db->databaseName() == 'oracle') {
    $conds['LENGTH(memento_key)'] = array('!=', 0);
} else {
    $conds['memento_key'] = array('!=', '');
}
$offset = $Params['Offset'];
if (!is_numeric($offset)) {
    $offset = 0;
}
$limitList = array(1 => 10, 2 => 25, 3 => 50, 4 => 100);
$limit = 10;
$limitId = eZPreferences::value('admin_workflow_processlist_limit');
if ($limitId and isset($limitList[$limitId])) {
    $limit = $limitList[$limitId];
}
$viewParameters = array('offset' => $offset);
$plist = eZWorkflowProcess::fetchList($conds, true, $offset, $limit);
$plistCount = eZWorkflowProcess::count(eZWorkflowProcess::definition(), $conds);
$totalProcessCount = 0;
$outList2 = array();
foreach ($plist as $p) {
    $mementoMain = eZOperationMemento::fetchMain($p->attribute('memento_key'));
    $mementoChild = eZOperationMemento::fetchChild($p->attribute('memento_key'));
    if (!$mementoMain or !$mementoChild) {
        continue;
    }
    $mementoMainData = $mementoMain->data();
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:processlist.php

示例4: switch

<?php

/**
 * @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2013.11
 * @package kernel
 */
$Module = $Params['Module'];
$ViewMode = $Params['ViewMode'];
if (eZPreferences::value('admin_url_list_limit')) {
    switch (eZPreferences::value('admin_url_list_limit')) {
        case '2':
            $limit = 25;
            break;
        case '3':
            $limit = 50;
            break;
        default:
            $limit = 10;
            break;
    }
} else {
    $limit = 10;
}
$offset = $Params['Offset'];
if (!is_numeric($offset)) {
    $offset = 0;
}
if ($ViewMode != 'all' && $ViewMode != 'invalid' && $ViewMode != 'valid') {
    $ViewMode = 'all';
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:list.php

示例5: templateInit

 * @filesource
 */
// Blacklist User by nl user id or by email
// update all nessesarry status fields to blacklisted
$module = $Params['Module'];
$templateFile = 'design:newsletter/blacklist_item_list.tpl';
require_once 'kernel/common/i18n.php';
include_once 'kernel/common/template.php';
$http = eZHTTPTool::instance();
$tpl = templateInit();
$http = eZHTTPTool::instance();
$db = eZDB::instance();
$viewParameters = array('offset' => 0, 'namefilter' => '');
$userParameters = $Params['UserParameters'];
$viewParameters = array_merge($viewParameters, $userParameters);
$limit = 10;
$limitArray = array(10, 10, 25, 50);
$limitArrayKey = eZPreferences::value('admin_blacklist_item_list_limit');
// get user limit preference
if (isset($limitArray[$limitArrayKey])) {
    $limit = $limitArray[$limitArrayKey];
}
$blacklistItemList = CjwNewsletterBlacklistItem::fetchAllBlacklistItems($limit, $viewParameters['offset']);
$blacklistItemListCount = CjwNewsletterBlacklistItem::fetchAllBlacklistItemsCount();
$tpl->setVariable('view_parameters', $viewParameters);
$tpl->setVariable('blacklist_item_list', $blacklistItemList);
$tpl->setVariable('blacklist_item_list_count', $blacklistItemListCount);
$tpl->setVariable('limit', $limit);
$Result = array();
$Result['content'] = $tpl->fetch($templateFile);
$Result['path'] = array(array('url' => 'newsletter/index', 'text' => ezi18n('cjw_newsletter/path', 'Newsletter')), array('url' => false, 'text' => ezi18n('cjw_newsletter/blacklist_item_list', 'Blacklists')));
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:31,代码来源:blacklist_item_list.php

示例6: switch

<?php

/**
 * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2012.6
 * @package kernel
 */
if (eZPreferences::value('admin_search_stats_limit')) {
    switch (eZPreferences::value('admin_search_stats_limit')) {
        case '2':
            $limit = 25;
            break;
        case '3':
            $limit = 50;
            break;
        default:
            $limit = 10;
            break;
    }
} else {
    $limit = 10;
}
$offset = $Params['Offset'];
if (!is_numeric($offset)) {
    $offset = 0;
}
$http = eZHTTPTool::instance();
$module = $Params['Module'];
if ($module->isCurrentAction('ResetSearchStats')) {
    eZSearchLog::removeStatistics();
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:stats.php

示例7: classListFromPolicy

 function classListFromPolicy($policy, $allowedLanguageCodes = false)
 {
     $canCreateClassIDListPart = array();
     $hasClassIDLimitation = false;
     $user = eZUser::currentUser();
     $userID = $user->attribute('contentobject_id');
     $object = false;
     if (isset($policy['ParentOwner'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         // if limitation value == 2, anonymous limited to current session.
         if (in_array(2, $policy['ParentOwner']) && $user->isAnonymous()) {
             $createdObjectIDList = eZPreferences::value('ObjectCreationIDList');
             if (!$createdObjectIDList || !in_array($object->ID, unserialize($createdObjectIDList))) {
                 return array();
             }
         } else {
             if ($object->attribute('owner_id') != $userID && $object->ID != $userID) {
                 return array();
             }
         }
     }
     if (isset($policy['ParentGroup'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         $access = $object->checkGroupLimitationAccess($policy['ParentGroup'], $userID);
         if ($access !== 'allowed') {
             return array();
         }
     }
     if (isset($policy['Class'])) {
         $canCreateClassIDListPart = $policy['Class'];
         $hasClassIDLimitation = true;
     }
     if (isset($policy['User_Section'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         if (!in_array($object->attribute('section_id'), $policy['User_Section'])) {
             return array();
         }
     }
     if (isset($policy['User_Subtree'])) {
         $allowed = false;
         if ($object === false) {
             $object = $this->attribute('object');
         }
         $assignedNodes = $object->attribute('assigned_nodes');
         foreach ($assignedNodes as $assignedNode) {
             $path = $assignedNode->attribute('path_string');
             foreach ($policy['User_Subtree'] as $subtreeString) {
                 if (strstr($path, $subtreeString)) {
                     $allowed = true;
                     break;
                 }
             }
         }
         if (!$allowed) {
             return array();
         }
     }
     if (isset($policy['Section'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         if (!in_array($object->attribute('section_id'), $policy['Section'])) {
             return array();
         }
     }
     if (isset($policy['ParentClass'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         if (!in_array($object->attribute('contentclass_id'), $policy['ParentClass'])) {
             return array();
         }
     }
     if (isset($policy['ParentDepth']) && is_array($policy['ParentDepth'])) {
         $NodeDepth = $this->attribute('depth');
         if (!in_array('*', $policy['ParentDepth']) && !in_array($NodeDepth, $policy['ParentDepth'])) {
             return array();
         }
     }
     if (isset($policy['Assigned'])) {
         if ($object === false) {
             $object = $this->attribute('object');
         }
         if ($object->attribute('owner_id') != $userID) {
             return array();
         }
     }
     $allowedNode = false;
     if (isset($policy['Node'])) {
         $allowed = false;
         foreach ($policy['Node'] as $nodeID) {
             $mainNodeID = $this->attribute('main_node_id');
             $node = eZContentObjectTreeNode::fetch($nodeID, false, false);
             if ($mainNodeID == $node['main_node_id']) {
//.........这里部分代码省略.........
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:101,代码来源:ezcontentobjecttreenode.php

示例8: switch

        } else {
            if ($Module->isCurrentAction('UnsubscribeSubscribers')) {
                jajNewsletterSubscription::unsubscribeByUUID($uuid, $user_id);
            } else {
                if ($Module->isCurrentAction('UndeleteSubscribers')) {
                    jajNewsletterSubscription::undeleteByUUID($uuid, $user_id);
                }
            }
        }
    }
} else {
    if ($Module->isCurrentAction('AddSubscribers')) {
        return $Module->redirectTo($Module->functionURI("list_add") . "/" . $ListID);
    }
}
switch (eZPreferences::value('admin_jaj_newsletter_subscription_list_limit')) {
    case '25':
        $limit = 25;
        break;
    case '50':
        $limit = 50;
        break;
    default:
        $limit = 10;
        break;
}
$offset = $Params['Offset'];
$tpl = eZTemplate::factory();
$ViewState = $Params['ViewState'];
$SubscriptionStates = jajNewsletterSubscription::states();
if (!in_array($ViewState, $SubscriptionStates)) {
开发者ID:jjohnsen,项目名称:jaj_newsletter,代码行数:31,代码来源:view.php

示例9: elseif

        $fuzzyFilter = true;
    elseif ( $Params['FuzzyFilter'] !== false )
        $fuzzyFilter = true;

    if ( $fuzzyFilter )
    {
        $viewParameters = array_merge( $viewParameters, array( 'fuzzy_filter' => $fuzzyFilter ) );
    }

    // check offset
    $viewParameters = array_merge( $viewParameters, array( 'offset' => ( isset( $Params['Offset'] ) and is_numeric( $Params['Offset'] ) ) ? $Params['Offset'] : 0 ) );


    // check limit
    $limitHint = array( 10, 10, 25, 50 );
    $viewParameters = array_merge( $viewParameters, array( 'limit' => $limitHint[eZPreferences::value( 'ezfind_elevate_preview_configurations' )] ) ) ;

    $limitArray = array( 'offset' => $viewParameters['offset'],
                         'limit'  => $viewParameters['limit'] );

    // check search query filter
    $searchQuery = false;
    $searchQueryArray = null;

    if ( $http->hasPostVariable( 'ezfind-elevationdetail-filter-searchquery' ) )
        $searchQuery = $http->postVariable( 'ezfind-elevationdetail-filter-searchquery' );
    elseif ( $Params['SearchQuery'] !== false )
        $searchQuery = $Params['SearchQuery'];

    if ( $searchQuery )
    {
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:elevation_detail.php

示例10: foreach

<?php

/**
 * @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version  2012.8
 * @package kernel
 */
$Module = $Params['Module'];
$offset = $Params['Offset'];
$listLimitPreferenceName = 'admin_state_group_list_limit';
$listLimitPreferenceValue = eZPreferences::value($listLimitPreferenceName);
switch ($listLimitPreferenceValue) {
    case '2':
        $limit = 25;
        break;
    case '3':
        $limit = 50;
        break;
    default:
        $limit = 10;
        break;
}
$languages = eZContentLanguage::fetchList();
$tpl = eZTemplate::factory();
eZDebug::writeDebug($Module->currentAction());
if ($Module->isCurrentAction('Remove') && $Module->hasActionParameter('RemoveIDList')) {
    $removeIDList = $Module->actionParameter('RemoveIDList');
    foreach ($removeIDList as $removeID) {
        $group = eZContentObjectStateGroup::fetchById($removeID);
        if ($group && !$group->isInternal()) {
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:groups.php

示例11: switch

        $productClass = $productClassList[0];
    }
}

if ( is_object( $productClass ) )
    $priceAttributeIdentifier = eZShopFunctions::priceAttributeIdentifier( $productClass );

switch ( eZPreferences::value( 'productsoverview_list_limit' ) )
{
    case '2': { $limit = 25; } break;
    case '3': { $limit = 50; } break;
    default:  { $limit = 10; } break;
}

$sortingField = eZPreferences::value( 'productsoverview_sorting_field' );
$sortingOrder = eZPreferences::value( 'productsoverview_sorting_order' );

$viewParameters = array( 'offset' => $offset );

$tpl = eZTemplate::factory();
$tpl->setVariable( 'product_class_list', $productClassList );
$tpl->setVariable( 'product_class', $productClass );
$tpl->setVariable( 'price_attribute_identifier', $priceAttributeIdentifier );
$tpl->setVariable( 'sorting_field', $sortingField );
$tpl->setVariable( 'sorting_order', $sortingOrder );
$tpl->setVariable( 'limit', $limit );
$tpl->setVariable( 'view_parameters', $viewParameters );

$Result = array();
$Result['content'] = $tpl->fetch( "design:shop/productsoverview.tpl" );
$Result['path'] = array( array( 'text' => ezpI18n::tr( 'kernel/shop', 'Products overview' ),
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:productsoverview.php

示例12: switch

 * @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
 * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 * @version //autogentag//
 * @package kernel
 */

$http = eZHTTPTool::instance();


$Module = $Params['Module'];

$offset = $Params['Offset'];

if( eZPreferences::value( 'admin_role_list_limit' ) )
{
    switch( eZPreferences::value( 'admin_role_list_limit' ) )
    {
        case '2': { $limit = 25; } break;
        case '3': { $limit = 50; } break;
        default:  { $limit = 10; } break;
    }
}
else
{
    $limit = 10;
}

if ( $http->hasPostVariable( 'RemoveButton' )  )
{
   if ( $http->hasPostVariable( 'DeleteIDArray' ) )
    {
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:list.php

示例13:

//
//
// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
$module = $Params['Module'];
$tpl = eZTemplate::factory();
$offset = $Params['Offset'];
$limit = 15;
if (eZPreferences::value('admin_orderlist_sortfield')) {
    $sortField = eZPreferences::value('admin_orderlist_sortfield');
}
if (!isset($sortField) || $sortField != 'created' && $sortField != 'user_name') {
    $sortField = 'created';
}
if (eZPreferences::value('admin_orderlist_sortorder')) {
    $sortOrder = eZPreferences::value('admin_orderlist_sortorder');
}
if (!isset($sortOrder) || $sortOrder != 'asc' && $sortOrder != 'desc') {
    $sortOrder = 'asc';
}
$http = eZHTTPTool::instance();
// The RemoveButton is not present in the orderlist, but is here for backwards
// compatibility. Simply replace the ArchiveButton for the RemoveButton will
// do the trick.
//
// Note that removing order can cause wrong order numbers (order_nr are
// reused).  See eZOrder::activate.
if ($http->hasPostVariable('RemoveButton')) {
    if ($http->hasPostVariable('OrderIDArray')) {
        $orderIDArray = $http->postVariable('OrderIDArray');
        if ($orderIDArray !== null) {
开发者ID:runelangseid,项目名称:ezpublish,代码行数:31,代码来源:orderlist.php

示例14: foreach

        foreach ($UserIDs as $id) {
            $object = eZContentObject::fetch($id);
            if ($object instanceof eZContentObject && eZUserAccountKey::fetchByUserID($id)) {
                $success[] = $object->attribute('name');
                $object->purge();
            } else {
                eZDebug::writeError("Unable to load the object and/or the eZUserAccountKey object for user #{$id}", 'user/unactivated');
                $errors[] = $id;
            }
        }
        $tpl->setVariable('success_remove', empty($success) ? false : $success);
        $tpl->setVariable('errors_remove', empty($errors) ? false : $errors);
    }
}
$limitPreference = 'admin_user_actions_list_limit';
switch (eZPreferences::value($limitPreference)) {
    case 2:
        $limit = 25;
        break;
    case 3:
        $limit = 50;
        break;
    case 1:
    default:
        $limit = 10;
}
$unactivatedCount = eZUserAccountKey::count(eZUserAccountKey::definition());
$unactivated = array();
$availableSortFields = array('time' => 'time', 'login' => 'login', 'email' => 'email');
$availableSortOrders = array('asc' => 'asc', 'desc' => 'desc');
// default sort field/sort order
开发者ID:netbliss,项目名称:ezpublish,代码行数:31,代码来源:unactivated.php

示例15: foreach

    foreach ($restoreIncludeArray as $element) {
        if ($element[2] === 'unset') {
            unset($vars[$element[0]][$element[1]]);
            continue;
        }
        $vars[$element[0]][$element[1]] = $element[2];
    }
    $restoreIncludeArray = $oldRestoreIncludeArray_d20717e07f71ae28b4af4bec0dfc6120;
}
unset($if_cond);
// if ends
$text .= '
';
// if begins
unset($if_cond);
$if_cond = eZPreferences::value("admin_navigation_class_temlates");
if (!isset($if_cond)) {
    $if_cond = NULL;
}
while (is_object($if_cond) and method_exists($if_cond, 'templateValue')) {
    $if_cond = $if_cond->templateValue();
}
if ($if_cond) {
    $text .= '    ';
    $oldRestoreIncludeArray_d20717e07f71ae28b4af4bec0dfc6120 = isset($restoreIncludeArray) ? $restoreIncludeArray : array();
    $restoreIncludeArray = array();
    if (!isset($dKeys)) {
        $resH = $tpl->resourceHandler("design");
        $dKeys = $resH->keys();
    }
    $resourceFound = false;
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:windows-66951aaf1bcb26ae0dc1a8ad5a4c7613.php


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