form_sanitizer($_POST['file_title'], '', 'file_title'), 'file_url' => form_sanitizer($_POST['file_url'], '', 'file_url'), ]; if (\defender::safe()) { return \defender::serialize(self::$widget_data); } } public function validate_delete() { } public function display_form_input() { $lang = file_exists(WIDGETS."file/locale/".LANGUAGE.".php") ? WIDGETS."file/locale/".LANGUAGE.".php" : WIDGETS."file/locale/English.php"; $widget_locale = fusion_get_locale('', $lang); self::$widget_data = [ 'file_title' => '', 'file_url' => '', ]; if (!empty(self::$colData['page_content'])) { self::$widget_data = \defender::unserialize(self::$colData['page_content']); } echo form_text('file_title', $widget_locale['f0100'], self::$widget_data['file_title'], ['inline' => TRUE, 'required' => TRUE]); echo form_text('file_url', $widget_locale['f0102'], self::$widget_data['file_url'], ['inline' => TRUE, 'required' => TRUE]); } public function display_form_button() { $widget_locale = fusion_get_locale('', WIDGETS."/file/locale/".LANGUAGE.".php"); echo form_button('save_widget', $widget_locale['f0103'], 'widget', ['class' => 'btn-primary']); echo form_button('save_and_close_widget', $widget_locale['f0104'], 'widget', ['class' => 'btn-success']); } }