$obj->charger($id); $objdesc = new Contenudesc(); $objdesc->charger($obj->id); $point_entree = "moddos"; $champ_parent = "dossier"; } else { exit; } } switch ($modif) { case 'titrecont': case 'titredos': $objdesc->titre = lireParam("value", "string"); echo $objdesc->titre; break; case 'lignecont': case 'lignedos': $obj->ligne = $obj->ligne ? 0 : 1; break; case 'lignetouscont': case 'lignetousdos': $ligne = lireParam("ligne", "int"); $parent = intval(lireParam("parent", "int")); $obj->query("update {$obj->table} set ligne={$ligne} where {$champ_parent}={$parent}"); break; default: exit; } $obj->maj(); $objdesc->maj(); ActionsModules::instance()->appel_module($point_entree, $obj);
function modifier($id, $lang, $dossier, $ligne, $titre, $chapo, $description, $postscriptum, $urlsuiv, $urlreecrite) { if (!isset($id)) { $id = ""; } if (!$lang) { $lang = 1; } $contenu = new Contenu(); $contenudesc = new Contenudesc(); $contenu->charger($id); $res = $contenudesc->charger($contenu->id, $lang); if (!$res) { CacheBase::getCache()->reset_cache(); $temp = new Contenudesc(); $temp->contenu = $contenu->id; $temp->lang = $lang; $lastid = $temp->add(); $contenudesc = new Contenudesc(); $contenudesc->charger_id($lastid); } $contenu->datemodif = date("Y-m-d H:i:s"); if ($contenu->dossier != $dossier) { $param_old = Contenudesc::calculer_clef_url_reecrite($contenu->id, $contenu->dossier); $param_new = Contenudesc::calculer_clef_url_reecrite($contenu->id, $dossier); $reecriture = new Reecriture(); $query_reec = "select * from {$reecriture->table} where param='&{$param_old}' and lang={$lang} and actif=1"; $resul_reec = $reecriture->query($query_reec); while ($row_reec = $reecriture->fetch_object($resul_reec)) { $tmpreec = new Reecriture(); $tmpreec->charger_id($row_reec->id); $tmpreec->param = "&{$param_new}"; $tmpreec->maj(); } $contenu->dossier = $dossier; $contenu->classement = $contenu->prochain_classement(); } if ($ligne == "on") { $contenu->ligne = 1; } else { $contenu->ligne = 0; } $contenudesc->chapo = $chapo; $contenudesc->description = $description; $contenudesc->postscriptum = $postscriptum; $contenudesc->titre = $titre; $contenudesc->chapo = str_replace("\n", "<br/>", $contenudesc->chapo); $contenu->maj(); $contenudesc->maj(); $contenudesc->reecrire($urlreecrite); ActionsModules::instance()->appel_module("modcont", $contenu); if ($urlsuiv) { redirige("listdos.php?parent=" . $contenu->dossier); } else { redirige("" . $_SERVER['PHP_SELF'] . "?id=" . $contenu->id . "&dossier=" . $contenu->dossier . "&lang=" . $lang); } exit; }
public function modify($lang, $folder, $online, $title, $chapo, $description, $postscriptum, $urlsuiv, $rewriteurl, $images, $documents, $tab) { if ($this->id == '') { throw new TheliaAdminException("Content not found", TheliaAdminException::CONTENT_NOT_FOUND); } $contenudesc = new Contenudesc($this->id, $lang); if ($contenudesc->id == '') { CacheBase::getCache()->reset_cache(); $contenudesc->contenu = $this->id; $contenudesc->lang = $lang; $contenudesc->id = $contenudesc->add(); } $this->oldFolder = $this->dossier; $this->datemodif = date('Y-m-d H:i:s'); if ($this->dossier != $folder) { $this->checkRewrite($folder); $this->checkOrder($folder); } $this->ligne = $online == 'on' ? 1 : 0; $contenudesc->chapo = str_replace("\n", "<br />", $chapo); $contenudesc->titre = $title; $contenudesc->postscriptum = $postscriptum; $contenudesc->description = $description; $this->maj(); $contenudesc->maj(); $contenudesc->reecrire($rewriteurl); $this->setLang($lang); $this->updateImage($images); $this->getImageFile()->ajouter("photo", array("jpg", "gif", "png", "jpeg"), "uploadimage"); $this->updateDocuments($documents); $this->getDocumentFile()->ajouter("document_", array(), "uploaddocument"); ActionsModules::instance()->appel_module("modcont", new Contenu($this->id)); if ($urlsuiv) { redirige('listdos.php?parent=' . $this->dossier); } else { redirige('contenu_modifier.php?id=' . $this->id . '&dossier=' . $this->dossier . '&tab=' . $tab . '&lang=' . $lang); } }