public function modifier($titre, $chapo, $description, $declidisp, $lang)
 {
     $this->verifyLoaded();
     $declinaisondesc = new Declinaisondesc($this->id, $lang);
     $declinaisondesc->titre = $titre;
     $declinaisondesc->chapo = nl2br($chapo);
     $declinaisondesc->description = nl2br($description);
     if ($declinaisondesc->id) {
         $declinaisondesc->maj();
     } else {
         $declinaisondesc->declinaison = $this->id;
         $declinaisondesc->lang = $lang;
         $declinaisondesc->id = $declinaisondesc->add();
     }
     ActionsModules::instance()->appel_module("moddeclinaison", new Declinaison($this->id));
     //declidisp
     if (!empty($declidisp) && is_array($declidisp)) {
         foreach ($declidisp as $declidisp_id => $titre) {
             $declidispdesc = new Declidispdesc($declidisp_id, $lang);
             $declidispdesc->titre = $titre;
             if ($declidispdesc->id) {
                 $declidispdesc->maj();
             } else {
                 $declidispdesc->declidisp = $declidisp_id;
                 $declidispdesc->lang = $lang;
                 $declidispdesc->classement = $this->maxClassement($this->id, $lang) + 1;
                 $declidispdesc->add();
             }
             $declidisp = new Declidisp($declidisp_id);
             ActionsModules::instance()->appel_module("moddeclidisp", $declidisp);
         }
     }
     redirige("declinaison_modifier.php?id=" . $this->id . "&lang=" . $lang);
 }
function modifier($id, $lang, $titre, $chapo, $description, $tabdisp)
{
    $json = new Services_JSON();
    if (!$lang) {
        $lang = 1;
    }
    $declidisp = new Declidisp();
    $declidispdesc = new Declidispdesc();
    $declinaison = new Declinaison();
    $declinaisondesc = new Declinaisondesc();
    $declinaison->charger($id);
    $res = $declinaisondesc->charger($declinaison->id, $lang);
    if (!$res) {
        $temp = new Declinaisondesc();
        $temp->declinaison = $declinaison->id;
        $temp->lang = $lang;
        $temp->add();
        $declinaisondesc->charger($declinaison->id, $lang);
    }
    $declinaisondesc->chapo = $chapo;
    $declinaisondesc->description = $description;
    $declinaisondesc->titre = $titre;
    $declinaisondesc->chapo = str_replace("\n", "<br/>", $declinaisondesc->chapo);
    $declinaisondesc->description = str_replace("\n", "<br/>", $declinaisondesc->description);
    $declinaison->maj();
    $declinaisondesc->maj();
    ActionsModules::instance()->appel_module("moddeclinaison", $declinaison);
    redirige($_SERVER['PHP_SELF'] . "?id=" . $declinaison->id);
}
Ejemplo n.º 3
0
/*      This program is free software; you can redistribute it and/or modify         */
/*      it under the terms of the GNU General Public License as published by         */
/*      the Free Software Foundation; either version 3 of the License                */
/*                                                                                   */
/*      This program is distributed in the hope that it will be useful,              */
/*      but WITHOUT ANY WARRANTY; without even the implied warranty of               */
/*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                */
/*      GNU General Public License for more details.                                 */
/*                                                                                   */
/*      You should have received a copy of the GNU General Public License            */
/*	    along with this program. If not, see <http://www.gnu.org/licenses/>.         */
/*                                                                                   */
/*************************************************************************************/
require_once __DIR__ . "/../pre.php";
require_once __DIR__ . "/../auth.php";
require_once __DIR__ . "/../../fonctions/divers.php";
if (!est_autorise("acces_configuration")) {
    exit;
}
header('Content-Type: text/html; charset=utf-8');
$data = explode('_', $_POST['id']);
$modif = $data[0];
$id = intval($data[1]);
if ($modif == "titredecli") {
    $objdesc = new Declinaisondesc();
    if ($objdesc->charger($id)) {
        $objdesc->titre = $_POST['value'];
        $objdesc->maj();
        echo $objdesc->titre;
    }
}