db = $db; } static function addPaginator($data,$ctl,Zend_Controller_Request_Abstract $request) { $page = $request->getParam('page'); $paginator = Zend_Paginator::factory($data); $paginator->setCurrentPageNumber($page); $paginator->setItemCountPerPage(12); $paginator->setView($ctl); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $ctl->paginator = $paginator; } static function Msg($type,$content,$url=''){ $html = '
'."\r\n"; $html.= '×'."\r\n"; $html.= $content."\r\n"; $html.= '
'."\r\n"; if(!empty($url)) { if($url == -1){ $html.= ''."\r\n"; }else{ $html.= ''."\r\n"; } } return $html; } static function Error($content,$type='',$url=''){ if(empty($type)) { $AlertType = "alert-error"; }else{ $AlertType = $type; } $html = '
'."\r\n"; $html.= '×'."\r\n"; if(!is_array($content)) { $html.= '

'.$content.'

'."\r\n"; }else{ $html.= ''."\r\n"; } $html.= '
'."\r\n"; return $html; } static function User($param){ $auth = Zend_Auth::getInstance(); if($auth->hasIdentity()) { $user = $auth->getIdentity(); return $user->$param; }else{ return false; } } static function Dump($data,$exit = true){ echo "
";
		var_dump($data);
		echo "
"; if($exit) { exit(); } } static function Post(Zend_Controller_Action $ctl,$msg){ if(empty($msg)) { return false; } if(!array($msg)) { $msg = array('content'=>$msg); } $helper = new Zend_Controller_Action_HelperBroker($ctl); $helper->viewRenderer->setNoRender(); echo $ctl->view->partial('post-message.phtml', $msg); return true; } }