first commit

This commit is contained in:
2023-09-04 21:59:34 +02:00
commit 650ef5b3e1
196 changed files with 24080 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
// po poprawkach
namespace admin\view;
class Adverts {
public function editAdvert( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Reklama' );
$dbedit = new \DataEdit( 'pp_adverts', 'id', $id );
$dbedit -> addPosition( 'name', 'Nazwa', 'text' );
$dbedit -> addPosition( 'date_start', 'Początek', 'text', 'onFocus="if ( $( this ).val() == \'\' ) $(this).val( \'' . date( 'Y-m-d' ) . '\');"' );
$dbedit -> addPosition( 'date_end', 'Koniec', 'text', 'onFocus="if ( $( this ).val() == \'\' ) $(this).val( \'' . date( 'Y-m-d' ) . '\');"' );
$dbedit -> addPosition( 'enabled', 'Aktywna', 'radio' , '' , \System::getComboYesNo() );
$dbedit -> addPosition( 'img', 'Obraz', 'file' );
$dbedit -> setUploadFolder( 'image' , 'upload/adverts/' );
$out .= $dbedit -> draw();
$tpl = new \Savant3;
$out .= $tpl -> fetch( 'adverts/adverts-edit' );
return $out;
}
public function showAdverts()
{
$out = \admin\view\PagePanel::show( 'Dodaj nową', false, false, 'Reklama' );
$dbrowse = new \DataBrowse( 'pp_adverts' );
$dbrowse -> addPosition( 'name', 'Nazwa', '', '', '', 'name' );
$dbrowse -> addPosition( 'date_start', 'Początek', '', '', '', 'date_start' );
$dbrowse -> addPosition( 'date_end', 'Koniec', '', '', '', 'date_end' );
$dbrowse -> addPosition( 'enabled', 'Aktywna', '' , \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'name ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'name', 'Nazwa' );
$dbrowse -> addFiltr( 'enabled', 'Aktywna', \System::getComboYesNo() );
$out .= $dbrowse -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,202 @@
<?php
// po poprawkach
namespace admin\view;
class Articles
{
public static function drawPagesArticles()
{
$tpl = new \Savant3();
$tpl -> _pages = \admin\factory\Articles::getPagesWithArticles();
return $tpl -> fetch( 'articles/article-sort' );
}
public static function showArticlesArchive()
{
$delete_articles = "var articles = ''; $('input:checkbox:checked').each( function() { if ( articles != '' ) articles = articles + ':'; articles = articles + $(this).val(); } ); $.prompt( 'Trwa usuwanie...' ); xajax_deleteArticles( articles );";
$tab_comment[0] = 'nie';
$tab_comment[1] = 'tak';
$tab_comment[2] = 'tylko dla zarejestrowanych';
$tab = \System::getArticlesTitle();
$dbrowse = new \DataBrowse( 'pp_articles', 'archive = 1' );
$dbrowse -> addPosition( 'id', 'Tytuł', '', $tab, '' );
$dbrowse -> addPosition( 'enabled', 'Opublikowany', '', \System::getComboYesNo(), 'text-align: center; width: 100px;' );
$dbrowse -> addPosition( 'date_modify', 'Data modyfikacji', '', '', 'width: 150px; text-align: center;', true );
$dbrowse -> addPositionSimple( 'przywróc', '', './?rw=restore' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'date_add DESC' );
$dbrowse -> addLp();
$dbrowse -> addCheckbox();
$dbrowse -> addFiltr( 'id{trans}', 'Tytuł', $tab );
$dbrowse -> addFiltr( 'print', 'Drukuj', \System::getComboYesNo() );
$dbrowse -> addFiltr( 'enabled', 'Opublikowany', \System::getComboYesNo() );
$dbrowse -> addFiltr( 'show_title', 'Pokaż tytuł', \System::getComboYesNo() );
$dbrowse -> addMenu( \admin\view\PagePanel::show( false, false, false, 'Archiwum', 'formularz', false, false, false, $delete_articles ) );
$out .= $dbrowse -> draw();
return $out;
}
public static function drawArticle( $version_id )
{
$article_id = \admin\factory\Articles::getArticleIdByVersionId( $version_id );
$version = \admin\factory\Articles::getArticleVersionByVersionId( $version_id );
$language = \admin\factory\Articles::getArticleParamLanguage( $article_id , $version );
$out = \admin\view\PagePanel::show( false , false , true );
$tpl = new \Savant3();
$tpl -> _language = $language;
$out .= $tpl -> fetch( 'articles/article-draw' );
return $out;
}
public static function addArticle()
{
\System::deleteSessionVar( 'id_menu' );
$out = \admin\view\PagePanel::show( false, 'Dodaj', true, 'Artykuły', 'formularz', false, false, 'saveArticle()' );
$pages = \admin\factory\Articles::getPagesAssign();
$language = \admin\factory\Articles::getArticleParamLanguage();
$tpl = new \Savant3();
$tpl -> _language = $language;
$tpl -> _rw = 'add';
$tpl -> _pages = $pages;
$tpl -> _id_form = 'formularz';
$tpl -> _layouts = \admin\factory\Layouts::getLayouts();
$out .= $tpl -> fetch( 'articles/article-edit' );
return $out;
}
public static function drawArticleEditPages( $pages, $step = 0 )
{
$tpl = new \Savant3;
$tpl -> _pages = $pages;
$tpl -> _step = $step;
return $tpl -> fetch( 'articles/article-edit-pages' );
}
public static function editArticle( $id )
{
\System::deleteSessionVar( 'id_menu' );
$out = \admin\view\PagePanel::show( false, 'Zapisz', true, 'Artykuły', 'formularz', false, false, 'saveArticle()' );
$article = \admin\factory\Articles::getArticleParam( $id );
$pages = \admin\factory\Articles::getPagesAssign( $id );
$language = \admin\factory\Articles::getArticleParamLanguage( $id );
$tpl = new \Savant3();
$tpl -> _article = $article;
$tpl -> _language = $language;
$tpl -> _pages = $pages;
$tpl -> _layouts = \admin\factory\Layouts::getLayouts();
$tpl -> _version = \admin\factory\Articles::getMaxArticleVersion( $id ) + 1;
$tpl -> _images = \admin\factory\Articles::getArticleImages( $id );
$tpl -> _files = \admin\factory\Articles::getArticleFiles( $id );
$out .= $tpl -> fetch( 'articles/article-edit' );
return $out;
}
public static function showVersions( $id )
{
global $bs;
$out = \admin\view\PagePanel::show( false, false, false, 'Artykuł: ' . \article\FArticle::getArticleTitle( $id ), '', true );
$lpk = 25;
if ( \System::formGetInt( 'r' ) )
\System::setSessionVar( 'pcms_page_limit' , \System::formGetInt( 'r' ) );
$limit = \System::getSessionVar( 'pcms_page_limit' );
$limit = \System::checkBrowseLimit( $limit );
$link = './';
$count_page = \admin\factory\Articles::getCountVersions( $id );
$tpl = new \Savant3;
$ls = ceil( $count_page / $lpk );
if ( $bs < 1 )
$bs = 1;
else if ( $bs > $ls )
$bs = $ls;
$a = \System::getPagingVar( "a" , $bs , $ls );
$b = \System::getPagingVar( "b" , $bs , $ls );
$tpl -> _a = $bs - $b;
$tpl -> _b = $bs + $a;
$tpl -> _ls = $ls;
$tpl -> _link = $link;
$tpl -> _bs = $bs;
$from = $lpk * ( $bs - 1 );
if ( $from < 0 )
$from = 0;
$lp = $from + 1;
$articles = \admin\factory\Articles::getVersions( $id , $from , $lpk );
$tpl -> _articles = $articles;
$tpl -> _bs = $bs;
$tpl -> _limit = $lpk;
$tpl -> _total = $count_page;
$tpl -> _start = $lpk * ( $bs - 1 ) + 1 < 0 ? 0 : $lpk * ( $bs - 1 ) + 1;
if ( $count_page == 0 )
$tpl -> _start = 0;
$tpl -> _end = $lpk * $bs > $count_page ? $count_page : $lpk * $bs;
$out .= $tpl -> fetch( 'articles/article-versions' );
return $out;
}
public static function showArticles()
{
$delete = "var articles = ''; $('input:checkbox:checked').each( function() { if ( articles != '' ) articles = articles + ':'; articles = articles + $(this).val(); } ); $.prompt( 'Trwa przenoszenie do archiwum...' ); xajax_moveArticlesToArchive( articles );";
$change = "$.prompt( 'Na pewno chcesz wykonać wybraną czynność?',{ submit: function(e,v,m,f) { if ( v == true ) document.location.href='./?rw=change-enabled&id=[param]'; }, buttons: { tak: true, nie: false }, focus: 1 })";
$change = 'onClick="' . $change . '"';
$clone = "$.prompt( 'Na pewno chcesz wykonać wybraną czynność?',{ submit: function(e,v,m,f) { if ( v == true ) xajax_cloneArticle( [param] ); }, buttons: { 'tak': true, 'nie': false }, focus: 1 })";
$clone = 'onClick="' . $clone . '"';
$tab_comment[0] = 'nie';
$tab_comment[1] = 'tak';
$tab_comment[2] = 'tylko dla zarejestrowanych';
$tab = \System::getArticlesTitle();
$dbrowse = new \DataBrowse( 'pp_articles', 'archive = 0' );
$dbrowse -> addPosition( 'id', 'Tytuł', '', $tab );
$dbrowse -> addPosition( 'enabled', 'Opublikowany', '', \System::getComboYesNo(), 'cursor: pointer; width: 100px; text-align: center;', false, false, $change );
$dbrowse -> addPosition( 'date_modify', 'Data modyfikacji', '', '', 'width: 150px; text-align: center;', 'date_modify' );
$dbrowse -> addPositionSimple( 'duplikuj', '', '', $clone );
$dbrowse -> addPositionSimple( 'pokaż', '', './?act=show_versions' );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'date_add DESC' );
$dbrowse -> addLp();
$dbrowse -> addCheckbox();
$dbrowse -> addFiltr( 'id{trans}', 'Tytuł', $tab );
$dbrowse -> addFiltr( 'enabled', 'Opublikowany', \System::getComboYesNo() );
$dbrowse -> addFiltr( 'show_title', 'Pokaż tytuł', \System::getComboYesNo() );
$dbrowse -> addMenu( \admin\view\PagePanel::show( true, false, false, 'Artykuły', 'formularz', false, false, false, $delete ) );
$out .= $dbrowse -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,78 @@
<?
namespace admin\view;
class Banners
{
public static function showBanners()
{
global $bs;
$out = \admin\view\PagePanel::show( 'Dodaj nowy', false, false, 'Banery' );
$lpk = 25;
if ( \System::formGetInt('r') )
\System::setSessionVar( 'pp_banner_limit' , \System::formGetInt('r') );
$limit = \System::getSessionVar( 'pp_banner_limit' );
$limit = \System::checkBrowseLimit( $limit );
$link = './';
$banners_count = \admin\factory\Banners::getCountBanners();
$tpl = new \Savant3;
$ls = ceil( $banners_count / $lpk );
if ( $bs < 1 )
$bs = 1;
else if ( $bs > $ls )
$bs = $ls;
$a = \System::getPagingVar( 'a', $bs, $ls );
$b = \System::getPagingVar( 'b', $bs, $ls );
$tpl -> _a = $bs - $b;
$tpl -> _b = $bs + $a;
$tpl -> _ls = $ls;
$tpl -> _link = $link;
$tpl -> _bs = $bs;
$from = $lpk * ( $bs - 1 );
if ( $from < 0 )
$from = 0;
$lp = $from+1;
$banners = \admin\factory\Banners::getBanners( $from, $lpk );
$tpl -> _banners = $banners;
$tpl -> _bs = $bs;
$tpl -> _limit = $lpk;
$tpl -> _total = $banners_count;
$tpl -> _start = $lpk * ( $bs - 1 ) + 1 > 0 ? $lpk * ( $bs - 1 ) + 1 : 0;
$tpl -> _end = $lpk * $bs > $banners_count ? $banners_count : $lpk * $bs;
$out .= $tpl -> fetch( 'other/banner' );
return $out;
}
public static function editBanner( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$order = \admin\factory\Banners::getMaxOrder();
$out = \admin\view\PagePanel::show( false, $value, true, 'Banery' );
$dbedit = new \DataEdit( 'pp_banner' , 'id' , $id );
$dbedit -> addPosition( 'title', 'Tytuł', 'text' );
$dbedit -> addPosition( 'link', 'Link', 'text' );
$dbedit -> addPosition( 'enabled', 'Aktywny', 'radio' , '' , \System::getComboYesNo() );
$dbedit -> addPosition( 'image', 'Obraz', 'file' );
$dbedit -> setUploadFolder( 'image' , 'upload/banner/' );
if ( !$id )
$dbedit -> addPositionHidden( 'o' , $order );
$out .= $dbedit -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,12 @@
<?php
namespace admin\view;
class FileManager {
public function showFileManager()
{
$tpl = new \Savant3;
return $tpl -> fetch( 'other/filemanager' );
}
}
?>

View File

@@ -0,0 +1,42 @@
<?
// po poprwakach
namespace admin\view;
class GuestBook
{
public function showEntries()
{
$out = \admin\view\PagePanel::show( 'Dodaj wpis', false, false, 'Księga gości' );
$dbrowse = new \DataBrowse( 'pp_guest_book' );
$dbrowse -> addPosition( 'signature', 'Podpis', '' , '' , '' , 'signature' );
$dbrowse -> addPosition( 'text', 'Treść', '' , '' , '' , 'text' );
$dbrowse -> addPosition( 'date', 'Data', '' , '' , '' , 'date' );
$dbrowse -> addPositionSimple( 'edytuj', '' , './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '' , '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'date DESC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'signature', 'Podpis', 'text' );
$dbrowse -> addFiltr( 'text', 'Treść', 'text' );
$out .= $dbrowse -> draw();
return $out;
}
public function editEntry( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Księga gości' );
$dbedit = new \DataEdit( 'pp_guest_book', 'id', $id );
$dbedit -> addPosition( 'signature', 'Podpis', 'text' );
$dbedit -> addPosition( 'text', 'Treść', 'textarea' );
$dbedit -> addPosition( 'date', 'Data', 'text' );
$out .= $dbedit -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,86 @@
<?
// po poprawkach
namespace admin\view;
class Languages
{
public function editTranslation( $id = '' )
{
$out = \admin\view\PagePanel::show( false, true, true, 'Tłumaczenia' );
$id ? $type = 'label' : $type = 'text';
$dbedit = new \DataEdit( 'pp_langs_text' , 'id' , $id );
$dbedit -> addPosition( 'text', 'Tekst', $type );
$dbedit -> addPosition( 'pl', 'Polski', 'textarea' );
$dbedit -> addPosition( 'en', 'Angielski', 'textarea' );
$dbedit -> addPosition( 'ru', 'Rosyjski', 'textarea' );
$dbedit -> addPosition( 'de', 'Niemiecki', 'textarea' );
$dbedit -> addPosition( 'uk', 'Ukraiński', 'textarea' );
$out .= $dbedit -> draw();
return $out;
}
public function showTranslations()
{
$delete = " var translations = '';
$('input:checkbox:checked').each(
function() {
if ( translations != '' )
translations = translations + ':';
translations = translations + $(this).val();
}
);
$.prompt( 'Trwa usuwanie tłumaczeń...' );
xajax_deleteTranslations( translations );";
$out = \admin\view\PagePanel::show( true, false, false, 'Tłumaczenia', '', false, false, false, $delete );
$dbrowse = new \DataBrowse( 'pp_langs_text' );
$dbrowse -> addPosition( 'text', 'Tekst', '', '', '', 'text' );
$dbrowse -> addPosition( 'pl', 'Polski', '', '', '', 'pl' );
$dbrowse -> addPosition( 'en', 'Angielski', '', '', '', 'en' );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'text ASC' );
$dbrowse -> addLp();
$dbrowse -> addCheckbox();
$dbrowse -> addFiltr( 'text', 'Tekst', 'text' );
$dbrowse -> addFiltr( 'pl', 'Polski', 'text' );
$out .= $dbrowse -> draw();
return $out;
}
public function showLanguages()
{
$out = \admin\view\PagePanel::show( false, false, false, 'Języki' );
$dbrowse = new \DataBrowse( 'pp_langs' );
$dbrowse -> addPosition( 'id', 'Id', '', '', '', 'id' );
$dbrowse -> addPosition( 'name', 'Nazwa', '', '', '', 'name' );
$dbrowse -> addPosition( 'enabled', 'Aktywny', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'id ASC' );
$dbrowse -> addLp();
$out .= $dbrowse -> draw();
return $out;
}
public function editLanguage( $id )
{
$out = \admin\view\PagePanel::show( false, true, true, 'Języki' );
$dbedit = new \DataEdit( 'pp_langs', 'id', $id );
$dbedit -> addPosition( 'name', 'Nazwa', 'label' );
$dbedit -> addPosition( 'enabled', 'Aktywny', 'radio' , '' , \System::getComboYesNo() );
$out .= $dbedit -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,57 @@
<?php
namespace admin\view;
class Layouts {
public static function showLayouts()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Szablony' );
$dbrowse = new \DataBrowse( 'pp_layouts' );
$dbrowse -> addPosition( 'name', 'Nazwa', '', '', '', 'name' );
$dbrowse -> addPosition( 'enabled', 'Aktywny', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'name ASC' );
$dbrowse -> addLp();
$out .= $dbrowse -> draw();
return $out;
}
public static function drawLayoutEditPages( $pages, $step = 0 )
{
$tpl = new \Savant3;
$tpl -> _pages = $pages;
$tpl -> _step = $step;
return $tpl -> fetch( 'other/layout-edit-pages' );
}
public static function addLayout()
{
$out = \admin\view\PagePanel::show( false, true, true, 'Szablony' );
$tpl = new \Savant3;
$tpl -> _rw = 'save_new';
$tpl -> _pages = \admin\factory\Layouts::getPagesAssign();
$out .= $tpl -> fetch( 'other/layout-edit' );
return $out;
}
public static function editLayout( $id )
{
\System::deleteSessionVar( 'id_menu' );
$out = \admin\view\PagePanel::show( false, true, true, 'Szablony', 'formularz' , false , false , 'saveLayout()' );
$tpl = new \Savant3;
$tpl -> _rw = 'save';
$tpl -> _pages = \admin\factory\Layouts::getPagesAssign( $id );
$tpl -> _layout = \admin\factory\Layouts::getLayout( $id, true );
$out .= $tpl -> fetch( 'other/layout-edit' );
return $out;
}
}
?>

View File

@@ -0,0 +1,38 @@
<?php
namespace admin\view;
class Menu
{
public static function showMenu()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Menu' );
$dbrowse = new \DataBrowse( 'pp_menu' );
$dbrowse -> addPosition( 'name', 'Nazwa', '', '', '', 'name' );
$dbrowse -> addPosition( 'enabled', 'Aktywne', './?rw=change-enabled', \System::getComboYesNo() );
$dbrowse -> addPosition( 'type', 'Typ', '', \admin\factory\Menu::getMenuType() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'id ASC' );
$dbrowse -> addLp();
$out .= $dbrowse -> draw();
return $out;
}
public static function editMenu( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Menu' );
$dbedit = new \DataEdit( 'pp_menu', 'id', $id );
$dbedit -> addPosition( 'name', 'Nazwa', 'text' );
$dbedit -> addPosition( 'enabled', 'Aktywne', 'radio', '', \System::getComboYesNo() );
$dbedit -> addPosition( 'type', 'Typ', 'combo', '', \admin\factory\Menu::getMenuType() );
$out .= $dbedit -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,38 @@
<?php
namespace admin\view;
class Newsletter {
public function editEmail( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Newsletter - emaile' );
$dbedit = new \DataEdit( 'pp_newsletter_emails', 'id', $id );
$dbedit -> addPosition( 'email', 'Email', 'text' );
$dbedit -> addPosition( 'enabled', 'Aktywny', 'radio', '', \System::getComboYesNo() );
$out .= $dbedit -> draw();
return $out;
}
public function showEmailList()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Newsletter - emaile' );
$dbrowse = new \DataBrowse( 'pp_newsletter_emails' );
$dbrowse -> addPosition( 'email', 'Email', '', '', '', 'email' );
$dbrowse -> addPosition( 'enabled', 'Aktywny', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'email ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'email', 'Email' );
$dbrowse -> addFiltr( 'enabled', 'Aktywny', \System::getComboYesNo() );
$out .= $dbrowse -> draw();
return $out;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace admin\view;
class Page {
public static function show()
{
$tpl = new \Savant3;
$tpl -> _content = \admin\controls\Page::getContent();
$tpl -> _page_type = \System::getSessionVar( 'page_type' );
$tpl -> _alert = \System::getSessionVar( 'alert' );
return $tpl -> fetch( 'other/page-main' );
}
}
?>

View File

@@ -0,0 +1,21 @@
<?php
namespace admin\view;
class PagePanel {
public static function show( $add = false, $save = false, $cancel = false, $title = '', $form = 'formularz', $back = false, $update = false, $save_ajax = false, $delete_ajax = false )
{
$tpl = new \Savant3();
$tpl -> _add = $add;
$tpl -> _save = $save;
$tpl -> _cancel = $cancel;
$tpl -> _id_form = $form;
$tpl -> _title = $title;
$tpl -> _back = $back;
$tpl -> _update = $update;
$tpl -> _save_ajax = $save_ajax;
$tpl -> _delete_ajax = $delete_ajax;
return $tpl -> fetch( 'other/page-panel' );
}
}
?>

View File

@@ -0,0 +1,87 @@
<?
// po poprawkach
namespace admin\view;
class Pages
{
public static function showAssignedArticles( $id )
{
$out = \admin\view\PagePanel::show( false, false, true, 'Przypisane artykuły' );
$tpl = new \Savant3();
$tpl -> _articles = \admin\factory\Pages::getAssignedArticles( $id );
$out .= $tpl -> fetch( 'pages/page-articles-list' );
return $out;
}
public static function showPages()
{
$tpl = new \Savant3;
$tpl -> _menu = \admin\factory\Menu::getMenu();
return $tpl -> fetch( 'pages/page-definition' );
}
public static function editPage( $id, $menu_id )
{
$out = \admin\view\PagePanel::show( false, 'Zapisz', true, 'Lista stron' );
$page = \admin\factory\Pages::getPageParam( $id );
$tpl = new \Savant3;
$tpl -> _id = $id;
$tpl -> _page = $page;
$tpl -> _rw = 'edit';
$tpl -> _menu_id = $menu_id;
$tpl -> _parent_id = $page['parent_id'];
$tpl -> _menu = \admin\factory\Menu::getMenu();
$tpl -> _language = \admin\factory\Pages::getPageParamLanguage( $id );
$tpl -> _pages = \admin\factory\Pages::getPages( $menu_id );
$tpl -> _page_types = \admin\factory\Pages::getPageTypes();
$tpl -> _sort = \admin\factory\Pages::getSortTypes();
$tpl -> _layouts = \admin\factory\Layouts::getLayouts();
$tpl -> _layout_id = \admin\factory\Pages::getPageLayout( $id );
$out .= $tpl -> fetch( 'pages/page-edit' );
return $out;
}
public static function addPage( $menu_id, $parent_id = 0 )
{
$out = \admin\view\PagePanel::show( false, 'Dodaj', true, 'Lista stron' );
$tpl = new \Savant3;
$tpl -> _rw = 'add';
$tpl -> _menu_id = $menu_id;
$tpl -> _parent_id = $parent_id;
$tpl -> _language = \language\FLanguage::getLangs();
$tpl -> _menu = \admin\factory\Menu::getMenu();
$tpl -> _page_types = \admin\factory\Pages::getPageTypes();
$tpl -> _pages = \admin\factory\Pages::getPages( $menu_id );
$tpl -> _sort = \admin\factory\Pages::getSortTypes();
$tpl -> _order = \admin\factory\Pages::selectMaxOrder();
$tpl -> _layouts = \admin\factory\Layouts::getLayouts();
$out .= $tpl -> fetch( 'pages/page-edit' );
return $out;
}
public static function drawSubpagesEdit( $pages, $parent_id, $step = 0, $this_id = false )
{
$tpl = new \Savant3();
$tpl -> _pages = $pages;
$tpl -> _parent_id = $parent_id;
$tpl -> _step = $step;
$tpl -> _this_id = $this_id;
return $tpl -> fetch( 'pages/page-subpages-edit' );
}
public static function drawSubpages( $pages, $parent_id = 0 )
{
$tpl = new \Savant3();
$tpl -> _pages = $pages;
$tpl -> _parent_id = $parent_id;
return $tpl -> fetch( 'pages/page-subpages' );
}
}
?>

View File

@@ -0,0 +1,66 @@
<?
// po poprawkach
namespace admin\view;
class Restriction
{
public function editBannedEmail( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Zbanowane adresy email' );
$dbedit = new \DataEdit( 'pp_banned_email', 'id', $id );
$dbedit -> addPosition( 'email', 'Email', 'text' );
$out .= $dbedit -> draw();
return $out;
}
public function showBannedEmails()
{
$out = \admin\view\PagePanel::show( 'Dodaj nowy', false, false, 'Zbanowane adresy email' );
$dbrowse = new \DataBrowse('pp_banned_email');
$dbrowse -> addPosition( 'email', 'Email', '', '', '', 'email' );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'email ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'email', 'Email' );
$out .= $dbrowse -> draw();
return $out;
}
public function editBannedLogin( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, "Zbanowane loginy" );
$dbedit = new \DataEdit( 'pp_banned_login', 'id', $id );
$dbedit -> addPosition( 'login', 'Login', 'text' );
$out .= $dbedit -> draw();
return $out;
}
public function showBannedLogins()
{
$out = \admin\view\PagePanel::show( 'Dodaj nowy', false, false, "Zbanowane loginy" );
$dbrowse = new \DataBrowse( 'pp_banned_login' );
$dbrowse -> addPosition( 'login', 'Login', '', '', '', 'login' );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'login ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'login', 'Login' );
$out .= $dbrowse -> draw();
return $out;
}
}
?>

View File

@@ -0,0 +1,37 @@
<?php
namespace admin\view;
class SContainers {
public function editContainer( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Zawartość statyczna' );
$tpl = new \Savant3;
if ( $id )
$tpl -> _container = \admin\factory\SContainers::getContainer( $id );
$tpl -> _languages = \admin\factory\SContainers::getContainerParamLanguage( $id );
$out .= $tpl -> fetch( 'scontainers/edit-container' );
return $out;
}
public function showContainerList()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Zawartość statyczna' );
$dbrowse = new \DataBrowse( 'pp_static_container' );
$dbrowse -> addPosition( 'name', 'Nazwa', '', '', '', 'name' );
$dbrowse -> addPosition( 'id', 'Użycie', '', "SELECT id, CONCAT( '[KONTENER:', id, ']' ) FROM pp_static_container", '', 'name' );
$dbrowse -> addPosition( 'enabled', 'Aktywne', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'name ASC' );
$dbrowse -> addLp();
$out .= $dbrowse -> draw();
return $out;
}
}

View File

@@ -0,0 +1,37 @@
<?
namespace admin\view;
class Settings
{
public static function showSettings()
{
$out = \admin\view\PagePanel::show( false, true, false, 'Ustawienia' );
$tpl = new \Savant3;
$tpl -> _firm_name = \admin\factory\Settings::getSystemSettings( 'firm_name' );
$tpl -> _street = \admin\factory\Settings::getSystemSettings( 'street' );
$tpl -> _postal_code = \admin\factory\Settings::getSystemSettings( 'postal_code' );
$tpl -> _city = \admin\factory\Settings::getSystemSettings( 'city' );
$tpl -> _nip = \admin\factory\Settings::getSystemSettings( 'nip' );
$tpl -> _email = \admin\factory\Settings::getSystemSettings( 'email' );
$tpl -> _phone = \admin\factory\Settings::getSystemSettings( 'phone' );
$tpl -> _account = \admin\factory\Settings::getSystemSettings( 'account' );
$tpl -> _person = \admin\factory\Settings::getSystemSettings( 'person' );
$tpl -> _fax = \admin\factory\Settings::getSystemSettings( 'fax' );
$tpl -> _contact_form = \admin\factory\Settings::getSystemSettings( 'contact_form' );
$tpl -> _user_register = \admin\factory\Settings::getSystemSettings( 'user_register' );
$tpl -> _admin_email = \admin\factory\Settings::getSystemSettings( 'admin_email' );
$tpl -> _email_host = \admin\factory\Settings::getSystemSettings( 'email_host' );
$tpl -> _email_port = \admin\factory\Settings::getSystemSettings( 'email_port' );
$tpl -> _email_login = \admin\factory\Settings::getSystemSettings( 'email_login' );
$tpl -> _email_password = \admin\factory\Settings::getSystemSettings( 'email_password' );
$tpl -> _google_map_key = \admin\factory\Settings::getSystemSettings( 'google_map_key' );
$tpl -> _register = \admin\factory\Settings::getSystemSettings( 'register' );
$tpl -> _facebook_url = \admin\factory\Settings::getSystemSettings( 'facebook_url' );
$tpl -> _info = \admin\factory\Settings::getSystemSettings( 'info' );
$out .= $tpl -> fetch( 'other/settings' );
return $out;
}
}
?>

View File

@@ -0,0 +1,90 @@
<?php
namespace admin\view;
class Users
{
public static function drawLoginForm()
{
$tpl = new \Savant3;
return $tpl -> fetch( 'other/login-form' );
}
public function editAdmin( $id = '' )
{
$id ? $value = 'Zapisz': $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Administratorzy' );
$dbedit = new \DataEdit( 'pp_users', 'id', $id );
$dbedit -> addPosition('login', 'Login', 'text');
$dbedit -> addPosition('name', 'Imię', 'text');
$dbedit -> addPosition('surname', 'Nazwisko', 'text');
$dbedit -> addPosition('enabled', 'Aktywny', 'radio', '', \System::getComboYesNo());
$dbedit -> addPositionHidden('admin', '1');
$dbedit -> addPositionPassword();
$out .= $dbedit->draw();
return $out;
}
public function showAdmins()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Administratorzy' );
$dbrowse = new \DataBrowse( 'pp_users', 'admin = "1" AND login != "Vampirius"' );
$dbrowse -> addPosition( 'login', 'Login', '', '', '', 'login' );
$dbrowse -> addPosition( 'name', 'Imię', '', '', '', 'name' );
$dbrowse -> addPosition( 'surname', 'Nazwisko', '', '', '', 'surname' );
$dbrowse -> addPosition( 'enabled', 'Aktywny', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'id ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'login', 'Login' );
$dbrowse -> addFiltr( 'enabled', 'Aktywny', \System::getComboYesNo() );
$out .= $dbrowse -> draw();
return $out;
}
public function showUsers()
{
$out = \admin\view\PagePanel::show( true, false, false, 'Użytkownicy' );
$dbrowse = new \DataBrowse( 'pp_users', 'admin = "0"' );
$dbrowse -> addPosition( 'login', 'Login', '', '', '', 'login' );
$dbrowse -> addPosition( 'name', 'Imię', '', '', '', 'name' );
$dbrowse -> addPosition( 'surname', 'Nazwisko', '', '', '', 'surname' );
$dbrowse -> addPosition( 'enabled', 'Aktywny', '', \System::getComboYesNo() );
$dbrowse -> addPositionSimple( 'edytuj', '', './?rw=edit' );
$dbrowse -> addPositionSimple( 'usuń', '', '', \System::deleteAction() );
$dbrowse -> setParam( 'id' );
$dbrowse -> addSort( 'id ASC' );
$dbrowse -> addLp();
$dbrowse -> addFiltr( 'login', 'Login' );
$dbrowse -> addFiltr( 'enabled', 'Aktywny', \System::getComboYesNo() );
$out .= $dbrowse -> draw();
return $out;
}
public function editUser( $id = '' )
{
$id ? $value = 'Zapisz' : $value = 'Dodaj';
$out = \admin\view\PagePanel::show( false, $value, true, 'Użytkownicy' );
$dbedit = new \DataEdit( 'pp_users', 'id', $id );
$dbedit -> addPosition( 'login', 'Login', 'text' );
$dbedit -> addPosition( 'name', 'Imię', 'text' );
$dbedit -> addPosition( 'surname', 'Nazwisko', 'text' );
$dbedit -> addPosition( 'enabled', 'Aktywny', 'radio', '', \System::getComboYesNo() );
$dbedit -> addPositionHidden( 'admin', '0' );
$dbedit -> addPositionPassword();
$out .= $dbedit -> draw();
return $out;
}
}
?>