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


PHP eZContentBrowse类代码示例

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


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

示例1: loadObjectList

 function loadObjectList($package, $http, $step, &$persistentData, $tpl, &$module)
 {
     if ($http->hasPostVariable('AddSubtree')) {
         eZContentBrowse::browse(array('action_name' => 'FindLimitationSubtree', 'description_template' => 'design:package/creators/ezcontentobject/browse_subtree.tpl', 'from_page' => '/package/create', 'persistent_data' => array('PackageStep' => $http->postVariable('PackageStep'), 'CreatorItemID' => $http->postVariable('CreatorItemID'), 'CreatorStepID' => $http->postVariable('CreatorStepID'), 'Subtree' => 1)), $module);
     } else {
         if ($http->hasPostVariable('AddNode')) {
             eZContentBrowse::browse(array('action_name' => 'FindLimitationNode', 'description_template' => 'design:package/creators/ezcontentobject/browse_node.tpl', 'from_page' => '/package/create', 'persistent_data' => array('PackageStep' => $http->postVariable('PackageStep'), 'CreatorItemID' => $http->postVariable('CreatorItemID'), 'CreatorStepID' => $http->postVariable('CreatorStepID'), 'Node' => 1)), $module);
         } else {
             if ($http->hasPostVariable('RemoveSelected')) {
                 foreach (array_keys($persistentData['node_list']) as $key) {
                     if (in_array($persistentData['node_list'][$key]['id'], $http->postVariable('DeleteIDArray'))) {
                         unset($persistentData['node_list'][$key]);
                     }
                 }
             } else {
                 if ($http->hasPostVariable('SelectedNodeIDArray') && !$http->hasPostVariable('BrowseCancelButton')) {
                     if ($http->hasPostVariable('Subtree') && $http->hasPostVariable('Subtree') == 1) {
                         foreach ($http->postVariable('SelectedNodeIDArray') as $nodeID) {
                             $persistentData['node_list'][] = array('id' => $nodeID, 'type' => 'subtree');
                         }
                     } else {
                         if ($http->hasPostVariable('Node') && $http->hasPostVariable('Node') == 1) {
                             foreach ($http->postVariable('SelectedNodeIDArray') as $nodeID) {
                                 $persistentData['node_list'][] = array('id' => $nodeID, 'type' => 'node');
                             }
                         }
                     }
                 }
             }
         }
     }
     $tpl->setVariable('node_list', $persistentData['node_list']);
 }
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: proccessHTTPInput

 public function proccessHTTPInput($module, $http, $edit = false)
 {
     if ($http->hasVariable('DiscardButton')) {
         return $module->redirectTo('csv_import/configs');
     }
     if ($http->hasVariable('BrowseParentNode')) {
         $url = $edit ? 'csv_import/edit_config/' . $this->attribute('id') : 'csv_import/add_config';
         $browseParameters = array('action_name' => 'AddParentNode', 'type' => 'NewObjectAddNodeAssignment', 'from_page' => $url);
         return eZContentBrowse::browse($browseParameters, $module);
     }
     if ($http->hasVariable('SelectedNodeIDArray')) {
         $nodeIDs = (array) $http->variable('SelectedNodeIDArray');
         $this->setAttribute('parent_node_id', (int) $nodeIDs[0]);
     } elseif ($http->hasVariable('parent_node_id')) {
         $this->setAttribute('parent_node_id', (int) $http->variable('parent_node_id'));
     }
     if ($http->hasVariable('name')) {
         $this->setAttribute('name', $http->variable('name'));
     }
     if ($http->hasVariable('class_id')) {
         $this->setAttribute('class_id', $http->variable('class_id'));
     }
     if ($http->hasVariable('attributes_mapping')) {
         $this->setAttribute('attributes_mapping_serialized', serialize($http->variable('attributes_mapping')));
     }
     return true;
 }
开发者ID:nxc,项目名称:nxc_import,代码行数:27,代码来源:csv_import_config.php

示例3: 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

示例4: 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

