first commit
This commit is contained in:
52
autoload/admin/controls/class.Pages.php
Normal file
52
autoload/admin/controls/class.Pages.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
namespace admin\controls;
|
||||
|
||||
class Pages {
|
||||
|
||||
public static function getContent()
|
||||
{
|
||||
$rw = \System::formGet( 'rw' );
|
||||
|
||||
if ( $rw == 'del_menu' )
|
||||
{
|
||||
\admin\factory\Menu::deleteMenu( \System::formGetInt( 'id' ) );
|
||||
header( 'Location: ./' );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $rw == 'save' && \admin\factory\Pages::savePage() )
|
||||
{
|
||||
\System::setAlert( 'Strona została zapisana.' );
|
||||
header( 'Location: ./' );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $rw == 'add_new' && \admin\factory\Pages::addPage() )
|
||||
{
|
||||
\System::setAlert( 'Strona została dodana.' );
|
||||
header( 'Location: ./' );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $rw == 'add_menu' )
|
||||
return \admin\view\Menu::editMenu();
|
||||
|
||||
if ( $rw == 'edit_menu' )
|
||||
return \admin\view\Menu::editMenu( \System::formGetInt( 'id' ) );
|
||||
|
||||
if ( $rw == 'edit' )
|
||||
return \admin\view\Pages::editPage( \System::formGet( 'id' ), \System::formGetInt( 'menu_id' ) );
|
||||
|
||||
if ( $rw == 'add' )
|
||||
return \admin\view\Pages::addPage( \System::formGetInt( 'menu_id' ), \System::formGetInt( 'parent_id' ) );
|
||||
|
||||
if ( $rw == 'article_list' )
|
||||
return \admin\view\Pages::showAssignedArticles( \System::formGetInt( 'id' ) );
|
||||
|
||||
if ( $rw == 'del' )
|
||||
\admin\factory\Pages::deletePage( \System::formGetInt( 'id' ) );
|
||||
|
||||
return \admin\view\Pages::showPages();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user