34 lines
682 B
PHP
34 lines
682 B
PHP
<?php
|
|
namespace view;
|
|
class Site
|
|
{
|
|
public static function show()
|
|
{
|
|
global $user;
|
|
|
|
$class = '\controls\\';
|
|
|
|
$results = explode( '_', \S::get( 'module' ) );
|
|
if ( is_array( $results ) ) foreach ( $results as $row )
|
|
$class .= ucfirst( $row );
|
|
|
|
$action = \S::get( 'action' );
|
|
|
|
$tpl = new \Tpl;
|
|
$tpl -> content = \controls\Site::route();
|
|
|
|
if ( !$user )
|
|
return $tpl -> render( 'site/layout-unlogged' );
|
|
else
|
|
{
|
|
$tpl -> user = $user;
|
|
if ( $alert = \S::get_session( 'alert' ) )
|
|
{
|
|
$tpl -> alert = $alert;
|
|
unset( $_SESSION['alert'] );
|
|
}
|
|
return $tpl -> render( 'site/layout-logged' );
|
|
}
|
|
}
|
|
}
|