function processPetition() { $this->setHelp("EducContent"); //Primero comprueba si estamos identificados y si no es asi //entonces vamos a ver si es una peticion de autenticacion if ($this->HasAccess()) { if ($this->issetViewVariable('submit')) { $courseData = $this->GetForm(); if ($this->CheckForm($courseData)) { $this->obj_data->createNewCourse($courseData, $user_id); $this->setViewClass('miguel_VResultNewCourse'); $this->setViewVariable('courseName', $courseData['c_name']); $this->setViewVariable('courseDescription', $courseData['cd_descripcion']); //$this->SendNotification(); $this->setCacheFile("miguel_VResultNewCourse_" . $this->getSessionElement("userinfo", "user_id")); $this->setCacheFlag(true); $this->setPageTitle('miguel_ResultNewCourse'); return; } $this->setViewVariable('courseDataForm', $courseData); } else { $this->setMessage(agt('Rellene el formulario para insertar un nuevo curso.')); } $this->setPageTitle('miguel_NewCourse'); $this->setViewVariable('courseDataForm', $this->GetDefaultForm()); //$this->addNavElement(Util::format_URLPath("newCourse/index.php", "course=".$course_id), $infoCourse['name']); $this->setCacheFile("miguel_VNewCourse_" . $this->getSessionElement("userinfo", "user_id")); $this->setCacheFlag(true); } else { header('Location:' . Util::format_URLPath('main/index.php')); } }
function processPetition() { //Se controla que el usuario no tenga acceso. Por defecto, se tiene acceso. $institution_id = -1; //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion $user_id = $this->getSessionElement('userinfo', 'user_id'); if (isset($user_id) && $user_id != '') { $institution_id = 0; } else { header('Location:' . Util::format_URLPath('main/index.php')); } if ($institution_id >= 0) { //Navega por la jerarquía $this->setViewClass("miguel_VMain"); $this->setMessage(agt('miguel_institutionList')); $this->setPageTitle("miguel_institutionList"); //$this->clearNavBarr(); $this->addNavElement(Util::format_URLPath('institution/index.php', 'id=institution'), agt("miguel_Institution")); $this->setViewVariable('arr_categories', $this->obj_data->getInstitutionResume()); $this->setCacheFile("miguel_VInstitution_" . $this->getSessionElement("userinfo", "user_id")); $this->setCacheFlag(true); $this->setHelp("EducContent"); } else { header('Location:' . Util::format_URLPath('main/index.php')); } }
function processPetition() { if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); } else { $status = 'main'; $status = $this->setViewVariable('status', 'main'); } switch ($status) { case 'main': default: //Presentación de mensajería $arrMessages = $this->obj_data->getNewUserMessages(Session::getValue('USERINFO_USER_ID')); $this->setViewVariable('arrMessages', $arrMessages); //Presentación de tablón de anuncios $NoticeArray = $this->obj_data->getNotices(); $this->setViewVariable('notice_array', $NoticeArray); break; } $this->clearNavBarr(); $this->addNavElement(Util::format_URLPath('alumnPage/index.php'), agt('Inicio')); $this->setPageTitle('miguel Alumn Page'); $this->setMessage(''); $this->setHelp(''); }
function add_mainMenu() { $div = html_div(''); $div->add(html_br()); $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 0, 0); $row = html_tr(); $blank = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 10, 10)); //$blank->set_tag_attribute('colspan','4'); $image = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 20, 14)); $image->set_tag_attribute('align', 'right'); $image->set_tag_attribute('width', '40%'); $link = html_a(Util::format_URLPath("bibliography/index.php"), agt('Catálogo'), null, "_top"); $link->set_tag_attribute('class', ''); $item1 = html_td('', '', $link); $item1->set_tag_attribute('width', '20%'); $link = html_a(Util::format_URLPath("bibliography/index.php", 'status=ref'), agt('Referencias bibliográficas'), null, "_top"); $link->set_tag_attribute('class', ''); $item2 = html_td('', '', $link); $item2->set_tag_attribute('width', '20%'); $link = html_a(Util::format_URLPath("bibliography/index.php", 'status=link'), agt('Enlaces de interés'), null, "_top"); $link->set_tag_attribute('class', ''); $item3 = html_td('', '', $link); $item3->set_tag_attribute('width', '20%'); $row->add($blank); $row->add($image); $row->add($item1); $row->add($item2); $row->add($item3); $table->add_row($row); $div->add($table); return $div; }
function processPetition() { if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); } else { $status = 'main'; $status = $this->setViewVariable('status', 'main'); } $this->addNavElement(Util::format_URLPath('statistics/index.php'), 'Página de Estadísticas'); switch ($status) { case 'main': default: //Presentación de tablón de anuncios $arrUsers = $this->obj_data->getUsers(); $iTotalCon = 0; for ($i = 0; $i < count($arrUsers); $i++) { $userId = $arrUsers[$i]['user.user_id']; $count = $this->obj_data->countLogin($userId); $arrUsers[$i]['countLogin'] = $count; $iTotalCon += $count; } $this->setViewVariable('arrUsers', $arrUsers); $this->setViewVariable('iTotalCon', $iTotalCon); break; } $this->setPageTitle("miguel statistics"); $this->setMessage("Estadísticas de miguel"); $this->setHelp(""); }
function add_mainMenu() { $div = html_div(''); $div->add(html_br()); $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 0, 0); $row = html_tr(); $blank = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 10, 10)); //$blank->set_tag_attribute('colspan','4'); $image = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 20, 14)); $image->set_tag_attribute('align', 'right'); $image->set_tag_attribute('width', '40%'); $link = html_a(Util::format_URLPath("profileManager/index.php", 'submit=new'), agt('Nuevo perfil'), null, "_top"); $link->set_tag_attribute('class', ''); $item1 = html_td('', '', $link); $item1->set_tag_attribute('width', '20%'); /*$link = html_a(Util::format_URLPath("profileManager/index.php",'submit=del'), agt('Baja perfil'), null, "_top"); $link->set_tag_attribute('class', ''); $item2 = html_td('', '', $link); $item2->set_tag_attribute('width', '20%'); */ $row->add($blank); $row->add($image); $row->add($item1); //$row->add($item2); $table->add_row($row); $div->add($table); return $div; }
function processPetition() { //Se controla que el usuario no tenga acceso. $bol_hasaccess = false; //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion $user_id = $this->getSessionElement('userinfo', 'user_id'); if (isset($user_id) && $user_id != '') { $bol_hasaccess = true; $user = $this->getSessionElement('userinfo', 'user_alias'); } else { } if ($bol_hasaccess) { if ($user == 'guest') { //Error, el usuario no puede ser el invitado } else { //Miramos si se puede hacer la inscripción directa $course_id = $this->getViewVariable('course_id'); $courseAccess = miguel_CourseInfo::getAccess($this->obj_data, $course_id); if (!$courseAccess) { //Realiza la inscripciÛn directa en el curso $this->_subscribeCourse($user_id, $course_id); $this->addNavElement(Util::format_URLPath('main/index.php'), agt('miguel_Courses')); $course_name = $this->obj_data->getCourseName($course_id); $this->setViewVariable('course_name', $course_name); $subject = agt('miguel_newCourseSubscriptionSubject') . ' ' . $course_name; $body = $course_name . ',\\n ' . agt('miguel_newCourseSubscriptionBody') . '\\n' . agt('miguel_disclaimer'); } else { //La inscripción ha de ser validada por el responsable $subject = agt('miguel_newCourseSubscriptionPending') . ' ' . $course_name; $body = $course_name . ',\\n ' . agt('miguel_newCourseSubscriptionBody') . '\\n' . agt('miguel_disclaimer'); } //Realiza la notificacion si esta permitido if ($this->getSessionElement('userinfo', 'notify_email')) { include_once Util::base_Path("include/classes/mailer.class.php"); $mail = new miguel_mailer(); $mail->From = $this->getSessionElement('userinfo', 'email'); $mail->FromName = $this->getSessionElement('userinfo', 'name') . ' ' . $this->getSessionElement('userinfo', 'surname'); $mail->AddAddress($this->getSessionElement('userinfo', 'email'), $this->getSessionElement('userinfo', 'name')); $mail->AddReplyTo($this->getSessionElement('userinfo', 'email'), $this->getSessionElement('userinfo', 'name')); $mail->Subject = $subject; $mail->Body = $body; if (!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; //exit; } } $this->setCacheFile("miguel_VSubscribe_" . $this->getSessionElement("userinfo", "user_id")); $this->setMessage(agt("miguel_userSubscribe")); $this->setPageTitle("miguel_userSubscribe"); } } else { //Bienvenida } $this->setCacheFlag(true); $this->setHelp("EducContent"); }
function processPetition() { /* * Set various "burocratic" things */ $this->addNavElement(Util::format_URLPath('authortool/index.php'), agt("nav_authortool")); $this->setMessage(agt('miguel_AuthorTool')); $this->setPageTitle(agt('miguel_AuthorTool')); $this->setHelp("EducAuthorTool"); /* * Get action status, if none -> set to list */ if ($this->IsSetVar('status')) { $status = $this->getViewVariable('status'); } else { $status = 'list'; $this->setViewVariable('status', $status); } /* * Get current folder id, if none -> set to 0, * which is the root one of actual course */ if ($this->issetViewVariable('current_folder_id')) { $folder_id = $this->getViewVariable('current_folder_id'); } else { $folder_id = 0; $this->setViewVariable('current_folder_id', $folder_id); } /* * Sets read access to this course files and folder */ $bol_hasaccess = false; $user_id = $this->getSessionElement('userinfo', 'user_id'); $course_id = $this->getSessionElement('courseinfo', 'course_id'); $course_id = 7; if (isset($user_id) && $user_id != '' && isset($course_id) && $course_id != '') { $bol_hasaccess = true; $user_alias = $this->getSessionElement('userinfo', 'user_alias'); $ret_sql = $this->obj_data->Select('user', 'id_profile', 'user_id = ' . $user_id); $user_profile_id = $ret_sql[0]['user.id_profile']; $this->setCacheFile('miguel_VAuthorTool_' . $course_id . '_' . $user_id); $this->setCacheFlag(true); /* * Execute the required action depdending on status once checked * access permission. */ $this->_exec_by_status($status, $folder_id, $user_id, $user_profile_id, $course_id); } else { /* * Otherwise, give control to main module */ $this->giveControl('main', 'miguel_CMain'); } }
function add_activity($title, $body, $id, $index) { $row = html_tr(); $lDelete = html_a(Util::format_URLPath('courseActivities/index.php', "status=delete&idi={$id}"), 'Eliminar'); $lUpdate = html_a(Util::format_URLPath('courseActivities/index.php', "status=showForm&index={$index}"), 'Modificar'); $tdLinks = html_td('ptabla03', '', $lDelete, $lUpdate); $title = html_td('ptabla02', '', $title); $body = html_td('ptabla03', '', $body); $row->add($title); $row->add($body); $row->add($tdLinks); return $row; }
function form() { //El formateo va a ser realizado sobre una tabla en la que cada fila es un campo del formulario $table =& html_table('40%', 0, 0, 0, 'center'); $table->set_class('ptabla03'); $param = '&id_forum=' . $this->getViewVariable('id_forum') . '&id_topic=' . $this->getViewVariable('id_topic'); $link = html_td('p', '', html_a(Util::format_URLPath('forum/index.php', 'status=new_post' . $param), agt('Añadir nuevo hilo'), 'boton02a')); $this->set_form_tabindex('orden', '14'); $sort = html_td('ptabla03', '', $this->element_form('orden')); $this->set_form_tabindex('Aceptar', '15'); $boton = html_td('ptabla03', '', $this->element_form('Aceptar')); //$boton->set_tag_attribute('valign', 'center'); $table->add_row($link, $sort, $boton); return $table; }
function processPetition() { //Consultar la variable status. Si no existe se establece a 'menú' if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); } else { $status = 'menu'; $status = $this->setViewVariable('status', 'menu'); } //$this->addNavElement(Util::format_URLPath('notice/index.php', 'status=list'), 'Tablón de anuncios'); //Según el valor de status abrir una u otra vista switch ($status) { case 'new': //Nuevo comentario $this->processPetitionNew(); $this->addNavElement(Util::format_URLPath('notice/index.php', 'status=new'), 'Nuevo comentario'); break; case 'list': //Listar comentarios $NoticeArray = $this->obj_data->getNotices(); $this->setViewVariable('notice_array', $NoticeArray); $this->addNavElement(Util::format_URLPath('notice/index.php', 'status=list'), 'Tablón de anuncios'); break; case 'show': if ($this->issetViewVariable('id')) { $id = $this->getViewVariable('id'); $NoticeArray = $this->obj_data->getNotice($id); $this->setViewVariable('author', $NoticeArray[0]['notice.author']); $this->setViewVariable('subject', $NoticeArray[0]['notice.subject']); $this->setViewVariable('time', $NoticeArray[0]['notice.time']); $this->setViewVariable('text', $NoticeArray[0]['notice.text']); } break; case 'menu': //Ver menú de opciones //Ver menú de opciones default: break; } //Establecer el título de la página $this->setPageTitle("miguel Notice Page"); $this->setMessage(''); //Establecer cual va a ser el archivo de la ayuda on-line, este se obtiene del directorio help/ $this->setHelp(""); }
/** * this function returns the contents * of the left block. It is already wrapped * in a TD * * @return HTMLTag object */ function right_block() { $ret_val = container(); $hr = html_hr(); $hr->set_tag_attribute("noshade"); $hr->set_tag_attribute("size", 2); $ret_val->add($hr); $ret_val->add(html_h4("Alta Título Bibliográfico de la Bibilioteca Virtual del Campus")); if ($this->issetViewVariable('newbook') && $this->getViewVariable('newbook') == 'ok') { $ret_val->add(html_h2(agt('Alta de título correcto.'))); $ret_val->add(html_a(Util::format_URLPath("main/index.php", 'id=institution'), agt('Volver'))); $ret_val->add(_HTML_SPACE); $ret_val->add(html_a(Util::format_URLPath('newBook/index.php'), agt('Nuevo Título Bibliográfico'))); } else { $ret_val->add($this->addForm('newBook', 'miguel_bookForm')); } return $ret_val; }
function _contactDetail() { $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 2, 2); $contact = $this->getViewVariable('detail_contacts'); if (is_array($contact) && $contact[0]['contact.contact_id'] != null) { $table->add_row($this->add_info('Nombre', $contact[0]['contact.contact_name'])); $table->add_row($this->add_info('Apellido', $contact[0]['contact.contact_surname'])); if ($contact[0]['contact.contact_nick'] != null) { $table->add_row($this->add_info('Usuario', $contact[0]['contact.contact_nick'])); } $table->add_row($this->add_info('Correo electrónico', $contact[0]['contact.contact_mail'])); $table->add_row($this->add_info('Comentarios', nl2br($contact[0]['contact.contact_comments']))); } $btDel = html_a(Util::format_URLPath("contact/index.php", "contact_id=" . $contact[0]['contact.contact_id'] . "&option=delete"), 'Eliminar', null, '_top'); $btDel->set_tag_attribute('class', ''); $btBack = html_a(Util::format_URLPath("contact/index.php", ''), 'Volver', null, '_top'); $btBack->set_tag_attribute('class', ''); $table->add_row($btBack, $btDel); return $table; }
function right_block() { $ret_val = container(); $hr = html_hr(); $hr->set_tag_attribute('noshade'); $hr->set_tag_attribute('size', 2); $ret_val->add($hr); $div = html_div('ul-big'); $div->add(html_img(Util::app_URLPath('../var/themes/Miguel/image/menu/addcourse.png'), 0, 0, 0, '')); $div->add(html_b('Nuevo Curso Adicionado')); $div->add(html_br(2)); $ret_val->add($div); $div1 = html_div(); $div1->add(agt('El curso se ha adicionado correctamente en la base de datos.')); $div1->add(html_br(2)); $div1->add(agt('NOMBRE DEL CUSRSO'), ' : ', $this->getViewVariable('courseName')); $div1->add(html_br(2), agt('DESCRIPCION'), ' : ', $this->getViewVariable('courseDescription')); $div1->add(new FormProcessor(new miguel_resultNewCourseForm(), 'resultNewCourse', Util::format_URLPath('main/index.php'))); $ret_val->add($div1); return $ret_val; }
function form() { $table =& html_table($this->_width, 0, 2, 2); $table->set_class('ptabla02'); $labelAdd = html_label('submit'); $labelAdd->add($this->element_form('submit')); $tdsubmit = html_td('', 'left', $labelAdd); $this->set_form_tabindex('submit', '10'); $menu_id = $this->getViewVariable('menu_id'); $arrSmn = $this->getViewVariable('arrSubmenus'); for ($i = 0; $i < count($arrSmn); $i++) { if ($arrSmn[$i]['name'] != '') { $submenu_id = $arrSmn[$i]['submenu_id']; $tdDelete = html_td('', '', html_a(Util::format_URLPath('moduleManager/index.php', "status=deleteSubmenu&menu_id={$menu_id}&submenu_id={$submenu_id}"), 'Eliminar')); $opt_id = 'submenu' . $submenu_id; $table->add_row($this->_showElement($opt_id, 7 + $i, $opt_id, $arrSmn[$i]['name'], $opt_id, 'left'), $tdDelete); } } $table->add_row($tdsubmit); return $table; }
function main_block() { $content = container(); //$hr = html_hr(); //$hr->set_tag_attribute("noshade"); //$hr->set_tag_attribute("size", 2); //$ret_val->add($hr); $content->add(html_h4(agt('Preinscripción'))); $content->add(html_br()); if ($this->issetViewVariable('strError')) { $strError = $this->getViewVariable('strError'); $ret_val->add(html_b(agt('Falta de informar los siguientes campos obligatorios: ') . $strError)); $ret_val->add(html_br(2)); } if ($this->issetViewVariable('newclient') && $this->getViewVariable('newclient') == 'ok') { $content->add(html_h2(agt('Preinscripción de usuario correcta.'))); $content->add(html_a(Util::format_URLPath('main/index.php'), agt('Volver'))); } else { $content->add($this->addForm('newInscription', 'miguel_inscriptionForm')); } $ret_val = html_table(Session::getContextValue("mainInterfaceWidth"), 0, 1, 0); $ret_val->add_row(html_td('', '', _HTML_SPACE), html_td('', '', $content), html_td('', '', _HTML_SPACE)); return $ret_val; }
/** * this function returns the contents * of the right block. It is already wrapped * in a TD * Solo se define right_block porque heredamos de VMenu y el left_block se encuentra ya definido por defecto con el men˙ del sistema. * Si heredara de miguel_VPage entonces habrÌa que definir de igual forma right_block y main_block. Esta ˙ltima es un contenedor de left_block y right_block * @return HTMLTag object */ function right_block() { //Crea el contenedor del right_block $ret_val = container(); //Vamos a ir creando los distintos elementos (Estos a su vez son tambiÈn contenedores) del contenedor principal. //hr es una linea horizontal de HTML. $hr = html_hr(); $hr->set_tag_attribute('noshade'); $hr->set_tag_attribute('size', 2); //Añade la linea horizontal al contenedor principal $ret_val->add($hr); //Crea un bloque div y le asigna la clase ul-big del CSS $div = html_div(); //Añade una imagen del tema $div->add(Theme::getThemeImage('modules/announces.png')); //Incluimos texto en negrita $div->add(html_b('Tabl�n de anuncios')); //Ahora dos retornos de carro $div->add(html_br(2)); //$ret_val->add($div); //$div = html_div('medium-text'); $status = $this->getViewVariable('status'); switch ($status) { case 'menu': default: $div->add($this->icon_link(Util::format_URLPath('notice/index.php', 'status=new'), Theme::getThemeImagePath('modules/announces.png'), 'Nuevo Mensaje')); $div->add(html_br(2)); $div->add($this->icon_link(Util::format_URLPath('notice/index.php', 'status=list'), Theme::getThemeImagePath('modules/announces.png'), 'Ver Mensajes')); $div->add(html_br(2)); $ret_val->add($div); break; case 'new': //Incluye en el Div un texto. Usa la funciÛn agt('etiqueta') para internacionalizar //$div->add(agt('miguelNoticeText')); //$div->add(html_br(2)); $ret_val->add($div); //Añadimos al contenedor principal el formulario de entrada de datos $ret_val->add($this->addForm('notice', 'miguel_noticeForm')); break; case 'list': $notice_array = $this->getViewVariable('notice_array'); for ($i = 0; $i < count($notice_array); $i++) { $div->add($this->add_notice($notice_array[$i]['notice.author'], $notice_array[$i]['notice.subject'], $notice_array[$i]['notice.time'], $notice_array[$i]['notice.notice_id'])); $div->add(html_br(2)); } $ret_val->add($div); break; case 'show': $ret_val->add($this->add_noticeDetails()); break; } //EnvÌa el contenedor del bloque right para que sea renderizado por el sistema return $ret_val; }
function _LinksList() { $ret_val = new container(); $div = html_div("medium-text"); $div->add(html_br(2)); $link = $this->getViewVariable('arr_links'); if (is_array($link) && $link[0]['link.link_id']) { $ul = html_ul(); $countLink = count($link); for ($i = 0; $i < $countLink; $i++) { $elem = container(); Debug::oneVar($link); $elem->add(html_a($link[$i]["link.link_url"], $link[$i]["link.link_name"], null, "_blank")); $elem->add(html_a(Util::format_URLPath("links/index.php", "link_id=" . $link[$i]["link.link_id"] . "&action=invalid"), "[" . agt("Enlace_roto") . "]", null, _top)); $elem->add(html_a(Util::format_URLPath("links/index.php", "link_id=" . $link[$i]["link.link_id"] . "&action=delete"), "[" . agt("Eliminar") . "]", null, _top)); $elem->add(html_br()); $elem->add($link[$i]["link.link_description"]); $ul->add($elem); } $div->add($ul); $div->add(html_a(Util::format_URLPath("links/index.php", "action=insert"), "[" . agt("insertar") . "]", null, _top)); $ret_val->add($div); } return $ret_val; }
function _categoryTable() { $ret_val = container(); $category = $this->getViewVariable('arr_categories'); if (is_array($category) && $category[0]['name']) { $div = html_div('medium-text'); $ul = html_ul(); $countCategory = count($category); for ($i = 0; $i < $countCategory; $i++) { $elem = container(); $elem->add(html_a(Util::format_URLPath('area/index.php', 'institution_id=' . $this->getViewVariable('institution_id') . '&faculty_id=' . $this->getViewVariable('faculty_id') . '&department_id=' . $category[$i]['id']), $category[$i]['name'], null, '_top')); $elem->add(html_small('(' . $category[$i]['num'] . ')')); $ul->add($elem); } $div->add($ul); $ret_val->add($div); } return $ret_val; }
/** * this function returns the contents * of the left block. It is already wrapped * in a TD * * @return HTMLTag object */ function right_block() { $ret_val = container(); $hr = html_hr(); $hr->set_tag_attribute("noshade"); $hr->set_tag_attribute("size", 2); $ret_val->add($hr); $ret_val->add(html_h4("Inscripción al Campus Virtual")); if ($this->issetViewVariable('newclient') && $this->getViewVariable('newclient') == 'ok') { $ret_val->add(html_h2(agt('Alta de usuario correcta.'))); $ret_val->add(html_a(Util::format_URLPath("main/index.php", 'id=institution'), agt('Volver'))); $ret_val->add(_HTML_SPACE); $ret_val->add(html_a(Util::format_URLPath('auth/index.php'), agt('Nuevo Usuario'))); } else { $ret_val->add($this->addForm('auth', 'miguel_inscriptionForm')); } return $ret_val; }
function right_block() { $ret_val = container(); $div = html_div(); $div->add(html_br()); $titulo = html_p('Tablón de anuncios'); $titulo->set_class('ptabla01'); $div->add($titulo); $status = $this->getViewVariable('status'); switch ($status) { case 'menu': default: $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 2, 2); $table->add_row(html_td('ptabla02', '', $this->icon_link(Util::format_URLPath('notice/index.php', 'status=new'), Theme::getThemeImagePath('boton_siguiente.gif'), 'Nuevo Mensaje'))); $table->add_row(html_td('ptabla02', '', $this->icon_link(Util::format_URLPath('notice/index.php', 'status=list'), Theme::getThemeImagePath('boton_siguiente.gif'), 'Ver Mensajes'))); $div->add($table); $ret_val->add($div); break; case 'new': $ret_val->add($div); $ret_val->add($this->addForm('notice', 'miguel_noticeForm')); break; case 'list': $notice_array = $this->getViewVariable('notice_array'); $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 2, 2); $table->add($this->add_noticeHead()); for ($i = 0; $i < count($notice_array); $i++) { $table->add($this->add_notice($notice_array[$i]['notice.author'], $notice_array[$i]['notice.subject'], $notice_array[$i]['notice.time'], $notice_array[$i]['notice.notice_id'])); } $div->add($table); $ret_val->add($div); break; case 'show': $ret_val->add($this->add_noticeDetails()); break; } return $ret_val; }
function add_notice($author, $text, $_date, $id) { //$check = html_input('radio',''); $row = html_tr(); $row->set_class(''); $row->set_id(''); $subject = html_td('', '', html_a(Util::format_URLPath('notice/index.php', "status=show&id={$id}"), $text)); $from = html_td('', '', $author); $date = html_td('', '', $_date); //$color = 'CECECE'; $color = '#99CE99'; $from->set_tag_attribute('bgcolor', $color); $date->set_tag_attribute('bgcolor', $color); $subject->set_tag_attribute('bgcolor', $color); $from->set_tag_attribute('width', '30%'); $subject->set_tag_attribute('width', '50%'); $date->set_tag_attribute('width', '20%'); $row->add($from); $row->add($subject); $row->add($date); return $row; }
function processPetition() { $arr_cvw = $this->getSessionData(); //Debug::oneVar($arr_cvw, __FILE__,__LINE__); //Obtención del id de curso //Parametro temporal para demo $course_id = $this->getViewVariable('id'); if (!isset($course_id)) { if (!isset($arr_cvw['course_id'])) { $course_id = 8; } else { $course_id = $arr_cvw['course_id']; } } else { $arr_cvw = array(); } //En un futuro deberia ser lo siguiente //$course_id = Session::getValue('course_id'); if ($course_id != $arr_cvw['course_id']) { unset($arr_cvw); $arr_cvw['course_id'] = $course_id; } //Si el curso se inicializa correctamente... if (isset($course_id) && $course_id != '') { include_once Util::app_Path('common/control/classes/miguel_courseinfo.class.php'); $infoCourse = miguel_CourseInfo::getInfo($this->obj_data, $course_id); //Debug::oneVar($infoCourse, __FILE__,__LINE__); //$this->setViewVariable('infoCourse', $infoCourse); //$arr_cvw['module_path'] = $this->obj_data->CourseModules($course_id); //Se obtiene el orden de documentos $arr_cvw['sec_docs'] = $this->obj_data->CourseModulesOrder($course_id); //Hay que ver si se nos redirecciona desde el exterior //Si existe la variable mid (id de módulo) reorientamos el índice $module_id = $this->getViewVariable('mid'); if (isset($module_id) && $module_id != '') { $this->moveIndex($module_id, $arr_cvw); } else { //Hay que navegar $option = $this->getViewVariable('opt'); //$this->processNavigation($option, $arr_cvw); $index = $arr_cvw['index']; $document_id = $arr_cvw['sec_docs'][$index]['document']; //Procesar datos de formulario if ($arr_cvw['accion']) { //Procesamos el formulario, si existe $this->processForm($document_id, $arr_cvw); //Sólo si no hay que mostrar un resultado se sigue if (!isset($arr_cvw['result'])) { //Procesamos la navegacion $this->processNavigation($option, $arr_cvw); } } else { $this->processNavigation($option, $arr_cvw); } } $index = $arr_cvw['index']; $document_id = $arr_cvw['sec_docs'][$index]['document']; $module_id = $arr_cvw['sec_docs'][$index]['module']; $arr_path = $this->getFolderNavInfo($document_id); //Debug::oneVar($arrPath, __FILE__,__LINE__); if ($arr_path['fl_type']) { $this->setViewVariable('view_elem', $this->processNextForm($arr_cvw)); $this->setViewClass('miguel_VCourseActioner'); $arr_cvw['accion'] = true; } else { $this->setViewClass('miguel_VCourseViewer'); $arr_cvw['accion'] = false; } $this->setViewVariable('ban_mid', $this->obj_data->getCourseModulesPosition($arr_cvw['course_id'], $module_id)); $this->setViewVariable('esInicio', $index == 0); $this->setViewVariable('hayPrevio', $index != 0); $this->setViewVariable('haySiguiente', $index < count($arr_cvw['sec_docs']) - 1); $this->setViewVariable('actual', Util::formatPath(MIGUEL_APPDIR . 'var/courses/course_' . $course_id . '/pages/' . $arr_path['fl_actual'])); //Util::formatPath(MIGUEL_APPDIR.'var/courses/'.$file); $this->setViewVariable('path', 'var/courses/course_' . $course_id . '/pages/'); //Guardamos variables de navegacion $this->setSessionElement('cvw', $arr_cvw); $this->addNavElement(Util::format_URLPath("courseViewer/index.php", 'url=' . $this->getViewVariable('url') . '&name=' . $this->getViewVariable('name')), $infoCourse['description']); $this->setPageTitle("miguel Course Viewer Page "); $this->setMessage(''); //$this->setCacheFile("miguel_vParser"); $this->setCacheFlag(true); $this->setHelp(""); } }
function processPetition() { /* ----------------- COMPRUEBA EL ACCESO AL MODULO E INICIALIZA --------------- */ //Se controla que el usuario no tenga acceso. $bol_hasaccess = false; //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion $user_id = $this->getSessionElement('userinfo', 'user_id'); $course_id = $this->getSessionElement('courseinfo', 'course_id'); //Para maqueta if (empty($course_id)) { $course_id = 7; } if (isset($user_id) && $user_id != '') { $bol_hasaccess = true; $user = $this->getSessionElement('userinfo', 'user_alias'); } $this->clearNavBarr(); if ($bol_hasaccess) { /* --------------- EXEC FILEMANAGER ACTIONS ----------------- */ if ($this->issetViewVariable('submit')) { /* ----------- NEW FOLDER -------------- */ if ($this->issetViewVariable('foldername')) { $this->setViewVariable('folder_id', $this->obj_data->insertFolder($this->getViewVariable('folder_id'), $course_id, $this->getViewVariable('foldername'), $user_id)); } /* ----------- SUBMIT FILE -------------- */ if ($_FILES['filename']['tmp_name'] != null) { include_once Util::app_Path("filemanager/include/classes/filemanager.class.php"); if (!$this->getViewVariable('filezip')) { fileManager::uploadFile($_FILES['filename']); $this->obj_data->insertFile($_FILES['filename']['name'], $_FILES['filename']['type'], $course_id, $this->getViewVariable('folder_id'), $user_id, $_FILES['filename']['size']); } else { $listUploadFiles = fileManager::uploadFileZip($_FILES['filename']); $listCount = count($listUploadFiles); for ($i = 0; $i < $listCount; $i++) { if (!$listUploadFiles[$i]['folder']) { //$parent_folder_id -> se busca dirname() en $listFolder[ruta_completa] y obtenemos el id y el nombre $this->obj_data->insertFile(basename($listUploadFiles[$i]['stored_filename']), '', $course_id, $this->getViewVariable('folder_id'), $user_id); } else { $this->obj_data->insertFolder($this->getViewVariable('folder_id'), $course_id, $this->getViewVariable('foldername'), $user_id); //Creamos una lista folder - (id - folder_name - folder_ruta_completa), necesaria para mantener la profundidad //folder_name -> basename( ruta ), parent_folder_name -> basename( dirname(ruta) ) $listFolder[] = array(basename(dirname($listUploadFiles[$i]['stored_filename'])), $lastIdFolder); } } } } /* ------------ OTRAS OPERACIONES ARCHIVOS Y DIRECTORIOS CON FORMULARIO INTERMEDIO-------------- */ /* Eliminar, Renombrar, Comentar, Mover, Hacer visible, Bloquear, Compartir, ¿Actualizar y guardar un log de cambios o control de versiones? */ if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); switch ($status) { case 'rename': if ($this->getViewVariable('tp') == 'f') { $this->obj_data->renameFolder($this->getViewVariable('id'), $this->getViewVariable('newname')); } else { $this->obj_data->renameFile($this->getViewVariable('id'), $this->getViewVariable('newname')); } break; case 'move': if ($this->getViewVariable('tp') == 'f') { $folder_id = $this->getViewVariable('id'); $nuevo_destino = $this->getViewVariable('nuevo_destino'); if ($folder_id != $nuevo_destino) { $this->obj_data->moveFolder($folder_id, $nuevo_destino); } $folder_id = null; unset($folder_id); $nuevo_destino = null; unset($nuevo_destino); } else { $this->obj_data->moveFile($course_id, $this->getViewVariable('id'), $this->getViewVariable('folder_id'), $this->getViewVariable('nuevo_destino')); } break; } $status = null; unset($status); } /* Debería retornar un valor error o estado de la operación y notificarlo en la carga del módulo */ } /* ------------------ OPERACIONES REALIZADAS DIRECTAMENTE ---------*/ if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); switch ($status) { case 'del': if ($this->getViewVariable('tp') == 'f') { $this->obj_data->deleteFolder($course_id, $this->getViewVariable('id')); } else { $this->obj_data->deleteFile($this->getViewVariable('id'), $this->getViewVariable('folder_id'), $course_id); } break; case 'visible': if ($this->getViewVariable('tp') == 'f') { $this->obj_data->visibleElement($this->getViewVariable('id'), 1, 'folder'); } else { $this->obj_data->visibleElement($this->getViewVariable('id'), 1, 'document'); } break; case 'invisible': if ($this->getViewVariable('tp') == 'f') { $this->obj_data->visibleElement($this->getViewVariable('id'), 0, 'folder'); } else { $this->obj_data->visibleElement($this->getViewVariable('id'), 0, 'document'); } break; case 'lock': $this->obj_data->lockDocument($this->getViewVariable('id'), 1); break; case 'unlock': $this->obj_data->lockDocument($this->getViewVariable('id'), 0); break; case 'share': $this->obj_data->shareDocument($this->getViewVariable('id'), 1); break; case 'unshare': $this->obj_data->shareDocument($this->getViewVariable('id'), 0); break; } } /* -------- SET CURRENT FOLDER, IF EMPTY BY DEFAULT FOLDER_ID = 0 ------------- */ if ($this->issetViewVariable("folder_id") != "") { $current_folder_id = $this->getViewVariable("folder_id"); } else { //$current_folder_id = $this->obj_data->getFolderId($course_id);//0; $current_folder_id = 0; } /* ----------- DISPLAY FOLDER CONTENT --------------- */ $current_folder_info = $this->obj_data->getFolderName($current_folder_id); $this->setViewVariable('current_folder_name', $current_folder_info[0]['folder_name']); $this->setViewVariable('folder_parent_id', $current_folder_info[0]['folder_parent_id']); $this->setViewVariable('arr_files', $this->obj_data->getFileList($course_id, $current_folder_id)); $this->setViewVariable('arr_folders', $this->obj_data->getFolderList($course_id, $current_folder_id)); $this->setViewVariable('folder_id', $current_folder_id); $operation_id = $this->getViewVariable('operation_id'); $this->setViewVariable('operation_id', $operation_id); if ($operation_id == 'move') { $this->obj_data->getFolderTree($course_id, $result, 0, 0); $this->setViewVariable('folderTree', $result); } $this->setViewVariable('user_id', $user_id); $this->setViewVariable('profile_id', $this->getSessionElement('userinfo', 'profile_id')); $this->setCacheFile("miguel_VFileManager" . $this->getSessionElement("userinfo", "user_id")); //$this->setMessage(agt("miguel_fileManager")); $this->setPageTitle("miguel_fileManager"); } else { $this->giveControl('main', 'miguel_CMain'); } $this->addNavElement(Util::format_URLPath('filemanager/index.php'), agt("Mis documentos")); $this->setCacheFlag(true); $this->setHelp("EducFileManager"); }
function add_mainMenu() { $div = html_div(''); $div->add(html_br()); $table =& html_table(Session::getContextValue('mainInterfaceWidth'), 0, 0, 0); $row = html_tr(); $blank = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 10, 10)); //$blank->set_tag_attribute('colspan','4'); $image = html_td('', '', html_img(Theme::getThemeImagePath("invisible.gif"), 20, 14)); $image->set_tag_attribute('align', 'right'); $image->set_tag_attribute('width', '40%'); $link = html_a(Util::format_URLPath("entityManager/index.php", 'submit=new'), agt('Registrar entidad'), null, "_top"); $link->set_tag_attribute('class', ''); $item1 = html_td('', '', $link); $item1->set_tag_attribute('width', '20%'); $link = html_a(Util::format_URLPath("entityManager/index.php", 'submit=ficha entidad'), agt('Ficha entidad'), null, "_top"); $link->set_tag_attribute('class', ''); $item2 = html_td('', '', $link); $item2->set_tag_attribute('width', '20%'); $link = html_a(Util::format_URLPath("entityManager/index.php", 'submit=del&entity=' . $this->getViewVariable('id')), agt('Baja entidad'), null, "_top"); $link->set_tag_attribute('class', ''); $item3 = html_td('', '', $link); $item3->set_tag_attribute('width', '20%'); $row->add($blank); $row->add($image); $row->add($item1); $row->add($item2); $row->add($item3); $table->add_row($row); $div->add($table); return $div; }
function processPetition() { //Se controla que el usuario no tenga acceso. Por defecto, se tiene acceso. //$institution_id = -1; //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion $user_id = $this->getSessionElement('userinfo', 'user_id'); if (isset($user_id) && $user_id != '') { $course_id = $this->getSessionElement('courseinfo', 'course_id'); if (empty($course_id)) { $course_id = 7; } //$this->setViewVariable('user_id', $user_id ); switch ($this->getViewVariable('option')) { case show: $ext_course = $this->getViewVariable('course'); $arr_courseplan = $this->obj_data->listCoursePlan($ext_course); $this->setViewClass('miguel_VMain'); break; case detail: //$module_id = $this->getViewVariable('module_id'); //$detail_courseplan = $this->obj_data->getCoursePlan($ourse_id, $module_id); //$this->setViewVariable('detail_courseplan', $detail_courseplan); //$this->setViewClass('miguel_VDetail'); break; default: $arr_courseplan = $this->obj_data->listCoursePlan($course_id); $this->setViewClass('miguel_VMain'); break; } $this->setViewVariable('arr_courseplan', $arr_courseplan); $this->setViewVariable('courseid', $course_id); $this->clearNavBarr(); //$this->addNavElement(Util::format_URLPath('coursePlan/index.php'), agt('Mapa del curso') ); $this->setCacheFile("miguel_VMain_CoursePlan_" . $this->getSessionElement("userinfo", "user_id")); $this->setMessage(''); $this->setPageTitle('Plan del curso'); $this->setCacheFlag(true); $this->setHelp("EducContent"); } else { header('Location:' . Util::format_URLPath('main/index.php')); } }
function _courseList($isGuest) { $ret_val = new container(); $div = html_div("medium-text"); $course = $this->getViewVariable('arr_courses'); if (is_array($course) && $course[0]['course_id']) { $ul = html_ul(); $countCourse = count($course); for ($i = 0; $i < $countCourse; $i++) { $elem = container(); $elem->add(html_a(Util::format_URLPath("course/index.php", "course=" . $course[$i]["course_id"]), $course[$i]["course_name"], null, "_top")); $elem->add(html_br()); $elem->add($course[$i]["course_description"]); $elem->add(html_br()); if (!$isGuest) { if (!$course[$i]["course_isRegister"]) { $elem->add(html_a(Util::format_URLPath("subscribe/index.php", "course_id=" . $course[$i]["course_id"]), agt('miguel_subscribe'), null, '_top')); } else { $elem->add(html_a(Util::format_URLPath("unsubscribe/index.php", "course_id=" . $course[$i]["course_id"]), agt('miguel_unsubscribe'), null, '_top')); } } $ul->add($elem); } $div->add($ul); $ret_val->add($div); } return $ret_val; }
function processPetition() { //Consultar la variable status. Si no existe se establece a 'menú' if ($this->issetViewVariable('status')) { $status = $this->getViewVariable('status'); } else { $status = 'menu'; $this->setViewVariable('status', 'menu'); } //Debug::oneVar($this->arr_form, __FILE__, __LINE__); //Según el valor de status abrir una u otra vista switch ($status) { case 'new': if ($this->issetViewVariable('submit')) { $this->processNewEvento(); } else { $this->setViewVariable('events', $this->obj_data->getEventTypes()); $this->addNavElement(Util::format_URLPath('calendar/index.php', 'status=new'), 'Nuevo evento'); $this->setMessage("Inserción de un nuevo evento"); } break; case 'delete': if ($this->issetViewVariable('id')) { $this->obj_data->deleteEvent($this->getViewVariable('id')); } $this->setViewVariable('calendar_array', $this->obj_data->getEvents()); $this->addNavElement(Util::format_URLPath('calendar/index.php', 'status=list'), 'Ver eventos'); break; case 'list': $this->setViewVariable('calendar_array', $this->obj_data->getEvents()); $this->addNavElement(Util::format_URLPath('calendar/index.php', 'status=list'), 'Ver eventos'); break; case 'show': if ($this->issetViewVariable('id')) { $id = $this->getViewVariable('id'); $event = $this->obj_data->getEvent($id); $this->setViewVariable('calendar', $id); $this->setViewVariable('course', $this->obj_data->getCourseDescription($event[0]['course_id'])); $this->setViewVariable('event', $this->obj_data->getEventTypeDescription($event[0]['event_type_id'])); $this->setViewVariable('subject', $event[0]['title']); $this->setViewVariable('content', $event[0]['description']); $this->setViewVariable('dt_ini', $event[0]['date_start']); $this->setViewVariable('dt_fin', $event[0]['date_end']); } break; case 'menu': $this->addNavElement(Util::format_URLPath('calendar/index.php'), 'Agenda del Curso'); $this->setMessage("Agenda del curso"); } //Establecer el título de la página $this->setPageTitle("miguel Calendar Page"); //Establecer cual va a ser el archivo de la ayuda on-line, este se obtiene del directorio help/ $this->setHelp(""); }
function add_catalogInfo($_name, $_surname, $_surname2, $_dni, $_user, $_phone, $_email, $_log) { $row = html_tr(); $link = $this->imag_alone(Util::format_URLPath('userManager/index.php', 'status=show&id=' . $_user . '&pid=' . $this->getViewVariable('pid')), Theme::getThemeImagePath('icono05.gif'), agt('Ver')); if ($_log) { $img_type = html_img(Theme::getThemeImagePath('conectado.gif'), 23, 20, 0); } else { $img_type = html_img(Theme::getThemeImagePath('desconectado.gif'), 23, 20, 0); } $conectado = html_td('', '', $img_type); //$link = _HTML_SPACE; $elem1 = html_td('ptabla03', '', $link); $elem1->set_tag_attribute('align', 'center'); $elem2 = html_td('ptabla03', '', agt($_name)); $elem3 = html_td('ptabla03', '', agt($_surname)); $elem4 = html_td('ptabla03', '', agt($_surname2)); $elem5 = html_td('ptabla03', '', agt($_dni)); $elem6 = html_td('ptabla03', '', agt($_user)); $elem7 = html_td('ptabla03', '', $img_type); $elem8 = html_td('ptabla03', '', agt($_phone)); $elem9 = html_td('ptabla03', '', agt($_email)); $elem1->set_tag_attribute('width', '2%'); $elem2->set_tag_attribute('width', '10%'); $elem3->set_tag_attribute('width', '10%'); $elem4->set_tag_attribute('width', '10%'); $elem5->set_tag_attribute('width', '8%'); $elem6->set_tag_attribute('width', '8%'); $elem7->set_tag_attribute('width', '2%'); $elem8->set_tag_attribute('width', '10%'); $elem9->set_tag_attribute('width', '40%'); $row->add($elem1); $row->add($elem2); $row->add($elem3); $row->add($elem4); $row->add($elem5); $row->add($elem6); $row->add($elem7); $row->add($elem8); $row->add($elem9); return $row; }
function processPetition() { //Se controla que el usuario no tenga acceso. Por defecto, se tiene acceso. $institution_id = -1; //Primero comprueba si estamos identificados y si no es asi entonces vamos a ver si es una peticion de autenticacion $user_id = $this->getSessionElement('userinfo', 'user_id'); if (isset($user_id) && $user_id != '') { if ($this->issetViewVariable('institution_id')) { $institution_id = $this->getViewVariable('institution_id'); } else { $institution_id = -1; } if ($this->issetViewVariable('faculty_id')) { $faculty_id = $this->getViewVariable('faculty_id'); } else { $institution_id = -1; } if ($this->issetViewVariable('department_id')) { $department_id = $this->getViewVariable('department_id'); } else { $institution_id = -1; } if ($this->issetViewVariable('area_id')) { $area_id = $this->getViewVariable('area_id'); } else { $institution_id = -1; } } else { header('Location:' . Util::format_URLPath('main/index.php')); } if ($institution_id >= 0) { $this->setViewVariable('arr_courses', $this->obj_data->getCourse($user_id, $institution_id, $faculty_id, $department_id, $area_id)); //Perfil superior al alumno, debería de ser una comprobación ACL $profile_id = $this->getSessionElement('userinfo', 'profile_id'); if ($profile_id < 4) { $navinfo = array("institution_id" => $institution_id, "faculty_id" => $faculty_id, "department_id" => $department_id, "area_id" => $area_id); $this->setSessionArray('navinfo', $navinfo); } $this->addNavElement(Util::format_URLPath('listCourses/index.php', 'institution_id=' . $institution_id . '&faculty_id=' . $faculty_id . '&department_id=' . $department_id . '&area_id=' . $area_id), agt('miguel_CourseList')); $this->setCacheFile("miguel_VMain_ListaCursos_" . $this->getSessionElement("userinfo", "user_id")); $this->setMessage(agt('miguel_CourseList')); $this->setPageTitle('miguel_CourseList'); $this->setCacheFlag(true); $this->setHelp("EducContent"); } else { //category_id header('Location:' . Util::format_URLPath('main/index.php')); } }