* * * @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 ); } //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 { // Testar se existe sessão e o usuário não tem acesso, mostra mensagem de falta de acesso. if ( $MIOLO->getLogin()->id ) { GForm::error(USUARIO_SEM_PERMISSAO); } else { $loginUrl = $MIOLO->getConf('home.url').'/index.php?module=gnuteca3&action=main:login' ; $page->redirect( $loginUrl ); } } createBreadCrumb(); } catch (Exception $ex) { GForm::error( $ex->getMessage() ); } } function createBreadCrumb() { global $navbar; global $action; $handlers = explode(':', $action); foreach ( $handlers as $h ) { $pai = $_SESSION['menuItems'][$h]['pai']; if ( strlen($pai) > 0 ) { $descricao = $_SESSION['menuItems'][$pai]['descricao']; $icone = $_SESSION['menuItems'][$pai]['icone']; if ( strlen($descricao) > 0 ) { $navbar->addOption('