function miguel_MenuBar($menu_file = '')
 {
     $file = Util::app_Path('common/include/menu.xml');
     if (!empty($menu_file)) {
         $file = Util::app_Path('common/include/' . $menu_file);
     }
     $this->_processXMLInitData($file);
     //Debug::oneVar($this, __FILE__, __LINE__);
 }
 /**
  * Este metodo se llama cada vez que se instancia la clase.
  * Se utiliza para crear los objetos del formulario
  */
 function form_init_elements()
 {
     //Debug::oneVar(Util::app_Path('install/include/gpl.txt'), __FILE__, __LINE__);
     if (file_exists(Util::app_Path('install/include/gpl.txt'))) {
         $str_content = File::Read(Util::app_Path('install/include/gpl.txt'));
     }
     $textarea = new FETextArea("Licence", false, 15, 90);
     $textarea->set_value($str_content);
     $this->add_element($textarea);
     $this->add_element($this->_formatElem("base_SubmitButton", "Salir", "quit", agt("Salir")));
     $this->add_element($this->_formatElem("base_SubmitButton", "Acepto", "submit", agt("Acepto") . " >"));
     $this->add_element($this->_formatElem("base_SubmitButton", "Regresar", "back", "< " . agt("Regresar")));
 }
 function _block()
 {
     include_once Util::app_Path("common/view/classes/miguel_navform.class.php");
     $ret_val = container();
     $titulo = html_h4('Ha salido correctamente de la aplicación');
     $titulo->set_tag_attribute('class', 'ptexto01');
     $msg = html_p('Para continuar trabajando en este Campus debe regresar a la página de inicio y acceder de nuevo.');
     $msg->set_tag_attribute('class', 'ptexto01');
     $ret_val->add($titulo);
     $ret_val->add($msg);
     //Dejar así, no usar  $this->addForm(), ya que el enlace se hace sin SID
     $ret_val->add(new FormProcessor(new miguel_navForm(), 'reload', Util::main_URLPath('index.php')));
     return $ret_val;
 }
 /**
  * Pasa el control a un controlador diferente
  * @param string $moduleName Nombre del módulo a instanciar
  * @param string $class Clase controlador
  *
  */
 function giveControl($moduleName, $class)
 {
     if (file_exists(Util::app_Path($moduleName . '/control/classes/' . strtolower($class) . '.class.php'))) {
         include Util::app_Path($moduleName . '/control/classes/' . strtolower($class) . '.class.php');
         $new_control = new $class();
     }
     if (isset($new_control)) {
         $new_control->Exec();
     }
     exit;
 }
Ejemplo n.º 5
0
      +----------------------------------------------------------------------+
      | miguel admin                                                         |
      +----------------------------------------------------------------------+
      | Copyright (c) 2004, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Manuel R. Freire Santos (Universidad Antonio de Nebrija)    |
      |                       <*****@*****.**>                  |
      |          miguel development team                                     |
      |                       <*****@*****.**>   |
      +----------------------------------------------------------------------+
