Progress 6 for the dashboards

This commit is contained in:
Julio Cesar Laura
2011-10-31 15:58:51 -04:00
parent 7024663aa9
commit b63b46bcff
2 changed files with 7 additions and 9 deletions

View File

@@ -14,26 +14,24 @@ class PMDashlet extends DashletInstance implements DashletInterface {
public function setup($dasInsUid) { public function setup($dasInsUid) {
try { try {
$dashletInstance = $this->getDashletInstance($dasInsUid); $dashletInstance = $this->getDashletInstance($dasInsUid);
//$this->dashletObject = new $dashletInstance['DAS_CLASS'](); $this->dashletObject = new $dashletInstance['DAS_CLASS']();
$this->dashletObject->setup($dashletInstance);
} }
catch (Exception $error) { catch (Exception $error) {
throw $error; throw $error;
} }
//recupera el registro
/*$array = loadDB()
//merge
$c = new $className();
$c->setup($array);*/
} }
public function render() { public function render() {
try { try {
// if (is_null($this->dashletObject)) {
throw new Exception('Please call to the function "setup" before call the function "render".');
}
$this->dashletObject->render();
} }
catch (Exception $error) { catch (Exception $error) {
throw $error; throw $error;
} }
//$this->c->render();
} }
// Own functions // Own functions

View File

@@ -96,7 +96,7 @@ class Dashboard extends Controller {
$this->setJSVar('dashletInstance', $this->pmDashlet->getDashletInstance($dasInsUid)); $this->setJSVar('dashletInstance', $this->pmDashlet->getDashletInstance($dasInsUid));
} }
else { else {
$this->setJSVar('dashletInstance', new stdclass()); $this->setJSVar('dashletInstance', '');
} }
G::RenderPage('publish', 'extJs'); G::RenderPage('publish', 'extJs');
} }