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');
 }
 protected function content()
 {
     $this->common_elements();
     //apostrofo
     $cloze_apostrophe = 'cloze_apostrofo';
     $options = array(ADA_NO_APOSTROPHE_TEST_MULTIPLE => translateFN('Senza apostrofo'), ADA_APOSTROPHE_TEST_MULTIPLE => translateFN('Con apostrofo'));
     if (isset($this->data[$cloze_apostrophe])) {
         $defaultValue = $this->data[$cloze_apostrophe];
     } else {
         $defaultValue = ADA_NO_APOSTROPHE_TEST_MULTIPLE;
     }
     $this->addSelect($cloze_apostrophe, translateFN('Tipologia di esercizio') . ':', $options, $defaultValue);
     //posizione box
     $box = 'box_position';
     $options = array(ADA_TOP_TEST_DRAGDROP => translateFN('Sopra il testo'), ADA_RIGHT_TEST_DRAGDROP => translateFN('A destra del testo'), ADA_BOTTOM_TEST_DRAGDROP => translateFN('Sotto il testo'), ADA_LEFT_TEST_DRAGDROP => translateFN('A sinistra del testo'));
     if (isset($this->data[$box])) {
         $defaultValue = $this->data[$box];
     } else {
         $defaultValue = ADA_RIGHT_TEST_DRAGDROP;
     }
     $this->addSelect($box, translateFN('Posizione box drag\'n\'drop') . ':', $options, $defaultValue);
     //titolo drag'n'drop
     $titolo = 'titolo_dragdrop';
     if (isset($this->data[$titolo])) {
         $defaultValue = $this->data[$titolo];
     } else {
         $defaultValue = null;
     }
     $this->addHidden('titolo_dragdrop')->withData(htmlentities($defaultValue, ENT_COMPAT | ENT_HTML401, ADA_CHARSET));
 }
 /**
  * build, manage and display the module's pages
  *
  * @return array
  *
  * @access public
  */
 public function run($action = null)
 {
     /* @var $html	string holds html code to be retuned */
     $htmlObj = null;
     /* @var $path	string  path var to render in the help message */
     $help = translateFN('Da qui puoi inserire o modifcare un login provider');
     /* @var $status	string status var to render in the breadcrumbs */
     $title = translateFN('Login Provider');
     switch ($action) {
         case MODULES_LOGIN_EDIT_LOGINPROVIDER:
             /**
              * edit action, display the form with passed data
              */
             /**
              * CARICARE LE CLASSI DAI FILES!!!!!
              */
             $htmlObj = new FormLoginProvider($this->toArray(), null, null, self::getAvailableClasses());
         default:
             /**
              * return an empty page as default action
              */
             break;
     }
     return array('htmlObj' => $htmlObj, 'help' => $help, 'title' => $title);
 }
 /**
  * Control rendering
  *
  * @return string
  */
 public function render()
 {
     $select = CDOMElement::create('select', 'id:' . $this->id . ',class:form');
     if (empty($this->files)) {
         $option = CDOMElement::create('option', 'value:template_clear');
         $option->addChild(new CText(translateFN('Nessun template trovato')));
         $select->addChild($option);
     } else {
         $option = CDOMElement::create('option');
         $option->setAttribute('value', '');
         $option->addChild(new CText(translateFN('Vuoto')));
         $select->addChild($option);
         $i = 0;
         foreach ($this->files as $k => $v) {
             $option = CDOMElement::create('option');
             $option->setAttribute('value', htmlspecialchars($v));
             $option->addChild(new CText($k));
             $select->addChild($option);
             $i++;
         }
     }
     $button = CDOMElement::create('input_button');
     $button->setAttribute('id', $this->id . '_button');
     $button->setAttribute('value', translateFN('Inserisci template'));
     $button->setAttribute('style', 'float:right;');
     $html = '<label id="l_' . $this->id . '" for="' . $this->id . '" class="' . self::DEFAULT_CLASS . '">' . $this->label . '</label> ' . $button->getHtml() . ' ' . $select->getHtml();
     return $html;
 }