示例5: array

             if (!$parentNode) {
                 return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel', array());
             }
             $parentObject = $parentNode->object();
             if (!$parentObject) {
                 return $module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel', array());
             }
             $parentObjectID = $parentObject->attribute('id');
             $ignoreNodesSelect = array_unique($ignoreNodesSelect);
             $ignoreNodesSelectSubtree = array_unique($ignoreNodesSelectSubtree);
             $ignoreNodesClick = array_unique($ignoreNodesClick);
             $classIDArray = array_unique($classIDArray);
             $classIdentifierArray = array_unique($classIdentifierArray);
             $classGroupArray = array_unique($classGroupArray);
             $sectionIDArray = array_unique($sectionIDArray);
             eZContentBrowse::browse(array('action_name' => 'MoveNode', 'description_template' => 'design:content/browse_move_node.tpl', 'keys' => array('class' => $classIDArray, 'class_id' => $classIdentifierArray, 'classgroup' => $classGroupArray, 'section' => $sectionIDArray), 'ignore_nodes_select' => $ignoreNodesSelect, 'ignore_nodes_select_subtree' => $ignoreNodesSelectSubtree, 'ignore_nodes_click' => $ignoreNodesClick, 'persistent_data' => array('ContentNodeID' => implode(',', $moveIDArray), 'ViewMode' => $viewMode, 'ContentObjectLanguageCode' => $languageCode, 'MoveNodeAction' => '1'), 'permission' => array('access' => 'create', 'contentclass_id' => $classIDArray), 'content' => array('name_list' => $objectNameArray, 'node_id_list' => $moveIDArray), 'start_node' => $parentNodeID, 'cancel_page' => $module->redirectionURIForModule($module, 'view', array($viewMode, $parentNodeID, $languageCode)), 'from_page' => "/content/action"), $module);
         } else {
             eZDebug::writeError("Empty SelectedIDArray parameter for action " . $module->currentAction(), 'content/action');
             $module->redirectTo($module->functionURI('view') . '/' . $viewMode . '/' . $parentNodeID . '/');
         }
     } else {
         eZDebug::writeError("Missing SelectedIDArray parameter for action " . $module->currentAction(), 'content/action');
         $module->redirectTo($module->functionURI('view') . '/' . $viewMode . '/' . $parentNodeID . '/');
     }
 } else {
     if ($http->hasPostVariable('UpdatePriorityButton')) {
         $viewMode = $http->postVariable('ViewMode', 'full');
         if ($http->hasPostVariable('ContentNodeID')) {
             $contentNodeID = $http->postVariable('ContentNodeID');
         } else {
             eZDebug::writeError("Variable 'ContentNodeID' can not be found in template.");
开发者ID:heliopsis,项目名称:ezpublish-legacy,代码行数:31,代码来源:action.php

示例6: array

            // Redirect the to detail page for the object's elevation configuration
            $module->redirectToView( 'elevation_detail', array( $objectID ) );
        }
    }
}

// From elevate's landing page, trigger browsing for an object to elevate, or to search elevation for
elseif ( $http->hasPostVariable( 'ezfind-elevate-browseforobject' ) or
         $http->hasPostVariable( 'ezfind-searchelevateconfigurations-browse' ) )
{
    $actionName = $http->hasPostVariable( 'ezfind-elevate-browseforobject' ) ? 'ezfind-elevate-browseforobject' : 'ezfind-searchelevateconfigurations-browse';
    $elevateSearchQuery =  $http->hasPostVariable( 'ezfind-elevate-searchquery' ) ? $http->postVariable( 'ezfind-elevate-searchquery' ): '';
    $browseType = 'SelectObjectRelationNode';
    eZContentBrowse::browse( array( 'action_name' => $actionName,
                                    'type' =>  $browseType,
                                    'from_page' => $module->currentRedirectionURI(),
                                    'persistent_data' => array( 'elevateSearchQuery' => $elevateSearchQuery ) ),
                             $module );
}

