function editTab()
 {
     return array(new Hidden('lang', $language), new FormText(__('Language'), google::languages($language)), empty($translation) ? null : '<span class="warning">' . __('Warning - Some of the text has been automatically translated') . '</span>', new Input(__('Title'), 'etitle', $_POST['etitle'] ? $_POST['etitle'] : ($obj->Name ? $obj->Name : @$translation['Name'])), new Li(Short::datetime(__('Publish'), 'estart', $active['start']), $obj->mayI(PUBLISH) ? new Minicheck(__('Activate post'), 'activated', $obj->Activated || $obj->Activated === '' || isset($_POST['activated'])) : null), Short::datetime(__('Hide'), 'eend', $active['stop']), new Checkbox(__('Locked position'), 'elocked', $locked), new ImagePicker(__('Image'), 'eimg', $_POST['eimg'] ? $_POST['eimg'] : $obj->Image), new htmlfield(_('Text'), 'etxt', $_POST['etxt'] ? $_POST['etxt'] : (@$obj->content['Text'] ? @$obj->content['Text'] : @$translation['Text'])), new Checkbox(__('Avoid updating time'), 'eupdate'));
 }
 /**
  * @return string
  */
 private function mainView()
 {
     global $USER, $CONFIG, $DB, $Controller;
     $form = new Form('newEvent');
     $calendarSettings = new Accordion(__('Calendar settings'), new Set(new Checkbox(__('Insert into calendar'), 'einscal'), Short::datetime(__('Starts'), 'cstart'), Short::datetime(__('Ends'), 'cend')));
     $calendarSettings->params = 'collapsible:true,active:false';
     return new Tabber('flows', __('New item'), $form->collection($calendarSettings, new Hidden('esave', 1), new Hidden('edit', $_REQUEST['edit'] ? $_REQUEST['edit'] : 'new'), new Set(new Select(__('Language'), 'lang', google::languages($CONFIG->Site->languages), $_POST['lang'] ? $_POST['lang'] : $USER->settings['language']), new Input(__('Title'), 'etitle', $_POST['etitle']), new ImagePicker(__('Image'), 'eimg'), new Li(Short::datetime(__('Publish'), 'estart', $_POST['estart']), $this->mayI(PUBLISH) ? new Minicheck(__('Activate post'), 'activated', true) : null), Short::datetime(__('Hide'), 'eend', $_POST['eend']), new TagInput(__('Flow'), 'flows', Flow::flows(), $_POST['flows'] ? $_POST['flows'] : '', true, false, 'required'), new htmlfield(_('Text'), 'etxt', $_POST['etxt']))), __('Flows'), $this->flowList());
 }
 function edit()
 {
     global $Controller;
     $groups = $Controller->getClass('Group');
     $startshow = $this->that->getActive();
     $startshow = @$startshow['start'];
     return array(new Formsection(__('Event details'), new Input(__('Title'), 'etitle', $_POST['etitle'] ? $_POST['etitle'] : $this->that->Name), new Select(__('Calendar'), 'calendar', $Controller->getClass('Calendar'), $this->that->calendar), Short::datetime(__('Starts'), 'estart', $this->that->start), Short::datetime(__('Ends'), 'eend', $this->that->end)), new Formsection(__('Description'), new ImagePicker(__('Image'), 'eimg', $_POST['eimg'] ? $_POST['eimg'] : $this->that->Image), new HTMLField(__('Text'), 'etxt', $_POST['etxt'] ? $_POST['etxt'] : $this->that->text)), new Formsection(__('Visibility'), Short::datetime(__('Show from'), 'active', $startshow), new Select(__('Visibility'), 'visibility', $groups, $this->getGroups(), true)), new Formsection(__('Attendance'), new Checkbox(__('Request registration'), 'attendance', $this->that->attendance), new Datepicker(__('Soft deadline'), 'sdeadline', $this->that->soft_deadline, false, __('Blank field disables')), new Datepicker(__('Hard deadline'), 'hdeadline', $this->that->hard_deadline, false, __('Blank field disables')), new Select(__('Contact group'), 'contact', $groups, $_POST['contact'], false, true), new TextArea(__('Attendance information'), 'attinfo', $this->that->attendance_info), new Select(__('Expected attendance'), 'attending_groups', $groups, $this->that->attending_groups, true), new Checkbox(__('Reminder'), 'reminder', $this->that->reminder)));
 }