<?
global $db;

ob_start();
?>
<?
echo \Html::input(
        array(
                'type'  => 'text',
                'label' => 'Tekst',
                'name'  => 'text',
                'class' => 'require',
                'value' => $this -> translation['text']
        )
);

if ( is_array( $this -> languages ) ): foreach ( $this -> languages as $language ):
    echo \Html::input(
            array(
                    'type'  => 'text',
                    'label' => $language['name'],
                    'name'  => $language['id'],
                    'value' => $this -> translation[$language['id']]
    ) );
  endforeach;
endif;
$out = ob_get_clean();

$grid                    = new \gridEdit;
$grid -> id              = 'translation-edit';
$grid -> gdb_opt         = $gdb;
$grid -> include_plugins = true;
$grid -> title           = 'Edycja tłumaczenia';
$grid -> fields          = [
        [
                'db'    => 'id',
                'type'  => 'hidden',
                'value' => $this -> translation['id']
        ]
];
$grid -> external_code   = $out;
$grid -> actions         = [
        'save'   => [ 'url' => '/admin/languages/translation_save/', 'back_url' => '/admin/languages/translation_list/' ],
        'cancel' => [ 'url' => '/admin/languages/translation_list/' ]
];
$grid -> persist_edit    = true;
$grid -> id_param        = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
  $(function ()
  {
    disable_menu();

    $('input[type="text"].date').datetimepicker({
      format: "YYYY-MM-DD",
      pickTime: false
    });
  });
</script>