Example #1
0
 function process()
 {
     $edit = $_POST['edit'];
     $this->template_name = 'pages/event/edit.tpl';
     $this->smarty->assign('event_types', $this->event_types);
     $this->smarty->assign('currency_codes', getCurrencyCodes());
     $this->smarty->assign('time_choices', getOptionsFromTimeRange(00, 2400, 30));
     $this->smarty->assign('yes_no', array('No', 'Yes'));
     $this->smarty->assign('seasons', getOptionsFromQuery("SELECT id AS theKey, display_name AS theValue FROM season ORDER BY year, id"));
     if ($edit['step'] == 'perform') {
         $errors = $this->check_input_errors($edit);
         if (count($errors) > 0) {
             $this->smarty->assign('edit', $edit);
             $this->smarty->assign('formErrors', $errors);
             return true;
         }
         $this->perform($edit);
         local_redirect(url("event/view/" . $this->event->registration_id));
     } else {
         # Smarty form auto-fill can't handle booleans directly,
         # so we substitute:
         $this->event->multiple = $this->event->multiple ? 1 : 0;
         $this->event->anonymous = $this->event->anonymous ? 1 : 0;
         $this->smarty->assign('edit', (array) $this->event);
     }
     return true;
 }
Example #2
0
function validate_currency_code($code)
{
    if ($code == "---") {
        return false;
    }
    $ary = array_change_key_case(getCurrencyCodes(), CASE_LOWER);
    return $ary[strtolower($code)] != "";
}