當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZContentOperationCollection::removeNodes方法代碼示例

本文整理匯總了PHP中eZContentOperationCollection::removeNodes方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentOperationCollection::removeNodes方法的具體用法?PHP eZContentOperationCollection::removeNodes怎麽用?PHP eZContentOperationCollection::removeNodes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eZContentOperationCollection的用法示例。


在下文中一共展示了eZContentOperationCollection::removeNodes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array_keys

             if ($count > 0) {
                 $hasChildren = true;
             }
         }
     }
     if ($hasChildren) {
         $http->setSessionVariable('CurrentViewMode', $viewMode);
         $http->setSessionVariable('DeleteIDArray', array_keys($removeList));
         $http->setSessionVariable('ContentNodeID', $nodeID);
         $http->setSessionVariable('ContentLanguage', $languageCode);
         return $module->redirectToView('removeobject');
     } else {
         if (eZOperationHandler::operationIsAvailable('content_removelocation')) {
             $operationResult = eZOperationHandler::execute('content', 'removelocation', array('node_list' => array_keys($removeList)), null, true);
         } else {
             eZContentOperationCollection::removeNodes(array_keys($removeList));
         }
     }
     return $module->redirectToView('view', array($viewMode, $redirectNodeID, $languageCode));
 } else {
     if ($http->hasPostVariable('EditButton')) {
         if ($http->hasPostVariable('ContentObjectID')) {
             $parameters = array($http->postVariable('ContentObjectID'));
             if ($http->hasPostVariable('ContentObjectVersion')) {
                 $parameters[] = $http->postVariable('ContentObjectVersion');
                 if ($http->hasPostVariable('ContentObjectLanguageCode')) {
                     $parameters[] = $http->postVariable('ContentObjectLanguageCode');
                 }
             } else {
                 if ($http->hasPostVariable('ContentObjectLanguageCode')) {
                     $languageCode = $http->postVariable('ContentObjectLanguageCode');
開發者ID:heliopsis,項目名稱:ezpublish-legacy,代碼行數:31,代碼來源:action.php

示例2: foreach

// to do this the following must be true:
// - The total child count must be zero
// - There must be no object removal (i.e. it is the only node for the object)
if ($totalChildCount == 0) {
    $canRemove = true;
    foreach ($deleteResult as $item) {
        if ($item['object_node_count'] <= 1) {
            $canRemove = false;
            break;
        }
    }
    if ($canRemove) {
        if (eZOperationHandler::operationIsAvailable('content_removelocation')) {
            $operationResult = eZOperationHandler::execute('content', 'removelocation', array('node_list' => array_keys($deleteNodeIdArray), 'move_to_trash' => $moveToTrash), null, true);
        } else {
            eZContentOperationCollection::removeNodes(array_keys($deleteNodeIdArray));
        }
        if ($http->hasSessionVariable('RedirectURIAfterRemove') && $http->sessionVariable('RedirectURIAfterRemove')) {
            $Module->redirectTo($http->sessionVariable('RedirectURIAfterRemove'));
            $http->removeSessionVariable('RedirectURIAfterRemove');
            return $http->removeSessionVariable('RedirectIfCancel');
        } else {
            return $Module->redirectToView('view', array($viewMode, $contentNodeID, $contentLanguage));
        }
    }
}
$tpl = eZTemplate::factory();
$tpl->setVariable('reverse_related', $info['reverse_related_count']);
$tpl->setVariable('module', $Module);
$tpl->setVariable('moveToTrashAllowed', $moveToTrashAllowed);
// Backwards compatibility
開發者ID:legende91,項目名稱:ez,代碼行數:31,代碼來源:removeobject.php


注:本文中的eZContentOperationCollection::removeNodes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。