Example #5
0
 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');
 }
Example #6
0
 protected function content()
 {
     //nome
     if (!empty($this->data['nome'])) {
         $defaultValue = $this->data['nome'];
     } else {
         $defaultValue = '';
     }
     $this->addTextInput('nome', translateFN('Nome (visualizzato nella breadcrumb)') . ':')->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR)->withData($defaultValue);
     //titolo
     $this->addTextInput('titolo', translateFN('Titolo') . ':')->setRequired()->setValidator(FormValidator::NOT_EMPTY_STRING_VALIDATOR)->withData($this->data['titolo']);
     //descrizione
     $this->addTextarea('testo', translateFN('Descrizione') . ':')->withData(Node::prepareInternalLinkMediaForEditor($this->data['testo']));
     //consegna (message showed on test / survey ending)
     if (!empty($this->data['nome'])) {
         $defaultValue = Node::prepareInternalLinkMediaForEditor($this->data['consegna']);
     } else {
         $defaultValue = translateFN('Dati inviati correttamente.');
     }
     $this->addTextarea('consegna', translateFN('Messaggio finale') . ':')->withData($defaultValue);
     //return
     $options = array(ADA_NO_TEST_RETURN => translateFN('Non mostrare link'), ADA_NEXT_NODE_TEST_RETURN => translateFN('Mostra link al nodo successivo del corso'), ADA_INDEX_TEST_RETURN => translateFN('Mostra link all\'indice del corso'), ADA_COURSE_INDEX_TEST_RETURN => translateFN('Mostra link all\'elenco dei corsi'));
     if (isset($this->data['return'])) {
         $defaultValue = $this->data['return'];
     } else {
         $defaultValue = ADA_NO_TEST_RETURN;
     }
     $this->addSelect('return', translateFN('Link di ritorno') . ':', $options, $defaultValue);
     //ripetibile
     $radios = array(ADA_YES_TEST_REPETEABLE => translateFN('Si'), ADA_NO_TEST_REPETEABLE => translateFN('No'));
     if (isset($this->data['ripetibile'])) {
         $defaultValue = $this->data['ripetibile'];
     } else {
         $defaultValue = ADA_YES_TEST_REPETEABLE;
     }
     $this->addRadios('ripetibile', translateFN('Ripetibile dall\'utente') . ':', $radios, $defaultValue);
     //suddivisione in sessioni
     $radios = array(ADA_SEQUENCE_TEST_MODE => translateFN('Si'), ADA_ONEPAGE_TEST_MODE => translateFN('No'));
     if (isset($this->data['suddivisione'])) {
         $defaultValue = $this->data['suddivisione'];
     } else {
         $defaultValue = ADA_ONEPAGE_TEST_MODE;
     }
     $this->addRadios('suddivisione', translateFN('Suddividi per sessioni') . ':', $radios, $defaultValue);
     //feedback
     $options = array(ADA_CORRECT_TEST_INTERACTION => translateFN('Correzioni risposte e risposta corretta'), ADA_RATING_TEST_INTERACTION => translateFN('Correzioni risposte, punteggio ottenuto e risposta corretta'), ADA_FEEDBACK_TEST_INTERACTION => translateFN('Correzioni risposte'), ADA_BLIND_TEST_INTERACTION => translateFN('Nessun feedback'));
     if (isset($this->data['feedback'])) {
         $defaultValue = $this->data['feedback'];
     } else {
         $defaultValue = ADA_RATING_TEST_INTERACTION;
     }
     $this->addSelect('feedback', translateFN('Feedback all\'utente') . ':', $options, $defaultValue);
     //livello minimo
     if (isset($this->data['min_level'])) {
         $defaultValue = $this->data['min_level'];
     } else {
         $defaultValue = 0;
     }
     $this->addTextInput('min_level', translateFN('Livello minimo per accedere al test (0 = nessun limite)') . ':')->setRequired()->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR)->withData($defaultValue);
 }
