125 lines
3.4 KiB
PHP
125 lines
3.4 KiB
PHP
<?php
|
|
namespace admin\factory;
|
|
|
|
class Pages
|
|
{
|
|
public static $_page_types = [ 0 => 'pełne artykuły', 1 => 'wprowadzenia', 2 => 'miniaturki', 3 => 'link', 4 => 'kontakt' ];
|
|
public static $_sort_types = [
|
|
0 => 'data dodania - najstarsze na początku',
|
|
1 => 'data dodania - najnowsze na początku',
|
|
2 => 'data modyfikacji - rosnąco',
|
|
3 => 'data mofyfikacji - malejąco',
|
|
4 => 'ręczne',
|
|
5 => 'alfabetycznie - A - Z',
|
|
6 => 'alfabetycznie - Z - A'
|
|
];
|
|
|
|
private static function repo(): \Domain\Pages\PagesRepository
|
|
{
|
|
global $mdb;
|
|
return new \Domain\Pages\PagesRepository( $mdb );
|
|
}
|
|
|
|
public static function save_articles_order( $page_id, $articles )
|
|
{
|
|
return self::repo()->saveArticlesOrder( $page_id, $articles );
|
|
}
|
|
|
|
public static function page_articles( $page_id )
|
|
{
|
|
return self::repo()->pageArticles( $page_id );
|
|
}
|
|
|
|
public static function menus_list()
|
|
{
|
|
return self::repo()->menusList();
|
|
}
|
|
|
|
public static function save_pages_order( $menu_id, $pages )
|
|
{
|
|
return self::repo()->savePagesOrder( $menu_id, $pages );
|
|
}
|
|
|
|
public static function page_delete( $page_id )
|
|
{
|
|
return self::repo()->pageDelete( $page_id );
|
|
}
|
|
|
|
public static function max_order()
|
|
{
|
|
return self::repo()->maxOrder();
|
|
}
|
|
|
|
public static function page_save(
|
|
$page_id, $title, $seo_link, $meta_title, $meta_description, $meta_keywords, $menu_id, $parent_id, $page_type, $sort_type, $layout_id, $articles_limit, $show_title, $status, $link, $noindex, $start,
|
|
$site_title, $block_direct_access, $cache, $canonical
|
|
)
|
|
{
|
|
return self::repo()->pageSave(
|
|
$page_id, $title, $seo_link, $meta_title, $meta_description, $meta_keywords, $menu_id, $parent_id, $page_type, $sort_type, $layout_id, $articles_limit, $show_title, $status, $link, $noindex, $start,
|
|
$site_title, $block_direct_access, $cache, $canonical
|
|
);
|
|
}
|
|
|
|
public static function update_supages_menu_id( $parent_id, $menu_id )
|
|
{
|
|
self::repo()->updateSubpagesMenuId( (int) $parent_id, (int) $menu_id );
|
|
}
|
|
|
|
public static function generate_seo_link( $title, $page_id, $article_id, $lang, $pid )
|
|
{
|
|
return self::repo()->generateSeoLink( $title, $page_id, $article_id, $lang, $pid );
|
|
}
|
|
|
|
public static function google_url_preview( $page_id, $title, $lang, $pid, $id, $seo_link, $language_link = '' )
|
|
{
|
|
return self::repo()->googleUrlPreview( $page_id, $title, $lang, $pid, $id, $seo_link, $language_link );
|
|
}
|
|
|
|
public static function menu_delete( $menu_id )
|
|
{
|
|
return self::repo()->menuDelete( $menu_id );
|
|
}
|
|
|
|
public static function menu_details( $menu_id )
|
|
{
|
|
return self::repo()->menuDetails( $menu_id );
|
|
}
|
|
|
|
public static function menu_save( $menu_id, $name, $status )
|
|
{
|
|
return self::repo()->menuSave( $menu_id, $name, $status );
|
|
}
|
|
|
|
public static function menu_lists()
|
|
{
|
|
return self::repo()->menuLists();
|
|
}
|
|
|
|
public static function page_details( $page_id )
|
|
{
|
|
return self::repo()->pageDetails( $page_id );
|
|
}
|
|
|
|
public static function page_url( $page_id )
|
|
{
|
|
return self::repo()->pageUrl( $page_id );
|
|
}
|
|
|
|
public static function page_title( $page_id )
|
|
{
|
|
return self::repo()->pageTitle( $page_id );
|
|
}
|
|
|
|
public static function page_languages( $page_id )
|
|
{
|
|
return self::repo()->pageLanguages( $page_id );
|
|
}
|
|
|
|
public static function menu_pages( $menu_id, $parent_id = null )
|
|
{
|
|
return self::repo()->menuPages( $menu_id, $parent_id );
|
|
}
|
|
}
|
|
?>
|