• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CDOMElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CDOMElement的典型用法代码示例。如果您正苦于以下问题:PHP CDOMElement类的具体用法?PHP CDOMElement怎么用?PHP CDOMElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CDOMElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render

 /**
  * 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;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:33,代码来源:templateEditorControlTest.inc.php


示例2: getAddExerciseForm

 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;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:29,代码来源:ServicesModuleHtmlLib.inc.php


示例3: extraObjectRow

 /**
  * 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();
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:67,代码来源:UserExtraModuleHtmlLib.inc.php


示例4: renderNoLevel

 /**
  * 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;
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:19,代码来源:survey.class.inc.php


示例5: render

 /**
  * 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();
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:17,代码来源:forgetExerciseTypeControlTest.inc.php


示例6: appendAction

 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();
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:13,代码来源:ADAEvent.inc.php


示例7: render

 /**
  * Control rendering
  *
  * @return string
  */
 public function render()
 {
     if ($this->modifiable) {
         $div = CDOMElement::create('div');
         $div->setAttribute('class', 'admin_link answers_footer');
         $div->addChild(new CText(' [ '));
         $a = CDOMElement::create('a');
         $a->addChild(new CText(translateFN('Aggiungi risposta')));
         $a->setAttribute('href', 'javascript:void(0);');
         $a->setAttribute('onclick', 'add_row(this);');
         $div->addChild($a);
         $div->addChild(new CText(' ] '));
         return $div->getHtml();
     } else {
         return '';
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:22,代码来源:answerFooterControlTest.inc.php


示例8: render

 /**
  * Control rendering
  *
  * @return string
  */
 public function render()
 {
     $i = 1;
     $div = CDOMElement::create('div', 'class:answers_header');
     if ($this->open_answer) {
         $cell = CDOMElement::create('div');
         $cell->setAttribute('class', 'cell other_answer');
         $cell->addChild(new CText(translateFN('Risposta aperta')));
         $div->addChild($cell);
     }
     $i++;
     $cell = CDOMElement::create('div');
     $cell->setAttribute('class', 'cell answer');
     if ($this->open_answer) {
         $cell->addChild(new CText(translateFN('Risposta') . ' / ' . translateFN('Indicazione (risp. aperta)')));
     } else {
         $cell->addChild(new CText(translateFN('Risposta')));
     }
     $div->addChild($cell);
     $i++;
     $cell = CDOMElement::create('div');
     $cell->setAttribute('class', 'cell value');
     $cell->addChild(new CText(translateFN('Punteggio')));
     $div->addChild($cell);
     $i++;
     if ($this->show_case_sensitive) {
         $cell = CDOMElement::create('div');
         $cell->setAttribute('class', 'cell case_sensitive');
         $cell->addChild(new CText(translateFN('Ignora Maiuscole')));
         $checkbox = CDOMElement::create('checkbox', 'class:case_sensitive_control');
         $checkbox->setAttribute('onchange', 'check_case_sensitive(this);');
         $cell->addChild($checkbox);
         $div->addChild($cell);
     }
     $i++;
     if ($this->modifiable) {
         $cell = CDOMElement::create('div');
         $cell->setAttribute('class', 'cell operations');
         $cell->addChild(new CText(translateFN('Operazioni')));
         $div->addChild($cell);
         $i++;
     }
     return $div->getHtml();
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:49,代码来源:answerHeaderControlTest.inc.php


示例9: renderingHtml

 /**
  * return necessaries html objects that represent the object
  *
  * @access protected
  *
  * @param $ref reference to the object that will contain this rendered object
  * @param $feedback "show feedback" flag on rendering
  * @param $rating "show rating" flag on rendering
  * @param $rating_answer "show correct answer" on rendering
  *
  * @return an object of CDOMElement
  */
 protected function renderingHtml(&$ref = null, $feedback = false, $rating = false, $rating_answer = false)
 {
     if (!$this->display) {
         return new CText('');
     }
     //if we don't have to display this question, let's return an empty item
     $out = parent::renderingHtml($ref, $feedback, $rating, $rating_answer);
     $name = $this->getPostFieldName();
     $post_data = $this->getPostData();
     $li = CDOMElement::create('li', 'class:answer_open_test');
     $textArea = CDOMElement::create('textarea');
     $textArea->setAttribute('name', $name . '[' . self::POST_ANSWER_VAR . ']');
     $textArea->setAttribute('class', 'open_answer_test');
     if ($this->feedback) {
         $textArea->addChild(new CText($this->givenAnswer['risposta'][self::POST_ANSWER_VAR]));
         $textArea->setAttribute('readonly', '');
     } else {
         if (!empty($post_data[self::POST_ANSWER_VAR])) {
             $textArea->addChild(new CText($post_data[self::POST_ANSWER_VAR]));
         }
     }
     $li->addChild($textArea);
     if ($_SESSION['sess_id_user_type'] != AMA_TYPE_STUDENT) {
         $span = CDOMElement::create('span', 'class:clozePopup,title:' . $this->id_nodo);
         $html .= $span->getHtml();
         $div = CDOMElement::create('div', 'id:popup_' . $this->id_nodo);
         $div->setAttribute('style', 'display:none;');
         $risposte = array();
         if (!empty($this->_children)) {
             foreach ($this->_children as $k => $v) {
                 $risposte[] = $v->testo . ' (' . $v->correttezza . ' ' . translateFN('Punti') . ')';
             }
         }
         $div->addChild(new CText(implode('<br/>', $risposte)));
         $html .= $div->getHtml();
     }
     $ref->addChild($li);
     return $out;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:51,代码来源:questionOpenAutomatic.class.inc.php


示例10: add

 /**
  * add course - test / survey association
  * adds a course node that contains link to test / survey too
  *
  * @global db $dh
  *
  * @param int $id_test
  *
  * @return boolean
  */
 public function add($id_test)
 {
     $dh = $GLOBALS['dh'];
     $test = $dh->test_getNode($id_test);
     if ($dh->isError($test)) {
         return false;
     }
     //creo nodo di riferimento
     $last_node = explode('_', get_max_idFN($this->courseObj->id));
     $new_id = $last_node[1] + 1;
     $new_node_id = $this->courseObj->id . '_' . $new_id;
     $url = MODULES_TEST_HTTP . '/index.php?id_test=' . $id_test;
     $link = CDOMElement::create('a');
     $link->setAttribute('href', $url);
     $link->addChild(new CText($url));
     $nodo_test['id'] = $new_node_id;
     $nodo_test['id_node_author'] = $test['id_utente'];
     $nodo_test['title'] = $test['titolo'];
     $nodo_test['name'] = $test['titolo'];
     $nodo_test['text'] = $link->getHtml();
     $nodo_test['type'] = ADA_CUSTOM_EXERCISE_TEST;
     $nodo_test['parent_id'] = $this->courseObj->id . '_0';
     $nodo_test['order'] = 999;
     $nodo_test['creation_date'] = today_dateFN();
     $nodo_test['pos_x0'] = 0;
     $nodo_test['pos_y0'] = 0;
     $nodo_test['pos_x1'] = 0;
     $nodo_test['pos_y1'] = 0;
     $id_node = $dh->add_node($nodo_test);
     if (empty($id_node) || $dh->isError($id_node)) {
         return false;
     }
     $res = $dh->test_addCourseTest($this->courseObj->id, $id_test, $id_node);
     if (!$dh->isError($res)) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:49,代码来源:switcherManagementTest.inc.php


示例11: run

 /**
  * 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 le opzioni per il login provider');
     /* @var $status	string status var to render in the breadcrumbs */
     $title = translateFN('Opzioni login');
     switch ($action) {
         case MODULES_LOGIN_EDIT_OPTIONSET:
             /**
              * edit action, display the form with passed data
              */
             $htmlObj = CDOMElement::create('span');
             $htmlObj->addChild(new CText('Le opzioni di questo provider non si configurano con un form'));
         default:
             /**
              * return an empty page as default action
              */
             break;
     }
     return array('htmlObj' => $htmlObj, 'help' => $help, 'title' => $title);
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:30,代码来源:hybridManagement.inc.php


示例12: fclose

    if ($debug == 1) {
        fclose($fpx);
    }
    /*
     * FINE GESTIONE PDT DA PAYPAL
     *
     */
    //$dati = $message;
    //    print_r($message);
    $info_div = CDOMElement::create('DIV', 'id:info_div');
    $info_div->setAttribute('class', 'info_div');
    $label_text = CDOMElement::create('span', 'class:info');
    $label_text->addChild(new CText($message));
    $info_div->addChild($label_text);
    $homeUser = $userObj->getHomePage();
    $link_span = CDOMElement::create('span', 'class:info_link');
    $link_to_home = BaseHtmlLib::link($homeUser, translateFN('vai alla home per accedere.'));
    $link_span->addChild($link_to_home);
    $info_div->addChild($link_span);
    //$data = new CText(translateFN('La tua iscrizione è stata effettuata con successo.'));
    $data = $info_div;
    //    print_r($data->getHtml());
    $path = translateFN('modulo di iscrizione');
    $dati .= $link_torna_home;
    $field_data = array('menu' => "", 'banner' => $banner, 'path' => $path, 'data' => $info_div->getHtml(), 'help' => '', 'user_name' => $user_name, 'user_type' => $user_type, 'messages' => $user_messages->getHtml(), 'agenda' => $user_agenda->getHtml(), 'titolo_corso' => $course_name, 'annulla_iscrizione' => $link_annulla_iscrizione, 'price' => $price);
} else {
    $dati = translateFN('Impossibile proseguire, Provider non trovato');
    $field_data = array('menu' => "", 'banner' => $banner, 'data' => $dati, 'help' => '', 'user_name' => $user_name, 'user_type' => $user_type, 'messages' => $user_messages->getHtml(), 'agenda' => $user_agenda->getHtml(), 'titolo_corso' => $course_name, 'annulla_iscrizione' => $link_annulla_iscrizione, 'price' => $price);
}
/**
 * Sends data to the rendering engine
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:student_course_instance_subscribe_confirm.php


示例13: clozePlaceholder

 /**
  * function that will replace cloze entries in text
  *
  * @param array $params - matched params from regexp
  * @return a string of HTML
  * @see getPreparedText
  */
 public function clozePlaceholder($params)
 {
     $ordine = $params[1];
     $value = $params[2];
     $value = '<cloze title="' . $ordine . '">' . $value . '</cloze>';
     $html = $value;
     if ($_SESSION['sess_id_user_type'] != AMA_TYPE_STUDENT) {
         $span = CDOMElement::create('span', 'class:clozePopup,title:' . $this->id_nodo . '_' . $ordine);
         $html .= $span->getHtml();
         $div = CDOMElement::create('div', 'id:popup_' . $this->id_nodo . '_' . $ordine);
         $div->setAttribute('style', 'display:none;');
         $risposte = array();
         $answers = $this->searchChild($ordine, 'ordine', true);
         if (!empty($answers)) {
             foreach ($answers as $v) {
                 $v->correttezza = is_null($v->correttezza) ? 0 : $v->correttezza;
                 $risposte[] = $v->testo . ' (' . $v->correttezza . ' ' . translateFN('Punti') . ')';
             }
         }
         $div->addChild(new CText(implode('<br/>', $risposte)));
         $html .= $div->getHtml();
     }
     return $html;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:questionEraseCloze.class.inc.php


示例14: getAddressBook

 protected static function getAddressBook(ADALoggableUser $userObj, $user_types_Ar = array(), $result_Ar = array())
 {
     $user_type = $userObj->getType();
     $address_book = CDOMElement::create('div', 'id:addressbook_div');
     $buttons = CDOMElement::create('div', 'id:buttons_div');
     //    $users_Ar = array();
     //    foreach($result as $tester => $users) {
     //      $users_Ar[$tester][$users['tipo']] = array($users['e_mail'], $users['username']);
     //    }
     $selects = CDOMElement::create('div');
     if (in_array(AMA_TYPE_SWITCHER, $user_types_Ar[$user_type])) {
         $switcher_bt = CDOMElement::create('a', 'id:js_switcher_bt, name:js_switcher_bt');
         $switcher_bt->setAttribute('onclick', "showMeHideOthers('js_switcher_sel');");
         $switcher_bt->addChild(new CText(translateFN('Switcher')));
         $buttons->addChild($switcher_bt);
         $switcher_sel = CDOMElement::create('select', 'id:js_switcher_sel, name:js_switcher_sel, size:10, class: hidden_element');
         $switcher_sel->setAttribute('onchange', 'add_addressee(this);');
         foreach ($result_Ar as $tester_name => $user_data_Ar) {
             $optgroup = CDOMElement::create('optgroup');
             $optgroup->setAttribute('label', $tester_name);
             foreach ($user_data_Ar as $user) {
                 if ($user['tipo'] == AMA_TYPE_SWITCHER) {
                     $option = CDOMElement::create('option', 'value:' . $user['username']);
                     if (isset($user['cognome']) || isset($user['nome'])) {
                         $displayname = $user['cognome'] . ' ' . $user['nome'];
                     } else {
                         $displayname = $user['username'];
                     }
                     $option->addChild(new CText($displayname));
                     $optgroup->addChild($option);
                 }
             }
             $switcher_sel->addChild($optgroup);
         }
         $selects->addChild($switcher_sel);
     }
     if (in_array(AMA_TYPE_TUTOR, $user_types_Ar[$user_type])) {
         $practitioner_bt = CDOMElement::create('a', 'id:js_practitioner_bt, name:js_practitioner_bt');
         $practitioner_bt->setAttribute('onclick', "showMeHideOthers('js_practitioner_sel');");
         $practitioner_bt->addChild(new CText(translateFN('Tutor')));
         $buttons->addChild($practitioner_bt);
         $practitioner_sel = CDOMElement::create('select', 'id:js_practitioner_sel, name: js_practitioner_sel, size:10, class: hidden_element');
         $practitioner_sel->setAttribute('onchange', 'add_addressee(this);');
         foreach ($result_Ar as $tester_name => $user_data_Ar) {
             $optgroup = CDOMElement::create('optgroup');
             $optgroup->setAttribute('label', $tester_name);
             foreach ($user_data_Ar as $user) {
                 if ($user['tipo'] == AMA_TYPE_TUTOR) {
                     $option = CDOMElement::create('option', 'value:' . $user['username']);
                     if (isset($user['cognome']) || isset($user['nome'])) {
                         $displayname = $user['cognome'] . ' ' . $user['nome'];
                     } else {
                         $displayname = $user['username'];
                     }
                     $option->addChild(new CText($displayname));
                     $optgroup->addChild($option);
                 }
             }
             $practitioner_sel->addChild($optgroup);
         }
         $selects->addChild($practitioner_sel);
     }
     if (in_array(AMA_TYPE_STUDENT, $user_types_Ar[$user_type])) {
         $user_bt = CDOMElement::create('a', 'id:js_user_bt, name:js_user_bt');
         $user_bt->setAttribute('onclick', "showMeHideOthers('js_user_sel');");
         $user_bt->addChild(new CText(translateFN('Students')));
         $buttons->addChild($user_bt);
         $user_sel = CDOMElement::create('select', 'id:js_user_sel, name: js_user_sel, size:10, class: hidden_element');
         $user_sel->setAttribute('onchange', 'add_addressee(this);');
         foreach ($result_Ar as $tester => $user_data_Ar) {
             $optgroup = CDOMElement::create('optgroup');
             $optgroup->setAttribute('label', $tester_name);
             foreach ($user_data_Ar as $user) {
                 /**
                  * @author giorgio 28/apr/2015
                  * 
                  * tutors are students for an ADA_SERVICE_TUTORCOMMUNITY type of course,
                  * so add them to the address book if they're returned in the $result_Ar
                  */
                 if ($user['tipo'] == AMA_TYPE_STUDENT || $user['tipo'] == AMA_TYPE_TUTOR && $userObj->getType() == AMA_TYPE_TUTOR && !$userObj->isSuper() && $user['id_utente'] != $userObj->getId()) {
                     $option = CDOMElement::create('option', 'value:' . $user['username']);
                     if (isset($user['cognome']) || isset($user['nome'])) {
                         $displayname = $user['cognome'] . ' ' . $user['nome'];
                     } else {
                         $displayname = $user['username'];
                     }
                     $option->addChild(new CText($displayname));
                     $optgroup->addChild($option);
                 }
             }
             $user_sel->addChild($optgroup);
         }
         $selects->addChild($user_sel);
     }
     $address_book->addChild($buttons);
     $address_book->addChild($selects);
     return $address_book;
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:98,代码来源:address_book.inc.php


示例15: foreach

            foreach ($errors as $err) {
                $err_msg .= $error_messages[$err] . "<br>";
            }
            $err_msg .= "</strong>";
        }
        // *****
    }
    //end if Spedisci
    // *****
    $destinatari_Ar = isset($form["destinatari"]) ? $form["destinatari"] : null;
    $destinatari = '';
    if (is_array($destinatari_Ar) && count($destinatari_Ar) > 0) {
        foreach ($destinatari_Ar as $d) {
            $destinatario = trim($d);
            $div = CDOMElement::create('div', "id:{$destinatario}");
            $checkbox = CDOMElement::create('checkbox', "name:destinatari[], value:{$destinatario}, checked: checked");
            $checkbox->setAttribute('onclick', "remove_addressee('{$destinatario}');");
            $div->addChild($checkbox);
            $div->addChild(new CText($destinatario));
            $destinatari .= $div->getHtml();
        }
    }
}
if (!isset($titolo)) {
    $titolo = "";
}
if (!isset($destinatari)) {
    $destinatari = "";
}
if (!isset($course_title)) {
    $course_title = "";
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:send_event.php


示例16: render

 /**
  * Control rendering
  *
  * @return string
  *
  * @see constructComponents
  */
 public function render()
 {
     $this->constructComponents();
     $html = '';
     foreach ($this->item as $field => $v) {
         if (is_null($v)) {
             continue;
         }
         if ($this->clonable) {
             $this->item[$field]->setAttribute('disabled', '');
         }
         if ($field == 'record' || $field == 'ordine') {
             $html .= $this->item[$field]->getHtml();
         } else {
             $div = CDOMElement::create('div');
             $div->setAttribute('class', 'answers_cell ' . $field);
             $div->addChild($this->item[$field]);
             $html .= $div->getHtml();
         }
     }
     if ($this->modifiable) {
         $div = CDOMElement::create('div');
         $div->setAttribute('class', 'answers_cell operations');
         $a = CDOMElement::create('a');
         $a->addChild(new CText(translateFN('Cancella')));
         $a->setAttribute('href', 'javascript:void(0);');
         if (!is_null($this->id)) {
             $a->setAttribute('onclick', "del(this," . $this->id . ");");
         } else {
             $a->setAttribute('onclick', "del(this);");
         }
         $div->addChild($a);
         $html .= $div->getHtml();
     }
     if ($this->clonable) {
         $div = CDOMElement::create('div', 'class:clonable');
         $html .= $div->getHtml();
     }
     $div = CDOMElement::create('div', 'class:answer_content');
     $div->addChild(new CText($html));
     return $div->getHtml();
 }
开发者ID:eguicciardi,项目名称:ada,代码行数:49,代码来源:answerClozeControlTest.inc.php


示例17: translateFN

 }
 if (!$isPublicCourse) {
     $add_instance_link = BaseHtmlLib::link("add_instance.php?id_course={$courseId}", $add_instance_img->getHtml());
 }
 if (isset($add_instance_link)) {
     $title = translateFN('Aggiungi classe');
     $div_AddInstances = CDOMElement::create('div');
     $div_AddInstances->setAttribute('title', $title);
     $div_AddInstances->setAttribute('class', 'tooltip');
     $div_AddInstances->addChild($add_instance_link);
     $actions[] = $div_AddInstances;
 }
 $delete_course_link = BaseHtmlLib::link("delete_course.php?id_course={$courseId}", $delete_img->getHtml());
 if (isset($delete_course_link)) {
     $title = translateFN('Cancella corso');
     $div_delete = CDOMElement::create('div');
     $div_delete->setAttribute('title', $title);
     $div_delete->setAttribute('class', 'tooltip');
     $div_delete->addChild($delete_course_link);
     $actions[] = $div_delete;
 }
 $actions = BaseHtmlLib::plainListElement('class:inline_menu', $actions);
 $servicelevel = null;
 /* if isset $_SESSION['service_level'] it means that the istallation supports course type */
 if (isset($_SESSION['service_level'][$course[4]])) {
     $servicelevel = $_SESSION['service_level'][$course[4]];
 }
 if (!isset($servicelevel)) {
     $servicelevel = DEFAULT_SERVICE_TYPE_NAME;
 }
 $tbody_data[] = array($imgDetails, $courseId, $course[1], translateFN($servicelevel), $course[2], $course[3], $actions);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:list_courses.php


示例18: header

          header('Location: ' . $location);
          exit();*/
    }
} else {
    $form = new UserProfileForm($languages);
    $user_dataAr = $userObj->toArray();
    unset($user_dataAr['password']);
    $user_dataAr['email'] = $user_dataAr['e_mail'];
    unset($user_dataAr['e_mail']);
    $form->fillWithArrayData($user_dataAr);
    $help = translateFN('Modifica dati utente');
}
$label = translateFN('Modifica dati utente');
$layout_dataAr['JS_filename'] = array(JQUERY, JQUERY_UI, JQUERY_MASKEDINPUT, JQUERY_NO_CONFLICT, ROOT_DIR . '/js/include/jquery/pekeUpload/pekeUpload.js');
$layout_dataAr['CSS_filename'] = array(JQUERY_UI_CSS, ROOT_DIR . '/js/include/jquery/pekeUpload/pekeUpload.css');
$maxFileSize = (int) (ADA_FILE_UPLOAD_MAX_FILESIZE / (1024 * 1024));
$optionsAr['onload_func'] = 'initDoc(' . $maxFileSize . ',' . $userObj->getId() . ');';
// $optionsAr['onload_func'] = 'initDateField();';
/*
 * Display error message  if the password is incorrect
 */
if (isset($_GET['message'])) {
    $help = $_GET['message'];
}
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'messages' => $user_messages->getHtml(), 'agenda' => $user_agenda->getHtml(), 'status' => $status, 'course_title' => translateFN('Modifica dati utente'), 'dati' => $form->getHtml(), 'help' => $help);
$imgAvatar = $userObj->getAvatar();
$avatar = CDOMElement::create('img', 'src:' . $imgAvatar);
$avatar->setAttribute('class', 'img_user_avatar');
$content_dataAr['user_modprofilelink'] = $userObj->getEditProfilePage();
$content_dataAr['user_avatar'] = $avatar->getHtml();
ARE::render($layout_dataAr, $content_dataAr, NULL, $optionsAr);
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:edit_author.php


