Exemple #1
0
 function getBulkReturnUrl()
 {
     $sReturnAction = $_REQUEST['fReturnAction'];
     $sReturnData = $_REQUEST['fReturnData'];
     $sAction = 'main';
     $qs = '';
     switch ($sReturnAction) {
         case 'browse':
             $sReturnData = empty($sReturnData) ? $_REQUEST['fFolderId'] : $sReturnData;
             $sTargetUrl = KTBrowseUtil::getUrlForFolder(Folder::get($sReturnData));
             break;
         case 'simpleSearch':
             $sTargetUrl = KTBrowseUtil::getSimpleSearchBaseUrl();
             $extra = 'fSearchableText=' . $sReturnData;
             break;
         case 'booleanSearch':
             $sTargetUrl = KTBrowseUtil::getBooleanSearchBaseUrl();
             $sAction = 'performSearch';
             $extra = 'boolean_search_id=' . $sReturnData;
             break;
         case 'search2':
             $sTargetUrl = KTBrowseUtil::getSearchResultURL();
             $sAction = 'searchResults';
             break;
         default:
             $sTargetUrl = $sReturnAction;
             $sAction = '';
     }
     $qs = !empty($sAction) ? 'action=' . $sAction : '';
     $qs .= !empty($extra) ? '&' . $extra : '';
     $sTargetUrl = KTUtil::addQueryString($sTargetUrl, $qs);
     return $sTargetUrl;
 }
Exemple #2
0
 function form_complete()
 {
     $sReturnAction = KTUtil::arrayGet($_REQUEST, 'fReturnAction');
     $sReturnData = KTUtil::arrayGet($_REQUEST, 'fReturnData');
     $sAction = 'main';
     switch ($sReturnAction) {
         case 'browse':
             $sReturnData = empty($sReturnData) ? $_REQUEST['fFolderId'] : $sReturnData;
             $sTargetUrl = KTBrowseUtil::getUrlForFolder(Folder::get($sReturnData));
             break;
         case 'simpleSearch':
             // do we use this?
             $sTargetUrl = KTBrowseUtil::getSimpleSearchBaseUrl();
             $extraargs = array('fSearchableText' => $sReturnData);
             break;
         case 'booleanSearch':
             // do we use this?
             $sTargetUrl = KTBrowseUtil::getBooleanSearchBaseUrl();
             $sAction = 'performSearch';
             $extraargs = array('boolean_search_id' => $sReturnData);
             break;
         case 'search2':
             $sTargetUrl = KTBrowseUtil::getSearchResultURL();
             $sAction = 'refresh';
             break;
         default:
             $sTargetUrl = $sReturnAction;
             $sAction = '';
     }
     $oForm = new KTForm();
     $oForm->setOptions(array('identifier' => 'ktcore.actions.bulk.complete.form', 'submit_label' => _kt('Return'), 'targeturl' => $sTargetUrl, 'context' => $this, 'action' => $sAction, 'extraargs' => $extraargs, 'noframe' => true));
     return $oForm;
 }