Example #7
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($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);
            }
     
     * 
     */
 }
 function __construct(Widget $widgetObj)
 {
     $content = "<div id='{$widgetObj->generatedDIVId}' class='ADAwidget loading'>" . self::$placeholder . "</div>";
     if ($widgetObj->ajaxModule) {
         $replacement = translateFN('Loading') . '...';
         if (JQUERY_SUPPORT) {
             $ajax_content = "<script type='text/javascript'>\$j.get('{$widgetObj->ajaxModule}'";
             if (!empty($widgetObj->optionsArr)) {
                 $ajax_content .= ' ,' . json_encode($widgetObj->optionsArr);
             }
             $ajax_content .= ").done( function(html){ \t\t\t\t\n\t\t\t\t\$j('#{$widgetObj->generatedDIVId}').removeClass('loading');\n\t\t\t\t\$j('#{$widgetObj->generatedDIVId}').html(html);  } );</script>";
         } else {
             // prototype 1.6 version
             $ajax_content = "<script type='text/javascript'>\n\t\t\t\t\t\tnew Ajax.Request('" . $widgetObj->ajaxModule . "', {\n\t\t\t\t\t\t\t\tmethod: 'get',";
             if (!empty($widgetObj->optionsArr)) {
                 $ajax_content .= 'parameters: ' . json_encode($widgetObj->optionsArr) . ',';
             }
             $ajax_content .= "  onComplete: function(response) {\n\t\t\t\t\t\t\$('" . $widgetObj->generatedDIVId . "').removeClassName('loading');\n\t\t\t\t\t\t\$('" . $widgetObj->generatedDIVId . "').update (response.responseText);\n\t\t\t  }\n\t\t\t});\n\t\t\t</script>";
         }
     } else {
         $replacement = translateFN('widget content generator not found');
         $ajax_content = '';
     }
     $this->content = str_replace(self::$placeholder, $replacement, $content) . $ajax_content;
 }
Example #10
0
 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');
 }
Example #11
0
 protected function content()
 {
     $this->setName('deleteForm');
     //cancella
     $radios = array(1 => translateFN('Si'), 0 => translateFN('No'));
     $this->addRadios('delete', $this->message, $radios, 0);
 }
