示例#1
0
 /**
  * Display form to edit a special event.
  * @param $args array
  * @param $request PKPRequest
  */
 function editSpecialEvent($args, $request)
 {
     $this->validate();
     $this->setupTemplate($request, true);
     $schedConf =& $request->getSchedConf();
     $specialEventId = !isset($args) || empty($args) ? null : (int) $args[0];
     $specialEventDao = DAORegistry::getDAO('SpecialEventDAO');
     // Ensure special event is valid and for this conference
     if ($specialEventId != null && $specialEventDao->getSpecialEventSchedConfId($specialEventId) == $schedConf->getId() || $specialEventId == null) {
         import('classes.manager.form.scheduler.SpecialEventForm');
         $templateMgr =& TemplateManager::getManager($request);
         $templateMgr->append('pageHierarchy', array($request->url(null, null, 'manager', 'specialEvents'), 'manager.scheduler.specialEvents'));
         if ($specialEventId == null) {
             $templateMgr->assign('specialEventTitle', 'manager.scheduler.specialEvent.createSpecialEventShort');
         } else {
             $templateMgr->assign('specialEventTitle', 'manager.scheduler.specialEvent.editSpecialEventShort');
         }
         $specialEventForm = new SpecialEventForm($specialEventId);
         if ($specialEventForm->isLocaleResubmit()) {
             $specialEventForm->readInputData();
         } else {
             $specialEventForm->initData();
         }
         $specialEventForm->display();
     } else {
         $request->redirect(null, null, null, 'specialEvents');
     }
 }
示例#2
0
 /**
  * Display form to edit a special event.
  * @param $args array optional, first parameter is the ID of the specialEvent to edit
  */
 function editSpecialEvent($args = array())
 {
     $this->validate();
     $this->setupTemplate(true);
     $schedConf =& Request::getSchedConf();
     $specialEventId = !isset($args) || empty($args) ? null : (int) $args[0];
     $specialEventDao =& DAORegistry::getDAO('SpecialEventDAO');
     // Ensure special event is valid and for this conference
     if ($specialEventId != null && $specialEventDao->getSpecialEventSchedConfId($specialEventId) == $schedConf->getId() || $specialEventId == null) {
         import('manager.form.scheduler.SpecialEventForm');
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->append('pageHierarchy', array(Request::url(null, null, 'manager', 'specialEvents'), 'manager.scheduler.specialEvents'));
         if ($specialEventId == null) {
             $templateMgr->assign('specialEventTitle', 'manager.scheduler.specialEvent.createSpecialEventShort');
         } else {
             $templateMgr->assign('specialEventTitle', 'manager.scheduler.specialEvent.editSpecialEventShort');
         }
         if (checkPhpVersion('5.0.0')) {
             // WARNING: This form needs $this in constructor
             $specialEventForm = new SpecialEventForm($specialEventId);
         } else {
             $specialEventForm =& new SpecialEventForm($specialEventId);
         }
         if ($specialEventForm->isLocaleResubmit()) {
             $specialEventForm->readInputData();
         } else {
             $specialEventForm->initData();
         }
         $specialEventForm->display();
     } else {
         Request::redirect(null, null, null, 'specialEvents');
     }
 }