本文整理汇总了PHP中Table::initTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::initTable方法的具体用法?PHP Table::initTable怎么用?PHP Table::initTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::initTable方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function courses_instances_list($file_action, $file_back, $field_list_ar, $courses_instances_ha, $courses_names_ha, $key, $id_student)
{
$dh = $GLOBALS['dh'];
$http_root_dir = $GLOBALS['http_root_dir'];
// inizializzazione variabili
$val = "";
$val2 = "";
$val3 = "";
$str = "";
$data = array();
$titolo = "";
// courses instances number from database query
$n = count($courses_instances_ha);
// LISTA istanze corsi
if ($n > 0) {
// creazione della tabella
$tb = new Table();
// setting delle caratteristiche della tabella
$tb->initTable('1', 'center', '0', '1', '', '', '', '', '', '1', '1');
// Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
// $caption = "<strong>".translateFN("Corsi ai quali sei iscritt*")."</strong>";
$i = 0;
foreach ($courses_instances_ha as $courses_instance) {
$id_corso = $courses_instance[1];
$keys = array_keys($courses_names_ha);
if (in_array($id_corso, $keys)) {
$titolo = "<a href='{$http_root_dir}/info.php?id_course={$id_corso}'>" . $courses_names_ha[$id_corso] . "</a>";
$id_instance = $courses_instance[0];
// TUTOR non mostrato qui
//$tutor_id = $dh->course_instance_tutor_get($id_instance);
//if (!empty($tutor_id)){
// $tutor = $dh->get_tutor($tutor_id);
// $tutor_uname = $tutor['username'];
//} else {
// $tutor_uname = translateFN("Non assegnato");
// }
$j = 1;
// reset dei valori
$val = "";
// reset dei valori
if ($courses_instance[2] == 0) {
$val[0] = translateFN("Non iniziato");
} else {
$val[0] = date("d-m-Y", $courses_instance[2]) . " ";
}
$val[1] = $courses_instance[3] . " ";
if ($courses_instance[4] == 0) {
$val[2] = translateFN("Non previsto");
} else {
$val[2] = date("d-m-Y", $courses_instance[4]) . " ";
}
$i++;
// links per le azioni
// $zoom_img_link = "<a href='$http_root_dir/info.php?id_course=$id_corso'><img src='img/zoom.png' alt='zoom in' border=0></a>";
$subscribe_img_link = "<a href=\"{$http_root_dir}/iscrizione/student_course_instance_subscribe.php?id_instance={$id_instance}&id_student={$id_student}&back_url={$file_back}\"><img src=\"img/edit.png\" alt=\"iscriviti\" border=\"0\"></a>";
$unsubscribe_img_link = "<a href=\"{$http_root_dir}/iscrizione/student_course_instance_unsubscribe.php?id_instance={$id_instance}&id_student={$id_student}&back_url={$file_back}\"><img src=\"img/delete.png\" alt=\"elimina iscrizione\" border=\"0\"></a>";
// controlla se lo studente e' gia'iscritto o preiscritto alla istanza del corso
$iscr = $dh->get_subscription($id_student, $id_instance);
// courses_instances[2] is the start date of the course instance
$now = time();
if ($courses_instance[4] == 0 || $courses_instance[4] > 0 && $courses_instance[4] > $now) {
if ($iscr['tipo'] == 0) {
$val3 = $subscribe_img_link;
} else {
$val3 = $unsubscribe_img_link;
}
} else {
if ($iscr['tipo'] == 0) {
$val3 = '';
} else {
$val3 = $unsubscribe_img_link;
}
}
$val[3] = "{$zoom_img_link} {$val3}";
$data[] = array(translateFN("corso") => $titolo, translateFN("durata") => $val[1], translateFN("inizio previsto") => $val[2], translateFN("iniziato") => $val[0], translateFN("azioni") => $val[3]);
}
}
$tb->setTable($data, $caption = translateFN("Lista corsi"), $summary = translateFN("Tabella"));
$str .= $tb->getTable();
// Search Form
$str .= "<br>";
if (!empty($file_action)) {
// FORM di ricerca
$fields["add"][] = "key";
$names["add"][] = translateFN("Cerca per argomento");
$edittypes["add"][] = "text";
$necessary["add"][] = "true";
$values["add"][] = "{$key}";
$options["add"][] = "";
$maxsize["add"][] = 12;
// creazione del form di ricerca corsi
$str .= MakeForm($fields, $names, $edittypes, $necessary, $values, $options, $maxsize, $file_action, "add", false, true);
}
} else {
$str = $this->info(translateFN("Nessun risultato"));
}
// scrittura stringa back
// $str .= $this->go_file_back($file_back,translateFN("Home degli studenti"));
return $str;
}
示例2: _get_course_instance_info
function _get_course_instance_info($id_course, $id_course_instance)
{
$common_dh = $GLOBALS['common_dh'];
$dh = $GLOBALS['dh'];
$sess_id_user = $_SESSION['sess_id_user'];
$userObj = $_SESSION['sess_userObj'];
$course_dataHa = $common_dh->get_service_info_from_course($id_course);
$service_title = $course_dataHa[1];
$service_level = $course_dataHa[3];
//..
$provider_dataHa = $common_dh->get_tester_info_from_id_course($id_course);
if (!AMA_DataHandler::isError($provider_dataHa)) {
$provider_pointer = $provider_dataHa['puntatore'];
$provider_name = $provider_dataHa['nome'];
$provider_dsn = Multiport::getDSN($provider_pointer);
if ($provider_dsn != null) {
$provider_dh = AMA_DataHandler::instance($provider_dsn);
$sub_courses = $provider_dh->get_subscription($sess_id_user, $id_course_instance);
// if (!AMA_DataHandler::isError($sub_courses)&&$sub_courses['tipo'] == 2) { // introducing status 3 (suspended) and 5 (completed)
if (!AMA_DataHandler::isError($sub_courses)) {
// introducing status 3 (suspended) and 5 (completed)
$info_dataHa = array();
$id_tutor = $dh->course_instance_tutor_get($id_course_instance);
// vito, 27 may 2009
if ($id_tutor !== false) {
$tutor = $dh->get_tutor($id_tutor);
// vito, 27 may 2009
if (!AMA_DataHandler::isError($tutor) && is_array($tutor)) {
$tutor_name = $tutor['nome'] . " " . $tutor['cognome'];
if (empty($tutor_name)) {
$tutor_info = translateFN('Non assegnato');
} else {
// if (isset($sess_id_user)){
// $tutor_info = "<a href=\"$http_root_dir/admin/zoom_tutor.php?id=$id_tutor\">$tutor_name</a>";
// } else{
$tutor_info = $tutor_name;
// }
}
}
} else {
$tutor_info = translateFN('Non assegnato');
}
$start_date = ts2dFN($sub_courses['istanza_ha']['data_inizio']);
// messaggi
$messages_list = "";
// FIXME
// appuntamenti
$msgs_ha = MultiPort::getUserAgenda($userObj);
if (AMA_DataHandler::isError($msgs_ha)) {
$errObj = new ADA_Error($msgs_ha, translateFN('Errore in lettura appuntamenti'));
}
$testers_dataAr = MultiPort::getTestersPointersAndIds();
$meeting_List = CommunicationModuleHtmlLib::getAgendaAsForm($dataAr, $testers_dataAr);
// $label_provider = translateFN('Fornitore');
// $label_title = translateFN('Titolo');
$label_date = translateFN('Data di inizio');
$label_tutor = translateFN('Tutor');
$label_meeting = translateFN('Appuntamenti');
$label_messages = translateFN('Messaggi');
$row = array("<img src=\"img/flag.png\" border=0> " . $label_date => $start_date, $label_tutor => $tutor_info, $label_meeting => $meeting_list, $label_messages => $messages_list);
array_push($info_dataHa, $row);
$tObj = new Table();
$tObj->initTable('1', 'center', '0', '1', '100%', '', '', '', '', 1, 1);
$caption = "<strong>" . translateFN("Storico del servizio") . "</strong>";
$summary = translateFN("Storico del servizio");
$tObj->setTable($info_dataHa, $caption, $summary);
$requested_service_data = $tObj->getTable();
} else {
$requested_service_data = translateFN("Nessun'informazione disponibile sul servizio {$id_course_instance}.");
}
} else {
$requested_service_data = translateFN("Nessun'informazione disponibile sul servizio {$id_course_instance}.");
}
} else {
$requested_service_data = translateFN("Nessun'informazione disponibile sul servizio {$id_course_instance}.");
}
return $requested_service_data;
}
示例3: get_student_dataFN
function get_student_dataFN($id_student, $id_instance)
{
$dh = $GLOBALS['dh'];
$http_root_dir = $GLOBALS['http_root_dir'];
$student_info_ha = $dh->_get_user_info($id_student);
// Get info of each student
if (AMA_DataHandler::isError($student_info_ha)) {
$msg = $student_info_ha->getMessage();
return $msg;
break;
}
$instance_course_ha = $dh->course_instance_get($id_instance);
// Get the instance courses data
if (AMA_DataHandler::isError($instance_course_ha)) {
$msg = $instance_course_ha->getMessage();
return $msg;
break;
}
$id_course = $instance_course_ha['id_corso'];
$start_date = AMA_DataHandler::ts_to_date($instance_course_ha['data_inizio'], ADA_DATE_FORMAT);
$info_course = $dh->get_course($id_course);
// Get title course
if (AMA_DataHandler::isError($info_course)) {
$msg = $info_course->getMessage();
return $msg;
break;
}
$course_title = $info_course['titolo'];
/*
global $debug;$debug=1;
mydebug(__LINE__,__FILE__,$student_info_ha);
$debug = 0;
*/
$name = $student_info_ha['nome'];
$name_desc = "<B>" . translateFN("Nome") . "</B>";
$surname = $student_info_ha['cognome'];
$surname_desc = "<B>" . translateFN("Cognome") . "</B>";
$email = $student_info_ha['email'];
$email_desc = "<B>" . translateFN("Email") . "</B>";
$phone_n = $student_info_ha['telefono'];
$phone_desc = "<B>" . translateFN("Telefono") . "</B>";
$user = $student_info_ha['username'];
$user_desc = "<B>" . translateFN("User Name") . "</B>";
$course_desc = "<B>" . translateFN("Titolo del Corso") . "</B>";
$start_desc = "<B>" . translateFN("Data di inizio") . "</B>";
$dati_stude[0]['name_desc'] = $name_desc;
$dati_stude[0]['name'] = $name;
$dati_stude[1]['surname_desc'] = $surname_desc;
$dati_stude[1]['surname'] = $surname;
$dati_stude[2]['email_desc'] = $email_desc;
$dati_stude[2]['email'] = $email;
$dati_stude[3]['phone_desc'] = $phone_desc;
$dati_stude[3]['phone'] = $phone_n;
$dati_stude[4]['user_desc'] = $user_desc;
$dati_stude[4]['user'] = $user;
$dati_stude[5]['course_desc'] = $course_desc;
$dati_stude[5]['course'] = $course_title;
$dati_stude[6]['start_desc'] = $start_desc;
$dati_stude[6]['start'] = $start_date;
$tObj = new Table();
// $tObj->initTable('0','center','0','1','100%','black','white','black','white');
$tObj->initTable('1', 'center', '0', '1', '', '', '', '', '', '1');
// Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
$caption = translateFN("Studente selezionato: <B>") . $id_student . "</B> ";
// $summary = translateFN("Elenco dei corsi monitorati");
$summary = "";
// $tObj->setTable($dati_stude,$caption,$summary);
$tObj->setTable($dati_stude, $caption, $summary);
$student_info = $tObj->getTable();
return $student_info;
}
示例4: array
//$icon = "<img src=\"img/exer_ico.png\" border=0>";
$exer_count++;
}
//$temp_results = array(translateFN("Titolo")=>"<a href=view.php?id_node=$res_id_node&querystring=$s_node_text>$icon $res_name</a>");
if ($res_type == ADA_GROUP_TYPE || $res_type == ADA_LEAF_TYPE || $res_type == ADA_NOTE_TYPE || $res_type == ADA_PRIVATE_NOTE_TYPE) {
$html_for_result = "<span class=\"{$class_name}\"><a href=\"view.php?id_node={$res_id_node}&querystring={$s_node_text}\">{$res_name}</a></span>";
}
/*else {
$html_for_result = "<span class=\"$class_name\"><a href=\"exercise.php?id_node=$res_id_node\">$res_name</a></span>";
}*/
$temp_results = array(translateFN('Titolo') => $html_for_result);
//$temp_results = array(translateFN("Titolo")=>$title,translateFN("Testo")=>$res_text);
array_push($total_results, $temp_results);
}
$tObj = new Table();
$tObj->initTable('0', 'center', '2', '1', '100%', 'black', 'white', 'black', 'white');
$summary = translateFN("Elenco dei nodi che soddisfano la ricerca al ") . $ymdhms;
// $caption = translateFN("Sono stati trovati")." $group_count ".translateFN("gruppi").", $node_count ".translateFN("nodi").", $exer_count ".translateFN("esercizi").", $note_count ".translateFN("note.");
$caption = translateFN("Sono stati trovati") . " {$group_count} " . translateFN("gruppi") . ", {$node_count} " . translateFN("nodi");
$tObj->setTable($total_results, $caption, $summary);
$search_results = $tObj->getTable();
// diretto:
//header("Location: view.php?id_node=$res_id_node");
} else {
$search_results = translateFN("Non è stato trovato nessun nodo.");
}
}
$menu = "<p>" . translateFN("Scrivi la o le parole che vuoi cercare, scegli quali oggetti cercare, e poi clicca su Cerca.");
$menu .= "<br>" . translateFN("ADA restituirà una lista con i nodi che contengono TUTTE le parole inserite.");
$menu .= "<br>" . translateFN("Le parole vengono trovate anche all'interno di altre parole, e senza distinzioni tra maiuscole e minuscole.") . "</p>";
// $menu .= "<br>".translateFN("Se vuoi cercare tra i media collegati (immagini, suoni, siti) usa la ")."<a href=search_media.php>".translateFN("Ricerca sui Media")."</a></p>";
示例5: time
/**
* @author giorgio 16/mag/2013
* added $returnHTML parameter
*/
function history_nodes_list_filtered_FN($period, $returnHTML = true)
{
$dh = $GLOBALS['dh'];
$start = $period > 0 ? time() - $period * 86400 : 0;
$result = $dh->get_last_visited_nodes_in_period($this->id_student, $this->id_course_instance, $start);
//verificare il controllo degli errori
if (AMA_DataHandler::isError($this->course_data)) {
$errObj = new ADA_Error($this->course_data, translateFN("Errore nella lettura dei dati"));
}
if ($period != 0) {
$caption = translateFN("Nodi visitati negli ultimi {$period} giorni");
} else {
$caption = translateFN("Tutti i nodi visitati");
}
$formatted_data = History::format_history_dataFN($result);
if ($returnHTML) {
$t = new Table();
$t->initTable('0', 'center', '1', '1', '90%', '', '', '', '', '0', '1');
$t->setTable($formatted_data, $caption, $caption);
if (!empty($formatted_data)) {
return $t->getTable();
} else {
return "Nessun nodo trovato";
}
} else {
$formatted_data['caption'] = $caption;
}
return $formatted_data;
}
示例6: whoami
require_once MODULES_NEWSLETTER_PATH . '/include/functions.inc.php';
$self = whoami();
$GLOBALS['dh'] = AMANewsletterDataHandler::instance(MultiPort::getDSN($_SESSION['sess_selected_tester']));
$containerDIV = CDOMElement::create('div', 'id:moduleContent');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET' && !empty($_GET) && isset($_GET['id']) && intval($_GET['id']) > 0) {
$idNewsletter = intval($_GET['id']);
$newsletterAr = $dh->get_newsletter($idNewsletter);
if (!AMA_DB::isError($newsletterAr) && $newsletterAr !== false) {
$historyAr = $dh->get_newsletter_history($idNewsletter);
$labels = array(translateFN('filtro'), translateFN('data di invio'), translateFN('n. utenti'));
$historyData = array();
foreach ($historyAr as $i => $historyEl) {
$historyData[$i] = array($labels[0] => convertFilterArrayToString(json_decode($historyEl['filter'], true), $dh, false), $labels[1] => $historyEl['datesent'], $labels[2] => $historyEl['status'] != MODULES_NEWSLETTER_HISTORY_STATUS_SENDING ? $historyEl['recipientscount'] : translateFN('Invio in corso') . '...');
}
$historyTable = new Table();
$historyTable->initTable('0', 'center', '1', '1', '90%', '', '', '', '', '1', '0', '', 'default', 'newsletterHistoryDetails');
$historyTable->setTable($historyData, translateFN('Stroico Newsletter') . ' - ' . $newsletterAr['subject'], translateFN('Stroico Newsletter') . ' - ' . $newsletterAr['subject']);
$containerDIV->addChild(new CText($historyTable->getTable()));
} else {
$containerDIV->addChild(new CText(translateFN('Newsletter non trovata, id= ') . $idNewsletter));
}
// if (!AMA_DB::isError($newsletterAr))
} else {
$containerDIV->addChild(new CText(translateFN('Nessuna newsletter da inviare')));
}
$data = $containerDIV->getHtml();
/**
* include proper jquery ui css file depending on wheter there's one
* in the template_family css path or the default one
*/
if (!is_dir(MODULES_NEWSLETTER_PATH . '/layout/' . $userObj->template_family . '/css/jquery-ui')) {
示例7: array
//.........这里部分代码省略.........
$file_name_http = $media_name;
}
}
//if (!empty($media_name)) {
// $file_name = $root_dir . $media_path . $media_name;
// $file_name_http = $http_root_dir . $media_path . $media_name;
if ($media_type < 3 && file_exists($file_name)) {
// Controllo del tipo di media
switch ($media_type) {
//case 0: //img
case _IMAGE:
$size = GetImageSize($file_name);
$x = $size[0];
$y = $size[1];
$r = 10;
/*
$debug=1;
mydebug(__LINE__,__FILE__,$file_name);
mydebug(__LINE__,__FILE__,$size);
$debug=0;
*/
switch (IMG_VIEWING_MODE) {
// it would be better to use a property instead
case 2:
// full img in page, only icon here
if ($javascript_ok) {
$link_media = "<img src=\"img/_img.png\"> <A HREF=\"#\" ONCLICK=\"newWindow('{$file_name_http}',{$x},{$y})\">{$media_name}</a>";
} else {
$link_media = "<img src=\"img/_img.png\"> <a href=\"{$file_name_http}\" target=\"img_win\" >{$media_name}</a>";
}
break;
case 1:
// icon in page, a reduced size preview here
if ($javascript_ok) {
$link_media = "<img src=\"include/resize.php?img={$file_name}&ratio={$r}\"> <A HREF=\"#\" ONCLICK=\"newWindow('{$file_name_http}',{$x},{$y})\">{$media_name}</a>";
} else {
$link_media = "<img src=\"include/resize.php?img={$file_name}&ratio={$r}\"> <a href=\"{$file_name_http}\" target=\"img_win\" >{$media_name}</a>";
}
break;
case 0:
// icon in page, icon here
// icon in page, icon here
default:
if ($javascript_ok) {
$link_media = "<img src=\"img/_img.png\"> <A HREF=\"#\" ONCLICK=\"newWindow('{$file_name_http}',{$x},{$y})\">{$media_name}</a>";
} else {
$link_media = "<img src=\"img/_img.png\"> <a href=\"{$file_name_http}\" target=\"img_win\" >{$media_name}</a>";
//mydebug(__LINE__,__FILE__,$link_media);
}
}
break;
//case 1:
//case 1:
case _SOUND:
$link_media = "<img src=\"img/_audio.png\"> <a href=\"{$file_name_http}\">{$media_name}</a>";
break;
//case 2:
//case 2:
case _VIDEO:
$link_media = "<img src=\"img/_video.png\"> <a href=\"{$file_name_http}\" target=\"img_win\" >{$media_name}</a>";
break;
}
} else {
//if ($media_type == 3){
if ($media_type == _LINK) {
if (stristr($media_name, "http")) {
$link_media = "<img src=\"img/_web.png\"> <a href=\"{$file_name_http}\" target=\"img_win\" >" . wordwrap($media_name, 20, "\n", 1) . "</a>";
} else {
$link_media = "<img src=\"img/_linkext.png\"> <a href=\"{$file_name_http}\" target=\"img_win\" >{$media_name}</a>";
}
} else {
if ($media_type == _DOC && file_exists($file_name)) {
$link_media = "<img src=\"img/_doc.png\"> <a href=\"{$file_name_http}\">{$media_name}</a>";
} else {
//$link_media =$media_name.": ".translateFN("non riconosciuto");
$link_media = sprintf(translateFN("%s: non riconosciuto"), $media_name);
}
}
}
$ok_media = array('media' => $link_media);
array_push($dataAr, $ok_media);
}
}
/*
*/
if (count($dataAr)) {
$t = new Table();
$t->initTable('0', 'center', '2', '0', '100%', '', '', '', '', '0', '0');
$t->setTable($dataAr, $caption = "", $summary = translateFN("Indice dei Media collegati"));
$t->getTable();
return $t->data;
} else {
return $this->_wrapTextInSpan(translateFN('Nessuno'), 'noitem')->getHtml();
}
} else {
return $this->_wrapTextInSpan(translateFN('Nessuno'), 'noitem')->getHtml();
}
//}
// fine filtro media
}
示例8: translateFN
if (in_array($user, array_keys($usersHa))) {
$n = $usersHa[$user];
$usersHa[$user] = $n + 1;
// echo $user.":".$usersHa[$user]."<br>";
} else {
$usersHa[$user] = 1;
}
}
$user_chat_report = translateFN("Totale messaggi:") . " " . $chat_msg . "<br />";
$user_chat_report .= translateFN("Ultimo messaggio:") . " " . ts2dFN($date) . " " . ts2tmFN($date) . "<br />";
$user_chat_report .= translateFN("Utenti / messaggi:") . "<br /><br />";
foreach ($usersHa as $k => $v) {
$user_chat_report .= "{$k}: {$v}<br/>\n";
}
$tObj = new Table();
$tObj->initTable('0', 'right', '1', '0', '90%', '', '', '', '', '1', '0');
// Syntax: $border,$align,$cellspacing,$cellpadding,$width,$col1, $bcol1,$col2, $bcol2
$caption = translateFN("Resoconto della chat di classe");
$summary = translateFN("Chat fino al {$ymdhms}");
$tObj->setTable($chat_dataAr, $caption, $summary);
$tabled_chat_dataHa = $tObj->getTable();
$menuOptions['id_instance'] = $sess_id_course_instance;
$menuOptions['id_course'] = $id_course;
$menuOptions['days'] = $days;
$menuOptions['id_chatroom'] = $sess_id_course_instance;
} else {
}
$tabled_chat_dataHa = translateFN("Nessuna chat disponibile.");
break;
case 'db':
$chat_report = "";
示例9: content
/**
* actually generates the form.
*
* this form is done through core and not extending the usual
* FForm object because as of today (03/dic/2013) the generation
* of forms containing tables and fields of array are not supported
*
* @return CBaseElement
* @access private
*/
private function content()
{
$form = CDOMElement::create('form', 'id:linkCourses, name:linkCourses, method:post');
if (isset($this->_data['conditionSetId'])) {
$form->addChild(CDOMElement::create('hidden', 'name:conditionSetId,value:' . $this->_data['conditionSetId']));
}
if (!empty($this->_coursesList)) {
$labels = array(translateFN('Nome e titolo del corso'), translateFN('collegato alla regola selezionata'));
foreach ($this->_coursesList as $id_course => $courseName) {
$selectItem = CDOMElement::create('select', 'class:linkCourseSelect,name:linkCourse[' . $id_course . ']');
$optionYES = CDOMElement::create('option', 'value:1');
$optionYES->addChild(new CText(translateFN('Sì')));
$optionNO = CDOMElement::create('option');
$optionNO->addChild(new CText(translateFN('No')));
$selectItem->addChild($optionYES);
$selectItem->addChild($optionNO);
if (in_array($id_course, $this->_data['linkedCourses'])) {
$optionYES->setAttribute('selected', 'selected');
} else {
$optionNO->setAttribute('selected', 'selected');
}
$rulesData[] = array($labels[0] => $courseName, $labels[1] => $selectItem->getHtml());
}
$table = new Table();
$table->initTable('0', 'center', '1', '1', '90%', '', '', '', '', '1', '0', '', 'default', 'linkedRulesTable');
$table->setTable($rulesData, translateFN('Imposta i corsi da collegare'), translateFN('Imposta i corsi da collegare'));
$form->addChild(new CText($table->getTable()));
$submitdiv = CDOMElement::create('div', 'id:submitDIV,class:tooltip');
$submit = CDOMElement::create('button', 'type:submit,id:submitButton');
$submit->setAttribute('title', translateFN('clicca per salvare i collegamenti'));
$submit->addChild(new CText(translateFN('Salva')));
$submitdiv->addChild($submit);
$form->addChild($submitdiv);
$warningDIV = CDOMElement::create('div', 'id:divWarning');
$warningDIV->addChild(new CText(translateFN('Attenzione: un corso può essere associato ad una sola regola. ' . ' Collegare un corso ad una regola sostituirà il collegamento alla regola precedente')));
$form->addChild($warningDIV);
} else {
$spanEmptyList = CDOMElement::create('span', 'class:emptyListWarning');
$spanEmptyList->addChild(new CText(translateFN('Nessun corso presente')));
$form->addChild($spanEmptyList);
}
return $form;
}
示例10: isset
function history_ex_done_FN($id_student, $id_profile = "", $id_course_instance = "")
{
/**
Esercizi svolti
Crea array con nodo e punteggio, ordinato in ordine
decrescente di punteggio.
*/
$dh = $GLOBALS['dh'];
$error = $GLOBALS['error'];
$http_root_dir = $GLOBALS['http_root_dir'];
$debug = isset($GLOBALS['debug']) ? $GLOBALS['debug'] : null;
if (empty($id_profile)) {
$id_profile = AMA_TYPE_TUTOR;
}
$ids_nodi_padri = array();
if (!empty($this->user_ex_historyAr)) {
foreach ($this->user_ex_historyAr as $k => $e) {
$exer_stats_ha[$k]['nome'] = $e[0];
$exer_stats_ha[$k]['titolo'] = $e[1];
$exer_stats_ha[$k]['id_nodo_parent'] = $e[2];
$exer_stats_ha[$k]['id_exe'] = $e[3];
$exer_stats_ha[$k]['id_nodo'] = $e[4];
$exer_stats_ha[$k]['id_istanza'] = $e[5];
$exer_stats_ha[$k]['data'] = $e[6];
$exer_stats_ha[$k]['punteggio'] = $e[7];
$exer_stats_ha[$k]['commento'] = $e[8];
$exer_stats_ha[$k]['correzione'] = $e[9];
$ids_nodi_padri[] = $exer_stats_ha[$k]['id_nodo_parent'];
}
if (!empty($ids_nodi_padri)) {
$nodi_padri = $dh->get_nodes($ids_nodi_padri, array('nome', 'titolo'));
}
$label1 = translateFN('Esercizio');
$label2 = translateFN('Data');
$label3 = translateFN('Punteggio');
$label4 = translateFN('Corretto');
$data = array();
foreach ($exer_stats_ha as $k => $e) {
$id_exe = $e['id_exe'];
$id_nodo = $e['id_nodo'];
$nome = $e['nome'];
$titolo = $e['titolo'];
$nome_padre = $nodi_padri[$e['id_nodo_parent']]['nome'];
$punteggio = $e['punteggio'];
if ($e['commento'] != '-' or $e['correzione'] != '-') {
$corretto = translateFN('Si');
} else {
$corretto = translateFN('-');
}
$date = ts2dFN($e['data']) . " " . ts2tmFN($e['data']);
if ($id_profile == AMA_TYPE_TUTOR) {
$zoom_module = "{$http_root_dir}/tutor/tutor_exercise.php";
} else {
$zoom_module = "{$http_root_dir}/browsing/exercise_history.php";
}
// vito, 18 mar 2009
$link = CDOMElement::create('a');
if (!empty($id_course_instance) && is_numeric($id_course_instance)) {
$link->setAttribute('href', $zoom_module . '?op=exe&id_exe=' . $id_exe . '&id_student=' . $id_student . '&id_nodo=' . $id_nodo . '&id_course_instance=' . $id_course_instance);
} else {
$link->setAttribute('href', $zoom_module . '?op=exe&id_exe=' . $id_exe . '&id_student=' . $id_student . '&id_nodo=' . $id_nodo);
}
$link->addChild(new CText($nome_padre . ' > '));
$link->addChild(new CText($nome));
$html = $link->getHtml();
$data[] = array($label1 => $html, $label2 => $date, $label3 => $punteggio, $label4 => $corretto);
}
$t = new Table();
$t->initTable('0', 'center', '1', '1', '90%', '', '', '', '', '1', '0', '', 'default', 'exercise_table');
$t->setTable($data, translateFN("Esercizi e punteggio"), translateFN("Esercizi e punteggio"));
$res = $t->getTable();
} else {
$res = translateFN("Nessun esercizio.");
}
return $res;
}
示例11: unset
unset($type);
}
}
if (!empty($links)) {
$linksul = CDOMElement::create('ul', 'class:ulactions');
foreach ($links as $link) {
$linksul->addChild($link);
}
$linksHtml = $linksul->getHtml();
} else {
$linksHtml = '';
}
$rulesData[$i] = array($labels[0] => $ruleAr['descrizione'], $labels[1] => $linksHtml);
}
$historyTable = new Table();
$historyTable->initTable('0', 'center', '1', '1', '90%', '', '', '', '', '1', '0', '', 'default', 'completeRulesList');
$historyTable->setTable($rulesData, translateFN('Elenco delle regole di completamento'), translateFN('Elenco delle regole di completamento'));
$rulesIndexDIV->addChild($newButton);
$rulesIndexDIV->addChild(new CText($historyTable->getTable()));
// if there are more than 10 rows, repeat the add new button below the table
if ($i > 10) {
$bottomButton = clone $newButton;
$bottomButton->setAttribute('class', 'newButton bottom');
$rulesIndexDIV->addChild($bottomButton);
}
} else {
$rulesIndexDIV->addChild(new CText(translateFN('Errore nella lettura dell\'elenco delle regole')));
}
$data = $rulesIndexDIV->getHtml();
/**
* include proper jquery ui css file depending on wheter there's one
示例12: translateFN
}
// switch $c_type
// verify the status of the chatroom
$started = $chatroomObj->is_chatroom_startedFN($id_chatroom);
$running = $chatroomObj->is_chatroom_activeFN($id_chatroom);
//$not_expired = $chatroomObj->is_chatroom_not_expiredFN($id_chatroom);
if ($running) {
$chatroom_status = translateFN('in corso');
$enter = "<a href=\"chat.php?id_room={$id_chatroom}&id_course={$id_course}\" target=\"_blank\"><img src=\"img/_chat.png\" alt=\"{$chat_label}\" border=\"0\"></a>";
} elseif (!$started) {
$chatroom_status = translateFN('non avviata');
$enter = translateFN("- - -");
} else {
$chatroom_status = translateFN('terminata');
$enter = translateFN("- - -");
}
// create the entries for the table
$row = array(translateFN('titolo') => translateFN($chat_title), translateFN('stato') => $chatroom_status, translateFN('tipo') => $chat_type, translateFN('entra') => $enter);
array_push($list_chatrooms, $row);
}
// initialize a new Table object that will visualize the list of the chatrooms
$tObj = new Table();
$tObj->initTable('1', 'center', '2', '2', '100%', '', '', '', '', '1', '', '');
$caption = "<strong>" . translateFN("La lista delle tue chatroom") . "</strong>";
$summary = translateFN("La lista delle tue chatroom");
$tObj->setTable($list_chatrooms, $caption, $summary);
$list_chatrooms_table = $tObj->getTable();
}
$banner = (include ROOT_DIR . '/include/banner.inc.php');
$content_dataAr = array('banner' => $banner, 'user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'course_title' => $modulo, 'help' => $help, 'data' => $list_chatrooms_table, 'chat_users' => isset($online_users) ? $online_users : '', 'edit_profile' => $userObj->getEditProfilePage());
ARE::render($layout_dataAr, $content_dataAr);
示例13: displayAllServicesData
//.........这里部分代码省略.........
$label10 = translateFN("Info");
$label11 = translateFN("Dettagli");
$old_service_country = "";
$old_service_title = "";
foreach ($service_infoAr as $course_dataHa) {
//var_dump($course_dataHa);
$id_service = $course_dataHa[0];
$service_title = translateFN($course_dataHa[1]);
$service_info = CDOMElement::create('a', 'href:' . HTTP_ROOT_DIR . '/browsing/service_info.php?id_service=' . $id_service);
$service_info->addChild(new CText($label10));
$service_info_link = $service_info->getHtml();
$service_level = $course_dataHa[2];
$service_country = $course_dataHa[7] . "/" . $course_dataHa[6];
$service_implementation_id = $course_dataHa[3];
$provider_name = $course_dataHa[5];
//var_dump($course_dataHa);
//if (AMA_DataHandler::isError($id_course_instanceAr)){ // never subscribed
if ($course_dataHa[8] == 0) {
// never subscribed
$norequest = "";
// is level attainable for this provider?
$max_level = $level_ha[$provider_pointer]['max_level'];
if ($max_level == 0 or $service_level - $maxlevel == 1) {
$course_subscription = CDOMElement::create('a', 'href:' . HTTP_ROOT_DIR . '/browsing/subscribe.php?id_course=' . $service_implementation_id);
$course_subscription->addChild(new CText($label4));
$course_subscription_link = $course_subscription->getHtml();
} else {
$course_subscription_link = $label7 . ":" . $service_level . "-" . $max_level;
// level too much higher
}
} else {
// var_dump($id_course_instanceAr) ;
$norequest = "&norequest=1";
$id_course_instance = $course_dataHa[8];
$course_subscription_link = $label9;
/*.": $id_course_instance"*/
}
$course_registration = CDOMElement::create('a', 'href:' . HTTP_ROOT_DIR . '/browsing/registration.php?id_course=' . $service_implementation_id);
$course_registration->addChild(new CText($label6));
$course_registration_link = $course_registration->getHtml();
$course_info = CDOMElement::create('a', 'href:' . HTTP_ROOT_DIR . '/browsing/service_info.php?id_course=' . $service_implementation_id . $norequest);
$course_info->addChild(new CText($label11));
$course_info_link = $course_info->getHtml();
if ($orderBy == 'service') {
if ($service_title != $old_service_title) {
$row[$label1] = "<strong>" . $service_title . "</strong>";
$old_service_title = $service_title;
// $row[$label10] = $service_info_link;
} else {
$row[$label1] = "";
// $row[$label10] = "";
}
// $course_info->addChild(new CText($provider_name));
$row[$label2] = $service_country;
// $row[$label5] = $course_info_link;
$row[$label5] = $provider_name;
$row[$label11] = $course_info_link;
$row[$label3] = level2stringFN($service_level);
if ($callerModule == 'user') {
$row[$label4] = $course_subscription_link;
} elseif ($callerModule == 'info') {
$row[$label4] = $course_registration_link;
}
} elseif ($orderBy == 'country') {
if ($service_country != $old_service_country) {
$row[$label2] = "<strong>" . $service_country . "</strong>";
$old_service_country = $service_country;
} else {
$row[$label2] = "";
}
// $course_info->addChild(new CText($service_title));
$row[$label5] = $provider_name;
$row[$label1] = $service_title;
// $row[$label10] = $service_info_link;
$row[$label11] = $course_info_link;
$row[$label3] = level2stringFN($service_level);
if ($callerModule == 'user') {
$row[$label4] = $course_subscription_link;
} elseif ($callerModule == 'info') {
$row[$label4] = $course_registration_link;
}
}
$to_sub_course_dataHa[] = $row;
}
if (count($to_sub_course_dataHa) > 0) {
$tObj = new Table();
$tObj->initTable('1', 'center', '0', '1', '100%', '', '', '', '', '1', '1');
$caption = "<strong>" . translateFN("Servizi che puoi richiedere") . "</strong>";
$summary = translateFN("Elenco dei servizi che puoi richiedere");
$tObj->setTable($to_sub_course_dataHa, $caption, $summary);
$all_services_data = $tObj->getTable();
// $submit_button = "<p align='center'><input type=\"submit\" name=\"submit\" value=".translateFN("Richiedi")."></p>";
} else {
// $submit_button = "<p align='center'><input type=\"submit\" name=\"submit\" value=".translateFN("Registrati")."></p>";
$all_services_data = translateFN("Non ci sono servizi che puoi richiedere");
}
$form .= $all_services_data;
//.$submit_button;
return $form;
}
示例14: translateFN
function format_as_tags($dataAr)
{
$dh = $GLOBALS['dh'];
$debug = $GLOBALS['debug'];
$reg_enabled = $GLOBALS['reg_enabled'];
$id_profile = $GLOBALS['id_profile'];
$sess_id_user = $SESSION['sess_id_user'];
if (!is_array($dataAr) || !count($dataAr)) {
$res = translateFN("Nessuna tag");
// header("Location: $error?err_msg=$msg");
} else {
$formatted_dataHa = array();
$k = -1;
foreach ($dataAr as $bookmark) {
$id_bk = $bookmark[0];
$id_node = $bookmark[1];
$date = $bookmark[2];
$author_id = $bookmark[4];
$node = $dh->get_node_info($id_node);
$title = $node['name'];
$icon = $node['icon'];
$description = $bookmark[3];
$authorHa = $dh->_get_user_info($author_id);
$author_uname = $authorHa['username'];
$k++;
$formatted_dataHa[$k]['autore'] = "<a href=\"tags.php?op=list_by_user&id_auth={$author_id}\">{$author_uname}</a>";
$formatted_dataHa[$k]['data'] = ts2dFN($date);
$formatted_dataHa[$k]['tag'] = "<a href=\"tags.php?op=list_by_tag&id_bk={$id_bk}\"><img src=\"img/check.png\" border=0> {$description}</a>";
if (is_array($dh->get_tutor($author_id))) {
// tag del tutor differenziate ??
$formatted_dataHa[$k]['id_nodo'] = "<a href=\"view.php?id_node={$id_node}\"><img src=\"img/{$icon}\" border=0> {$title}</a> (" . translateFN("Tutor") . ")";
//vito 13 gennaio 2009
// if ($id_profile == AMA_TYPE_TUTOR){
// $formatted_dataHa[$k]['del'] = "<a href=\"tags.php?op=delete&id_bk=$id_bk\">
// <img src=\"img/delete.png\" name=\"del_icon\" border=\"0\"
// alt=\"" . translateFN("Elimina") . "\"></a>";
// $formatted_dataHa[$k]['edit'] = "<a href=\"tags.php?op=edit&id_bk=$id_bk\">
// <img src=\"img/edit.png\" name=\"edit_icon\" border=\"0\"
// alt=\"" . translateFN("Edit") . "\"></a>";
// } else {
// $formatted_dataHa[$k]['del'] = "-";
// $formatted_dataHa[$k]['edit'] = "-";
// }
} else {
$formatted_dataHa[$k]['nodo'] = "<a href=\"view.php?id_node={$id_node}\"><img src=\"img/{$icon}\" border=0> {$title}</a>";
// vito 13 gennaio 2009
// if ($reg_enabled AND $author_id == $sess_user_id){
// $formatted_dataHa[$k]['del'] = "<a href=\"tags.php?op=delete&id_bk=$id_bk\">
// <img src=\"img/delete.png\" name=\"del_icon\" border=\"0\"
// alt=\"" . translateFN("Elimina") . "\"></a>";
// $formatted_dataHa[$k]['edit'] = "<a href=\"tags.php?op=edit&id_bk=$id_bk\">
// <img src=\"img/edit.png\" name=\"edit_icon\" border=\"0\"
// alt=\"" . translateFN("Edit") . "\"></a>";
// } else {
// $formatted_dataHa[$k]['del'] = "-";
// $formatted_dataHa[$k]['edit'] = "-";
// }
}
$formatted_dataHa[$k]['zoom'] = "<a href=\"tags.php?op=zoom&id_bk={$id_bk}\">\n <img src=\"img/zoom.png\" name=\"zoom_icon\" border=\"0\"\n alt=\"" . translateFN("Zoom") . "\"></a>";
}
$t = new Table();
$t->initTable('', 'default', '2', '1', '100%', '', '', '', '', 1, 0);
$t->setTable($formatted_dataHa, translateFN("Tag"), '');
$res = $t->getTable();
}
return $res;
}