当前位置: 首页>>代码示例>>PHP>>正文


PHP CDOMElement类代码示例

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


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


注:本文中的CDOMElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。