*/
include_once '../common/miguel_base.inc.php';
include_once Util::app_Path('admin/control/classes/miguel_cadmin.class.php');
$miguel = new miguel_CAdmin();
$miguel->Exec();
Ejemplo n.º 6
0
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("courseCard/control/classes/miguel_ccoursecard.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CCourseCard();
//Ejecuta el controlador
$miguel->Exec();
Ejemplo n.º 7
0
/*
      +----------------------------------------------------------------------+
      | andromeda:  miguel Framework, written in PHP                         |
      +----------------------------------------------------------------------+
      | Copyright (c) 2003,2004 miguel Development Team                      |
      +----------------------------------------------------------------------+
      |   This library is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU Library General Public        |
      |   License as published by the Free Software Foundation; either       | 
      |   version 2 of the License, or (at your option) any later version.   |
      |                                                                      |
      |   This library is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  |
      |   Library General Public License for more details.                   |
      |                                                                      |
      |   You should have received a copy of the GNU Library General Public  |
      |   License along with this program; if not, write to the Free         |
      |   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,    |
      |   MA 02111-1307, USA.                                                |      
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Sólo para desarrollo
include_once '../common/miguel_base.inc.php';
include_once Util::app_Path('error/control/classes/miguel_cerror.class.php');
$miguel = new miguel_CError();
$miguel->Exec();
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |
      +----------------------------------------------------------------------+
*/
/**
 * Esta clase se encarga de gestionar el formulario para accesos
 * de usuarios a la plataforma miguel
 *
 * @author  Jesus A. Martinez Cerezal <*****@*****.**>
 * @author miguel development team <*****@*****.**>
 * @package miguel main
 * @version 1.0.0
 */
include_once Util::app_Path("common/view/classes/miguel_formcontent.class.php");
class miguel_bookForm extends miguel_FormContent
{
    function form_init_elements()
    {
        $elemTitulo = $this->_formatElem("FEText", 'titulo', 'titulo', FALSE, "100");
        $elemTitulo->set_attribute('class', 'ptabla03');
        $this->add_element($elemTitulo);
        $elemAutor = $this->_formatElem("FEText", "autor", "autor", FALSE, "100");
        $elemAutor->set_attribute('class', 'ptabla03');
        $this->add_element($elemAutor);
        $elemDate = $this->_formatElem("FEYears", "año", "f_edicion", FALSE, null, null, '1900', date('Y'));
        $elemDate->set_attribute('class', 'ptabla03');
        $this->add_element($elemDate);
        $elemEditorial = $this->_formatElem("FEText", "editorial", "editorial", FALSE, "100");
        $elemEditorial->set_attribute('class', 'ptabla03');
Ejemplo n.º 9
0
/*
      +----------------------------------------------------------------------+
      | miguel base                                                          |
      +----------------------------------------------------------------------+
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("install/control/classes/miguel_cinstall.class.php");
$miguel = new miguel_CInstall();
$miguel->Exec();
Ejemplo n.º 10
0
/*
      +----------------------------------------------------------------------+
      | miguel base                                                          |
      +----------------------------------------------------------------------+
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("courseViewer/control/classes/miguel_ccourseviewer.class.php");
$miguel = new miguel_CCourseViewer();
$miguel->Exec();
 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");
 }
Ejemplo n.º 12
0
      +----------------------------------------------------------------------+
      | entityManager/index.php                                             |
      +----------------------------------------------------------------------+
      | Copyright (c) 2004, SHS Polar Sistemas Informáticos, S.L.            |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("entityManager/control/classes/miguel_centitymanager.class.php");
$miguel = new miguel_CEntityManager();
$miguel->Exec();
Ejemplo n.º 13
0
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("email/control/classes/miguel_cemail.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CEmail();
//Ejecuta el controlador
$miguel->Exec();
 /**
  * Permite añadir un formulario en la página
  * @param string $str_moduleName Nombre del módulo al que pertenece
  * @param string $str_className Nombre de la clase Formulario
  * @param string $str_param Parametros adicionales (opcional)
  * @return object FormProcessor
  */
 function addForm($str_moduleName, $str_className, $str_param = '')
 {
     $ret_val = container();
     $this->registry->pushApp('common');
     $file_name = Util::app_Path($str_moduleName . '/view/classes/' . strtolower($str_className) . '.class.php');
     /*
     if($this->issetViewVariable('wm')){
     	if($str_param == ''){
     		$str_param = 'wm';
     	} else {
     		$str_param = 'wm&'.$str_param;
     	}
     	$str_param = 'wm';
     }
     */
     if ($this->issetViewVariable('wm')) {
     }
     if (file_exists($file_name)) {
         include $file_name;
         if ($str_param == '') {
             $ret_val = new FormProcessor(new $str_className($this->arr_commarea), strtolower($str_className), Util::format_URLPath(trim(str_replace('/' . MIGUELBASE_MODULES_BASE, ' ', $_SERVER['PHP_SELF']))));
         } else {
             $ret_val = new FormProcessor(new $str_className($this->arr_commarea), strtolower($str_className), Util::format_URLPath(trim(str_replace('/' . MIGUELBASE_MODULES_BASE, ' ', $_SERVER['PHP_SELF'])), $str_param));
         }
         //$ret_val->set_form_target('parent');
         /*
         if($this->issetViewVariable('wm')){
         	$ret_val->set_onsubmit('self.close()');
         }
         */
     }
     $this->registry->popApp('common');
     return $ret_val;
 }
Ejemplo n.º 15
0
      +----------------------------------------------------------------------+
      |statistics/index.php                                                  |
      +----------------------------------------------------------------------+
      | Copyright (c) 2004, SHS Polar Sistemas Informáticos, S.L.            |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("statistics/control/classes/miguel_cstatistics.class.php");
$miguel = new miguel_CStatistics();
$miguel->Exec();
Ejemplo n.º 16
0
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("courseTask/control/classes/miguel_ccoursetask.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CcourseTask();
//Ejecuta el controlador
$miguel->Exec();
Ejemplo n.º 17
0
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("todo/control/classes/miguel_ctodo.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CTodo();
//Ejecuta el controlador
$miguel->Exec();
Ejemplo n.º 18
0
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("courseIdeas/control/classes/miguel_ccourseideas.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CCourseIdeas();
//Ejecuta el controlador
$miguel->Exec();
 function _exec_by_status($status, $folder_id, $user_id, $user_profile_id, $course_id)
 {
     /*
      * We have success by default ;-)
      */
     $this->SetViewVariable('opstat', 'success');
     /*
      * Select the action given by status
      */
     switch ($status) {
         case 'list':
             /*
              * First, we must check our permissions
              */
             if (!$this->obj_data->checkFolderPerms("r", $course_id, $user_profile_id, $folder_id)) {
                 $this->giveControl('main', 'miguel_CMain');
             }
             /*
              * Get/set order list:
              */
             /*
              * Relation among fileds of tables folder and document about order
              */
             $fdOrderRelations = array("id" => array("folder_id", "document.document_id"), "name" => array("folder_name", "document.document_name"), "date" => array("folder_date", "document.date_publish,\r\n\t\t\t\t\t\tdocument.document_name"), "comment" => array("folder_comment", "document.document_comment"), "user_alias" => array("folder_name", "user.user_alias,\r\n\t\t\t\t\t\tdocument.document_name"), "accepted" => array("folder_name", "document.document_accepted,\r\n\t\t\t\t\t\tdocument.document_name"), "mime" => array("folder_name", "document.document_mime,\r\n\t\t\t\t\t\tdocument.document_name"), "actions" => array("folder_perms, foldeer_name", "document.document_name"));
             /*
              * This is somewhat a "hack" but it works and doesn't overload the server.
              * The problem is that we cannot use in_array('orderby', $fdOrderRelations)
              * because..??.. in_array sucks! 
              */
             $fdOrderbyArray = array("id", "name", "date", "comment", "user_alias", "accepted", "mime", "actions");
             $this->setViewVariable('fdOrderbyArray', $fdOrderbyArray);
             if ($this->IsSetVar('orderby', 'orderhow') && in_array($this->getViewVariable('orderby'), $fdOrderbyArray) && ($this->getViewVariable('orderhow') == 0 || $this->getViewVariable('orderhow') == 1)) {
                 $orderby = $this->getViewVariable('orderby');
                 $orderhow = $this->getViewVariable('orderhow');
             } else {
                 $orderby = 'name';
                 $this->setViewVariable('orderby', $orderby);
                 $orderhow = 0;
                 $this->setViewVariable('orderhow', $orderhow);
             }
             /*
              * No real action to execute,
              * but we'll get some data that we'll need in View class
              */
             $this->setViewVariable('FolderList', $this->obj_data->getFolderList($course_id, $folder_id, $user_profile_id, $fdOrderRelations[$orderby][0], $orderhow));
             $this->setViewVariable('FileList', $this->obj_data->getFileList($course_id, $folder_id, $user_profile_id, $user_id, $fdOrderRelations[$orderby][1], $orderhow));
             $this->setViewVariable('FolderProperties', $this->obj_data->getFolderProperties($course_id, $folder_id, $user_profile_id, $user_id));
             $this->setViewVariable('FolderDeeps', $this->obj_data->getFolderDeeps($course_id, $folder_id));
             break;
         case 'send_file':
             /*
              * First, we must check our permissions
              */
             if (!$this->obj_data->checkFilePerms("w", $course_id, $user_id, $user_profile_id, $this->getViewVariable('document_id'))) {
                 $this->giveControl('main', 'miguel_CMain');
             }
             /*
              * We get the junk var of actual file from the BBDD if we're updating
              * instead of creating one
              */
             if ($this->IsSetVar('document_id')) {
                 $this->setViewVariable('document_junk', $this->obj_data->getFileJunk($course_id, $this->getViewVariable('document_id')));
             }
             /*
              * Send a file
              */
             if ($this->IsSetVar('submit') && $_FILES['filename']['tmp_name'] != NULL) {
                 include_once Util::app_Path("filemanager/include/classes/filemanager.class.php");
                 $md5 = md5_file($_FILES['filename']['tmp_name']);
                 if (!$this->getViewVariable('filezip')) {
                     if (!($file_properties = fileManager::uploadFile($_FILES['filename'], $this->getViewVariable('document_junk')))) {
                         $this->SetViewVariable('opstat', 'fserror');
                     }
                     if (!$this->obj_data->insertFile($file_properties['name'], $file_properties['type'], $file_properties['size'], $file_properties['junk'], $md5, $this->getViewVariable('document_comment'), $course_id, $user_id, $folder_id, NULL, $this->getViewVariable('document_id'), $this->getViewVariable('document_accepted'))) {
                         $this->SetViewVariable('opstat', 'dberror');
                     }
                 } else {
                     /*
                      * ZIP files: 
                      */
                     if (!($listUploadFiles = fileManager::uploadFileZip($_FILES['filename']))) {
                         $this->SetViewVariable('opstat', 'fserror');
                     }
                     $listCount = count($listUploadFiles);
                     if (!($folder_zip_id = $this->obj_data->insertFolder($_FILES['filename']['name'], $course_id, $folder_id, $ZipElement['comment'], $this->getViewVariable('shared'), $this->getViewVariable('folder_perms'), NULL))) {
                         $this->SetViewVariable('opstat', 'dberror');
                     }
                     foreach ($listUploadFiles as $ZipElement) {
                         if (!$ZipElement['folder']) {
                             /*
                              * Upload the zip files in the folders they belong to
                              *
                              * $folder_parent_id -> find dirname() in 
                              * $listFolder[ruta_completa] and obtain name and id
                              */
                             $search_folder_name = basename(dirname($ZipElement['stored_filename']));
                             $search_folder_dir = dirname(dirname($ZipElement['stored_filename']));
                             $j = 0;
                             $countList = count($listFolder);
                             $find = false;
                             $folder_parent_id = $folder_zip_id;
                             while ($j < $countList && !$find) {
                                 if ($listFolder[$j][0] == $search_folder_name && $listFolder[$j][1] == $search_folder_dir) {
                                     $folder_parent_id = $listFolder[$j][2];
                                     $find = true;
                                 }
                                 $j++;
                             }
                             $fileJunk = substr(md5(time()), 10, 20);
                             $fileFullPath = Util::app_Path("../var/data/") . basename($ZipElement['stored_filename'] . "-{$fileJunk}");
                             if (!copy($ZipElement['filename'], $fileFullPath)) {
                                 $this->SetViewVariable('opstat', 'fserror');
                             }
                             if (!$this->obj_data->insertFile(basename($ZipElement['stored_filename']), "application/download", $ZipElement['size'], md5_file($fileFullPath), $fileJunk, $ZipElement['comment'], $user_id, $course_id, $folder_id, NULL, NULL, $this->getViewVariable('document_accepted'), 1)) {
                                 $this->SetViewVariable('opstat', 'zipdirdberror');
                             }
                         } else {
                             /*
                              * Recreate the zip dirs structure
                              *
                              * Create a folder list (id, folder_name, folder_full_path)
                              * needed to know the path deepness:
                              * folder_name -> basename(path)
                              * parent_folder_name -> basename(dirname(ruta))
                              */
                             $folder_name = basename($ZipElement['stored_filename']);
                             $folder_dir = dirname($ZipElement['stored_filename']);
                             $folder_parent_id = $folder_zip_id;
                             if ($folder_dir != '.') {
                                 /*
                                  * Find in listFolder if current element
                                  * is contained into other folder.
                                  * In order to do that, it looks for
                                  * folder_name & folder_dir in current
                                  * folder_dir and obtains the id.
                                  */
                                 $search_folder_name = basename($folder_dir);
                                 $search_folder_dir = dirname($folder_dir);
                                 $j = 0;
                                 $countList = count($listFolder);
                                 $find = false;
                                 while ($j < $countList && !$find) {
                                     if ($listFolder[$j][0] == $search_folder_name && $listFolder[$j][1] == $search_folder_dir) {
                                         $folder_parent_id = $listFolder[$j][2];
                                         $find = true;
                                     }
                                     $j++;
                                 }
                             }
                             /*
                              * Finally insert the folder and create a new
                              * element in $listFolder for it
                              */
                             if (!($_folder_id = $this->obj_data->insertFolder($folder_name, $course_id, $folder_parent_id, $ZipElement['comment'], $this->getViewVariable('shared'), $this->getViewVariable('folder_perms'), NULL))) {
                                 $this->SetViewVariable('zipdir', 'error');
                                 $this->SetViewVariable('opstat', 'dberror');
                             }
                             $listFolder[] = array($folder_name, $folder_dir, $_folder_id);
                         }
                     }
                 }
             } else {
                 /*
                  * If form is not being submitted but we're editing a file
                  * then we'll get document vars that we'll need in View
                  */
                 if ($this->IsSetVar('document_id')) {
                     $this->setViewVariable("FileProperties", $this->obj_data->getFileProperties($this->getViewVariable('document_id'), $course_id, $user_profile_id, $user_id));
                 }
             }
             break;
         case 'send_folder':
             /*
              * First, we must check our permissions
              */
             if (!$this->obj_data->checkFolderPerms("w", $course_id, $user_profile_id, $this->getViewVariable('folder_id'))) {
                 $this->giveControl('main', 'miguel_CMain');
             }
             /*
              * Submit a folder (this means either update or create one).
              */
             if ($this->IsSetVar('submit', 'folder_name')) {
                 if (!$this->obj_data->insertFolder($this->getViewVariable('folder_name'), $course_id, $folder_id, $this->getViewVariable('folder_comment'), $this->getViewVariable('shared'), $this->getViewVariable('folder_perms'), $this->getViewVariable('folder_id'))) {
                     $this->SetViewVariable('opstat', 'dberror');
                 }
             } else {
                 /*
                  * If form is not being submitted but we're editing a folder
                  * then we'll get document vars that we'll need in View
                  */
                 if ($this->IsSetVar('folder_id')) {
                     $this->setViewVariable("FolderProperties", $this->obj_data->getFolderProperties($this->getViewVariable('folder_id'), $course_id, $user_profile_id));
                 }
             }
             break;
         case 'send_document':
             /*
              * First, we must check our permissions
              */
             if (!$this->obj_data->checkFilePerms("w", $course_id, $user_id, $user_profile_id, $this->getViewVariable('document_id'))) {
                 $this->giveControl('main', 'miguel_CMain');
             }
             /*
              * We get the junk var of actual file from the BBDD if we're updating
              * instead of creating one
              */
             if ($this->IsSetVar('document_id')) {
                 $this->setViewVariable('document_junk', $this->obj_data->getFileJunk($course_id, $this->getViewVariable('document_id')));
             }
             /*
              * Send a document (that means either create or update a document)
              */
             if ($this->IsSetVar('submit', 'name', 'content', 'type')) {
                 include_once Util::app_Path("filemanager/include/classes/filemanager.class.php");
                 $md5 = md5($this->getViewVariable('document_content'));
                 if (!($file_properties = fileManager::uploadDocument($this->getViewVariable('document_name'), $this->getViewVariable('document_content'), $this->getViewVariable('document_junk')))) {
                     $this->SetViewVariable('opstat', 'fserror');
                 }
                 if (!$this->obj_data->insertFile($file_properties['name'], $file_properties['type'], $file_properties['size'], $file_properties['junk'], $md5, $this->getViewVariable('document_comment'), $course_id, $user_id, $folder_id, $this->getViewVariable('authortool_editable'), $this->getViewVariable('document_id'), $this->getViewVariable('document_accepted'))) {
                     $this->SetViewVariable('opstat', 'dberror');
                 }
             } else {
                 /*
                  * If form is not being submitted but we're editing a file
                  * then we'll get document vars that we'll need in View
                  */
                 if ($this->IsSetVar('document_id')) {
                     $this->setViewVariable("FileProperties", $this->obj_data->getFileProperties($this->getViewVariable('document_id'), $course_id, $user_profile_id, $user_id));
                 }
             }
             break;
         case 'delete':
             /*
              * First we check we have the most inmediate needed var
              */
             if (!$this->IsSetVar('what')) {
                 $this->giveControl('main', 'miguel_CMain');
             } else {
                 switch ($this->getViewVariable('what')) {
                     case 'folder':
                         /*
                          * First, we must check needed var
                          */
                         if (!$this->IsSetVar('folder_id')) {
                             $this->giveControl('main', 'miguel_CMain');
                         }
                         /*
                          * Delete folder
                          */
                         if (!$this->obj_data->deleteFolder($this->getViewVariable('folder_id'), $course_id, $user_profile_id, $user_id)) {
                             $this->SetViewVariable('opstat', 'foldererror');
                         }
                         break;
                     case 'document':
                         /*
                          * First, we must check our permissions
                          */
                         if (!$this->IsSetVar('document_id')) {
                             $this->giveControl('main', 'miguel_CMain');
                         }
                         /*
                          * Delete folder
                          */
                         if (!$this->obj_data->deleteFile($this->getViewVariable('document_id'), $course_id, $user_profile_id, $user_id)) {
                             $this->SetViewVariable('opstat', 'fileerror');
                         }
                         break;
                 }
             }
             break;
     }
 }
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |
      +----------------------------------------------------------------------+
*/
/**
 * Define la clase base de miguel.
 *
 * @author Jesus A. Martinez Cerezal <*****@*****.**>
 * @author Antonio F. Cano Damas <*****@*****.**>
 * @author miguel development team <*****@*****.**>
 * @package miguel common
 * @subpackage control
 * @version 1.0.0
 *
 */
include_once Util::app_Path('common/control/classes/base_login.php');
class miguel_UserInfo
{
    /**
     * Informa si el usuario es administrador a no.
     * @param base_model $obj_model Instancia de un modelo
     * @param string $str_user Identificador de usuario (nickname).
     * @return boolean Devuelve TRUE si el usuario es administrador, y FALSE si no lo es.
     */
    function isAdmin(&$obj_model, $str_user)
    {
        $ret_sql = $obj_model->Select('admin', 'idUser', "idUser = {$str_user}");
        if ($obj_model->hasError()) {
            $ret_val = null;
        } else {
            //dbg_var($ret_sql[0], __FILE__, __LINE__);
Ejemplo n.º 21
0
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//Carga el código de Andromeda
include_once "../common/miguel_base.inc.php";
//Carga el código del controlador
include_once Util::app_Path("alumnPage/control/classes/miguel_calumnpage.class.php");
//Instancia un Controlador en memoria. Esto al mismo tiempo inicializa el modelo y la vista
$miguel = new miguel_CAlumnPage();
//Ejecuta el controlador
$miguel->Exec();
 function processError($num_err, $mens_err, $nombre_archivo, $num_linea, $vars)
 {
     // conjunto de errores de los cuales se almacenara un rastreo
     $errores_de_usuario = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE);
     if (in_array($num_err, $errores_de_usuario)) {
         // marca de fecha/hora para el registro de error
         $dt = date('Y-m-d H:i:s (T)');
         // definir una matriz asociativa de cadenas de error
         // en realidad las unicas entradas que deberiamos
         // considerar son E_WARNING, E_NOTICE, E_USER_ERROR,
         // E_USER_WARNING y E_USER_NOTICE
         $tipo_error = array(E_ERROR => 'Error', E_WARNING => 'Advertencia', E_PARSE => 'Error de Intérprete', E_NOTICE => 'Anotación', E_CORE_ERROR => 'Error de Núcleo', E_CORE_WARNING => 'Advertencia de Núcleo', E_COMPILE_ERROR => 'Error de Compilación', E_COMPILE_WARNING => 'Advertencia de Compilacón', E_USER_ERROR => 'Error de Usuario', E_USER_WARNING => 'Advertencia de Usuario', E_USER_NOTICE => 'Anotación de Usuario');
         $err = "<errorentry>\n";
         $err .= "\t<datetime>" . $dt . "</datetime>\n";
         $err .= "\t<errornum>" . $num_err . "</errornum>\n";
         $err .= "\t<errortype>" . $tipo_error[$num_err] . "</errortype>\n";
         $err .= "\t<errormsg>" . $mens_err . "</errormsg>\n";
         if (!empty($nombre_archivo)) {
             $err .= "\t<scriptname>" . $nombre_archivo . "</scriptname>\n";
         }
         if (!empty($num_linea)) {
             $err .= "\t<scriptlinenum>" . $num_linea . "</scriptlinenum>\n";
         }
         //if (in_array($num_err, $errores_de_usuario)){
         //	$err .= "\t<vartrace>" . wddx_serialize_value($vars, "Variables") . "</vartrace>\n";
         //}
         $err .= "</errorentry>\n\n";
         // guardar en el registro de errores, y enviar un correo
         error_log($err, 3, MIGUELBASE_ERRORLOG_FILE);
         //)mail("*****@*****.**", "Error Critico de Usuario en miguel", $err);
         if ($num_err != E_USER_ERROR) {
             include_once Util::app_Path('error/control/classes/miguel_cerror.class.php');
             $obj_error = new miguel_CError($tipo_error[$num_err], $mens_err);
             $obj_error->Exec();
         } else {
             $err = "\n";
             $err .= "\tdatetime: " . $dt . "\n";
             $err .= "\terrornum: " . $num_err . "\n";
             $err .= "\terrortype: " . $tipo_error[$num_err] . "\n";
             $err .= "\terrormsg: " . $mens_err . "\n";
             if (!empty($nombre_archivo)) {
                 $err .= "\tscriptname: " . $nombre_archivo . "\n";
             }
             if (!empty($num_linea)) {
                 $err .= "\tscriptlinenum: " . $num_linea . "\n";
             }
             echo '<h1>Error Fatal</h1><br>';
             echo '<pre>' . $err . '</pre><br>';
             echo '<h3>Consulte con el administrador</h3><br>';
             Session::close();
             die;
         }
     }
 }
 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("");
     }
 }
/**
 * Define la clase para la pantalla principal de administrador de usuarios
 *
 * Utiliza la libreria phphtmllib.
 *
 * @author Jesus A. Martinez Cerezal <*****@*****.**>
 * @author miguel development team <*****@*****.**>
 * @package miguel userManager
 * @subpackage view
 * @version 1.0.0
 *
 */
/**
 * Include classes library
 */
include_once Util::app_Path("common/view/classes/miguel_vmenu.class.php");
class miguel_VUserManager extends miguel_VMenu
{
    function miguel_VUserManager($title, $arr_commarea)
    {
        $this->miguel_VMenu($title, $arr_commarea);
    }
    function right_block()
    {
        //Crea el contenedor del right_block
        $main = container();
        // $main->add(html_hr());
        //$main->add($this->add_mainMenu());
        //Titulo
        //$titulo = html_p(agt('Biblioteca'));
        $titulo = html_br();
Ejemplo n.º 25
0
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//include_once("../base/timecontrol.class.php");
//$timeck = new timeControl();
//include_once ($_SERVER['DOCUMENT_ROOT']."/andromeda/common/miguel_base.inc.php");
include_once "../common/miguel_base.inc.php";
//$timeck->getInterval();
include_once Util::app_Path("/main/control/classes/miguel_cmain.class.php");
//$timeck->getInterval();
$miguel = new miguel_CMain();
//$timeck->getInterval();
$miguel->Exec();
//$timeck->getInterval();
//dbg_var($timeck->seeResults());
//dbg_sessionVars();
//dbg_allVars();
//dbg_allClasses();
 /**
  * Este metodo se llama cada vez que se instancia la clase.
  * Se utiliza para crear los objetos del formulario
  */
 function form_init_elements()
 {
     //we want an confirmation page for this form.
     //$this->set_confirm();
     // Course Info
     $elemT1 = new FEText("courseName", true, 10);
     $elemT1->set_style_attribute('align', 'left');
     $elemT1->set_attribute("id", "coursename");
     $elemT1->set_attribute("accesskey", "n");
     $this->add_element($elemT1);
     $elemP1 = new FETextArea("coursedataDescripcion", true, 10, 50, null, 300);
     $elemP1->set_style_attribute('align', 'left');
     $elemP1->set_attribute("id", "coursedatadescripcion");
     $elemP1->set_attribute("accesskey", "d");
     $this->add_element($elemP1);
     include Util::app_Path("andromeda/include/classes/nls.inc.php");
     $language = $this->_formatElem("FEListBox", "courseLanguage", "courseLanguage", FALSE, "100px", NULL, $nls['languages_form']);
     $language->set_style_attribute('align', 'left');
     $language->set_attribute("id", "courselanguage");
     $language->set_attribute("accesskey", "l");
     $this->add_element($language);
     $elemT2 = new FEText("coursedataVersion", FALSE, 10);
     $elemT2->set_style_attribute('align', 'left');
     $elemT2->set_attribute("id", "coursedataversion");
     $elemT2->set_attribute("accesskey", "v");
     $this->add_element($elemT2);
     $elemP2 = new FETextArea("coursedataPalabrasClaves", false, 10, 50, null, 300);
     $elemP2->set_style_attribute('align', 'left');
     $elemP2->set_attribute("id", "coursedatapalabrasclaves");
     $elemP2->set_attribute("accesskey", "w");
     $this->add_element($elemP2);
     $elemT3 = new FEText("coursedataDestinatarios", FALSE, 10);
     $elemT3->set_style_attribute('align', 'left');
     $elemT3->set_attribute("id", "coursedatadestinatarios");
     $elemT3->set_attribute("accesskey", "u");
     $this->add_element($elemT3);
     $elemP3 = new FETextArea("coursedataConocimientosPrevios", false, 10, 50, null, 300);
     $elemP3->set_style_attribute('align', 'left');
     $elemP3->set_attribute("id", "coursedataconocimientosprevios");
     $elemP3->set_attribute("accesskey", "k");
     $this->add_element($elemP3);
     $elemT4 = new FEText("coursedataMetodologia", FALSE, 10);
     $elemT4->set_style_attribute('align', 'left');
     $elemT4->set_attribute("id", "coursedatametodologia");
     $elemT4->set_attribute("accesskey", "m");
     $this->add_element($elemT4);
     $elemCB1 = new FECheckBox('courseActive', agt('Poner el curso activo.'));
     $elemCB1->set_style_attribute('align', 'left');
     $elemCB1->set_attribute("id", "courseactive");
     $elemCB1->set_attribute("accesskey", "o");
     $this->add_element($elemCB1);
     $elemCB2 = new FECheckBox('courseAccess', agt('Poner el curso accesible.'));
     $elemCB2->set_style_attribute('align', 'left');
     $elemCB2->set_attribute("id", "courseaccess");
     $elemCB2->set_attribute("accesskey", "p");
     $this->add_element($elemCB2);
     $submit = $this->_formatElem("base_SubmitButton", "Aceptar", "submit", agt("Insertar Curso"));
     $submit->set_attribute("id", "submit");
     $submit->set_attribute("accesskey", "e");
     $this->add_element($submit);
 }
Ejemplo n.º 27
0
      +----------------------------------------------------------------------+
      |teacherPage/index.php                                                 |
      +----------------------------------------------------------------------+
      | Copyright (c) 2004, SHS Polar Sistemas Informáticos, S.L.            |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   | 
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("teacherPage/control/classes/miguel_cteacherpage.class.php");
$miguel = new miguel_CTeacherPage();
$miguel->Exec();
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: SHS Polar Sistemas Informáticos, S.L. <www.polar.es>        |
      |          Equipo de Desarrollo Software Libre <*****@*****.**>   |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |
      +----------------------------------------------------------------------+
*/
/**
 * Include classes library
 */
include_once Util::app_Path("common/view/classes/miguel_vpage.class.php");
require_once Util::app_Path("andromeda/view/classes/base_calendar.class.php");
//		;$path_fs = substr($_SERVER['PATH_TRANSLATED'], 0, strrpos($_SERVER['PATH_TRANSLATED'],"/"));
//		$path_fs = 'C:\php5xampp-dev\htdocs';
//		$phphtmllib = $path_fs . "/phphtmllib";
include_once "{$phphtmllib}/includes.inc";
//require_once($phphtmllib."/widgets/Calendar.inc");
//require_once('./base_calendar.class.php');
// build the calendar
class MyCalendar extends Calendar
{
    var $_link;
    function MyCalendar($ancho, $hora, $idioma, $link, $param, $addParam)
    {
        $this->Calendar($ancho, $hora, $idioma);
        $this->_link = $link . $addParam . '&' . $param . '=';
    }
Ejemplo n.º 29
0
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
//include_once("../base/timecontrol.class.php");
//$timeck = new timeControl();
//include_once ($_SERVER['DOCUMENT_ROOT']."/andromeda/common/miguel_base.inc.php");
include_once "../common/miguel_base.inc.php";
//$timeck->getInterval();
include_once Util::app_Path("contact/control/classes/miguel_ccontact.class.php");
//$timeck->getInterval();
$miguel = new miguel_CContact();
//$timeck->getInterval();
$miguel->Exec();
//$timeck->getInterval();
//dbg_var($timeck->seeResults());
//dbg_sessionVars();
//dbg_allVars();
//dbg_allClasses();
Ejemplo n.º 30
0
/*
      +----------------------------------------------------------------------+
      | miguel base                                                          |
      +----------------------------------------------------------------------+
      | Copyright (c) 2003, miguel Development Team                          |
      +----------------------------------------------------------------------+
      |   This program is free software; you can redistribute it and/or      |
      |   modify it under the terms of the GNU General Public License        |
      |   as published by the Free Software Foundation; either version 2     |
      |   of the License, or (at your option) any later version.             |
      |                                                                      |
      |   This program is distributed in the hope that it will be useful,    |
      |   but WITHOUT ANY WARRANTY; without even the implied warranty of     |
      |   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      |
      |   GNU General Public License for more details.                       |
      |                                                                      |
      |   You should have received a copy of the GNU General Public License  |
      |   along with this program; if not, write to the Free Software        |
      |   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA          |
      |   02111-1307, USA. The GNU GPL license is also available through     |
      |   the world-wide-web at http://www.gnu.org/copyleft/gpl.html         |
      +----------------------------------------------------------------------+
      | Authors: Jesus A. Martinez Cerezal <*****@*****.**>              |
      |          miguel Development Team                                     |
      |                       <*****@*****.**>   |      
      +----------------------------------------------------------------------+
*/
include_once "../common/miguel_base.inc.php";
include_once Util::app_Path("/institution/control/classes/miguel_cinstitution.class.php");
$miguel = new miguel_CInstitution();
$miguel->Exec();