<?
global $db;
ob_start();
?>
<?= \Html::input( [
  'label' => 'Strona',
  'name' => 'strona',
  'id' => 'strona',
  'value' => $this -> topic['strona'],
  'inline' => true
] );?>
<?= \Html::input( [
  'label' => 'Kategoria',
  'name' => 'kategoria',
  'id' => 'kategoria',
  'value' => $this -> topic['kategoria'],
  'inline' => true
] );?>
<?= \Html::input( [
  'label' => 'Kategoria ID',
  'name' => 'kategoria_id',
  'id' => 'kategoria_id',
  'value' => $this -> topic['kategoria_id'],
  'inline' => true
] );?>
<?= \Html::input( [
  'label' => 'Link',
  'name' => 'link',
  'id' => 'link',
  'value' => $this -> topic['link'],
  'inline' => true
] );?>
<?= \Html::input( [
  'label' => 'Temat',
  'name' => 'temat',
  'id' => 'temat',
  'value' => $this -> topic['temat'],
  'inline' => true
] );?>
<?= \Html::input( [
  'label' => 'Data publikacji',
  'name' => 'data_publikacji',
  'id' => 'data_publikacji',
  'value' => $this -> topic['data_publikacji'],
  'inline' => true
] );?>
<?= \Html::input_switch( [
  'label' => 'Opublikowany',
  'name' => 'opublikowany',
  'id' => 'opublikowany',
  'checked' => $this -> topic['opublikowany'] == 1 ? true : false,
  'inline' => true
] );?>
<?= \Html::input_switch( [
  'label' => 'Zaakceptowany',
  'name' => 'zaakceptowany',
  'id' => 'zaakceptowany',
  'checked' => $this -> topic['zaakceptowany'] == 1 ? true : false,
  'inline' => true
] );?>
<?
$out = ob_get_clean();

$grid = new \gridEdit;
$grid -> id = 'client-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja <strong>tematu zbiorowego</strong>';
$grid -> fields = [
  [
    'db' => 'id',
    'type' => 'hidden',
    'value' => $this -> topic['id']
  ]
];
$grid -> external_code = $out;
$grid -> actions = [
    'save'   => [ 'url' => '/backend_sites/topic_save/', 'back_url' => '/backend_sites/topics/' ],
    'cancel' => [ 'url' => '/backend_sites/topics/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>