Example #12
0
 protected function content()
 {
     $dh = $GLOBALS['dh'];
     $this->setName('switcherForm');
     //lista dei test presenti
     $test_list = $dh->test_getCourseTest(array('id_corso' => $this->id_course));
     //getting already present test list
     $test_ids = array();
     if (!empty($test_list)) {
         $checkboxes = array();
         foreach ($test_list as $v) {
             $checkboxes[$v['id_test']] = $v['titolo'];
             $test_ids[] = $v['id_test'];
         }
         $this->addCheckboxes('delete_test[]', translateFN('Seleziona i sondaggi da rimuovere dal corso') . ':', $checkboxes, null);
     }
     //lista dei test da aggiungere
     $tmp_tests = $dh->test_getNodes(array('id_nodo_parent' => null, 'tipo' => 'LIKE ' . ADA_TYPE_SURVEY . '%'));
     //getting available test
     $options = array('' => ' --- ');
     $empty = true;
     foreach ($tmp_tests as $v) {
         if (!in_array($v['id_nodo'], $test_ids)) {
             $options[$v['id_nodo']] = $v['titolo'];
             $empty = false;
         }
     }
     if ($empty) {
         $options = array('' => translateFN('Nessun questionario presente'));
         $empty = false;
     }
     if (!$empty) {
         $this->addSelect('id_test', translateFN('Seleziona il sondaggio da aggiungere al corso') . ':', $options, '');
     }
 }
 public static function getAddExerciseForm($form_dataAr = array(), $errorsAr = array())
 {
     $form = CDOMElement::create('form', 'id:add_exercise, name:add_exercise, class:fec, method:post');
     $form->setAttribute('action', 'add_exercise.php?verify=1');
     //$form->setAttribute('onsubmit',"return checkNec();");
     $form->setAttribute('enctype', 'multipart/form-data');
     $parent_node = FormElementCreator::addTextInput('parent_node', 'Nodo parent', $form_dataAr, $errorsAr, '', true);
     $form->addChild($parent_node);
     $exercise_title = FormElementCreator::addTextInput('exercise_title', 'Titolo esercizio', $form_dataAr, $errorsAr, '', true);
     $form->addChild($exercise_title);
     $exercise_familyAr = array(ADA_STANDARD_EXERCISE_TYPE => translateFN('Multiple Choice'), ADA_OPEN_MANUAL_EXERCISE_TYPE => translateFN('Open with Manual Correction'), ADA_OPEN_AUTOMATIC_EXERCISE_TYPE => translateFN('Open with Automatic Correction'), ADA_OPEN_UPLOAD_EXERCISE_TYPE => translateFN('Open Manual + Upload'), ADA_CLOZE_EXERCISE_TYPE => translateFN('CLOZE'));
     $exercise_family = FormElementCreator::addSelect('exercise_family', 'Tipo di esercizio', $exercise_familyAr, $form_dataAr, $errorsAr, '', true);
     $form->addChild($exercise_family);
     $exercise_interactionAr = array(ADA_BLIND_EXERCISE_INTERACTION => translateFN('No Feedback'), ADA_FEEDBACK_EXERCISE_INTERACTION => translateFN('With Feedback'), ADA_RATING_EXERCISE_INTERACTION => translateFN('With Feedback and Rating'));
     $exercise_interaction = FormElementCreator::addSelect('exercise_interaction', 'Tipo di interazione', $exercise_interactionAr, $form_dataAr, $errorsAr, '', true);
     $form->addChild($exercise_interaction);
     $test_modeAr = array(ADA_SINGLE_EXERCISE_MODE => translateFN('Only One Exercise'), ADA_SEQUENCE_EXERCISE_MODE => translateFN('Next Exercise will be Shown'), ADA_RANDOM_EXERCISE_MODE => translateFN('A Random Picked Exercise will be Shown'));
     $test_mode = FormElementCreator::addSelect('test_mode', 'ModalitĂ  di esecuzione', $test_modeAr, $form_dataAr, $errorsAr, '', true);
     $form->addChild($test_mode);
     $test_simplificationAr = array(ADA_NORMAL_EXERCISE_SIMPLICITY => translateFN('Normal Exercise'), ADA_MEDIUM_EXERCISE_SIMPLICITY => translateFN('Medium Exercise'), ADA_SIMPLIFY_EXERCISE_SIMPLICITY => translateFN('Simplified Exercise'));
     $test_simplification = FormElementCreator::addSelect('test_simplification', "SemplicitĂ  dell'esercizio", $test_simplificationAr, $form_dataAr, $errorsAr, '', true);
     $form->addChild($test_simplification);
     $test_barrierAr = array(ADA_NO_EXERCISE_BARRIER => translateFN('No barrier'), ADA_YES_EXERCISE_BARRIER => translateFN('With barrier'));
     $test_barrier = FormElementCreator::addSelect('test_barrier', 'Con sbarramento', $test_barrierAr, $form_dataAr, $errorsAr, '', true);
     $form->addChild($test_barrier);
     $buttons = FormElementCreator::addSubmitAndResetButtons();
     $form->addChild($buttons);
     return $form;
 }
 public function __construct()
 {
     parent::__construct();
     $this->setName('EditranslatorForm');
     $this->addTextarea('TranslationTextArea', translateFN('Modifica traduzione'));
     $j = 'return saveTranslation()';
     $this->setOnSubmit($j);
 }
 public function __construct()
 {
     parent::__construct();
     $this->addTextInput('username', translateFN('Nome utente'))->setRequired()->setValidator(FormValidator::EMAIL_VALIDATOR);
     $this->addPasswordInput('password', translateFN('Password'))->setRequired()->setValidator(FormValidator::PASSWORD_VALIDATOR);
     $this->addPasswordInput('passwordcheck', translateFN('Conferma la password'))->setRequired()->setValidator(FormValidator::PASSWORD_VALIDATOR);
     $this->addSelect('tipo', translateFN('Tipo Utente'), array(0 => translateFN('Scegli il tipo...'), AMA_TYPE_AUTHOR => translateFN('Autore'), AMA_TYPE_STUDENT => translateFN('Studente'), AMA_TYPE_TUTOR => translateFN('Tutor'), AMA_TYPE_SUPERTUTOR => translateFN('Super Tutor')), 0)->setRequired()->setValidator(FormValidator::POSITIVE_NUMBER_VALIDATOR);
 }
 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');
 }
 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($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');
 }
 /**
  * get an object representing a row in one of the user 'extra' tables
  * and returns it formatted in HTML.
  * 
  * Put all elements inside a table, with $columnsPerRow items per each row.
  * Label and Value are in 2 separate cells but count as 1 together.
  * 
  * @param extraTable derived object $extraObject
  * @param int how many columns per row $columnsPerRow
  */
 public static function extraObjectRow($extraObject, $columnsPerRow = 3)
 {
     $className = get_class($extraObject);
     $keyProperty = $className::getKeyProperty();
     $fields = $className::getFields();
     $table = CDOMElement::create('table', 'class:extraTableDatas ' . $className . ',id:' . $className . '_' . $extraObject->{$keyProperty});
     $tbody = CDOMElement::create('tbody');
     for ($row = null, $printedRows = 0, $numRow = 0, $numCol = 0, $num = 0; $num < count($fields); $num++) {
         $label = $extraObject->getLabel($num);
         $propertyName = $fields[$num];
         if ($label === null) {
             continue;
         }
         if ($row === null) {
             $row = CDOMElement::create('tr', 'class:extraTableRow row-' . $numRow++);
         }
         $columnLbl = CDOMElement::create('td', 'class:extraTableLabel labelCol-' . $numCol . ',id:lbl_' . $propertyName . '_' . $extraObject->{$keyProperty});
         $columnLbl->addChild(new CText($label . ": "));
         $row->addChild($columnLbl);
         $columnVal = CDOMElement::create('td', 'class:extraTableValue valueCol-' . $numCol++ . ',id:val_' . $propertyName . '_' . $extraObject->{$keyProperty});
         $columnVal->addChild(new CText($extraObject->{$propertyName}));
         $row->addChild($columnVal);
         if (++$printedRows % $columnsPerRow === 0) {
             $tbody->addChild($row);
             $row = null;
         }
     }
     // check if there's a row to be closed
     if ($row !== null) {
         // printedRows has surely one extra increment, let's recuperate it
         $printedRows--;
         // add empty cells to complete the row
         while (++$printedRows % $columnsPerRow !== 0) {
             // need 2 empty cells (label and value) for each 'column'
             for ($i = 0; $i < 2; $i++) {
                 $row->addChild(CDOMElement::create('td'));
             }
         }
         $tbody->addChild($row);
     }
     $table->addChild($tbody);
     // generate a div for edit and delete buttons
     $buttonsdiv = CDOMElement::create('div', 'class:extraButtonDiv ' . $className);
     $editbutton = CDOMElement::create('a', 'class:extraEditButton');
     $editbutton->setAttribute('href', 'javascript:editExtra(\'' . $className . '\',' . $extraObject->{$keyProperty} . ');');
     $editbutton->addChild(new CText(translateFN('Modifica')));
     $deletebutton = CDOMElement::create('a', 'class:extraDeleteButton');
     $deletebutton->setAttribute('href', 'javascript:deleteExtra(\'' . $className . '\',' . $extraObject->{$keyProperty} . ',\'' . $extraObject::getForeignKeyProperty() . '\');');
     $deletebutton->addChild(new CText(translateFN('Cancella')));
     $buttonsdiv->addChild($editbutton);
     $buttonsdiv->addChild($deletebutton);
     // generate a div for wrapping up the table
     $div = CDOMElement::create('div', 'class:extraTableContainer ' . $className . ',id:extraDIV_' . $extraObject->{$keyProperty});
     $div->addChild($table);
     $div->addChild($buttonsdiv);
     return $div->getHtml() . CDOMElement::create('div', 'class:clearfix')->getHtml();
 }
