<?
namespace admin\view;

class Pages
{
  public static function subpages_browse_list( $pages, $parent_id = null, $step = 1 )
  {
    $tpl = new \Tpl();
    $tpl -> pages      = $pages;
    $tpl -> parent_id  = $parent_id;
    $tpl -> step       = $step;
    return $tpl -> render( 'pages/subpages-browse-list' );
  }

  static public function browse_list( $menus, $modal = false )
  {
    return \Tpl::view( 'pages/pages-browse-list', [
      'menus' => $menus,
      'modal' => $modal
    ] );
  }

  public static function page_articles( $page_id, $articles )
  {
    $tpl = new \Tpl;
    $tpl -> page_id  = $page_id;
    $tpl -> articles = $articles;
    return $tpl -> render( 'pages/page-articles' );
  }

  public static function page_edit( $page, $parent_id, $menu_id, $menus, $layouts, $languages, $settings )
  {
    $tpl = new \Tpl;
    $tpl -> menu_id    = $menu_id;
    $tpl -> parent_id  = $parent_id;
    $tpl -> menus      = $menus;
    $tpl -> page       = $page;
    $tpl -> layouts    = $layouts;
    $tpl -> languages  = $languages;
    $tpl -> settings   = $settings;
    return $tpl -> render( 'pages/page-edit' );

  }

	public static function menu_edit( $menu )
	{
    $tpl = new \Tpl;
    $tpl -> menu = $menu;
    return $tpl -> render( 'pages/menu-edit' );
	}

  public static function pages_list( $menus )
  {
    $tpl = new \Tpl;
    $tpl -> menus = $menus;
    return $tpl -> render( 'pages/pages-list' );
  }

  public static function subpages_list( $pages, $parent_id = null, $step = 1 )
  {
    $tpl = new \Tpl();
    $tpl -> pages      = $pages;
    $tpl -> parent_id  = $parent_id;
    $tpl -> step       = $step;
    return $tpl -> render( 'pages/subpages-list' );
  }
}
?>