public static function addExtraControls(FForm $theForm)
 {
     $theForm->addTextInput('samplefield', translateFN('Esempio'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     // add an extra field if we're embedding the controls
     // in the standard edit_user form
     if (!isset($this)) {
         $theForm->addHidden('forceSaveExtra')->withData(true);
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->addRadios('delete', translateFN('Vuoi rimuovere davvero la classe?'), array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $this->addHidden('id_course');
     $this->addHidden('id_course_instance');
 }
Exemple #3
0
 public function __construct()
 {
     parent::__construct();
     $this->addTextInput('username', translateFN('Username'))->setRequired()->setValidator(FormValidator::USERNAME_VALIDATOR);
     $this->addHidden('findByUsername');
     $this->addHidden('id_course_instance');
 }
 public function __construct()
 {
     parent::__construct();
     $desc = translateFN("Vuoi davvero cancellare la chat selezionata?") . ' ' . translateFN('Saranno cancellate anche le conversazioni della chat');
     $this->addRadios('delete', $desc, array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $this->addHidden('id_room');
 }
 public function __construct($cod = FALSE, $action = NULL)
 {
     parent::__construct();
     if ($action != NULL) {
         $this->setAction($action);
     }
     $this->setName('registration');
     $this->addTextInput('nome', translateFN('Nome'))->setRequired()->setValidator(FormValidator::FIRSTNAME_VALIDATOR);
     $this->addTextInput('cognome', translateFN('Cognome'))->setRequired()->setValidator(FormValidator::LASTNAME_VALIDATOR);
     $this->addTextInput('birthdate', translateFN('Data di nascita'))->setRequired()->setValidator(FormValidator::DATE_VALIDATOR);
     $this->addTextInput('birthcity', translateFN('Comune o stato estero di nascita'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('birthprovince', translateFN('Provincia di nascita'));
     $this->addTextInput('email', translateFN('Email'))->setRequired()->setValidator(FormValidator::EMAIL_VALIDATOR);
     $this->addSelect('sesso', translateFN('Genere'), array('0' => translateFN('Scegli un genere'), 'M' => translateFN('Maschio'), 'F' => translateFN('Femmina')), '0');
     $this->addTextInput('matricola', translateFN('numero di matricola'));
     /*
     * 
            if ($cod) {
                $this->addTextInput('codice', translateFN('Codice'))
                     ->setRequired()
                     ->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
            }
     
     * 
     */
 }
 public function __construct()
 {
     parent::__construct();
     $this->addTextInput('username', translateFN('Username'))->setRequired()->setValidator(FormValidator::USERNAME_VALIDATOR);
     $this->addPasswordInput('password', translateFN('Password'))->setRequired()->setValidator(FormValidator::PASSWORD_VALIDATOR);
     $this->addHidden('performLogin');
 }
 public function __construct()
 {
     parent::__construct();
     $this->setName('EditranslatorForm');
     $this->addTextarea('TranslationTextArea', translateFN('Modifica traduzione'));
     $j = 'return saveTranslation()';
     $this->setOnSubmit($j);
 }
 public function __construct($tutorsAr = array(), $checkedTutors)
 {
     parent::__construct();
     $this->addCheckboxes('id_tutors_new[]', translateFN("Seleziona i tutors dall'elenco"), $tutorsAr, $checkedTutors);
     $this->addHidden('id_tutors_old');
     $this->addHidden('id_course_instance');
     $this->addHidden('id_course');
 }
 public function __construct()
 {
     parent::__construct();
     $this->addPasswordInput('password', translateFN('Password'))->setRequired()->setValidator(FormValidator::PASSWORD_VALIDATOR);
     $this->addPasswordInput('passwordcheck', translateFN('Conferma password'))->setRequired()->setValidator(FormValidator::PASSWORD_VALIDATOR);
     $this->addHidden('userId');
     $this->addHidden('token');
 }
Exemple #10
0
 public function __construct($data = array())
 {
     parent::__construct();
     $this->data = $data;
     $this->header();
     $this->content();
     $this->footer();
 }
 public function __construct($tutorsAr = array(), $checkedRadioButton)
 {
     parent::__construct();
     $this->addRadios('id_tutor_new', translateFN("Seleziona un tutor dall'elenco"), $tutorsAr, $checkedRadioButton);
     $this->addHidden('id_tutor_old');
     $this->addHidden('id_course_instance');
     $this->addHidden('id_course');
 }
 public function __construct()
 {
     parent::__construct();
     $this->setEncType('multipart/form-data');
     $this->setAccept('text/csv');
     $this->addFileInput('uploaded_file', translateFN('Seleziona il file contenente gli studenti da iscrivere'));
     $this->addHidden('id_course');
     $this->addHidden('id_course_instance');
 }
 public function __construct($language = NULL)
 {
     parent::__construct();
     $this->setName('translatorForm');
     $this->addTextInput('t_name', translateFN('Cerca nella traduzione'));
     $this->addSelect('selectLanguage', translateFN('Selezionare una lingua '), $language, 1);
     $this->setMethod('POST');
     $j = 'return initDataTable();';
     $this->setOnSubmit($j);
 }
Exemple #14
0
 public function __construct($formName, $courseList)
 {
     parent::__construct();
     $this->setName($formName);
     $courseList[0] = translateFN('Scegli un corso da esportare');
     $this->addSelect('course', translateFN('Seleziona un corso da cui esportatre'), $courseList, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addCheckboxes('nomedia', translateFN('Se si pensa di assegnare il corso importato allo stesso autore di quello esporato, si può evitare di esportare i files multimediali'), array('1' => translateFN('Non esportare i media')), null);
     $this->setSubmitValue(translateFN('Avanti') . " >>");
     $this->setOnSubmit('return goToExportStepTwo();');
 }
 public function __construct()
 {
     parent::__construct();
     //$action = PAYPAL_ACTION;
     $action = HTTP_ROOT_DIR . "/browsing/student_course_instance_transfer.php";
     //?instance=$instanceId&student=$studentId&provider=$providerId&course=$courseId";
     $this->setAction($action);
     $submitValue = translateFN('Paga con bonifico');
     $this->setSubmitValue($submitValue);
     $this->addHidden('instance');
     $this->addHidden('student');
     $this->addHidden('provider');
     $this->addHidden('course');
 }
Exemple #16
0
 public function __construct($data, $formName = null, $action = null, $selectOptions = null)
 {
     parent::__construct();
     if (!is_null($formName)) {
         $this->setName($formName);
     }
     if (!is_null($action)) {
         $this->setAction($action);
     }
     $this->addHidden('provider_id');
     $this->addSelect('className', translateFN('Classe PHP'), $selectOptions, reset($selectOptions))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('name', translateFN('Nome'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('buttonLabel', translateFN('Testo per il bottone'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->fillWithArrayData($data);
 }
 public function __construct($formName)
 {
     parent::__construct();
     $this->setName($formName);
     $isDraftOptions = array('0' => translateFN('No'), '1' => translateFN('Sì'));
     $this->addHidden('id');
     $this->addTextInput('subject', translateFN('Oggetto'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('sender', translateFN('Mittente'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('date', translateFN('Data'))->setRequired()->setValidator(FormValidator::DATE_VALIDATOR);
     $this->addSelect('draft', translateFN('Bozza'), $isDraftOptions, 1)->setRequired()->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     $this->addTextarea('htmltext', translateFN('Testo HTML'))->setRequired()->setValidator(FormValidator::MULTILINE_TEXT_VALIDATOR);
     $this->addButton('generatePlainText', translateFN('Genera testo dall\'HTML'))->setAttribute('onclick', 'javascript:toPlainText(FCKeditorAPI.GetInstance(\'htmltext\').GetData());');
     $this->addTextarea('plaintext', translateFN('Testo Alternativo'))->setRequired()->setValidator(FormValidator::MULTILINE_TEXT_VALIDATOR);
     $this->setSubmitValue(translateFN('Salva'));
 }
 public function __construct($cod = FALSE, $action = NULL)
 {
     parent::__construct();
     if ($action != NULL) {
         $this->setAction($action);
     }
     $this->setName('advancedForm');
     $this->addTextInput('s_node_name', translateFN('Titolo'));
     $this->addTextInput('s_node_title', translateFN('Keywords'));
     $this->addTextarea('s_node_text', translateFN('Testo'));
     $this->setMethod('GET');
     $this->addHidden('s_AdvancedForm');
     $j = 'javascript:disableForm()';
     $this->setOnSubmit($j);
 }
 public function __construct($formName, $courseList)
 {
     parent::__construct();
     $this->setName($formName);
     $this->addHidden('id');
     $this->addHidden('recipientsCount')->withData(0);
     $this->addHidden('enqueuedmsg')->withData(translateFN('Newsletter inoltrata per l\'invio'));
     $userType = FormControl::create(FormControl::SELECT, 'userType', translateFN('Tipo Utente'))->withData(array(0 => translateFN('Scegli il tipo...'), AMA_TYPE_AUTHOR => translateFN('Autore'), AMA_TYPE_STUDENT => translateFN('Studente'), AMA_TYPE_TUTOR => translateFN('Tutor'), AMA_TYPE_SWITCHER => translateFN('Switcher'), 9999 => translateFN('Tutti')), 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $userPlatformStatus = FormControl::create(FormControl::SELECT, 'userPlatformStatus', translateFN('Stato Studente nella Piattaforma'))->withData(array(-1 => translateFN('Scegli lo stato...'), ADA_STATUS_PRESUBSCRIBED => translateFN('Non Confermato'), ADA_STATUS_REGISTERED => translateFN('Confermato')), -1)->setAttribute('disabled', 'true')->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $userCourseStatus = FormControl::create(FormControl::SELECT, 'userCourseStatus', translateFN('Stato Studente nel corso selezionato'))->withData(array(-1 => translateFN('Scegli lo stato...'), ADA_SERVICE_SUBSCRIPTION_STATUS_UNDEFINED => translateFN('In visita'), ADA_SERVICE_SUBSCRIPTION_STATUS_REQUESTED => translateFN('Preiscritto'), ADA_SERVICE_SUBSCRIPTION_STATUS_ACCEPTED => translateFN('Iscritto'), ADA_SERVICE_SUBSCRIPTION_STATUS_SUSPENDED => translateFN('Rimosso'), ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED => translateFN('Completato')), -1)->setAttribute('disabled', 'true')->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addFieldset(translateFN('Filtro') . ' ' . translateFN('Utenti'), 'userChoice')->withData(array($userType, $userPlatformStatus, $userCourseStatus));
     $courseList[0] = translateFN('Scegli il corso...');
     $courseSel = FormControl::create(FormControl::SELECT, 'idCourse', translateFN('Corso'))->withData($courseList, 0)->setAttribute('disabled', 'true')->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $instanceSel = FormControl::create(FormControl::SELECT, 'idInstance', translateFN('Istanza Corso'))->setAttribute('disabled', 'true')->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addFieldset(translateFN('Filtro') . ' ' . translateFN('Corsi'), 'courseChoice')->withData(array($courseSel, $instanceSel));
     $this->setSubmitValue(translateFN('Invia Newsletter'));
 }
 public function __construct($action = NULL)
 {
     parent::__construct();
     $formName = 'moreUserFields';
     $classObj = new $formName();
     $fieldList = $formName::getFields();
     if ($action != NULL) {
         $this->setAction($action);
     }
     $this->setName($formName);
     // pls don't touch theese hidden fields
     $this->addHidden('saveAsMultiRow')->withData(1);
     $this->addHidden('_isSaved')->withData(0);
     $this->addHidden('extraTableName')->withData($formName);
     $this->addHidden($formName::getForeignKeyProperty());
     $this->addHidden($formName::getKeyProperty())->withData(0);
     // the firsrt two fields are 'service' fields, so start at index 2
     $fieldIndex = 2;
     /**
      * submit button text label, you can use your own here
      */
     $this->setSubmitValue(translateFN('Salva'));
     /**
      * YOUR OWN FIELDS STARTS HERE, if you're following the example,
      * it's all about defining which type of controls you want, forget
      * about labels and fields name and id.
      */
     /**
      * @author giorgio 22/nov/2013
      * uncomment and edit below to add/edit fields
      * from the one to MANY table storing extra user data
      */
     // 3
     // 		$this->addTextInput($fieldList[$fieldIndex], $classObj->getLabel($fieldIndex++))
     // 		->setRequired()
     // 		->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     // 4
     // 		$this->addSelect($fieldList[$fieldIndex], $classObj->getLabel($fieldIndex++),
     // 				array ('0'=>'First Choice','1'=>'Second Choice','2'=>'Third Choice')
     // 				, 0)
     // 			  ->setRequired()
     // 		      ->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     // 5
     // 		$this->addRadios($fieldList[$fieldIndex], $classObj->getLabel($fieldIndex++),
     // 				array ('0'=>'Don\'t agree','1'=>'Agree', '2'=>'Unsure'), 0)->setRequired();
 }
 public function __construct($id_user, $id_tutor, $id_course_instance, $event_token)
 {
     parent::__construct();
     //$authors = array_merge(array(0 => translateFN('Scegli un autore per il corso')), $authors);
     //$languages = array_merge(array(0 => translateFN('Scegli una lingua per il corso')), $languages);
     $id_user = $userObj->getId();
     $this->setName('formEguidanceForm');
     $this->setId('formEguidanceForm');
     $this->setSubmitValue(translateFN('Salva'));
     $authors[0] = translateFN('Scegli un autore per i contenuti del servizio');
     $languages[0] = translateFN('Scegli una lingua per i contenuti del servizio');
     $this->addSelect('id_utente_autore', translateFN('Autore per i contenuti del servizio'), $authors, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addSelect('id_lingua', translateFN('Lingua per i contenuti del servizio'), $languages, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addHidden('id_corso');
     $this->addHidden('id_utente')->withData($user_id);
     $this->addTextInput('nome', translateFN('Codice servizio'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('titolo', translateFN('Titolo'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     //$this->addTextInput('data_creazione', translateFN('Data creazione'));
     //$this->addTextInput('data_pubblicazione', translateFN('Data pubblicazione'));
     $this->addTextarea('descrizione', translateFN('Descrizione'))->setValidator(FormValidator::MULTILINE_TEXT_VALIDATOR);
     //        $this->addTextInput('id_nodo_iniziale', translateFN('Id nodo iniziale'))
     //             ->withData(0)
     //             ->setRequired()
     //             ->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     //
     //        $this->addTextInput('id_nodo_toc', translateFN('Id nodo toc'));
     //
     //        $this->addTextInput('media_path', translateFN('Media path'))
     //             ->withData(MEDIA_PATH_DEFAULT);
     //
     //        $this->addTextInput('static_mode', translateFN('Static mode'));
     /*
             $this->addTextInput('crediti', translateFN('Crediti corso'))
         ->setRequired()
         ->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     * 
     */
     $desc = translateFN('Livello servizio:');
     $this->addRadios('common_area', $desc, array(0 => translateFN('Help per studente'), 1 => translateFN('Area di interazione per utenti registrati')), 0);
     $this->addHidden('id_nodo_iniziale')->withData(0);
     $this->addHidden('crediti')->withData(0);
     $this->addHidden('id_nodo_toc');
     $this->addHidden('media_path');
     $this->addHidden('static_mode');
 }
Exemple #22
0
 public function __construct($data, $formName = null, $action = null)
 {
     parent::__construct();
     if (!is_null($formName)) {
         $this->setName($formName);
     }
     if (!is_null($action)) {
         $this->setAction($action);
     }
     $this->addHidden('option_id');
     $this->addTextInput('name', translateFN('Nome'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('host', translateFN('Host'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('authdn', translateFN('DN Autenticazione'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('basedn', translateFN('DN Ricerca'))->setRequired()->setAttribute('maxlength', $this->maxlength)->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('filter', translateFN('Filtro'))->setAttribute('maxlength', $this->maxlength);
     $this->addSelect('usertype', translateFN('Tipo Utente'), array(0 => translateFN('Scegli il tipo...'), AMA_TYPE_AUTHOR => translateFN('Autore'), AMA_TYPE_STUDENT => translateFN('Studente'), AMA_TYPE_SWITCHER => translateFN('Switcher'), AMA_TYPE_TUTOR => translateFN('Tutor'), AMA_TYPE_SUPERTUTOR => translateFN('Super Tutor')), 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->fillWithArrayData($data);
 }
 public function __construct($presubscriptions, $subscriptions, $instanceId)
 {
     parent::__construct();
     $data = array(ADA_STATUS_PRESUBSCRIBED => translateFN('Preiscritto'), ADA_STATUS_SUBSCRIBED => translateFN('Iscritto'), ADA_STATUS_REMOVED => translateFN('Rimosso'), ADA_STATUS_VISITOR => translateFN('In visita'), ADA_SERVICE_SUBSCRIPTION_STATUS_COMPLETED => translateFN('Completato'));
     foreach ($presubscriptions as $p) {
         $selectId = 'currentStatus[' . $p->getSubscriberId() . ']';
         $hiddenId = 'previousStatus[' . $p->getSubscriberId() . ']';
         $this->addSelect($selectId, $p->getSubscriberFullname(), $data, $p->getSubscriptionStatus());
         $this->addHidden($hiddenId)->withData($p->getSubscriptionStatus());
     }
     foreach ($subscriptions as $p) {
         $selectId = 'currentStatus[' . $p->getSubscriberId() . ']';
         $hiddenId = 'previousStatus[' . $p->getSubscriberId() . ']';
         $this->addSelect($selectId, $p->getSubscriberFullname(), $data, $p->getSubscriptionStatus());
         $this->addHidden($hiddenId)->withData($p->getSubscriptionStatus());
     }
     $this->addHidden('instanceId')->withData($instanceId);
 }
 public function __construct()
 {
     parent::__construct();
     $action = PAYPAL_ACTION;
     $this->setAction($action);
     $submitValue = translateFN('Paga Ora');
     $this->setSubmitValue($submitValue);
     $this->addHidden('cmd');
     $this->addHidden('business');
     $this->addHidden('id_course_instance');
     $this->addHidden('currency_code');
     $this->addHidden('notify_url');
     $this->addHidden('return');
     $this->addHidden('upload');
     $this->addHidden('address1');
     $this->addHidden('city');
     $this->addHidden('country');
     $this->addHidden('zip');
     $this->addHidden('first_name');
     $this->addHidden('last_name');
     $this->addHidden('address_override');
     $this->addHidden('email');
     $this->addHidden('amount_1');
     $this->addHidden('item_name_1');
     $this->addHidden('rm');
     $this->addHidden('no_shipping');
     /*$this->addHidden('id_layout')->withData(0);
             
             $this->addTextInput('data_inizio_previsto', translateFN('Data inizio previsto'))
                  ->setRequired()
                  ->setValidator(FormValidator::DATE_VALIDATOR);
     
             $this->addTextInput('durata', translateFN('Durata'))
                  ->setRequired()
                  ->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     
             $this->addRadios(
                     'started',
                     translateFN('Iniziato'),
                     array(0 => translateFN('No'), 1 => translateFN('Si')),
                     0);
              *
              */
 }
 public function __construct()
 {
     parent::__construct();
     $this->addTextInput('id_room', translateFN('ChatRoom ID'))->setAttribute('readonly', 'readonly');
     $this->addTextInput('chat_title', translateFN('Titolo'))->setRequired()->setValidator(FormValidator::FIRSTNAME_VALIDATOR);
     $this->addTextInput('chat_topic', translateFN('Argomento'))->setRequired()->setValidator(FormValidator::DEFAULT_VALIDATOR);
     $this->addTextArea('welcome_msg', translateFN('Messaggio di benvenuto'))->setValidator(FormValidator::DEFAULT_VALIDATOR);
     $this->addTextInput('chat_owner', translateFN('Proprietario'))->setRequired()->setAttribute('readonly', 'readonly')->setValidator(FormValidator::USERNAME_VALIDATOR);
     $this->addTextInput('actual_chat_type', translateFN('Tipo'))->setAttribute('readonly', 'readonly');
     if (!isset($chatroom_started) || isset($chatroom_started) && !$chatroom_started) {
         $this->addSelect('new_chat_type', translateFN('Nuovo tipo'), array('-- select --' => '-- select --', 'Classe' => translateFN('Classe'), 'Pubblica' => translateFN('Pubblica')), 0);
     }
     $this->addTextInput('max_users', translateFN('Numero di utenti'))->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     $this->addTextInput('start_day', translateFN('Data di apertura (gg/mm/aaaa)'))->setAttribute('readonly', 'readonly')->setValidator(FormValidator::DATE_VALIDATOR);
     $this->addTextInput('start_time', translateFN('Ora di apertura (oo:mm:ss)'))->setAttribute('readonly', 'readonly')->setValidator(FormValidator::TIME_VALIDATOR);
     $this->addTextInput('end_day', translateFN('Data di chiusura (gg/mm/aaaa)'))->setValidator(FormValidator::DATE_VALIDATOR);
     $this->addTextInput('end_time', translateFN('Ora di chiusura (oo:mm:ss)'))->setValidator(FormValidator::TIME_VALIDATOR);
     $this->addTextInput('id_course_instance', translateFN('ID Classe'))->setRequired()->setAttribute('readonly', 'readonly')->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
 }
 public function __construct()
 {
     parent::__construct();
     $this->addHidden('id_course');
     $this->addHidden('id_course_instance');
     $this->addHidden('id_layout')->withData(0);
     $this->addTextInput('title', translateFN('Titolo'));
     $this->addTextInput('price', translateFN('Prezzo (99999.99)'))->setValidator(FormValidator::NON_NEGATIVE_MONEY_VALIDATOR);
     $this->addTextInput('data_inizio_previsto', translateFN('Data inizio previsto (gg/mm/aaaa)'))->setRequired()->setValidator(FormValidator::DATE_VALIDATOR);
     $desc = translateFN('Iscrizioni aperte');
     $this->addRadios('open_subscription', $desc, array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $desc = translateFN('Iniziato');
     $this->addRadios('started', $desc, array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $this->addTextInput('durata', translateFN('Durata'))->setRequired()->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     $desc = translateFN('modo autoistruzione');
     $this->addRadios('self_instruction', $desc, array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $desc = translateFN("Iscrizione autonoma dell'utente");
     $this->addRadios('self_registration', $desc, array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $this->addTextInput('duration_hours', translateFN('Durata prevista in ore'))->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addTextInput('duration_subscription', translateFN("Durata iscrizione dell'utente in gg."))->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     $this->addTextInput('start_level_student', translateFN('Livello assegnato agli studenti (0 - 99)'))->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     /* if isset $_SESSION['service_level'] it means that the istallation supports course type */
     if (isset($_SESSION['service_level'])) {
         /**
          * @author giorgio 04/mag/2015
          *
          * course instances of a non public course cannot be public,
          * so remove the 'public course' choice from service type select field 
          */
         $shownServiceTypes = array();
         foreach ($_SESSION['service_level'] as $key => $val) {
             if (!(bool) $_SESSION['service_level_info'][$key]['isPublic']) {
                 $shownServiceTypes[$key] = $val;
             }
         }
         $desc = translateFN('Tipo') . ':';
         $this->addSelect('service_level', $desc, $shownServiceTypes, reset($shownServiceTypes))->setRequired();
     }
 }
Exemple #27
0
 public function __construct($formName, $authorsList, $courseList)
 {
     parent::__construct();
     $authorsList[0] = translateFN('Scegli un autore per il corso');
     $courseList[0] = translateFN('Importa come nuovo corso');
     $this->setName($formName);
     $this->addHidden('importFileName');
     $this->addSelect('author', translateFN("Seleziona l'autore a cui assegnare il corso importato"), $authorsList, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addSelect('courseID', translateFN("Seleziona il corso in cui importare"), $courseList, 0)->setRequired()->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     if (isset($_SESSION['service_level'])) {
         /**
          * @author giorgio 06/mag/2015
          *
          * switcher can add public courses only if:
          * - it's a multiprovider having session tester equals to PUBLIC tester
          * - it's not multiprovider
          */
         $shownServiceTypes = array();
         foreach ($_SESSION['service_level'] as $key => $val) {
             if ((bool) $_SESSION['service_level_info'][$key]['isPublic']) {
                 // this coud have been an OR, but looks more readable this way
                 if (MULTIPROVIDER && $_SESSION['sess_selected_tester'] == ADA_PUBLIC_TESTER) {
                     $shownServiceTypes[$key] = $val;
                 } else {
                     if (!MULTIPROVIDER) {
                         $shownServiceTypes[$key] = $val;
                     }
                 }
             } else {
                 $shownServiceTypes[$key] = $val;
             }
         }
         $desc = translateFN('Tipo di corso') . ':';
         $this->addSelect('service_level', $desc, $shownServiceTypes, reset($shownServiceTypes));
     }
     $this->setSubmitValue(translateFN('Avanti') . " >>");
     $this->setOnSubmit('return goToImportSelectNode();');
 }
 public function __construct()
 {
     parent::__construct();
     $this->addRadios('delete', translateFN("Vuoi davvero disabilitare l'utente selezionato?"), array(0 => translateFN('No'), 1 => translateFN('Si')), 0);
     $this->addHidden('id_user');
 }
 public function __construct()
 {
     parent::__construct();
     $this->addTextInput('username', translateFN('Username'))->setRequired()->setValidator(FormValidator::EMAIL_VALIDATOR);
 }
 public function __construct($authors, $languages)
 {
     parent::__construct();
     //$authors = array_merge(array(0 => translateFN('Scegli un autore per il corso')), $authors);
     //$languages = array_merge(array(0 => translateFN('Scegli una lingua per il corso')), $languages);
     $authors[0] = translateFN('Scegli un autore per il corso');
     $languages[0] = translateFN('Scegli una lingua per il corso');
     $this->addSelect('id_utente_autore', translateFN('Autore'), $authors, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addSelect('id_lingua', translateFN('Lingua del corso'), $languages, 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addHidden('id_corso');
     $this->addHidden('id_layout')->withData(0);
     $this->addTextInput('nome', translateFN('Codice corso'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addTextInput('titolo', translateFN('Titolo'))->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR);
     $this->addHidden('data_creazione');
     //$this->addTextInput('data_creazione', translateFN('Data creazione'));
     $this->addTextInput('data_pubblicazione', translateFN('Data pubblicazione'));
     //             ->setValidator(FormValidator::DATE_VALIDATOR);
     $this->addTextarea('descrizione', translateFN('Descrizione'))->setValidator(FormValidator::MULTILINE_TEXT_VALIDATOR);
     //        $this->addTextInput('id_nodo_iniziale', translateFN('Id nodo iniziale'))
     //             ->withData(0)
     //             ->setRequired()
     //             ->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR);
     //
     //        $this->addTextInput('id_nodo_toc', translateFN('Id nodo toc'));
     //
     //        $this->addTextInput('media_path', translateFN('Media path'))
     //             ->withData(MEDIA_PATH_DEFAULT);
     //
     //        $this->addTextInput('static_mode', translateFN('Static mode'));
     $this->addTextInput('crediti', translateFN('Crediti corso'))->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     $this->addTextInput('duration_hours', translateFN('Durata prevista in ore'))->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
     /* if isset $_SESSION['service_level'] it means that the istallation supports course type */
     if (isset($_SESSION['service_level'])) {
         /**
          * @author giorgio 23/apr/2015
          * 
          * switcher can add public courses only if:
          * - it's a multiprovider having session tester equals to PUBLIC tester
          * - it's not multiprovider
          */
         $shownServiceTypes = array();
         foreach ($_SESSION['service_level'] as $key => $val) {
             if ((bool) $_SESSION['service_level_info'][$key]['isPublic']) {
                 // this coud have been an OR, but looks more readable this way
                 if (MULTIPROVIDER && $_SESSION['sess_selected_tester'] == ADA_PUBLIC_TESTER) {
                     $shownServiceTypes[$key] = $val;
                 } else {
                     if (!MULTIPROVIDER) {
                         $shownServiceTypes[$key] = $val;
                     }
                 }
             } else {
                 $shownServiceTypes[$key] = $val;
             }
         }
         $desc = translateFN('Tipo di corso') . ':';
         $this->addSelect('service_level', $desc, $shownServiceTypes, reset($shownServiceTypes))->setRequired();
     }
     $this->addHidden('id_nodo_iniziale')->withData(0);
     $this->addHidden('id_nodo_toc');
     $this->addHidden('media_path');
     $this->addHidden('static_mode');
 }