'Aktualita', 'Table' => 'News', 'Items' => array( 'Title' => array('Type' => 'String', 'Caption' => 'Titulek', 'Default' => ''), 'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''), ), ); function AddFinish() { if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) { $Form = new Form($this->System, $this->ItemFormClass); $Form->LoadValuesFromForm(); $Form->Values['Time'] = 'NOW()'; $Form->Values['User'] = $this->System->Modules['User']->User['Id']; $Form->SaveValuesToDatabase(0); $Output = $this->System->SystemMessage('Nová aktualita', 'Přidáno'); } else $Output = USER_BAD_ROLE; return($Output); } function Add() { if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) { $Form = new Form($this->System, $this->ItemFormClass); $Form->OnSubmit = '?Module=News&Action=AddFinish'; $Output = $Form->ShowEditForm(); } else $Output = USER_BAD_ROLE; return($Output); } function View() { $Output = 'Aktuálně:
'; $DbResult = $this->Database->query('SELECT * FROM News ORDER BY Time DESC LIMIT 10'); while($DbRow = $DbResult->fetch_assoc()) { $Output .= '
'.$DbRow['Title'].'('.$DbRow['Time'].')
'.$DbRow['Content'].'
'; } $Output .= ''; return($Output); } }