本文整理汇总了PHP中eZContentBrowse::browse方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentBrowse::browse方法的具体用法?PHP eZContentBrowse::browse怎么用?PHP eZContentBrowse::browse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentBrowse
的用法示例。
在下文中一共展示了eZContentBrowse::browse方法的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']);
}
示例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;
}
示例3: relateExistingObject
function relateExistingObject($http, $action, $objectAttribute, $parameters)
{
$assignedNodesIDs = array();
$module = $GLOBALS['module'];
$objectID = $objectAttribute->attribute('contentobject_id');
$contentObjectAttributeID = $objectAttribute->attribute('id');
$contentClassAttributeID = $objectAttribute->attribute('contentclassattribute_id');
$version = $objectAttribute->attribute('version');
$languageCode = $objectAttribute->attribute('language_code');
$postQuestionID = eZSurveyType::PREFIX_ATTRIBUTE . '_ezsurvey_id_' . $contentObjectAttributeID;
$contentClassAttribute = eZContentClassAttribute::fetch($contentClassAttributeID);
$classID = $contentClassAttribute->attribute('contentclass_id');
$contentClass = eZContentClass::fetch($classID);
$classIdentifier = $contentClass->attribute('identifier');
$customActionButton = "CustomActionButton[" . $contentObjectAttributeID . "_ezsurvey_related_object_" . $this->ID . "_relate_existing_node]";
eZContentBrowse::browse(array('action_name' => 'AddRelatedSurveyObject', 'persistent_data' => array($postQuestionID => $this->ID, 'ContentObjectAttribute_id[]' => $contentObjectAttributeID, 'ClassIdentifier' => $classIdentifier, 'ContentLanguageCode' => $languageCode, $customActionButton => $this->ID, 'HasObjectInput' => false), 'description_template' => 'design:content/browse_related.tpl', 'content' => array(), 'keys' => array(), 'ignore_nodes_select' => $assignedNodesIDs, 'from_page' => $module->redirectionURI('content', 'edit', array($objectID, $version, $languageCode))), $module);
return eZModule::HOOK_STATUS_CANCEL_RUN;
}
示例4: foreach
if ($http->hasPostVariable("RemoveRuleButton")) {
$discountRuleIDList = $http->postVariable("removeRuleList");
$db = eZDB::instance();
$db->begin();
foreach ($discountRuleIDList as $discountRuleID) {
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();
示例5: browse
function browse($Module, $srcNode)
{
if ($Module->hasActionParameter('LanguageCode')) {
$languageCode = $Module->actionParameter('LanguageCode');
} else {
$languageCode = false;
}
$nodeID = $srcNode->attribute('node_id');
$object = $srcNode->attribute('object');
$objectID = $object->attribute('id');
$class = $object->contentClass();
$classID = $class->attribute('id');
$srcParentNodeID = $srcNode->attribute('parent_node_id');
$ignoreNodesSelect = array();
$ignoreNodesClick = array();
foreach ($object->assignedNodes(false) as $element) {
$ignoreNodesSelect[] = $element['node_id'];
$ignoreNodesClick[] = $element['node_id'];
}
$ignoreNodesSelect = array_unique($ignoreNodesSelect);
$ignoreNodesClick = array_unique($ignoreNodesClick);
$viewMode = 'full';
if ($Module->hasActionParameter('ViewMode')) {
$viewMode = $Module->actionParameter('ViewMode');
}
eZContentBrowse::browse(array('action_name' => 'CopySubtree', 'description_template' => 'design:content/browse_copy_subtree.tpl', 'keys' => array('class' => $classID, 'class_id' => $class->attribute('identifier'), 'classgroup' => $class->attribute('ingroup_id_list'), 'section' => $object->attribute('section_id')), 'ignore_nodes_select' => $ignoreNodesSelect, 'ignore_nodes_click' => $ignoreNodesClick, 'persistent_data' => array('ObjectID' => $objectID, 'NodeID' => $nodeID), 'permission' => array('access' => 'create', 'contentclass_id' => $classID), 'content' => array('node_id' => $nodeID), 'start_node' => $srcParentNodeID, 'cancel_page' => $Module->redirectionURIForModule($Module, 'view', array($viewMode, $srcParentNodeID, $languageCode)), 'from_page' => "/content/copysubtree"), $Module);
}
示例6: 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.");
示例7: 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
)
{
示例8: if
$bookmark = eZContentBrowseBookmark::fetch( $deleteID );
if ( $bookmark === null )
continue;
if ( $bookmark->attribute( 'user_id' ) == $userID )
$bookmark->remove();
}
}
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' );
示例9:
$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;
}
示例10: 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();
}
}
}
}
示例11: 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 {
示例12: 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')));
示例13: customObjectAttributeHTTPAction
//.........这里部分代码省略.........
}
}
if ($itemAdded || $itemToBeRemoved) {
//if there is same item in history, or item to be removed (in history or valid), set the item in history to be modified
// if item is not to be removed, add to the block since it's not in block ,but in history or valid
if (!$itemToBeRemoved) {
$block->addItem($itemAdded);
}
$itemAdded->setXMLStorable(true);
$itemAdded->setAttribute('node_id', $nodeID);
$itemAdded->setAttribute('priority', $block->getItemCount());
$itemAdded->setAttribute('ts_publication', time());
$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();
示例14: customObjectAttributeHTTPAction
//.........这里部分代码省略.........
$rootGroup->cleanupRules();
if ( count( $group->attribute( 'multioption_list') ) == 0 )
{
$rootGroup->removeChildGroup( $group->attribute( 'group_id' ) );
}
$contentObjectAttribute->setContent( $rootGroup );
$contentObjectAttribute->store();
}
}
else if ( $actionlist[0] == "switch-mode" )
{
$editMode = $actionlist[1];
$sessionVarName = 'eZEnhancedMultioption_edit_mode_' . $contentObjectAttribute->attribute( 'id' );
$http->setSessionVariable( $sessionVarName, $editMode );
$rootGroup = $contentObjectAttribute->content();
$contentObjectAttribute->setContent( $rootGroup );
}
else if ( $actionlist[0] == "reset-rules" )
{
$rootGroup = $contentObjectAttribute->content();
$rootGroup->Rules = array();
$contentObjectAttribute->setContent( $rootGroup );
$contentObjectAttribute->store();
}
else if ( $actionlist[0] == "set-object" )
{
if ( $http->hasPostVariable( 'BrowseActionName' ) and
$http->postVariable( 'BrowseActionName' ) == ( 'AddRelatedObject_' . $contentObjectAttribute->attribute( 'id' ) ) and
$http->hasPostVariable( "SelectedObjectIDArray" ) )
{
if ( !$http->hasPostVariable( 'BrowseCancelButton' ) )
{
$selectedObjectArray = $http->hasPostVariable( "SelectedObjectIDArray" );
$selectedObjectIDArray = $http->postVariable( "SelectedObjectIDArray" );
$rootGroup = $contentObjectAttribute->content();
$groupID = $actionlist[1];
$multioptionID = $actionlist[2];
$optionID = $actionlist[3];
$objectID = $selectedObjectIDArray[0];
$rootGroup->setObjectForOption( $multioptionID, $optionID, $objectID );
$contentObjectAttribute->setContent( $rootGroup );
$contentObjectAttribute->store();
}
}
}
else if ( $actionlist[0] == "browse-object" )
{
$module = $parameters['module'];
$redirectionURI = $parameters['current-redirection-uri'];
$ini = eZINI::instance( 'content.ini' );
$browseType = 'AddRelatedObjectToDataType';
$browseTypeINIVariable = $ini->variable( 'ObjectRelationDataTypeSettings', 'ClassAttributeStartNode' );
foreach( $browseTypeINIVariable as $value )
{
list( $classAttributeID, $type ) = explode( ';',$value );
if ( $classAttributeID == $contentObjectAttribute->attribute( 'contentclassattribute_id' ) && strlen( $type ) > 0 )
{
$browseType = $type;
break;
}
}
eZContentBrowse::browse( array( 'action_name' => 'AddRelatedObject_' . $contentObjectAttribute->attribute( 'id' ),
'type' => $browseType,
'browse_custom_action' => array( 'name' => 'CustomActionButton[' . $contentObjectAttribute->attribute( 'id' ) .
'_set-object_'. $actionlist[1] . '_' . $actionlist[2] . '_' .$actionlist[3] . ']',
'value' => $contentObjectAttribute->attribute( 'id' ) ),
'persistent_data' => array( 'HasObjectInput' => 0 ),
'from_page' => $redirectionURI ),
$module );
}
else if ( $actionlist[0] == "remove-object" )
{
$rootGroup = $contentObjectAttribute->content();
$groupID = $actionlist[1];
$multioptionID = $actionlist[2];
$optionID = $actionlist[3];
$rootGroup->removeObjectFromOption( $multioptionID, $optionID );
$contentObjectAttribute->setContent( $rootGroup );
$contentObjectAttribute->store();
}
else
{
eZDebug::writeError( "Unknown custom HTTP action: " . $action, "eZMultiOptionType" );
}
}
示例15: ITTematicaSync
<?php
$module = $Params['Module'];
$http = eZHTTPTool::instance();
$tpl = eZTemplate::factory();
$repository = $Params['repository'];
try {
$itTematicaSync = new ITTematicaSync($repository);
$remoteTags = $itTematicaSync->fetchRemoteTags();
// Tematiche dal sito remoto
if ($http->hasPostVariable('SelezionaDestinazione')) {
eZContentBrowse::browse(array('action_name' => 'SelectDestinationNodeID', 'selection' => 'single', 'return_type' => 'NodeID', 'start_node' => 2, 'from_page' => '/itobjectsync/client/' . $repository, 'cancel_page' => '/itobjectsync/client/' . $repository), $module);
return;
}
$itTematicaSync->modifySelection($http);
// Eventuali modifiche alla selezione
// Variabili passate al template
$tpl->setVariable('remote_tags', $remoteTags);
$tpl->setVariable('repository_url', $itTematicaSync->getRepositoryUrl());
$tpl->setVariable('default_dest_node_id', $itTematicaSync->getDefaultDestinationNodeID());
$tpl->setVariable('tematiche', $itTematicaSync->getTematiche());
} catch (Exception $ex) {
$tpl->setVariable('exception', $ex->getMessage());
}
$Result['content'] = $tpl->fetch("design:itobjectsync/client.tpl");
$Result['path'] = array(array('url' => 'content/dashboard', 'text' => 'Pannello strumenti'), array('url' => false, 'text' => 'Import automatico Tematica'));