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


PHP eZContentBrowse::result方法代码示例

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


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

示例1: checkRelationAssignments

/**
 * @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
 */

function checkRelationAssignments( $module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage, &$validation )
{
    $http = eZHTTPTool::instance();
    // Add object relations
    if ( $module->isCurrentAction( 'AddRelatedObject' ) )
    {
        $selectedObjectIDArray = eZContentBrowse::result( 'AddRelatedObject' );
        $relatedObjects = $object->relatedContentObjectArray( $editVersion, false, 0, array( 'AllRelations' => eZContentObject::RELATION_COMMON ) );
        $relatedObjectIDArray = array();
        $objectID = $object->attribute( 'id' );

        foreach (  $relatedObjects as  $relatedObject )
            $relatedObjectIDArray[] = $relatedObject->attribute( 'id' );

        if ( is_array( $selectedObjectIDArray ) )
        {
            $db = eZDB::instance();
            $db->begin();
            foreach ( $selectedObjectIDArray as $selectedObjectID )
            {
                if ( $selectedObjectID != $objectID && !in_array( $selectedObjectID, $relatedObjectIDArray ) )
                    $object->addContentObjectRelation( $selectedObjectID, $editVersion );
            }
            $db->commit();
        }

        $module->redirectToView( 'edit', array( $object->attribute( 'id' ), $editVersion, $editLanguage, $fromLanguage ),
                                 null, false, 'content-relation-items' );
        return eZModule::HOOK_STATUS_CANCEL_RUN;
    }
    if ( $module->isCurrentAction( 'UploadedFileRelation' ) )
    {
        $relatedObjectID = eZContentUpload::result( 'RelatedObjectUpload' );
        if ( $relatedObjectID )
        {
            $db = eZDB::instance();
            $db->begin();
            $object->addContentObjectRelation( $relatedObjectID, $editVersion );
            $db->commit();
        }
        // We redirect to the edit page to get the correct url,
        // also we use the anchor 'content-relation-items' to make sure the
        // browser scrolls down the relation list (if the anchor exists).
        $module->redirectToView( 'edit', array( $object->attribute( 'id' ), $editVersion, $editLanguage, $fromLanguage ),
                                 null, false, 'content-relation-items' );
        return eZModule::HOOK_STATUS_CANCEL_RUN;
    }
}
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:55,代码来源:relation_edit.php

