Example #1
0
 /**
  * Deprecated
  * @see PageRouter::redirectHome()
  */
 function redirectHome()
 {
     $_this =& PKPRequest::_checkThis();
     return $_this->_delegateToRouter('redirectHome');
 }
Example #2
0
 /**
  * Handle a 404 error (page not found).
  */
 function handle404()
 {
     PKPRequest::_checkThis();
     header('HTTP/1.0 404 Not Found');
     fatalError('404 Not Found');
 }
Example #3
0
 /**
  * This method exists to maintain backwards compatibility
  * with calls to methods that have been factored into the
  * Router implementations.
  *
  * It delegates the call to the router and returns the result.
  *
  * NB: This method is protected and may not be used by
  * external classes. It should also only be used in legacy
  * methods.
  *
  * @return mixed depends on the called method
  */
 function &_delegateToRouter($method)
 {
     $_this =& PKPRequest::_checkThis();
     if (is_null($_this->_deprecationWarning)) {
         $_this->_deprecationWarning = Config::getVar('debug', 'deprecation_warnings');
         if (is_null($_this->_deprecationWarning)) {
             $_this->_deprecationWarning = false;
         }
     }
     if ($_this->_deprecationWarning) {
         trigger_error('Deprecated function');
     }
     $router =& $_this->getRouter();
     // Construct the method call
     $callable = array($router, $method);
     // Get additional parameters but replace
     // the first parameter (currently the
     // method to be called) with the request
     // as all router methods required the request
     // as their first parameter.
     $parameters = func_get_args();
     $parameters[0] =& $_this;
     $returner = call_user_func_array($callable, $parameters);
     return $returner;
 }
 /**
  * This method exists to maintain backwards compatibility
  * with calls to methods that have been factored into the
  * Router implementations.
  *
  * It delegates the call to the router and returns the result.
  *
  * NB: This method is protected and may not be used by
  * external classes. It should also only be used in legacy
  * methods.
  *
  * @return mixed depends on the called method
  */
 function &_delegateToRouter($method)
 {
     // This call is deprecated. We don't trigger a
     // deprecation error, though, as there are so
     // many instances of this error that it has a
     // performance impact and renders the error
     // log virtually useless when deprecation
     // warnings are switched on.
     // FIXME: Fix enough instances of this error so that
     // we can put a deprecation warning in here.
     $_this =& PKPRequest::_checkThis();
     $router =& $_this->getRouter();
     // Construct the method call
     $callable = array($router, $method);
     // Get additional parameters but replace
     // the first parameter (currently the
     // method to be called) with the request
     // as all router methods required the request
     // as their first parameter.
     $parameters = func_get_args();
     $parameters[0] =& $_this;
     $returner = call_user_func_array($callable, $parameters);
     return $returner;
 }
 /**
  * Save changes to a review form.
  */
 function updateReviewForm()
 {
     $this->validate();
     $this->setupTemplate(true, $reviewForm);
     $reviewFormId = Request::getUserVar('reviewFormId') === null ? null : (int) Request::getUserVar('reviewFormId');
     $conference =& Request::getConference();
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     $reviewForm =& $reviewFormDao->getReviewForm($reviewFormId, ASSOC_TYPE_CONFERENCE, $conference->getId());
     //if ($reviewFormId != null && (!isset($reviewForm) || $reviewForm->getIncompleteCount() != 0)) {
     if ($reviewFormId != null && !isset($reviewForm)) {
         $source = Request::getUserVar('source');
         if (!isset($source)) {
             Request::redirect(null, null, null, 'reviewForms');
         } else {
             $source = $source . '/' . $reviewFormId;
             PKPRequest::_checkThis()->url($source);
         }
     }
     import('manager.form.ReviewFormForm');
     $reviewFormForm = new ReviewFormForm($reviewFormId);
     $reviewFormForm->readInputData();
     if ($reviewFormForm->validate()) {
         $reviewFormId = $reviewFormForm->execute();
         //Request::redirect(null, null, null, 'reviewForms');
         $source = Request::getUserVar('source');
         if (!isset($source)) {
             Request::redirect(null, null, null, 'reviewForms');
         } else {
             $source = $source . '/' . $reviewFormId;
             header("Location: " . $source);
         }
     } else {
         $templateMgr =& TemplateManager::getManager();
         if ($reviewFormId == null) {
             $templateMgr->assign('pageTitle', 'manager.reviewForms.create');
         } else {
             $templateMgr->assign('pageTitle', 'manager.reviewForms.edit');
         }
         $reviewFormForm->display();
     }
 }