Example #20
0
 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');
 }
Example #21
0
 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);
     }
 }
Example #22
0
 /**
  * Render the object structure when the test/survet cannot be accessed by student
  *
  * @access protected
  *
  * @param $return_html choose the return type
  *
  * @return an object of CDOMElement
  */
 protected function renderNoLevel($return_html = true)
 {
     $html = CDOMElement::create('div');
     $html->addChild(new CText(translateFN('Non puoi accedere a questo sondaggio')));
     if ($return_html) {
         return $html->getHtml();
     } else {
         return $html;
     }
 }
Example #23
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') . "&nbsp;&gt;&gt;");
     $this->setOnSubmit('return goToExportStepTwo();');
 }
Example #24
0
 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);
 }
 protected function content()
 {
     $this->common_elements();
     //punteggio massimo
     if (isset($this->data['correttezza'])) {
         $defaultValue = $this->data['correttezza'];
     } else {
         $defaultValue = 0;
     }
     $this->addTextInput('correttezza', translateFN('Punteggio massimo assegnabile') . ': ')->setRequired()->setValidator(FormValidator::NON_NEGATIVE_NUMBER_VALIDATOR)->withData($defaultValue);
 }
 /**
  * Control rendering
  *
  * @return string
  */
 public function render()
 {
     $div = CDOMElement::create('div');
     $div->setAttribute('style', 'text-align:center;');
     $div->addChild(new CText(' [ '));
     $a = CDOMElement::create('a');
     $a->addChild(new CText(sprintf(translateFN('Cambia tipologia %s'), translateFN('Domanda'))));
     $a->setAttribute('href', $_SERVER['REQUEST_URI'] . '&forgetExerciseType');
     $div->addChild($a);
     $div->addChild(new CText(' ] '));
     return $div->getHtml();
 }
 protected function content()
 {
     $this->common_elements();
     //tipologia domanda cloze sinonimi
     $cloze_sinonimi = 'cloze_sinonimi';
     $options = array(ADA_NORMAL_SELECT_TEST => translateFN('No'), ADA_SYNONYM_SELECT_TEST => translateFN('Si'));
     if (isset($this->data[$cloze_sinonimi])) {
         $defaultValue = $this->data[$cloze_sinonimi];
     } else {
         $defaultValue = ADA_NORMAL_SELECT_TEST;
     }
     $this->addRadios($cloze_sinonimi, translateFN('Nella tendina, mostrare un valore preimpostato?'), $options, $defaultValue);
 }
Example #28
0
 private static function appendAction($action)
 {
     if (empty($action)) {
         return '';
     }
     $div = CDOMElement::create('div', 'id:enter_appointment');
     $link = CDOMElement::create('a');
     $link->setAttribute('href', '#');
     $link->setAttribute('onclick', $action);
     $link->addChild(new CText(translateFN('Enter the appointment')));
     $div->addChild($link);
     return $div->getHtml();
 }
 protected function content()
 {
     $this->common_elements();
     //variante
     $variant = 'variant';
     $options = array(ADA_NORMAL_TEST_VARIATION => translateFN('Nessuna variante'), ADA_ERASE_TEST_VARIATION => translateFN('Variante cancellazione'), ADA_HIGHLIGHT_TEST_VARIATION => translateFN('Variante evidenziazione'));
     if (isset($this->data[$variant])) {
         $defaultValue = $this->data[$variant];
     } else {
         $defaultValue = ADA_NORMAL_TEST_VARIATION;
     }
     $this->addSelect($variant, translateFN('Variante visualizzazione esercizio') . ':', $options, $defaultValue);
 }
 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');
 }