示例19: foreach

        foreach ($tutor_monitoring as $k => $v) {
            $ul = CDOMElement::create('ul');
            if (!empty($v)) {
                foreach ($v as $i => $l) {
                    $nome_corso = $l['titolo'] . (!empty($l['title']) ? ' - ' . $l['title'] : '');
                    $li = CDOMElement::create('li');
                    $li->addChild(new CText($nome_corso));
                    $ul->addChild($li);
                }
            } else {
                $nome_corso = translateFN('Nessun corso trovato');
                $li = CDOMElement::create('li');
                $li->addChild(new CText($nome_corso));
                $ul->addChild($li);
            }
            $tip = CDOMElement::create('div', 'id:tooltipContent' . $k);
            $tip->addChild(new CText(translateFN('Tutor assegnato ai seguenti corsi:<br />')));
            $tip->addChild($ul);
            $tooltips .= $tip->getHtml();
            $js .= 'new Tooltip("tooltip' . $k . '", "tooltipContent' . $k . '", {DOM_location: {parentId: "header"}, className: "tooltip", offset: {x:+15, y:0}, hook: {target:"rightMid", tip:"leftMid"}});' . "\n";
        }
        $js .= '</script>';
        $tooltips .= $js;
        //end
        $data = new TutorAssignmentForm($tutors, $id_tutor_old);
        $data->fillWithArrayData(array('id_tutor_old' => $id_tutor_old, 'id_course_instance' => $courseInstanceObj->getId(), 'id_course' => $courseObj instanceof Course ? $courseObj->getId() : null));
    } else {
        $data = new CText(translateFN('Classe non trovata'));
    }
}
$title = translateFN('Assegnazione di un tutor alla classe');
开发者ID:eguicciardi,项目名称:ada,代码行数:31,代码来源:assign_tutor.php


