<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
  $( function() 
  {    
    $( 'textarea' ).ckeditor(
    {
      toolbar : 'MyTool',
      height: '150'
    });    
  });
</script>
<?
global $db;

ob_start();

  echo \Html::textarea(
              array(
                'label'   => 'Nagłówek',
                'name'    => 'newsletter_header',
                'id'      => 'newsletter_header',
                'value'   => $this -> settings['newsletter_header'],
                'inline'  => true
              )
          );
  echo \Html::textarea(
              array(
                'label'   => 'Stopka cz 1. (dołączana zawsze)',
                'name'    => 'newsletter_footer_1',
                'id'      => 'newsletter_footer_1',
                'value'   => $this -> settings['newsletter_footer_1'],
                'inline'  => true
              )
          );
  echo \Html::textarea(
              array(
                'label'   => 'Stopka cz 2. (dołączana tylko w przypadku newslettera)',
                'name'    => 'newsletter_footer_2',
                'id'      => 'newsletter_footer_2',
                'value'   => $this -> settings['newsletter_footer_2'],
                'inline'  => true
              )
          );
  
$out = ob_get_clean();

$grid = new \gridEdit;
$grid -> id               = 'settings-edit';
$grid -> gdb_opt          = $gdb;
$grid -> include_plugins  = true;
$grid -> title            = 'Edycja ustawień';
$grid -> actions          = [ 
                              'save' => [ 'url' => '/admin/newsletter/settings_save/', 'back_url' => '/admin/newsletter/settings/' ], 
                            ];
$grid -> external_code    = $out;
echo $grid -> draw();
?>
<script>CKEDITOR.dtd.$removeEmpty['span'] = false;</script>
<style type="text/css">#g-edit-cancel { display: none; }</style>