<?PHP
class Admin_IndexController extends Zend_Controller_Action
{
    function init()
    {
		$this->smarty=Zend_Registry::get('smarty');
		$this->smarty->assign('baseUrl',$this->_request->getBaseUrl());
    }
    
	function preDispatch()
	{
		$auth = Zend_Auth::getInstance();
		if (!$auth->hasIdentity()) {
			$this->_redirect('auth/login');
		}else{
			//Zend_Loader::loadClass('Article');
			$this->smarty->assign('baseUrl',$this->_request->getBaseUrl());
			$this->smarty->assign('user',Zend_Auth::getInstance()->getIdentity());
			$user = Zend_Auth::getInstance()->getIdentity();
			//print_r($user);
			
			$this->smarty->assign('nickname',$user->nickname);
		}
	}
    
    function indexAction()
    {	
    	
       	$this->smarty->assign('title','博客管理后台');
       	$this->smarty->display('index/index.phtml');
    }
    
	function topAction()
    {
    		$this->smarty->display('index/top.phtml');
    }
    
    function menuAction()
    {
    		$this->smarty->display('index/menu.phtml');
    }
    
 	function mainAction()
    {
    		$this->smarty->display('index/main.phtml');
    }
    
  
}