示例20: clozePlaceholder

 /**
  * abstract function that will replace cloze entries in text
  *
  * @param array $params - matched params from regexp
  * @return a string of HTML
  * @see getPreparedText
  */
 public function clozePlaceholder($params)
 {
     $ordine = $params[1];
     $name = $this->getPostFieldName();
     $post_data = $this->getPostData();
     $class = 'normal_cloze_question_test';
     $obj = CDOMElement::create('text');
     $obj->setAttribute('name', $name . '[' . self::POST_ANSWER_VAR . '][' . $ordine . ']');
     $obj->setAttribute('value', $post_data[self::POST_ANSWER_VAR][$ordine]);
     if ($this->feedback) {
         $obj->setAttribute('readonly', '');
         $risposta = $this->givenAnswer['risposta'][self::POST_ANSWER_VAR][$ordine];
         if (!empty($risposta)) {
             $obj->setAttribute('value', $risposta);
             if (!empty($this->_children)) {
                 foreach ($this->_children as $answer) {
                     if ($this->isAnswerCorrect($answer, $ordine, $risposta)) {
                         $class .= ' right_answer_test';
                     } else {
                         $class .= ' wrong_answer_test';
                     }
                 }
             }
         } else {
             $class .= ' empty_answer_test';
         }
     }
     $correctAnswer = false;
     if ($this->feedback && ($this->rating || $this->rating_answer) && !strstr($class, 'right_answer_test')) {
         $correctAnswer = $this->getMostCorrectAnswer($ordine);
         if ($correctAnswer) {
             $popup = CDOMElement::create('div', 'id:popup_' . $this->id_nodo . '_' . $ordine);
             $popup->setAttribute('style', 'display:none;');
             $popup->addChild(new CText($correctAnswer->testo));
             if ($this->rating) {
                 $popup->addChild(new CText(' (' . $correctAnswer->correttezza . ' ' . translateFN('Punti') . ')'));
             }
             $obj->setAttribute('class', $class . ' answerPopup');
             $obj->setAttribute('title', $this->id_nodo . '_' . $ordine);
             $html = $obj->getHtml() . $popup->getHtml();
         }
     }
     if (!$correctAnswer) {
         $obj->setAttribute('class', $class);
         $html = $obj->getHtml();
     }
     if ($_SESSION['sess_id_user_type'] != AMA_TYPE_STUDENT) {
         $span = CDOMElement::create('span', 'class:clozePopup,title:' . $this->id_nodo . '_' . $ordine);
         $html .= $span->getHtml();
         $div = CDOMElement::create('div', 'id:popup_' . $this->id_nodo . '_' . $ordine);
         $div->setAttribute('style', 'display:none;');
         $risposte = array();
         if (!empty($this->_children)) {
             foreach ($this->_children as $k => $v) {
                 if ($v->ordine == $ordine) {
                     $v->correttezza = is_null($v->correttezza) ? 0 : $v->correttezza;
                     $risposte[] = $v->testo . ' (' . $v->correttezza . ' ' . translateFN('Punti') . ')';
                 }
             }
         }
         $d 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CDataColumn类代码示例发布时间:2022-05-23
下一篇:
PHP CDBResult类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap