source: spip-zone/_plugins_/pgn4spip/branches/formulaires/configurer_pgn4spip.php @ 90061

Last change on this file since 90061 was 90061, checked in by jack@…, 6 years ago

Avant de tout casser on passe le trunk dans "branches"

File size: 1.8 KB
Line 
1<?php
2/**********************************************************************************
3 * @Subject "OK" and "Reinit" buttons for the configurer_pgn4spip.html config form
4 * @package pgn4spip plugin to embed pgn4web Chessboard in a SPIP 3.x article
5 * @version 2.61.0
6 * @copyright copyright (c) 2012 Matt Chesstale
7 * @license GNU General Public License version 3
8 * @language PHP for SPIP 3
9 *
10 * @history: Based on formulaires_configurer_mediabox_traiter_dist() in
11 *                       plugins-dist\mediabox\formulaires\configurer_mediabox.php
12 * @see          http://permalink.gmane.org/gmane.comp.web.spip.devel/62805
13 **********************************************************************************/
14if (!defined("_ECRIRE_INC_VERSION")) return; // No direct access allowed to this file
15define('PLUGIN_Name', "pgn4spip");
16define('PLUGIN_Form', "configurer_" . PLUGIN_Name);
17define('PATH_Conf', PLUGIN_Name . '/' . PLUGIN_Name . '_conf.php');
18if (!function_exists('InitOptionValueByDefault')) require _DIR_PLUGINS . PATH_Conf;
19
20// Implement "Reinit" and "Save" buttons
21function formulaires_configurer_pgn4spip_traiter()
22{
23        include_spip('inc/cvt_configurer'); include_spip('inc/meta');
24        global $optValue; // Current values of options
25
26        if (_request('reinit'))
27        {       // The user clicks to the "reinit" button in the configuration form
28                InitOptionValueByDefault($optValue); // Initial values of options
29                effacer_meta(PLUGIN_Name); // Deleting the configuration restores default settings in the form
30                return array('message_ok'=>_T('pgn4spip:config_reinit'), 'editable'=>true);
31        }
32        else // The user clicks to the "Save" button
33        {       // Save current values of options from the GUI form to the configuration
34                cvtconf_formulaires_configurer_enregistre(PLUGIN_Form, func_get_args());
35                return array('message_ok'=>_T('config_info_enregistree'), 'editable'=>true);
36        }
37}
38?>
Note: See TracBrowser for help on using the repository browser.