public static function GfTitleSavePreset() { $fields = array('name', 'font', 'title_color', 'title_size', 'title_bold', 'title_italic', 'title_underline', 'title_shadow_vertical', 'title_shadow_horizontal', 'title_shadow_blur', 'title_shadow_color', 'is_default'); $values = array(); foreach ($fields as $field) { $values[$field] = isset($_POST[$field]) ? $_POST[$field] : null; } if ($values['name'] == null) { $values['name'] = 'auto preset name'; } GFontsDB::SaveTitlePreset($values); $response = array('result' => 0, 'message' => ''); echo json_encode($response); die; }