first commit
This commit is contained in:
42
autoload/admin/view/class.GuestBook.php
Normal file
42
autoload/admin/view/class.GuestBook.php
Normal 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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user