* * * @author Eduardo Bonfandini [eduardo@solis.coop.br] * * @version $Id$ * * \b Maintainers: \n * Eduardo Bonfandini [eduardo@solis.coop.br] * Jamiel Spezia [jamiel@solis.coop.br] * Jader Fiegenbaum [jader@solis.coop.br] * * @since * Class created on 21/07/2008 * **/ function defaultHandler( $handler , $title , $form=null, $searchForm = null, $img = null) { global $module; global $MIOLO; global $theme; global $page; $subHandler = explode(':', $handler); $subHandler = $subHandler[2]; if ( !$form ) { $form = 'Frm'.ucfirst($subHandler); } if ( !$img ) { $img = $subHandler.'-16x16.png'; } $function = MIOLO::_REQUEST('function'); $ui = $MIOLO->getUI(); if ( !$searchForm ) { $searchForm = $form . 'Search'; } if ( ( strlen( $function ) == 0 ) || ( $function == 'search' ) || ( $function == 'detail' ) || ($function == 'execute')) { $content = $ui->getForm($module,$searchForm); } else { $content = $ui->getForm( $module, $form ); } //caso o debug esteja ativado mostra o último notice if ( $MIOLO->getConf('gnuteca.debug') ) { $notice = pg_last_notice( $content->business->db->conn->id ); if ( $notice ) { //clog( $notice ); } } //tenta verificar as permissões, pode retornar erro caso não exista transação try { if ( $content->checkAccess() ) { $content->setIcon($ui->getImage($module, $img )); $theme->setContent($content); } else { $loginUrl = $MIOLO->getConf('home.url').'/index.php?module=gnuteca3&action=main:login' ; $page->redirect( $loginUrl ); } } catch (Exception $ex) { GForm::error( $ex->getMessage() ); } } ?>