<?php
/**
* @author:  Bunzia Alexander <nifus@mail.ru> <http://www.weblancer.net/users/nifus/>
* @copyright: Copyright (c) 2010, Bunzia Alexander
* @version: 1.0
* @license: http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

/**
* Блок авторизации/меню пользователя.
*
*/
include_once(MAIN_SOURCE_PATH.'/modules/users/inc/url.php');



function users_login_menu(){
global $MAIN_USER;
  include_once(MAIN_SOURCE_PATH.'/modules/admin/inc/url.php');
  include_once(MAIN_SOURCE_PATH.'/modules/users/inc/url.php');
	$t = new PHPTAL( false );
	$t -> setSnippet('users','users_login_menu_block');
	
	if ( MAIN_USER>0 ){
		// пользователь
   		$t -> user = 1;
			$t -> login = $MAIN_USER -> login();	
			$t -> u_name = $MAIN_USER -> name();
			$t -> login = $MAIN_USER -> login();
  	  $t -> is_admin =  $MAIN_USER -> is_admin();
  	  $t -> avatar_src =  $MAIN_USER -> avatar_src();
  	  
  	  
  	  $t -> URL_USERS_PROFILE = sys_url(URL_USERS_PROFILE,MAIN_USER);
  	}else{
  		$t -> is_admin = false;
  		$t -> user = 0;
  	}
  	
  	return  $t -> execute();
}



?>
