<?
namespace admin\view;

class LoginRestriction
{

    public function edit( $id )
    {
		global $lang , $sys;

		$out = \admin\view\PagePanel::show( false , true , true , $lang -> getTrans( 'T_ZAKAZANE_LOGINY' ) );

		$dbedit = new \DataEdit( 'pcms_banned_login' , 'id' , $id );
		$dbedit -> addPosition( 'login'		, $lang -> getTrans( 'T_LOGIN' )	, 'text' );
		$out .= $dbedit -> draw();

		return $out;
	}
    
    /* ---------- */
    
    public function add()
    {
        global $lang , $sys;

    	$out = \admin\view\PagePanel::show( false , true , true , $lang -> getTrans( 'T_ZAKAZANE_LOGINY' ) );

		$dbedit = new \DataEdit( 'pcms_banned_login' , 'id' );
		$dbedit -> addPosition( 'login'		, $lang -> getTrans( 'T_LOGIN' )	, 'text' );
		$out .= $dbedit -> draw();

		return $out;
    }
    
    /* ---------- */
    
    public function show()
    {
        global $lang , $sys;

    	$out = \admin\view\PagePanel::show( true , false , false , $lang -> getTrans( 'T_ZAKAZANE_LOGINY' ) );

		$dbrowse = new \DataBrowse('pcms_banned_login');
		$dbrowse -> addPosition( 'login'	, $lang -> getTrans( 'T_LOGIN' ) 	, '' , '' , 'text-align:left;' , true );
		$dbrowse -> addPositionSimple( $lang -> getTrans( 'T_EDYTUJ' )	, '' , 'index.php?rw=edit' );
		$dbrowse -> addPositionSimple( $lang -> getTrans( 'T_USUN' )	, '' , '' , $sys -> deleteAction() );
		$dbrowse -> setParam( 'id' );
		$dbrowse -> addSort( 'login ASC' );
		$dbrowse -> addLp();
		$dbrowse -> addFiltr( 'login'	, $lang -> getTrans( 'T_LOGIN' ) );
		$out .= $dbrowse -> draw();

		return $out;
    }
}
?>