@@ -43,15 +43,13 @@ |
||
43 | 43 | |
44 | 44 | if(is_callable(array($controlador, $metodo))){ |
45 | 45 | $metodo = $peticion->getMetodo(); |
46 | - } |
|
47 | - else{ |
|
46 | + } else{ |
|
48 | 47 | $metodo = 'index'; |
49 | 48 | } |
50 | 49 | |
51 | 50 | if(isset($args)){ |
52 | 51 | call_user_func_array(array($controlador, $metodo), $args); |
53 | - } |
|
54 | - else{ |
|
52 | + } else{ |
|
55 | 53 | call_user_func(array($controlador, $metodo)); |
56 | 54 | } |
57 | 55 |
@@ -30,33 +30,33 @@ |
||
30 | 30 | |
31 | 31 | public static function actuar(CFSolicitud $peticion) |
32 | 32 | { |
33 | - $controlador = $peticion->getControlador() . 'Controlador'; |
|
33 | + $controlador = $peticion->getControlador().'Controlador'; |
|
34 | 34 | //definimos la ruta al controlador |
35 | - $rutaControlador = SITE_ROOT . 'mvc' . DS .'controladores' . DS . $controlador . '.php'; |
|
35 | + $rutaControlador = SITE_ROOT.'mvc'.DS.'controladores'.DS.$controlador.'.php'; |
|
36 | 36 | $metodo = $peticion->getMetodo(); |
37 | 37 | $args = $peticion->getArgumentos(); |
38 | 38 | |
39 | 39 | //verifcamos que el archivo existe con la funcion de PHP is_readable |
40 | - if(is_readable($rutaControlador)){ |
|
40 | + if (is_readable($rutaControlador)) { |
|
41 | 41 | require_once $rutaControlador; |
42 | 42 | $controlador = new $controlador; |
43 | 43 | |
44 | - if(is_callable(array($controlador, $metodo))){ |
|
44 | + if (is_callable(array($controlador, $metodo))) { |
|
45 | 45 | $metodo = $peticion->getMetodo(); |
46 | 46 | } |
47 | - else{ |
|
47 | + else { |
|
48 | 48 | $metodo = 'index'; |
49 | 49 | } |
50 | 50 | |
51 | - if(isset($args)){ |
|
51 | + if (isset($args)) { |
|
52 | 52 | call_user_func_array(array($controlador, $metodo), $args); |
53 | 53 | } |
54 | - else{ |
|
54 | + else { |
|
55 | 55 | call_user_func(array($controlador, $metodo)); |
56 | 56 | } |
57 | 57 | |
58 | 58 | } else { |
59 | - header('Location: '. Cf_BASE_URL.'error/'); |
|
59 | + header('Location: '.Cf_BASE_URL.'error/'); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | } |
63 | 63 | \ No newline at end of file |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $rutaLib = RUTA_LIBS . $libreria . '.php'; |
39 | 39 | if(is_readable($rutaLib)){ |
40 | 40 | require_once $rutaLib; |
41 | - //echo 'libreria cargada'; |
|
41 | + //echo 'libreria cargada'; |
|
42 | 42 | } |
43 | 43 | else { |
44 | 44 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function cargaModelo($modelo){ |
49 | 49 | $modelo=$modelo.'Modelo'; |
50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
50 | + $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
51 | 51 | if(is_readable($rutaMod)){ |
52 | 52 | require_once $rutaMod; |
53 | 53 | $modelo = new $modelo; |
54 | 54 | return $modelo; |
55 | - //echo 'modelo cargado'; |
|
55 | + //echo 'modelo cargado'; |
|
56 | 56 | } |
57 | 57 | else { |
58 | 58 | //echo $rutaMod; |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function cargaAyudante($ayudante){ |
67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
67 | + $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
68 | 68 | if(is_readable($rutaAyudante)){ |
69 | 69 | require_once $rutaAyudante; |
70 | - //echo 'libreria cargada'; |
|
70 | + //echo 'libreria cargada'; |
|
71 | 71 | } |
72 | 72 | else { |
73 | 73 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | if(is_readable($rutaLib)){ |
40 | 40 | require_once $rutaLib; |
41 | 41 | //echo 'libreria cargada'; |
42 | - } |
|
43 | - else { |
|
42 | + } else { |
|
44 | 43 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
45 | 44 | } |
46 | 45 | } |
@@ -53,8 +52,7 @@ discard block |
||
53 | 52 | $modelo = new $modelo; |
54 | 53 | return $modelo; |
55 | 54 | //echo 'modelo cargado'; |
56 | - } |
|
57 | - else { |
|
55 | + } else { |
|
58 | 56 | //echo $rutaMod; |
59 | 57 | |
60 | 58 | |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | if(is_readable($rutaAyudante)){ |
69 | 67 | require_once $rutaAyudante; |
70 | 68 | //echo 'libreria cargada'; |
71 | - } |
|
72 | - else { |
|
69 | + } else { |
|
73 | 70 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
74 | 71 | } |
75 | 72 | } |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $this->_vista = new CFVista(new CFSolicitud); |
35 | 35 | } |
36 | 36 | |
37 | - protected function cargaLib($libreria){ |
|
38 | - $rutaLib = RUTA_LIBS . $libreria . '.php'; |
|
39 | - if(is_readable($rutaLib)){ |
|
37 | + protected function cargaLib($libreria) { |
|
38 | + $rutaLib = RUTA_LIBS.$libreria.'.php'; |
|
39 | + if (is_readable($rutaLib)) { |
|
40 | 40 | require_once $rutaLib; |
41 | 41 | //echo 'libreria cargada'; |
42 | 42 | } |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
48 | - protected function cargaModelo($modelo){ |
|
49 | - $modelo=$modelo.'Modelo'; |
|
50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
51 | - if(is_readable($rutaMod)){ |
|
48 | + protected function cargaModelo($modelo) { |
|
49 | + $modelo = $modelo.'Modelo'; |
|
50 | + $rutaMod = RUTA_MOD.$modelo.'.php'; |
|
51 | + if (is_readable($rutaMod)) { |
|
52 | 52 | require_once $rutaMod; |
53 | 53 | $modelo = new $modelo; |
54 | 54 | return $modelo; |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | - protected function cargaAyudante($ayudante){ |
|
67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
68 | - if(is_readable($rutaAyudante)){ |
|
66 | + protected function cargaAyudante($ayudante) { |
|
67 | + $rutaAyudante = RUTA_AYUDANTES.$ayudante.'.php'; |
|
68 | + if (is_readable($rutaAyudante)) { |
|
69 | 69 | require_once $rutaAyudante; |
70 | 70 | //echo 'libreria cargada'; |
71 | 71 | } |
@@ -42,8 +42,7 @@ |
||
42 | 42 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
43 | 43 | include_once $ver_ruta; |
44 | 44 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
45 | - } |
|
46 | - else { |
|
45 | + } else { |
|
47 | 46 | |
48 | 47 | header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
49 | 48 |
@@ -36,16 +36,16 @@ |
||
36 | 36 | public function imprimirVista($vista, $item = false) |
37 | 37 | { |
38 | 38 | |
39 | - $ver_ruta = VIEW_PATH . $this->_controlador . DS . $vista . '.phtml'; |
|
39 | + $ver_ruta = VIEW_PATH.$this->_controlador.DS.$vista.'.phtml'; |
|
40 | 40 | |
41 | - if(is_readable($ver_ruta)){ |
|
42 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
|
41 | + if (is_readable($ver_ruta)) { |
|
42 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'encabezado.php'; |
|
43 | 43 | include_once $ver_ruta; |
44 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
|
44 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'pie_de_pagina.php'; |
|
45 | 45 | } |
46 | 46 | else { |
47 | 47 | |
48 | - header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
|
48 | + header('Location: '.Cf_BASE_URL.'error/index'.'?error='.'vista'); |
|
49 | 49 | |
50 | 50 | } |
51 | 51 | } |
@@ -87,16 +87,13 @@ |
||
87 | 87 | $_SESSION['lang'] = $lang; |
88 | 88 | |
89 | 89 | setcookie('lang', $lang, time() + (3600 * 24 * 30)); |
90 | -} |
|
91 | -else if(isSet($_SESSION['lang'])) |
|
90 | +} else if(isSet($_SESSION['lang'])) |
|
92 | 91 | { |
93 | 92 | $lang = $_SESSION['lang']; |
94 | -} |
|
95 | -else if(isSet($_COOKIE['lang'])) |
|
93 | +} else if(isSet($_COOKIE['lang'])) |
|
96 | 94 | { |
97 | 95 | $lang = $_COOKIE['lang']; |
98 | -} |
|
99 | -else |
|
96 | +} else |
|
100 | 97 | { |
101 | 98 | $lang = 'es'; // por defecto el idioma para el app es español puede ser en, bt, de, zh |
102 | 99 | } |
@@ -42,44 +42,44 @@ discard block |
||
42 | 42 | /** Cf directorio separador */ |
43 | 43 | defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); |
44 | 44 | /** Cf raiz del sitio */ |
45 | -defined('SITE_ROOT')? null: define('SITE_ROOT', realpath(dirname(__FILE__)).DS); |
|
45 | +defined('SITE_ROOT') ? null : define('SITE_ROOT', realpath(dirname(__FILE__)).DS); |
|
46 | 46 | /** Cf PATH del sitio */ |
47 | -defined('SITE_PATH') ? NULL : define ('SITE_PATH', realpath(dirname(__FILE__) . DS . '..' . DS) . DS); |
|
47 | +defined('SITE_PATH') ? NULL : define('SITE_PATH', realpath(dirname(__FILE__).DS.'..'.DS).DS); |
|
48 | 48 | |
49 | 49 | /** Cf definimos constante Ruta directa al nucleo de framework */ |
50 | -define('RUTA_NUCLEO', SITE_ROOT . 'Sistema'.DS.'Nucleo' . DS); |
|
50 | +define('RUTA_NUCLEO', SITE_ROOT.'Sistema'.DS.'Nucleo'.DS); |
|
51 | 51 | |
52 | 52 | # define para mvc erp |
53 | 53 | |
54 | 54 | /** Cf definimos constante directa a la vista del framework */ |
55 | -define('VIEW_PATH', SITE_ROOT . 'mvc'.DS.'vistas' . DS); |
|
55 | +define('VIEW_PATH', SITE_ROOT.'mvc'.DS.'vistas'.DS); |
|
56 | 56 | /** Cf definimos constante directa a los controladores del framework */ |
57 | -define('CONTR_PATH', SITE_ROOT . 'mvc'.DS.'controladores' . DS); |
|
57 | +define('CONTR_PATH', SITE_ROOT.'mvc'.DS.'controladores'.DS); |
|
58 | 58 | /** Cf definimos constante directa a los modelos del framework */ |
59 | -define('RUTA_MOD', SITE_ROOT . 'mvc'.DS.'modelos' . DS); |
|
59 | +define('RUTA_MOD', SITE_ROOT.'mvc'.DS.'modelos'.DS); |
|
60 | 60 | |
61 | 61 | # define ruta a los stilos del public |
62 | 62 | |
63 | 63 | /** Cf definimos constante directa a los css dentro del directorio public_ del framework */ |
64 | -define('CSS_PATH', SITE_ROOT . 'public_'.DS.'css' . DS); |
|
64 | +define('CSS_PATH', SITE_ROOT.'public_'.DS.'css'.DS); |
|
65 | 65 | /** Cf definimos constante directa a los css dentro del directorio public_ del framework */ |
66 | -define('IMG_PATH', SITE_ROOT . 'public_'.DS.'img' . DS); |
|
66 | +define('IMG_PATH', SITE_ROOT.'public_'.DS.'img'.DS); |
|
67 | 67 | /** Cf definimos constante directa a los js dentro del directorio public_ del framework */ |
68 | -define('JS_PATH', SITE_ROOT . 'public_'.DS.'js' . DS); |
|
68 | +define('JS_PATH', SITE_ROOT.'public_'.DS.'js'.DS); |
|
69 | 69 | /** Cf definimos constante directa a las librerias dentro del framework */ |
70 | -define('RUTA_LIBS', SITE_ROOT . 'Sistema'.DS.'librerias' . DS); |
|
70 | +define('RUTA_LIBS', SITE_ROOT.'Sistema'.DS.'librerias'.DS); |
|
71 | 71 | /** Cf definimos constante directa a los ayudantes del framework */ |
72 | -define('RUTA_AYUDANTES', SITE_ROOT . 'Sistema'.DS.'ayudantes' . DS); |
|
72 | +define('RUTA_AYUDANTES', SITE_ROOT.'Sistema'.DS.'ayudantes'.DS); |
|
73 | 73 | |
74 | 74 | /** Cf definimos constante directa a los lenguajes del framework */ |
75 | -define('RUTA_LENGUAJES', SITE_ROOT . 'Sistema'.DS.'lenguajes' . DS); |
|
75 | +define('RUTA_LENGUAJES', SITE_ROOT.'Sistema'.DS.'lenguajes'.DS); |
|
76 | 76 | |
77 | 77 | |
78 | 78 | //LENGUAJES |
79 | 79 | //En el directorio sistema lenguajes hay varios archivos php cada uno para crear las constantes en el idioma especifico |
80 | 80 | //luego por get capturamos la variable lan al inicio de la aplicacion asi: www.tuapp.com/?lang=de |
81 | 81 | |
82 | -if(isSet($_GET['lang'])) |
|
82 | +if (isSet($_GET['lang'])) |
|
83 | 83 | { |
84 | 84 | $lang = $_GET['lang']; |
85 | 85 | |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | |
89 | 89 | setcookie('lang', $lang, time() + (3600 * 24 * 30)); |
90 | 90 | } |
91 | -else if(isSet($_SESSION['lang'])) |
|
91 | +else if (isSet($_SESSION['lang'])) |
|
92 | 92 | { |
93 | 93 | $lang = $_SESSION['lang']; |
94 | 94 | } |
95 | -else if(isSet($_COOKIE['lang'])) |
|
95 | +else if (isSet($_COOKIE['lang'])) |
|
96 | 96 | { |
97 | 97 | $lang = $_COOKIE['lang']; |
98 | 98 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $lang = 'es'; // por defecto el idioma para el app es español puede ser en, bt, de, zh |
102 | 102 | } |
103 | 103 | |
104 | -$lang_file = 'lang.'.(empty($lang)?'en':$lang).'.php'; |
|
104 | +$lang_file = 'lang.'.(empty($lang) ? 'en' : $lang).'.php'; |
|
105 | 105 | // optimizacion de codigo al evaluar la llamda del archivo lang |
106 | 106 | /* |
107 | 107 | switch ($lang) { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | } |
136 | 136 | */ |
137 | -include_once RUTA_LENGUAJES . $lang_file; |
|
137 | +include_once RUTA_LENGUAJES.$lang_file; |
|
138 | 138 | |
139 | 139 | //FIN LENGUAJES |
140 | 140 | |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | |
150 | 150 | # Cargamos la autocarga dinamica y configuraciones |
151 | 151 | //require_once RUTA_NUCLEO . 'Cf_Autocarga.php'; |
152 | -require_once RUTA_NUCLEO . 'CFConfiguracion.php'; |
|
152 | +require_once RUTA_NUCLEO.'CFConfiguracion.php'; |
|
153 | 153 | |
154 | -try{ |
|
154 | +try { |
|
155 | 155 | |
156 | 156 | Nucleo\CFBootstrap::actuar(new Nucleo\CFSolicitud); |
157 | 157 | //CFBootstrap::actuar(new CFSolicitud); |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
62 | 62 | |
63 | 63 | $datas->insertarDatos( |
64 | - $this->_ayuda->filtrarEntero($_POST['id']), |
|
65 | - $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
66 | - $this->_ayuda->filtrarTexto($_POST['email']), |
|
67 | - $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
64 | + $this->_ayuda->filtrarEntero($_POST['id']), |
|
65 | + $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
66 | + $this->_ayuda->filtrarTexto($_POST['email']), |
|
67 | + $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
68 | 68 | ); |
69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
70 | 70 | $_POST['option1']=false; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | public function insertarComentario(){ |
77 | 77 | |
78 | - /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
78 | + /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
79 | 79 | if(isset($_GET['titulo'])){ |
80 | 80 | $this->_vista->salida_campo = $_GET['titulo']; |
81 | 81 | } |
@@ -19,46 +19,46 @@ discard block |
||
19 | 19 | $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
20 | 20 | } |
21 | 21 | |
22 | - public function index(){ |
|
22 | + public function index() { |
|
23 | 23 | $datas = $this->cargaModelo('blog'); |
24 | 24 | |
25 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
26 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
27 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
25 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
26 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
27 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
28 | 28 | $this->_vista->titulo = 'Blog Calima Framework'; |
29 | 29 | $this->_vista->imprimirVista('index', 'blog'); |
30 | 30 | |
31 | 31 | } |
32 | - public function crearpost(){ |
|
32 | + public function crearpost() { |
|
33 | 33 | $datas = $this->cargaModelo('blog'); |
34 | 34 | |
35 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
35 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
36 | 36 | $this->_vista->titulo = 'Blog Calima Framework crear post'; |
37 | 37 | $this->_vista->imprimirVista('crearpost', 'blog'); |
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | - public function wikipost(){ |
|
41 | + public function wikipost() { |
|
42 | 42 | $datas = $this->cargaModelo('blog'); |
43 | 43 | |
44 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
45 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
46 | - $this->_vista->comentarios= $datas->llamarComentarios(); |
|
47 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
48 | - $this->_vista->contar= $datas->contarComentarios($_GET['id']); |
|
49 | - $this->_vista->video= $datas->llamarDatosBlogId($_GET['id']); |
|
44 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
45 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
46 | + $this->_vista->comentarios = $datas->llamarComentarios(); |
|
47 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
48 | + $this->_vista->contar = $datas->contarComentarios($_GET['id']); |
|
49 | + $this->_vista->video = $datas->llamarDatosBlogId($_GET['id']); |
|
50 | 50 | $this->_vista->titulo = 'Blog 1 Calima Framework'; |
51 | 51 | $this->_vista->imprimirVista('wikipost', 'blog'); |
52 | 52 | |
53 | 53 | |
54 | 54 | $this->_vista->titulo = 'Registro CalimaFramework'; |
55 | - if(isset($_GET['titulo'])){ |
|
55 | + if (isset($_GET['titulo'])) { |
|
56 | 56 | $this->_vista->salida_campo = $_GET['titulo']; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $this->_vista->imprimirVista('wikipost', 'blog'); |
60 | 60 | //$datas = $this->cargaModelo('blog'); |
61 | - if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
|
61 | + if (isset($_POST['enviar']) && isset($_POST['option1'])) { |
|
62 | 62 | |
63 | 63 | $datas->insertarDatos( |
64 | 64 | $this->_ayuda->filtrarEntero($_POST['id']), |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | $this->_ayuda->filtrarTexto($_POST['comentario']) |
68 | 68 | ); |
69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
70 | - $_POST['option1']=false; |
|
70 | + $_POST['option1'] = false; |
|
71 | 71 | |
72 | 72 | } |
73 | 73 | |
74 | 74 | } |
75 | 75 | |
76 | - public function insertarComentario(){ |
|
76 | + public function insertarComentario() { |
|
77 | 77 | |
78 | 78 | /*$this->_vista->titulo = 'Registro CalimaFramework'; |
79 | 79 | if(isset($_GET['titulo'])){ |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | |
39 | 39 | |
40 | - if (isset($_POST['email'])) { |
|
40 | + if (isset($_POST['email'])) { |
|
41 | 41 | $para="[email protected]"; |
42 | 42 | $this->_ayuda->enviarCorreo( |
43 | 43 | $_POST['email'], |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
12 | 12 | |
13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda(); |
|
13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function index() |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | $this->_vista->imprimirVista('index', 'inicio'); |
20 | 20 | |
21 | 21 | if (isset($_POST['email'])) { |
22 | - $this->_vista->validar=1; |
|
23 | - $para="[email protected]"; |
|
22 | + $this->_vista->validar = 1; |
|
23 | + $para = "[email protected]"; |
|
24 | 24 | $this->_ayuda->enviarCorreo( |
25 | 25 | $_POST['email'], |
26 | 26 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | |
40 | 40 | if (isset($_POST['email'])) { |
41 | - $para="[email protected]"; |
|
41 | + $para = "[email protected]"; |
|
42 | 42 | $this->_ayuda->enviarCorreo( |
43 | 43 | $_POST['email'], |
44 | 44 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -6,16 +6,16 @@ |
||
6 | 6 | * and open the template in the editor. |
7 | 7 | */ |
8 | 8 | |
9 | -class errorControlador extends \Sistema\Nucleo\CFControlador{ |
|
9 | +class errorControlador extends \Sistema\Nucleo\CFControlador { |
|
10 | 10 | |
11 | 11 | public function __construct() { |
12 | 12 | parent::__construct(); |
13 | 13 | } |
14 | 14 | |
15 | - public function index(){ |
|
15 | + public function index() { |
|
16 | 16 | |
17 | - $this->_vista->titulo="Error detectado"; |
|
18 | - $this->_vista->imprimirVista('index','error'); |
|
17 | + $this->_vista->titulo = "Error detectado"; |
|
18 | + $this->_vista->imprimirVista('index', 'error'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | //verificamos la version de php en tu servidor web o local |
28 | 28 | if (version_compare(PHP_VERSION, '5.3.20', '<')) |
29 | 29 | { |
30 | - die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
30 | + die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | //Cargamos los Espacios de nombres para el nucleo y los ayudantes |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $this->_ayuda= new Sisayu\CFPHPAyuda; |
50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
51 | - //$this->cargaAyudante('CfPHPSeguridad'); |
|
51 | + //$this->cargaAyudante('CfPHPSeguridad'); |
|
52 | 52 | $this->_seg= new Sisayu\CfPHPSeguridad; |
53 | 53 | |
54 | 54 | $this->_sesion=new Sisnuc\CFSesion(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
67 | 67 | |
68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
68 | + } elseif (Cf_CONFIG_INICIO=='false') { |
|
69 | 69 | |
70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | public function __construct() { |
47 | 47 | parent::__construct(); |
48 | 48 | |
49 | - $this->_ayuda= new Sisayu\CFPHPAyuda; |
|
49 | + $this->_ayuda = new Sisayu\CFPHPAyuda; |
|
50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
51 | 51 | //$this->cargaAyudante('CfPHPSeguridad'); |
52 | - $this->_seg= new Sisayu\CFPHPSeguridad; |
|
52 | + $this->_seg = new Sisayu\CFPHPSeguridad; |
|
53 | 53 | |
54 | - $this->_sesion=new Sisnuc\CFSesion(); |
|
54 | + $this->_sesion = new Sisnuc\CFSesion(); |
|
55 | 55 | |
56 | 56 | } |
57 | 57 | |
@@ -59,13 +59,13 @@ discard block |
||
59 | 59 | { |
60 | 60 | // Se verifica que en el archivo de configuracion.php la constante Cf_CONFIG_INICIO==true |
61 | 61 | //Si esta en True se lanza el instalador de Cf |
62 | - if(Cf_CONFIG_INICIO==true){ |
|
62 | + if (Cf_CONFIG_INICIO == true) { |
|
63 | 63 | |
64 | 64 | $this->_vista->titulo = 'CalimaFramework'; |
65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
67 | 67 | |
68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
68 | + }elseif (Cf_CONFIG_INICIO == 'false') { |
|
69 | 69 | |
70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | $nombre=$_POST['nombre']; |
39 | 39 | $email=$_POST['email']; |
40 | 40 | $usuario=$_POST['nombre']; |
41 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
41 | + $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
42 | 42 | |
43 | - $datas->insertarRegistro( |
|
44 | - $this->_seg->filtrarTexto($_POST['nombre']), |
|
45 | - $this->_seg->filtrarTexto($_POST['email']), |
|
46 | - '1', |
|
47 | - $clave |
|
43 | + $datas->insertarRegistro( |
|
44 | + $this->_seg->filtrarTexto($_POST['nombre']), |
|
45 | + $this->_seg->filtrarTexto($_POST['email']), |
|
46 | + '1', |
|
47 | + $clave |
|
48 | 48 | ); |
49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
50 | 50 | //$_POST['option1']=false; |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | $_SESSION['usuario']=$usuario; |
68 | 68 | $this->_ayuda->redireccionUrl('index'); |
69 | 69 | } |
70 | - $this->_ayuda->redireccionUrl('usuario'); |
|
70 | + $this->_ayuda->redireccionUrl('usuario'); |
|
71 | 71 | |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - public function cerrarSesion(){ |
|
75 | + public function cerrarSesion(){ |
|
76 | 76 | $this->_sesion->iniciarSesion('_s', false); |
77 | 77 | session_destroy(); |
78 | 78 | $this->_sesion->destruir('usuario'); |
@@ -48,8 +48,7 @@ |
||
48 | 48 | ); |
49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
50 | 50 | //$_POST['option1']=false; |
51 | - } |
|
52 | - else{ |
|
51 | + } else{ |
|
53 | 52 | $this->_ayuda->redireccionUrl('usuario/registro'); |
54 | 53 | } |
55 | 54 | } |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | parent::__construct(); |
11 | 11 | |
12 | 12 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | - $this->_seg= new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | - $this->_sesion=new Sistema\Nucleo\CFSesion(); |
|
13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | + $this->_seg = new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | + $this->_sesion = new Sistema\Nucleo\CFSesion(); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function index(){ |
|
18 | + public function index() { |
|
19 | 19 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
20 | 20 | session_destroy(); |
21 | 21 | $this->_vista->titulo = 'CalimaFramework Login'; |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | $this->_vista->imprimirVista('index', 'usuario'); |
24 | 24 | } |
25 | 25 | |
26 | - public function registro(){ |
|
26 | + public function registro() { |
|
27 | 27 | $this->_vista->titulo = 'CalimaFramework registro'; |
28 | 28 | $this->_vista->imprimirVista('registro', 'usuario'); |
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | - public function crearRegistro(){ |
|
32 | + public function crearRegistro() { |
|
33 | 33 | $datas = $this->cargaModelo('usuario'); |
34 | - if(isset($_POST['nombre'])){ |
|
35 | - $nombre=$_POST['nombre']; |
|
36 | - $email=$_POST['email']; |
|
37 | - $usuario=$_POST['nombre']; |
|
38 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
34 | + if (isset($_POST['nombre'])) { |
|
35 | + $nombre = $_POST['nombre']; |
|
36 | + $email = $_POST['email']; |
|
37 | + $usuario = $_POST['nombre']; |
|
38 | + $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
39 | 39 | |
40 | 40 | $datas->insertarRegistro( |
41 | 41 | $this->_seg->filtrarTexto($_POST['nombre']), |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | ); |
46 | 46 | $this->_ayuda->redireccionUrl('usuario'); |
47 | 47 | } |
48 | - else{ |
|
48 | + else { |
|
49 | 49 | $this->_ayuda->redireccionUrl('usuario/registro'); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - public function valida(){ |
|
54 | - if(isset($_POST['usuario'])){ |
|
55 | - $usuario=$_POST['usuario']; |
|
56 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
53 | + public function valida() { |
|
54 | + if (isset($_POST['usuario'])) { |
|
55 | + $usuario = $_POST['usuario']; |
|
56 | + $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
57 | 57 | |
58 | 58 | $datosUser = $this->cargaModelo('usuario'); |
59 | - $valida=$datosUser->seleccionUsuario($usuario, $clave); |
|
59 | + $valida = $datosUser->seleccionUsuario($usuario, $clave); |
|
60 | 60 | |
61 | - if(isset($valida)){ |
|
61 | + if (isset($valida)) { |
|
62 | 62 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
63 | - $_SESSION['usuario']=$usuario; |
|
64 | - $_SESSION['id_usuario']=$valida['id_usuario']; |
|
65 | - $_SESSION['nivel']=$valida['nivel']; |
|
63 | + $_SESSION['usuario'] = $usuario; |
|
64 | + $_SESSION['id_usuario'] = $valida['id_usuario']; |
|
65 | + $_SESSION['nivel'] = $valida['nivel']; |
|
66 | 66 | $this->_ayuda->redireccionUrl('data/index'); |
67 | 67 | } |
68 | 68 | $this->_ayuda->redireccionUrl('usuario'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - public function cerrarSesion(){ |
|
73 | + public function cerrarSesion() { |
|
74 | 74 | $this->_sesion->iniciarSesion('_s', false); |
75 | 75 | session_destroy(); |
76 | 76 | $this->_sesion->destruir('usuario'); |