// Store the actual Elevate configuration
else if ( $http->hasPostVariable( 'ezfind-elevate-do' ) )
{
    $doStorage = true;

    // Check if we have all required data
    // Validate ObjectID
    if ( !$http->hasPostVariable( 'elevateObjectID' ) or
         ( $elevatedObject = eZContentObject::fetch( $http->postVariable( 'elevateObjectID' ) ) ) === null
       )
    {
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:elevate.php

示例7: 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

示例8:

                        $rssExport->store();
                    }
                }
            }
        }
    }
}
if ($http->hasPostVariable('Item_Count')) {
    $db = eZDB::instance();
    $db->begin();
    for ($itemCount = 0; $itemCount < $http->postVariable('Item_Count'); $itemCount++) {
        if ($http->hasPostVariable('SourceBrowse_' . $itemCount)) {
            $skipValues = $http->hasPostVariable('Ignore_Values_On_Browse_' . $itemCount) && $http->postVariable('Ignore_Values_On_Browse_' . $itemCount);
            eZRSSEditFunction::storeRSSExport($Module, $http, false, $skipValues ? $http->postVariable('Item_ID_' . $itemCount) : null);
            //
            eZContentBrowse::browse(array('action_name' => 'RSSObjectBrowse', 'description_template' => 'design:rss/browse_source.tpl', 'from_page' => '/rss/edit_export/' . $RSSExportID . '/' . $http->postVariable('Item_ID_' . $itemCount) . '/NodeSource'), $Module);
            break;
        }
        // remove selected source (if any)
        if ($http->hasPostVariable('RemoveSource_' . $itemCount)) {
            $itemID = $http->postVariable('Item_ID_' . $itemCount);
            if ($rssExportItem = eZRSSExportItem::fetch($itemID, true, eZRSSExport::STATUS_DRAFT)) {
                // remove the draft version
                $rssExportItem->remove();
                // remove the published version
                $rssExportItem->setAttribute('status', eZRSSExport::STATUS_VALID);
                $rssExportItem->remove();
                eZRSSEditFunction::storeRSSExport($Module, $http);
            }
            break;
        }
开发者ID:netbliss,项目名称:ezpublish,代码行数:31,代码来源:edit_export.php

示例9: 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

示例10: 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

示例11: fetchHttpInput

 function fetchHttpInput($http, $module)
 {
     if ($http->hasPostVariable('NewRule_' . self::NOTIFICATION_HANDLER_ID)) {
         eZContentBrowse::browse(array('action_name' => 'AddSubtreeSubscribingNode', 'from_page' => '/notification/settings/'), $module);
     } else {
         if ($http->hasPostVariable('RemoveRule_' . self::NOTIFICATION_HANDLER_ID) and $http->hasPostVariable('SelectedRuleIDArray_' . self::NOTIFICATION_HANDLER_ID)) {
             $user = eZUser::currentUser();
             $userList = eZSubtreeNotificationRule::fetchList($user->attribute('contentobject_id'), false);
             foreach ($userList as $userRow) {
                 $listID[] = $userRow['id'];
             }
             $ruleIDList = $http->postVariable('SelectedRuleIDArray_' . self::NOTIFICATION_HANDLER_ID);
             foreach ($ruleIDList as $ruleID) {
                 if (in_array($ruleID, $listID)) {
                     eZPersistentObject::removeObject(eZSubtreeNotificationRule::definition(), array('id' => $ruleID));
                 }
             }
         } else {
             if ($http->hasPostVariable("BrowseActionName") and $http->postVariable("BrowseActionName") == "AddSubtreeSubscribingNode" and !$http->hasPostVariable('BrowseCancelButton')) {
                 $selectedNodeIDArray = $http->postVariable("SelectedNodeIDArray");
                 $user = eZUser::currentUser();
                 $existingNodes = eZSubtreeNotificationRule::fetchNodesForUserID($user->attribute('contentobject_id'), false);
                 foreach ($selectedNodeIDArray as $nodeID) {
                     if (!in_array($nodeID, $existingNodes)) {
                         $rule = eZSubtreeNotificationRule::create($nodeID, $user->attribute('contentobject_id'));
                         $rule->store();
                     }
                 }
                 //            $Module->redirectTo( "//list/" );
             }
         }
     }
 }
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:33,代码来源:ezsubtreehandler.php

示例12: array

    $subscriptionList->publish();
    return $Module->redirectToView('subscription_list', array($subscriptionList->attribute('url_alias')));
}
if ($http->hasPostVariable('CancelButton')) {
    $subscriptionList->removeDraft();
    return $Module->redirectToView('list_subscriptions');
}
$relatedObjectMap = array();
$extension = 'eznewsletter';
for ($count = 1; $count <= 3; ++$count) {
    $postName = 'BrowseRelatedObject_' . $count;
    $attributeName = 'related_object_id_' . $count;
    $selectName = 'related' . $count;
    $deleteName = 'DeleteRelatedObject_' . $count;
    if ($http->hasPostVariable($postName)) {
        return eZContentBrowse::browse(array('action_name' => 'ArticlePoolBrowse', 'keys' => array(), 'description_template' => "design:{$extension}/browse_article_pool.tpl", 'from_page' => 'newsletter/edit_subscription_list/' . $subscriptionListID . '/' . $selectName), $Module);
    }
    if ($http->hasPostVariable($deleteName)) {
        $subscriptionList->setAttribute($attributeName, 0);
        $subscriptionList->store();
    }
    if (isset($Params['BrowseSelected']) && $Params['BrowseSelected'] == $selectName) {
        if ($http->hasPostVariable('SelectedObjectIDArray')) {
            $relatedObjectID = $http->postVariable('SelectedObjectIDArray');
            if (isset($relatedObjectID) && !$http->hasPostVariable('BrowseCancelButton')) {
                $subscriptionList->setAttribute($attributeName, $relatedObjectID[0]);
                $subscriptionList->store();
            }
        }
    }
}
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:edit_subscription_list.php

示例13: array

    if ($Module->isCurrentAction('Export')) {
        $pdfExport->setAttribute('source_node_id', $Module->actionParameter('SourceNode'));
        if ($pdfExport->attribute('status') == eZPDFExport::CREATE_ONCE && $pdfExport->countGeneratingOnceExports() > 0) {
            $validation['placement'][] = array('text' => ezpI18n::tr('kernel/pdf', 'An export with such filename already exists.'));
            $validation['processed'] = true;
            $inputValidated = false;
        }
    }
    if ($inputValidated) {
        $pdfExport->store();
    }
}
$setWarning = false;
// used to set missing options during export
if ($Module->isCurrentAction('BrowseSource')) {
    eZContentBrowse::browse(array('action_name' => 'ExportSourceBrowse', 'description_template' => 'design:content/browse_export.tpl', 'from_page' => '/pdf/edit/' . $pdfExport->attribute('id')), $Module);
} else {
    if ($Module->isCurrentAction('Export') && $inputValidated) {
        // remove the old file ( user may changed the filename )
        $originalPdfExport = eZPDFExport::fetch($Params['PDFExportID']);
        if ($originalPdfExport && $originalPdfExport->attribute('status') == eZPDFExport::CREATE_ONCE) {
            $filename = $originalPdfExport->attribute('filepath');
            if (file_exists($filename)) {
                unlink($filename);
            }
        }
        if ($pdfExport->attribute('status') == eZPDFExport::CREATE_ONCE) {
            generatePDF($pdfExport, $pdfExport->attribute('filepath'));
            $pdfExport->store(true);
            return $Module->redirect('pdf', 'list');
        } else {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例14: array

    if (count($nodeIDArray) > 0 and is_numeric($nodeIDArray[0])) {
        // update the database.
        $nodeID = $nodeIDArray[0];
        if ($config === false) {
            $configList = eZSurveyRelatedConfig::fetchList();
            if (count($configList) == 0) {
                $config = eZSurveyRelatedConfig::create();
            } else {
                $config = $configList[0];
            }
        }
        $config->setAttribute('node_id', $nodeID);
        $config->store();
    }
}
if ($Module->isCurrentAction('BrowseForObjects')) {
    $assignedNodesIDs = array();
    eZContentBrowse::browse(array('action_name' => 'AddRelatedSurveyNode', 'description_template' => 'design:content/browse_related.tpl', 'content' => array(), 'keys' => array(), 'ignore_nodes_select' => $assignedNodesIDs, 'from_page' => $Module->redirectionURI('survey', 'wizard', array())), $Module);
    return eZModule::HOOK_STATUS_CANCEL_RUN;
}
$tpl = eZTemplate::factory();
$tpl->setVariable('state', $state);
$tpl->setVariable('content_class_list', $contentClassList);
if ($config !== false) {
    $tpl->setVariable('config', $config);
    $tpl->setVariable('survey_attribute_found', $surveyAttributeFound);
    $tpl->setVariable('browse_attribute', $browseAttribute);
}
$Result = array();
$Result['content'] = $tpl->fetch('design:survey/wizard.tpl');
$Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('survey', 'Survey Wizard')));
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:wizard.php

