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


PHP eZContentBrowse::nodeAliasID方法代码示例

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


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

示例1: customObjectAttributeHTTPAction


//.........这里部分代码省略.........
                 $contentObjectAttribute->store();
             } else {
                 if ($action == 'remove_objects') {
                     $content = $contentObjectAttribute->content();
                     $relationList = $content['relation_list'];
                     $newRelationList = array();
                     foreach ($relationList as $relationItem) {
                         if (in_array($relationItem['contentobject_id'], $selections)) {
                             $this->removeRelationObject($contentObjectAttribute, $relationItem);
                         } else {
                             $newRelationList[] = $relationItem;
                         }
                     }
                     $content['relation_list'] = $newRelationList;
                     $contentObjectAttribute->setContent($content);
                     $contentObjectAttribute->store();
                 }
             }
         } else {
             if ($action == 'browse_objects') {
                 $module = $parameters['module'];
                 $redirectionURI = $parameters['current-redirection-uri'];
                 $ini = eZINI::instance('content.ini');
                 $browseType = 'AddRelatedObjectListToDataType';
                 $browseTypeINIVariable = $ini->variable('ObjectRelationDataTypeSettings', 'ClassAttributeStartNode');
                 foreach ($browseTypeINIVariable as $value) {
                     list($classAttributeID, $type) = explode(';', $value);
                     if (is_numeric($classAttributeID) and $classAttributeID == $contentObjectAttribute->attribute('contentclassattribute_id') and strlen($type) > 0) {
                         $browseType = $type;
                         break;
                     }
                 }
                 // Fetch the list of "allowed" classes .
                 // A user can select objects of only those allowed classes when browsing.
                 $classAttribute = $contentObjectAttribute->attribute('contentclass_attribute');
                 $classContent = $classAttribute->content();
                 if (isset($classContent['class_constraint_list'])) {
                     $classConstraintList = $classContent['class_constraint_list'];
                 } else {
                     $classConstraintList = array();
                 }
                 $browseParameters = array('action_name' => 'AddRelatedObject_' . $contentObjectAttribute->attribute('id'), 'type' => $browseType, 'browse_custom_action' => array('name' => 'CustomActionButton[' . $contentObjectAttribute->attribute('id') . '_set_object_relation_list]', 'value' => $contentObjectAttribute->attribute('id')), 'persistent_data' => array('HasObjectInput' => 0), 'from_page' => $redirectionURI);
                 $base = $parameters['base_name'];
                 $nodePlacementName = $base . '_browse_for_object_start_node';
                 if ($http->hasPostVariable($nodePlacementName)) {
                     $nodePlacement = $http->postVariable($nodePlacementName);
                     if (isset($nodePlacement[$contentObjectAttribute->attribute('id')])) {
                         $browseParameters['start_node'] = eZContentBrowse::nodeAliasID($nodePlacement[$contentObjectAttribute->attribute('id')]);
                     }
                 }
                 if (count($classConstraintList) > 0) {
                     $browseParameters['class_array'] = $classConstraintList;
                 }
                 eZContentBrowse::browse($browseParameters, $module);
             } else {
                 if ($action == 'set_object_relation_list') {
                     if (!$http->hasPostVariable('BrowseCancelButton')) {
                         $selectedObjectIDArray = $http->postVariable("SelectedObjectIDArray");
                         $content = $contentObjectAttribute->content();
                         $priority = 0;
                         for ($i = 0; $i < count($content['relation_list']); ++$i) {
                             if ($content['relation_list'][$i]['priority'] > $priority) {
                                 $priority = $content['relation_list'][$i]['priority'];
                             }
                         }
                         if ($selectedObjectIDArray !== null) {
                             foreach ($selectedObjectIDArray as $objectID) {
                                 // Check if the given object ID has a numeric value, if not go to the next object.
                                 if (!is_numeric($objectID)) {
                                     eZDebug::writeError("Related object ID (objectID): '{$objectID}', is not a numeric value.", __METHOD__);
                                     continue;
                                 }
                                 /* Here we check if current object is already in the related objects list.
                                  * If so, we don't add it again.
                                  * FIXME: Stupid linear search. Maybe there's some better way?
                                  */
                                 $found = false;
                                 foreach ($content['relation_list'] as $i) {
                                     if ($i['contentobject_id'] == $objectID) {
                                         $found = true;
                                         break;
                                     }
                                 }
                                 if ($found) {
                                     continue;
                                 }
                                 ++$priority;
                                 $content['relation_list'][] = $this->appendObject($objectID, $priority, $contentObjectAttribute);
                                 $contentObjectAttribute->setContent($content);
                                 $contentObjectAttribute->store();
                             }
                         }
                     }
                 } else {
                     eZDebug::writeError("Unknown custom HTTP action: " . $action, 'eZObjectRelationListType');
                 }
             }
         }
     }
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:101,代码来源:ezobjectrelationlisttype.php

