protected function editorSettings()
 {
     $file = editorTab::getNewEditorTab();
     $file->setName('Súbor');
     $field_file = new editorFieldFileUpload();
     $field_file->setField('file')->setFieldLabel('Súbor')->setFieldHint('Nahrajte súbor potrebný pre miniaplikáciu.');
     $field_file->setAllowedTypes('*.jar; *.swf; *.css; *.js; *.jpg; *.jpeg; *.gif; *.png; *.xml');
     $field_file->setShowFilePath(TRUE);
     $field_file->setRules(array('required' => TRUE, 'messages' => array('required' => 'Súbor je potrebné nahrať.')));
     $field_file->setMaxSize('10MB');
     $field_file->setUploadPath('public/uploads/miniapps');
     $file->addField($field_file);
     $field_miniapp_id = new editorFieldParentIdRecord();
     $field_miniapp_id->setField('miniapp_id');
     $field_miniapp_id->setParentTable('miniapps');
     $field_miniapp_id_else = new editorFieldMMRelation();
     $field_miniapp_id_else->setFilterInFields(array('name'))->setForeignTable('miniapps')->setField('miniapp_id')->setFieldLabel('Miniaplikácia')->setFieldHint('Vyberte miniaplikáciu, ktorej patrí tento súbor.');
     $field_miniapp_id_else->setEditOnly(FALSE);
     $field_miniapp_id_else_name = gridField::newGridField();
     $field_miniapp_id_else_name->setField('name')->setName('Názov miniaplikácie')->setType(GRID_FIELD_TYPE_TEXT);
     $field_miniapp_id_else->addGridField($field_miniapp_id_else_name);
     $field_miniapp_id_else->setRules(array('required' => TRUE, 'min_mm_items' => 1, 'max_mm_items' => 1, 'messages' => array('requited' => 'Je nutná vybrať cieľovú miniaplikáciu', 'min_mm_items' => 'Musí byť zvolená jedna cieľová miniaplikácia.', 'max_mm_items' => 'Cieľová miniaplikácia môže byť iba jedna.')));
     $field_miniapp_id->setElseField($field_miniapp_id_else);
     $file->addField($field_miniapp_id);
     $this->addEditorTab($file);
 }
 protected function editorSettings()
 {
     $image = editorTab::getNewEditorTab();
     $image->setName('Obrázok');
     $field_description = new editorFieldText();
     $field_description->setField('description')->setFieldLabel('Popis')->setFieldHint('Sem zadajte popis pre obrázok.');
     $image->addField($field_description);
     $field_file = new editorFieldFileUpload();
     $field_file->setField('file')->setFieldLabel('Obrázok')->setFieldHint('Vyberte súbor s obrázkom a nahrajte ho na server.');
     $field_file->setAllowedTypes('*.jpg;*.jpeg;*.png;*.gif');
     $field_file->setMaxSize('3MB');
     $field_file->setUploadPath('public/uploads/images/');
     $field_file->setRules(array('required' => TRUE, 'messages' => array('required' => 'Je nutné vybrať nejaký súbor s obrázkom.')));
     $field_file->setUseFancybox(TRUE);
     $image->addField($field_file);
     $this->addEditorTab($image);
 }
 protected function editorSettings()
 {
     $general = editorTab::getNewEditorTab();
     $general->setName('Všeobecné informácie');
     $field_name = new editorFieldText();
     $field_name->setField('name')->setFieldLabel('Názov obdobia')->setFieldHint('Zadajte názov obdobia.');
     $field_name->setRules(array('required' => true, 'messages' => array('required' => 'Je nutné zadať názov obdobia.')));
     $general->addField($field_name);
     $field_start_year = new editorFieldText();
     $field_start_year->setField('start_year')->setFieldLabel('Začiatok obdobia (rok)')->setFieldHint('Zadajte rok, v ktorom sa začalo toto obdobie.');
     $field_start_year->setRules(array('required' => true, 'range' => array(-9999, 9999), 'messages' => array('required' => 'Je nutné zadať rok začiatku obdobia.', 'range' => 'Rok musí byť číslo v rozsahu od {0} do {1}.')));
     $general->addField($field_start_year);
     $field_is_over = new editorFieldSingleCheckbox();
     $field_is_over->setField('_is_over')->setFieldLabel('Obdobie už skončilo')->setFieldHint('Označte, ak obdobie už skončilo.')->setDefaultChecked(FALSE)->setCheckboxText('Áno')->setDefaultValue(1);
     $general->addField($field_is_over);
     $field_end_year = new editorFieldText();
     $field_end_year->setField('end_year')->setFieldLabel('Koniec obdobia (rok)')->setFieldHint('Zadajte rok, v ktorom sa skončilo toto obdobie.');
     $field_end_year->setRules(array('required' => '#' . $field_is_over->getFieldHtmlID() . ':checked', 'range' => array(-9999, 9999), 'greater_than' => '#' . $field_start_year->getFieldHtmlID(), 'messages' => array('required' => 'Je nutné zadať rok konca obdobia.', 'range' => 'Rok musí byť číslo v rozsahu od {0} do {1}.', 'greater_than' => 'Rok konca musí byť väčšie číslo ako rok začiatku.')));
     $general->addField($field_end_year);
     $this->addEditorTab($general);
     $texts = editorTab::getNewEditorTab();
     $texts->setName('Informácie');
     $field_description = new editorFieldTinymce();
     $field_description->setField('description')->setFieldLabel('Detailný text o období')->setFieldHint('Sem vložte text popisujúci obdobie.')->setRules(array('required' => true, 'messages' => array('required' => 'Je potrebné vyplniť túto položku.')));
     $texts->addField($field_description);
     $this->addEditorTab($texts);
     $img = editorTab::getNewEditorTab();
     $img->setName('Pozadie');
     $field_image = new editorFieldFileUpload();
     $field_image->setField('image')->setFieldLabel('Obrázok pozadia')->setFieldHint('Vyberte súbor s obrázkom a nahrajte ho na server.');
     $field_image->setAllowedTypes('*.jpg;*.jpeg;*.png');
     $field_image->setMaxSize('1MB');
     $field_image->setUploadPath('public/uploads/periods/');
     $field_image->setUseFancybox(TRUE);
     $field_image->setRules(array('required' => TRUE, 'messages' => array('required' => 'Je nutné vybrať nejaký súbor s obrázkom.')));
     $img->addField($field_image);
     $field_bg_color = new editorFieldColorPicker();
     $field_bg_color->setField('bg_color')->setFieldLabel('Farba pozadia')->setFieldHint('Zadajte farbu pozadia posuvníka časovej osi.');
     $field_bg_color->setDefaultColor('#000000');
     $img->addField($field_bg_color);
     $field_number_color = new editorFieldColorPicker();
     $field_number_color->setField('number_color')->setFieldLabel('Farba číselnej osi')->setFieldHint('Zadajte farbu číselnej osi na časovej osi.');
     $field_number_color->setDefaultColor('#ffffff');
     $img->addField($field_number_color);
     $field_border_color = new editorFieldColorPicker();
     $field_border_color->setField('border_color')->setFieldLabel('Farba orámovania')->setFieldHint('Zadajte farbu orámovania časovej osi.');
     $field_border_color->setDefaultColor('#000000');
     $img->addField($field_border_color);
     $this->addEditorTab($img);
     $physicists = editorTab::getNewEditorTab();
     $physicists->setName('Fyzici');
     $field_physicists = new editorFieldMMRelation();
     $field_physicists->setField('physicists')->setFieldLabel('Fyzici tohoto obdobia')->setFieldHint('Vyberte fyzikov tohoto obdobia.');
     $field_physicists->setEditOnly(TRUE);
     $field_physicists->setForeignTable('physicists');
     $field_physicists->setFilterInFields(array('name', 'description', 'short_description'));
     $field_physicists_photo = gridField::newGridField();
     $field_physicists_photo_sub = gridField::newGridField();
     $field_physicists_photo_sub->setField('file');
     $field_physicists_photo->setField('PhotoObject')->setType(GRID_FIELD_TYPE_IMAGE)->setName('Fotka')->setWidth('25%');
     $field_physicists_photo->setSubField($field_physicists_photo_sub);
     $field_physicists->addGridField($field_physicists_photo);
     $field_physicists_name = gridField::newGridField();
     $field_physicists_name->setField('name')->setType(GRID_FIELD_TYPE_TEXT)->setName('Meno');
     $field_physicists->addGridField($field_physicists_name);
     $physicists->addField($field_physicists);
     $this->addEditorTab($physicists);
     $inventions = editorTab::getNewEditorTab();
     $inventions->setName('Objavy');
     $field_inventions = new editorFieldMMRelation();
     $field_inventions->setField('inventions')->setFieldLabel('Fyzici tohoto obdobia')->setFieldHint('Vyberte fyzikov tohoto obdobia.');
     $field_inventions->setEditOnly(TRUE);
     $field_inventions->setForeignTable('inventions');
     $field_inventions->setFilterInFields(array('name', 'description', 'short_description'));
     $field_inventions_photo = gridField::newGridField();
     $field_inventions_photo_sub = gridField::newGridField();
     $field_inventions_photo_sub->setField('file');
     $field_inventions_photo->setField('PhotoObject')->setType(GRID_FIELD_TYPE_IMAGE)->setName('Obrázok')->setWidth('25%');
     $field_inventions_photo->setSubField($field_inventions_photo_sub);
     $field_inventions->addGridField($field_inventions_photo);
     $field_inventions_name = gridField::newGridField();
     $field_inventions_name->setField('name')->setType(GRID_FIELD_TYPE_TEXT)->setName('Názov');
     $field_inventions->addGridField($field_inventions_name);
     $inventions->addField($field_inventions);
     $this->addEditorTab($inventions);
 }