示例15: customObjectAttributeHTTPAction


//.........这里部分代码省略.........
                                 $itemAdded->setAttribute('ts_visible', '0');
                                 $itemAdded->setAttribute('ts_hidden', '0');
                                 $itemAdded->setAttribute('action', 'modify');
                             } else {
                                 if (!$itemValid) {
                                     //if there is no same item in history and valid, also the item is not to be removed, add new
                                     $item = $block->addItem(new eZPageBlockItem());
                                     $item->setAttribute('object_id', $objectID);
                                     $item->setAttribute('node_id', $nodeID);
                                     $item->setAttribute('priority', $block->getItemCount());
                                     $item->setAttribute('ts_publication', time());
                                     $item->setAttribute('action', 'add');
                                 }
                             }
                         }
                     }
                     $contentObjectAttribute->setContent($page);
                     $contentObjectAttribute->store();
                 }
             }
             break;
         case 'new_item_browse':
             $module = $parameters['module'];
             $redirectionURI = $redirectionURI = $parameters['current-redirection-uri'];
             $page = $contentObjectAttribute->content();
             $zone = $page->getZone($params[1]);
             $block = $zone->getBlock($params[2]);
             $type = $block->attribute('type');
             $blockINI = eZINI::instance('block.ini');
             $classArray = false;
             if ($blockINI->hasVariable($type, 'AllowedClasses')) {
                 $classArray = $blockINI->variable($type, 'AllowedClasses');
             }
             eZContentBrowse::browse(array('class_array' => $classArray, 'action_name' => 'AddNewBlockItem', 'browse_custom_action' => array('name' => 'CustomActionButton[' . $contentObjectAttribute->attribute('id') . '_new_item-' . $params[1] . '-' . $params[2] . ']', 'value' => $contentObjectAttribute->attribute('id')), 'from_page' => $redirectionURI, 'cancel_page' => $redirectionURI, 'persistent_data' => array('HasObjectInput' => 0)), $module);
             break;
         case 'new_source':
             $page = $contentObjectAttribute->content();
             $zone = $page->getZone($params[1]);
             $block = $zone->getBlock($params[2]);
             if ($http->hasPostVariable('SelectedNodeIDArray')) {
                 $selectedNodeIDArray = $http->postVariable('SelectedNodeIDArray');
                 $blockINI = eZINI::instance('block.ini');
                 $fetchParametersSelectionType = $blockINI->variable($block->attribute('type'), 'FetchParametersSelectionType');
                 $fetchParams = unserialize($block->attribute('fetch_params'));
                 if ($fetchParametersSelectionType['Source'] == 'single') {
                     $fetchParams['Source'] = $selectedNodeIDArray[0];
                 } else {
                     $fetchParams['Source'] = $selectedNodeIDArray;
                 }
                 $block->setAttribute('fetch_params', serialize($fetchParams));
                 $persBlockObject = eZFlowBlock::fetch($block->attribute('id'));
                 if ($persBlockObject instanceof eZFlowBlock) {
                     $persBlockObject->setAttribute('last_update', 0);
                     $persBlockObject->store();
                 }
             }
             $contentObjectAttribute->setContent($page);
             $contentObjectAttribute->store();
             break;
         case 'new_source_browse':
             $page = $contentObjectAttribute->content();
             $zone = $page->getZone($params[1]);
             $block = $zone->getBlock($params[2]);
             $blockINI = eZINI::instance('block.ini');
             $fetchParametersSelectionType = $blockINI->variable($block->attribute('type'), 'FetchParametersSelectionType');
             $module = $parameters['module'];
开发者ID:BGCX067,项目名称:ezpublish-thetechtalent-svn-to-git,代码行数:67,代码来源:ezpagetype.php


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