示例2: browse

 static function browse($parameters = array(), &$module)
 {
     $ini = eZINI::instance('browse.ini');
     if (!isset($parameters['action_name'])) {
         $parameters['action_name'] = $ini->variable('BrowseSettings', 'DefaultActionName');
     }
     if (!isset($parameters['type'])) {
         $parameters['type'] = $parameters['action_name'];
     }
     //$ini->variable( $parameters['action_name'], 'BrowseType' );
     if (!isset($parameters['selection'])) {
         if ($ini->hasVariable($parameters['type'], 'SelectionType')) {
             $parameters['selection'] = $ini->variable($parameters['type'], 'SelectionType');
         } else {
             $parameters['selection'] = $ini->variable('BrowseSettings', 'DefaultSelectionType');
         }
     }
     if (!isset($parameters['return_type'])) {
         if ($ini->hasVariable($parameters['type'], 'ReturnType')) {
             $parameters['return_type'] = $ini->variable($parameters['type'], 'ReturnType');
         } else {
             $parameters['return_type'] = $ini->variable('BrowseSettings', 'DefaultReturnType');
         }
     }
     if (!isset($parameters['browse_custom_action'])) {
         $parameters['browse_custom_action'] = false;
     }
     if (!isset($parameters['custom_action_data'])) {
         $parameters['custom_action_data'] = false;
     }
     if (!isset($parameters['description_template'])) {
         $parameters['description_template'] = false;
     }
     if (!isset($parameters['start_node'])) {
         $parameters['start_node'] = $ini->variable($parameters['type'], 'StartNode');
     }
     if (!isset($parameters['ignore_nodes_select'])) {
         $parameters['ignore_nodes_select'] = array();
     }
     if (!isset($parameters['ignore_nodes_select_subtree'])) {
         $parameters['ignore_nodes_select_subtree'] = array();
     }
     if (!isset($parameters['ignore_nodes_click'])) {
         $parameters['ignore_nodes_click'] = array();
     }
     if (!isset($parameters['class_array'])) {
         if ($ini->hasVariable($parameters['type'], 'Class')) {
             $parameters['class_array'] = $ini->variable($parameters['type'], 'Class');
         } else {
             $parameters['class_array'] = false;
         }
     }
     if (isset($parameters['keys'])) {
         $overrideStartNode = false;
         foreach ($parameters['keys'] as $key => $keyValue) {
             $variableName = 'StartNode_' . $key;
             if (!$ini->hasVariable($parameters['type'], $variableName)) {
                 continue;
             }
             $keyData = $ini->variable($parameters['type'], $variableName);
             if (is_array($keyValue)) {
                 foreach ($keyValue as $keySubValue) {
                     if (isset($keyData[$keySubValue])) {
                         $overrideStartNode = $keyData[$keySubValue];
                     }
                 }
             } else {
                 if (isset($keyData[$keyValue])) {
                     $overrideStartNode = $keyData[$keyValue];
                 }
             }
             if ($overrideStartNode) {
                 break;
             }
         }
         if ($overrideStartNode) {
             $parameters['start_node'] = $overrideStartNode;
         }
     }
     if (!isset($parameters['persistent_data'])) {
         $parameters['persistent_data'] = false;
     }
     if (!isset($parameters['permission'])) {
         $parameters['permission'] = false;
     }
     if (!isset($parameters['top_level_nodes'])) {
         $parameters['top_level_nodes'] = $ini->variable('BrowseSettings', 'DefaultTopLevelNodes');
         if ($ini->hasVariable($parameters['type'], 'TopLevelNodes')) {
             $parameters['top_level_nodes'] = $ini->variable($parameters['type'], 'TopLevelNodes');
         }
     }
     if (!is_numeric($parameters['start_node'])) {
         $parameters['start_node'] = eZContentBrowse::nodeAliasID($parameters['start_node']);
     }
     for ($i = 0; $i < count($parameters['top_level_nodes']); $i++) {
         if (!is_numeric($parameters['top_level_nodes'][$i])) {
             $parameters['top_level_nodes'][$i] = eZContentBrowse::nodeAliasID($parameters['top_level_nodes'][$i]);
         }
     }
     if (!isset($parameters['cancel_page'])) {
//.........这里部分代码省略.........
开发者ID:runelangseid,项目名称:ezpublish,代码行数:101,代码来源:ezcontentbrowse.php

示例3: customObjectAttributeHTTPAction

 function customObjectAttributeHTTPAction($http, $action, $contentObjectAttribute, $parameters)
 {
     switch ($action) {
         case "set_object_relation":
             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");
                     // Delete the old version from ezcontentobject_link if count of translations > 1
                     $this->removeContentObjectRelation($contentObjectAttribute);
                     $objectID = $selectedObjectIDArray[0];
                     $contentObjectAttribute->setAttribute('data_int', $objectID);
                     $contentObjectAttribute->store();
                 }
             }
             break;
         case "browse_object":
             $module = $parameters['module'];
             $redirectionURI = $parameters['current-redirection-uri'];
             $ini = eZINI::instance('content.ini');
             $browseParameters = array('action_name' => 'AddRelatedObject_' . $contentObjectAttribute->attribute('id'), 'type' => 'AddRelatedObjectToDataType', 'browse_custom_action' => array('name' => 'CustomActionButton[' . $contentObjectAttribute->attribute('id') . '_set_object_relation]', 'value' => $contentObjectAttribute->attribute('id')), 'persistent_data' => array('HasObjectInput' => 0), 'from_page' => $redirectionURI);
             $browseTypeINIVariable = $ini->variable('ObjectRelationDataTypeSettings', 'ClassAttributeStartNode');
             foreach ($browseTypeINIVariable as $value) {
                 list($classAttributeID, $type) = explode(';', $value);
                 if ($classAttributeID == $contentObjectAttribute->attribute('contentclassattribute_id') && strlen($type) > 0) {
                     $browseParameters['type'] = $type;
                     break;
                 }
             }
             $nodePlacementName = $parameters['base_name'] . '_browse_for_object_start_node';
             if ($http->hasPostVariable($nodePlacementName)) {
                 $nodePlacement = $http->postVariable($nodePlacementName);
                 if (isset($nodePlacement[$contentObjectAttribute->attribute('id')])) {
                     $browseParameters['start_node'] = eZContentBrowse::nodeAliasID($nodePlacement[$contentObjectAttribute->attribute('id')]);
                 }
             }
             // Fetch the list of "allowed" classes .
             // A user can select objects of only those allowed classes when browsing.
             $classAttribute = $contentObjectAttribute->attribute('contentclass_attribute');
             $classContent = $classAttribute->content();
             if (isset($classContent['class_constraint_list'])) {
                 $classConstraintList = $classContent['class_constraint_list'];
             } else {
                 $classConstraintList = array();
             }
             if (count($classConstraintList) > 0) {
                 $browseParameters['class_array'] = $classConstraintList;
             }
             eZContentBrowse::browse($browseParameters, $module);
             break;
         case "remove_object":
             // Delete the old version from ezcontentobject_link if count of translations > 1
             $this->removeContentObjectRelation($contentObjectAttribute);
             $contentObjectAttribute->setAttribute('data_int', 0);
             $contentObjectAttribute->store();
             break;
         default:
             eZDebug::writeError("Unknown custom HTTP action: " . $action, "eZObjectRelationType");
             break;
     }
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:61,代码来源:ezobjectrelationtype.php


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