示例2: array

        eZDiscountSubRuleValue::removeBySubRuleID($discountRuleID);
        eZDiscountSubRule::remove($discountRuleID);
    }
    $db->commit();
    // we changed prices => remove content cache
    eZContentCacheManager::clearAllContentCache();
    $module->redirectTo($module->functionURI("discountgroupview") . "/" . $discountGroupID);
    return;
}
if ($http->hasPostVariable("AddCustomerButton")) {
    eZContentBrowse::browse(array('action_name' => 'AddCustomer', 'description_template' => 'design:shop/browse_discountcustomer.tpl', 'keys' => array('discountgroup_id' => $discountGroupID), 'content' => array('discountgroup_id' => $discountGroupID), 'from_page' => "/shop/discountgroupview/{$discountGroupID}"), $module);
    return;
}
// Add customer or customer group to this rule
if ($module->isCurrentAction('AddCustomer')) {
    $selectedObjectIDArray = eZContentBrowse::result('AddCustomer');
    $userIDArray = eZUserDiscountRule::fetchUserID($discountGroupID);
    $db = eZDB::instance();
    $db->begin();
    foreach ($selectedObjectIDArray as $objectID) {
        if (!in_array($objectID, $userIDArray)) {
            $userRule = eZUserDiscountRule::create($discountGroupID, $objectID);
            $userRule->store();
        }
    }
    $db->commit();
    // because we changed users, we have to remove content cache
    eZContentCacheManager::clearAllContentCache();
}
if ($http->hasPostVariable("RemoveCustomerButton")) {
    if ($http->hasPostVariable("CustomerIDArray")) {
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:discountgroupmembershipview.php

示例3: chooseOptionsToCopy

function chooseOptionsToCopy($Module, &$Result, $srcNode, $chooseVersions, $chooseCreator, $chooseTime)
{
    $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
    $tpl = eZTemplate::factory();
    $tpl->setVariable('node', $srcNode);
    $tpl->setVariable('selected_node_id', $selectedNodeIDArray[0]);
    $tpl->setVariable('choose_versions', $chooseVersions);
    $tpl->setVariable('choose_creator', $chooseCreator);
    $tpl->setVariable('choose_time', $chooseTime);
    $Result['content'] = $tpl->fetch('design:content/copy_subtree.tpl');
    $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/content', 'Content')), array('url' => false, 'text' => ezpI18n::tr('kernel/content', 'Copy subtree')));
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:12,代码来源:copysubtree.php

示例4: array

$checkCurrAction = false;
//Checks if it is needed to clear $parameterValue
$currentAction = $module->currentAction();
if ($currentAction == 'BackToToolbars') {
    return $Module->redirectToView('toolbarlist', array());
} elseif ($currentAction == 'SelectToolbarNode') {
    $selectedNodeIDArray = eZContentBrowse::result('SelectToolbarNode');
    $nodeID = $selectedNodeIDArray[0];
    if (is_numeric($nodeID)) {
        $toolIndex = $http->variable('tool_index');
        $parameterName = $http->variable('parameter_name');
        $iniAppend->setVariable("Tool_" . $toolbarPosition . "_" . $toolArray[$toolIndex] . "_" . ($toolIndex + 1), $parameterName, $nodeID);
        $succeed = $iniAppend->save(false, false, false, false, true, true);
    }
} elseif ($currentAction == 'SelectToolbarNodePath') {
    $selectedNodeIDArray = eZContentBrowse::result('SelectToolbarNode');
    $nodeID = $selectedNodeIDArray[0];
    if (!$http->hasPostVariable('BrowseCancelButton')) {
        if (!is_numeric($nodeID)) {
            $nodeID = 2;
        }
        $toolIndex = $http->variable('tool_index');
        $parameterName = $http->variable('parameter_name');
        $iniAppend->setVariable("Tool_" . $toolbarPosition . "_" . $toolArray[$toolIndex] . "_" . ($toolIndex + 1), $parameterName, $nodeID);
        $succeed = $iniAppend->save(false, false, false, false, true, true);
    }
} elseif ($currentAction == 'NewTool' || $currentAction == 'UpdatePlacement' || $currentAction == 'Browse' || $currentAction == 'Remove') {
    $deleteToolArray = array();
    if ($currentAction == 'Remove' && $http->hasPostVariable('deleteToolArray')) {
        $deleteToolArray = $http->postVariable('deleteToolArray');
    }
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:toolbar.php

示例5: array

 $nodeID = $module->actionParameter('NodeID');
 $object = eZContentObject::fetch($objectID);
 if (!$object) {
     return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
 }
 $user = eZUser::currentUser();
 if (!$object->checkAccess('edit') && !$user->attribute('has_manage_locations')) {
     return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
 }
 $existingNode = eZContentObjectTreeNode::fetch($nodeID);
 if (!$existingNode) {
     return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
 }
 $class = $object->contentClass();
 if ($module->isCurrentAction('AddAssignment')) {
     $selectedNodeIDArray = eZContentBrowse::result('AddNodeAssignment');
     if (!is_array($selectedNodeIDArray)) {
         $selectedNodeIDArray = array();
     }
     if (eZOperationHandler::operationIsAvailable('content_addlocation')) {
         $operationResult = eZOperationHandler::execute('content', 'addlocation', array('node_id' => $nodeID, 'object_id' => $objectID, 'select_node_id_array' => $selectedNodeIDArray), null, true);
     } else {
         eZContentOperationCollection::addAssignment($nodeID, $objectID, $selectedNodeIDArray);
     }
 } else {
     if ($module->isCurrentAction('SelectAssignmentLocation')) {
         $ignoreNodesSelect = array();
         $ignoreNodesClick = array();
         $assigned = eZNodeAssignment::fetchForObject($objectID, $object->attribute('current_version'), 0, false);
         $publishedAssigned = $object->assignedNodes(false);
         $isTopLevel = false;
开发者ID:heliopsis,项目名称:ezpublish-legacy,代码行数:31,代码来源:action.php

示例6: array

        $discountRuleName = ezpI18n::tr( 'design/admin/shop/discountruleedit', 'New discount rule' );
        $discountRulePercent = 0.0;
        $discountRuleSelectedClasses = array( -1 );
        $discountRuleSelectedSections = array( -1 );
        $discountRuleSelectedProducts = array();

        $discountRule = array( 'id' => 0,
                               'name' => $discountRuleName,
                               'discount_percent' => $discountRulePercent );
    }
}

if ( $module->isCurrentAction( 'FindProduct' ) )
{
    // returning from browse; add products to product list
    $result = eZContentBrowse::result( 'FindProduct' );
    if ( $result )
    {
        $discountRuleSelectedProducts = array_merge( $discountRuleSelectedProducts, $result );
        $discountRuleSelectedProducts = array_unique( $discountRuleSelectedProducts );
    }
}

if ( $http->hasPostVariable( 'DeleteProductButton' ) )
{
    // remove products from list:
    if ( $http->hasPostVariable( 'DeleteProductIDArray' ) )
    {
        $deletedIDList = $http->postVariable( 'DeleteProductIDArray' );
        $arrayKeys = array_keys( $discountRuleSelectedProducts );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:discountruleedit.php

示例7: checkNodeMovements

function checkNodeMovements( $module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $FromLanguage, &$validation )
{
    $http = eZHTTPTool::instance();

    // If the object has been previously published we do not allow node assignment operations
    if ( $object->attribute( 'status' ) != eZContentObject::STATUS_DRAFT )
    {
        return;
    }

    // If node assignment handling is diabled we return immedieately
    $useNodeAssigments = true;
    if ( $http->hasPostVariable( 'UseNodeAssigments' ) )
        $useNodeAssigments = (bool)$http->postVariable( 'UseNodeAssigments' );

    if ( !$useNodeAssigments )
        return;

    $ObjectID = $object->attribute( 'id' );
    // Move to another node
    if ( $module->isCurrentAction( 'MoveNodeAssignment' ) )
    {
        $selectedNodeIDArray = eZContentBrowse::result( 'MoveNodeAssignment' );
        $fromNodeID = $http->postVariable( "FromNodeID" );
        $oldAssignmentParentID = $http->postVariable( 'OldAssignmentParentID' );

        if ( $selectedNodeIDArray != null )
        {
            $assignedNodes = $version->nodeAssignments();
            $assignedIDArray = array();
            foreach ( $assignedNodes as  $assignedNode )
            {
                $assignedNodeID = $assignedNode->attribute( 'parent_node' );
                $assignedIDArray[] = $assignedNodeID;
            }
            foreach ( $selectedNodeIDArray as $nodeID )
            {
                if ( !in_array( $nodeID, $assignedIDArray ) )
                {
                    $isPermitted = true;
                    // Check access
                    $newNode = eZContentObjectTreeNode::fetch( $nodeID );
                    $newNodeObject = $newNode->attribute( 'object' );

                    $canCreate = $newNodeObject->checkAccess( 'create', $class->attribute( 'id' ), $newNodeObject->attribute( 'contentclass_id' ) ) == 1;
                    eZDebug::writeDebug( $canCreate,"can create");
                    if ( !$canCreate )
                    {
                        $isPermitted = false;
                    }
                    else
                    {
                        $canCreateClassList = $newNodeObject->attribute( 'can_create_class_list' );
                        $canCreateClassIDList = array();
                        foreach ( array_keys( $canCreateClassList ) as $key )
                        {
                            $canCreateClassIDList[] = $canCreateClassList[$key]['id'];
                        }
                        $objectClassID = $object->attribute( 'contentclass_id' );
                        if ( !in_array( $objectClassID, $canCreateClassIDList ) )
                             $isPermitted = false;
                    }
                    if ( !$isPermitted )
                    {
                        eZDebug::writeError( $newNode->pathWithNames(), "You are not allowed to place this object under:" );
                        $validation[ 'placement' ][] = array( 'text' => ezpI18n::tr( 'kernel/content', "You are not allowed to place this object under: %1", null, array( $newNode->pathWithNames() ) ) );
                        $validation[ 'processed' ] = true;
                        // Error message.
                    }
                    else
                    {
                        $oldAssignment = eZPersistentObject::fetchObject( eZNodeAssignment::definition(),
                                                                           null,
                                                                           array( 'contentobject_id' => $object->attribute( 'id' ),
                                                                                  'parent_node' => $oldAssignmentParentID,
                                                                                  'contentobject_version' => $version->attribute( 'version' )
                                                                                  ),
                                                                           true );

                        $realNode = eZContentObjectTreeNode::fetchNode( $version->attribute( 'contentobject_id' ), $oldAssignment->attribute( 'parent_node' ) );

                        $db = eZDB::instance();
                        $db->begin();
                        // No longer remove then add assignment, instead change the existing one
                        if ( $realNode  === null )
                        {
                            $fromNodeID = 0;
                        }
                        if ( $oldAssignment->attribute( 'is_main' ) == '1' )
                        {
                            $oldAssignment->setAttribute( 'parent_node', $nodeID );
                            $oldAssignment->setAttribute( 'is_main', 1 );
                            $oldAssignment->setAttribute( 'from_node_id', $fromNodeID );
//                            $version->assignToNode( $nodeID, 1, $fromNodeID, $oldAssignment->attribute( 'sort_field' ), $oldAssignment->attribute( 'sort_order' ) );
                        }
                        else
                        {
                            $oldAssignment->setAttribute( 'parent_node', $nodeID );
                            $oldAssignment->setAttribute( 'is_main', 0 );
                            $oldAssignment->setAttribute( 'from_node_id', $fromNodeID );
//.........这里部分代码省略.........
开发者ID:nottavi,项目名称:ezpublish,代码行数:101,代码来源:node_edit.php

示例8: if

    }
    if ( $http->hasPostVariable( 'NeedRedirectBack' ) )
    {
        return $Module->redirectTo( $http->postVariable( 'RedirectURI', $http->sessionVariable( 'LastAccessesURI', '/' ) ) );
    }
}
else if ( $Module->isCurrentAction( 'Add' )  )
{
    return eZContentBrowse::browse( array( 'action_name' => 'AddBookmark',
                                           'description_template' => 'design:content/browse_bookmark.tpl',
                                           'from_page' => "/content/bookmark" ),
                                    $Module );
}
else if ( $Module->isCurrentAction( 'AddBookmark' )  )
{
    $nodeList = eZContentBrowse::result( 'AddBookmark' );
    if ( $nodeList )
    {
        $db = eZDB::instance();
        $db->begin();
        foreach ( $nodeList as $nodeID )
        {
            $node = eZContentObjectTreeNode::fetch( $nodeID );
            if ( $node )
            {
                $nodeName = $node->attribute( 'name' );
                eZContentBrowseBookmark::createNew( $userID, $nodeID, $nodeName );
            }
        }
        $db->commit();
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:bookmark.php

示例9: section

{
    $section = eZSection::fetch( $SectionID );
    if ( !is_object( $section ) )
    {
        eZDebug::writeError( "Cannot fetch section (ID = $SectionID).", 'section/assign' );
    }
    else
    {
        $currentUser = eZUser::currentUser();

        if ( $currentUser->canAssignSection( $SectionID ) )
        {
            if ( $Module->isCurrentAction( 'AssignSection' ) )
            {   // Assign section to subtree of node

                $selectedNodeIDArray = eZContentBrowse::result( 'AssignSection' );
                if ( is_array( $selectedNodeIDArray ) and count( $selectedNodeIDArray ) > 0 )
                {
                    $nodeList = eZContentObjectTreeNode::fetch( $selectedNodeIDArray );
                    if ( !is_array( $nodeList ) and is_object( $nodeList ) )
                    {
                        $nodeList = array( $nodeList );
                    }

                    $allowedNodeIDList = array();
                    $deniedNodeIDList = array();
                    foreach ( $nodeList as $node )
                    {
                        $nodeID = $node->attribute( 'node_id' );
                        $object = $node->attribute( 'object' );
                        if ( $currentUser->canAssignSectionToObject( $SectionID, $object ) )
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:assign.php

示例10: foreach

        $db = eZDB::instance();
        $db->begin();
        foreach ($deleteIDArray as $deleteID) {
            eZRole::removeRole($deleteID);
        }
        // Clear role caches.
        eZRole::expireCache();
        // Clear all content cache.
        eZContentCacheManager::clearAllContentCache();
        $db->commit();
    }
}
// Redirect to content node browse in the user tree
// Assign the role for a user or group
if ($Module->isCurrentAction('AssignRole')) {
    $selectedObjectIDArray = eZContentBrowse::result('AssignRole');
    foreach ($selectedObjectIDArray as $objectID) {
        $role->assignToUser($objectID);
    }
    // Clear role caches.
    eZRole::expireCache();
    // Clear all content cache.
    eZContentCacheManager::clearAllContentCache();
}
if ($http->hasPostVariable('NewButton')) {
    $role = eZRole::createNew();
    return $Module->redirectToView('edit', array($role->attribute('id')));
}
$viewParameters = array('offset' => $offset);
$tpl = eZTemplate::factory();
$roles = eZRole::fetchByOffset($offset, $limit, $asObject = true, $ignoreTemp = true);
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:list.php

示例11: customClassAttributeHTTPAction

 function customClassAttributeHTTPAction($http, $action, $classAttribute)
 {
     switch ($action) {
         case 'browse_for_placement':
             $module = $classAttribute->currentModule();
             $customActionName = 'CustomActionButton[' . $classAttribute->attribute('id') . '_browsed_for_placement]';
             eZContentBrowse::browse(array('action_name' => 'SelectObjectRelationListNode', 'content' => array('contentclass_id' => $classAttribute->attribute('contentclass_id'), 'contentclass_attribute_id' => $classAttribute->attribute('id'), 'contentclass_version' => $classAttribute->attribute('version'), 'contentclass_attribute_identifier' => $classAttribute->attribute('identifier')), 'persistent_data' => array($customActionName => '', 'ContentClassHasInput' => false), 'description_template' => 'design:class/datatype/browse_objectrelationlist_placement.tpl', 'from_page' => $module->currentRedirectionURI()), $module);
             break;
         case 'browsed_for_placement':
             $nodeSelection = eZContentBrowse::result('SelectObjectRelationListNode');
             if ($nodeSelection and count($nodeSelection) > 0) {
                 $nodeID = $nodeSelection[0];
                 $content = $classAttribute->content();
                 $content['default_placement'] = array('node_id' => $nodeID);
                 $classAttribute->setContent($content);
             }
             break;
         case 'disable_placement':
             $content = $classAttribute->content();
             $content['default_placement'] = false;
             $classAttribute->setContent($content);
             break;
         default:
             eZDebug::writeError("Unknown objectrelationlist action '{$action}'", __METHOD__);
             break;
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:27,代码来源:ezobjectrelationlisttype.php

示例12: array

// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
$http = eZHTTPTool::instance();
$module = $Params["Module"];
$NodeID = $Params['NodeID'];
$exportTypeParam = $Params['ExportType'];
$tpl = eZTemplate::factory();
$success = true;
if ($http->hasPostVariable("ExportButton")) {
    eZContentBrowse::browse(array('action_name' => 'OOPlace', 'description_template' => 'design:ezodf/browse_place.tpl', 'content' => array(), 'from_page' => '/ezodf/export/', 'cancel_page' => '/ezodf/export/'), $module);
    return;
}
$doExport = false;
if ($module->isCurrentAction('OOPlace')) {
    // We have the file and the placement. Do the actual import.
    $selectedNodeIDArray = eZContentBrowse::result('OOPlace');
    $nodeID = $selectedNodeIDArray[0];
    $doExport = true;
}
if ($http->hasPostVariable("NodeID")) {
    $nodeID = $http->postVariable("NodeID");
    $doExport = true;
} else {
    if (is_numeric($NodeID)) {
        $nodeID = $NodeID;
        $doExport = true;
    }
}
$exportType = false;
if ($http->hasPostVariable("ExportType")) {
    $type = $http->postVariable("ExportType");
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:export.php

示例13: chooseObjectVersionsToCopy

function chooseObjectVersionsToCopy($Module, &$Result, $object)
{
    $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
    $tpl = eZTemplate::factory();
    $tpl->setVariable('object', $object);
    $tpl->setVariable('selected_node_id', $selectedNodeIDArray[0]);
    $Result['content'] = $tpl->fetch('design:content/copy.tpl');
    $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('kernel/content', 'Content')), array('url' => false, 'text' => ezpI18n::tr('kernel/content', 'Copy')));
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:9,代码来源:copy.php

示例14: chooseObjectVersionsToCopy

function chooseObjectVersionsToCopy($Module, &$Result, $object)
{
    $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
    require_once 'kernel/common/template.php';
    $tpl = templateInit();
    $tpl->setVariable('object', $object);
    $tpl->setVariable('selected_node_id', $selectedNodeIDArray[0]);
    $Result['content'] = $tpl->fetch('design:content/copy.tpl');
    $Result['path'] = array(array('url' => false, 'text' => ezi18n('kernel/content', 'Content')), array('url' => false, 'text' => ezi18n('kernel/content', 'Copy')));
}
开发者ID:stevoland,项目名称:ez_patch,代码行数:10,代码来源:copy.php


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