Commit caf3cb5999a0e600209a18d04ebb5288414128ab

Authored by Rafael Santos
1 parent 022b24e8
Exists in master

Continuacao da localizacao do usuario no sistema

Showing 1 changed file with 27 additions and 2 deletions   Show diff stats
ieducar/intranet/include/clsListagem.inc.php
... ... @@ -253,6 +253,26 @@ class clsListagem extends clsCampos
253 253  
254 254 return NULL;
255 255 }
  256 +
  257 + function breadcrumbs($separator = ' » ', $home = 'Home') {
  258 +
  259 + $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
  260 + $base_url = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
  261 + $breadcrumbs = array("<a href=\"$base_url\">$home</a>");
  262 +
  263 + $last = end(array_keys($path));
  264 +
  265 + foreach ($path AS $x => $crumb) {
  266 + $title = ucwords(str_replace(array('.php', '_'), Array('', ' '), $crumb));
  267 + if ($x != $last){
  268 + $breadcrumbs[] = '<a href="$base_url$crumb">$title</a>';
  269 + }else{
  270 + $breadcrumbs[] = $title;
  271 + }
  272 + }
  273 +
  274 + return implode($separator, $breadcrumbs);
  275 +}
256 276  
257 277 function RenderHTML()
258 278 {
... ... @@ -298,8 +318,13 @@ class clsListagem extends clsCampos
298 318 else {
299 319 $tipo = 'cad';
300 320 }
301   -
302   - $barra = '<b>Caminho: '. $_SERVER['SCRIPT_NAME']. '</b><br>';
  321 +
  322 + $server = $_SERVER['SERVER_NAME'];
  323 + $endereco = $_SERVER ['REQUEST_URI'];
  324 + $enderecoPagina = $_SERVER['PHP_SELF'];
  325 +
  326 + //$barra = '<b>Localizacao: http://'.$server.$endereco.'</b><br>';
  327 + $barra = '<b>Localizacao:'. $enderecoPagina .'</b><br>';
303 328 $barra .= '<b>Filtros de busca</b>';
304 329  
305 330 if (class_exists('clsPmiajudaPagina')) {
... ...