function listar($tpl)
 {
     $tabla_listado = new table(true);
     //Empieza comentado
     if ($_SESSION['super'] || $_SESSION['admin']) {
         $my_corp = new corps();
         $my_corp->get_list_corps();
         $cadena = '' . $tabla_listado->make_tables('user_corps', $my_corp->corps_list, array('Nombre', 50), array('id_corp', 'name'), 10, array('select'), false);
         $variables = $tabla_listado->nombres_variables;
         $tpl->assign('variables', $variables);
         $tpl->assign('cadena', $cadena);
         return $tpl;
     }
     //Fin comentado
     $cadena = '' . $tabla_listado->make_tables('user_corps', $this->emp->corps_list, array('Nombre', 50), array('id_corp', 'name'), 10, array('select'), false);
     $variables = $tabla_listado->nombres_variables;
     $tpl->assign('variables', $variables);
     $tpl->assign('cadena', $cadena);
     return $tpl;
 }
 function calculate_tpl($method, $tpl)
 {
     switch ($method) {
         case 'select':
             $_SESSION['ident_group'] = $_GET['id'];
             $my_corp = new corps();
             $tpl = $my_corp->view($_SESSION['ident_corp'], $tpl);
             $tpl->assign('plantilla', 'corps_view.tpl');
             break;
         default:
             $method = 'list';
             $tpl = $this->listar($tpl);
             //Empieza comentado
             /*								if($_SESSION['super'] || $_SESSION['admin'])
             								{
             									$tpl->assign('plantilla','user_corps_'.$method.'.tpl');	
             								}
             								else
             								{
             								Fin comentado
             									if($num_corps == 1)
             									{
             										$_SESSION['ident_corp'] = $this->emp->corps_list[0]['id_corp'];
             										$my_corp = new corps();
             										$tpl = $my_corp->view($_SESSION['ident_corp'],$tpl);
             										$tpl->assign('plantilla','corps_view.tpl');	
             										
             									}
             									else
             										$tpl->assign('plantilla','user_corps_'.$method.'.tpl');	
             							Empieza comentado			
             								}*/
             //Fin cometnado
             break;
     }
     return $tpl;
 }
    $plantilla = 'wellcome.tpl';
    $tpl->assign('plantilla', $plantilla);
} else {
    ///*************************************
    //En este orden
    if (!isset($_GET['method'])) {
        $method = null;
    } else {
        $method = $_GET['method'];
    }
    $tpl = $objeto->calculate_tpl($method, $tpl);
    //Se obtiene el nombre de la empresa en la que se est� trabajando
    if ($_SESSION['ident_corp'] == 0) {
        $corp = "";
    } else {
        $my_corp = new corps();
        $my_corp->read($_SESSION['ident_corp']);
        $corp = $my_corp->name;
    }
    $nav_bar = $objeto->bar($method, $corp);
    $title = $objeto->title($method, $corp);
    //elige la plantilla a presentar
}
//pasa las variables de la presentaci�n a la plantilla dependiente del objeto
$tpl->assign('title', $title);
$tpl->assign('nav_bar', $nav_bar);
//Antes de ir a la plantilla se registra la hora m�xima a la que puede estar el usuario en esa p�gina
$_SESSION['max_page_time'] = time() + 1200;
//Guardar en bbdd fecha de expiracion
$session = new sessions();
$session->expire = $_SESSION['max_page_time'];