/**
  * Trasforma le variabili $_GET in view_parameters e redirige la richiesta in base al parametro $_GET['RedirectUrlAlias']
  *
  * @see modules/ocsearch/action.php
  * @param array $requestFields
  * @param eZModule $module
  */
 public static function redirect(array $requestFields, eZModule $module = null)
 {
     $result = new OCClassSearchFormFetcher();
     $result->setRequestFields($requestFields);
     if ($module) {
         $redirect = '/';
         if (isset($requestFields['RedirectUrlAlias'])) {
             $redirect = $requestFields['RedirectUrlAlias'];
         } elseif (isset($requestFields['RedirectNodeID'])) {
             $node = eZContentObjectTreeNode::fetch($requestFields['RedirectNodeID']);
             if ($node instanceof eZContentObjectTreeNode) {
                 $redirect = $node->attribute('url_alias');
             }
         }
         $redirect = rtrim($redirect, '/') . $result->getViewParametersString();
         $module->redirectTo($redirect);
     }
 }
 /**
  * @deprecated usare un client ad hoc
  *
  * @param eZModule $module
  * @param eZTemplate $tpl
  * @param $repositoryNodeID
  * @param $localParentNodeID
  *
  * @throws Exception
  */
 protected function handleTagChooserImport(eZModule $module, eZTemplate $tpl, $repositoryNodeID, $localParentNodeID, &$Result)
 {
     if (isset($this->attributes['definition']['AskTagTematica']) && $this->attributes['definition']['AskTagTematica'] == true) {
         $http = eZHTTPTool::instance();
         if (!$http->hasPostVariable('SelectTags')) {
             $tpl->setVariable('fromPage', '/repository/import/' . $this->attributes['definition']['Identifier'] . '/' . $repositoryNodeID);
             $tpl->setVariable('localParentNodeID', $localParentNodeID);
             $Result['content'] = $tpl->fetch('design:repository/eztagschooser.tpl');
             $Result['path'] = array(array('url' => false, 'text' => 'Scegli Tag'));
             return;
         } else {
             $tagIDs = array();
             $tagKeywords = array();
             $tagParents = array();
             foreach ($_POST as $key => $value) {
                 if (substr($key, 0, 8) == 'tematica') {
                     list($tagID, $tagKeyword, $tagParent) = explode(";", $value);
                     $tagIDs[] = $tagID;
                     $tagKeywords[] = $tagKeyword;
                     $tagParents[] = $tagParent;
                 }
             }
         }
         $newObject = $this->import($repositoryNodeID, $localParentNodeID);
         foreach ($newObject->contentObjectAttributes() as $attribute) {
             if ($attribute->contentClassAttributeIdentifier() == 'tematica') {
                 $eZTags = new eZTags();
                 $eZTags->createFromStrings(implode('|#', $tagIDs), implode('|#', $tagKeywords), implode('|#', $tagParents));
                 $eZTags->store($attribute);
                 break;
             }
         }
         $module->redirectTo($newObject->attribute('main_node')->attribute('url_alias'));
     } else {
         $newObject = $this->import($repositoryNodeID, $localParentNodeID);
         $module->redirectTo($newObject->attribute('main_node')->attribute('url_alias'));
     }
 }
Beispiel #3
0
/**
 * Redirects the user
 *
 * @param eZHTTPTool $http
 * @param eZModule $module
 * @return mixed
 */
function redirect($http, $module)
{
    $http->removeSessionVariable('NGConnectAuthResult');
    $http->removeSessionVariable('NGConnectForceRedirect');
    if ($http->hasSessionVariable('NGConnectLastAccessURI')) {
        return $module->redirectTo($http->sessionVariable('NGConnectLastAccessURI'));
    } else {
        return $module->redirectTo('/');
    }
}