[surforce-library] r56 committed - bugs: varios, en validaciones de parámetros que se cargan desde el .in...

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 17, 2010, 10:22:53 AM1/17/10
to surforce...@googlegroups.com
Revision: 56
Author: enriqueplace
Date: Sun Jan 17 07:22:07 2010
Log: bugs: varios, en validaciones de parámetros que se cargan desde
el .ini y luego carga en vista
http://code.google.com/p/surforce-library/source/detail?r=56

Modified:
/trunk/library/Zsurforce/Generic/Controller.php

=======================================
--- /trunk/library/Zsurforce/Generic/Controller.php Sat Jan 16 16:39:37 2010
+++ /trunk/library/Zsurforce/Generic/Controller.php Sun Jan 17 07:22:07 2010
@@ -28,13 +28,13 @@
protected $_debug = null;

protected $_controllerName = null;
-
+
protected $_moduleName = null;

protected $_user = null;

protected $_config = null;
-
+
/**
* Define inicio del controller
*
@@ -45,75 +45,76 @@
parent::init();
/*
* Carga información desde el bootstrap (index.php).
- */
+ */
$this->_registry = Zend_Registry::getInstance();

if (Zend_Registry::isRegistered('debug')) {
- $this->_debug = $this->_registry->get('debug');
+ $this->_debug = $this->_registry->get('debug');
+ $this->view->debug = $this->_debug;
}
if (Zend_Registry::isRegistered('devel')) {
- $this->_devel = $this->_registry->get('devel');
+ $this->_devel = $this->_registry->get('devel');
+ $this->view->devel = $this->_devel;
}
if (Zend_Registry::isRegistered('config')) {
- $this->_config = $this->_registry->get('config');
- }
-
- $this->_user = Zend_Auth::getInstance()->getIdentity();
-
- if( Zend_Registry::isRegistered('session')){
+ $this->_config = $this->_registry->get('config');
+ $this->view->config = $this->_config;
+ }
+
+ $this->_user = Zend_Auth::getInstance()->getIdentity();
+ $this->view->user = $this->_user;
+
+ if (Zend_Registry::isRegistered('session')){
$this->_session = $this->_registry->get('session');
+ $this->view->session = $this->_session;
}

- /*
- * Carga información para el layout (antes de las vistas)
- */
- $layout = Zend_Layout::getMvcInstance();
- $layout->logo = $this->_config->layout->logo;
-
+ if($this->_config){
+ /*
+ * Carga información para el layout (antes de las vistas)
+ */
+ $layout = Zend_Layout::getMvcInstance();
+ $layout->logo = $this->_config->layout->logo;
+ }

/*
* Carga información para las vistas del sistema
- */
+ */
$this->initView();
- if (Zend_Registry::isRegistered('base_path_app')) {
+ if (Zend_Registry::isRegistered('base_path_app')) {
$this->view->basePath =
$this->_registry->get('base_path_app');
- }
+ }
if (Zend_Registry::isRegistered('base_path_html')) {
$this->view->basePathHtml =
$this->_registry->get('base_path_html');
}
-
- $this->view->baseUrl = $this->_request->getBaseUrl();
-
- $this->view->debug = $this->_debug;
- $this->view->devel = $this->_devel;
- $this->view->session = $this->_session;
- $this->view->config = $this->_config;
- $this->view->user = $this->_user;
+
+ $this->view->baseUrl = $this->_request->getBaseUrl();
+

/*
* FIXME: generar un archivo de log, al imprimir esta linea
* rompe la session del sistema
- */
+ */
if(isset($this->_debug) && $this->_debug){
echo "<!--".var_export($this->_request,true)."-->";
- }
+ }

$this->_controllerName = $this->view->controllerName =
$this->_request->getParam('controller');
$this->_moduleName = $this->view->moduleName =
$this->_request->getParam('module');

$this->view->addHelperPath(
- '../library/Zsurforce/View/Helper/',
- 'Zsurforce_View_Helper'
+ '../library/Zsurforce/View/Helper/',
+ 'Zsurforce_View_Helper'
);
$this->view->addHelperPath(
- 'ZendX/JQuery/View/Helper',
- 'ZendX_JQuery_View_Helper'
+ 'ZendX/JQuery/View/Helper',
+ 'ZendX_JQuery_View_Helper'
);

/*
* Ejemplo para cargar por defecto las clases necesarias para el
controller,
* como puede ser también un Modelo
- */
+ */
// Zend_Loader::loadClass('clase');
// Zend_Loader::loadClass('Configuracion');
}
Reply all
Reply to author
Forward
0 new messages