function ajouter($parent, $lang, $titre, $chapo, $description, $postscriptum, $ligne) { $dossier = new Dossier(); $dossier->parent = $parent; if ($ligne != "") { $dossier->ligne = 1; } else { $dossier->ligne = 0; } if ($parent == "") { $parent = 0; } $lastid = $dossier->add(); $dossier->charger($lastid); $dossier->maj(); $dossierdesc = new Dossierdesc(); $dossierdesc->dossier = $lastid; $dossierdesc->lang = $lang; $dossierdesc->titre = $titre; $dossierdesc->chapo = $chapo; $dossierdesc->description = $description; $dossierdesc->postscriptum = $postscriptum; $dossierdesc->add(); $dossierdesc->reecrire(); ActionsModules::instance()->appel_module("ajoutdos", $dossier); redirige($_SERVER['PHP_SELF'] . "?id=" . $lastid . "&lang=" . $lang); }
public function modify($lang, $parent, $online, $title, $chapo, $description, $postscriptum, $urlsuiv, $rewriteurl, $images, $documents, $tab) { if ($this->id == '') { throw new TheliaAdminException("Folder not found", TheliaAdminException::FOLDER_NOT_FOUND); } $dossierdesc = new Dossierdesc($this->id, $lang); if ($dossierdesc->id == '') { CacheBase::getCache()->reset_cache(); $dossierdesc->dossier = $this->id; $dossierdesc->lang = $lang; $dossierdesc->id = $dossierdesc->add(); } $this->oldParent = $this->parent; if ($this->parent != $parent) { $this->checkOrder($parent); } $this->parent = $parent; $this->ligne = $online == 'on' ? 1 : 0; $dossierdesc->chapo = str_replace("\n", "<br />", $chapo); $dossierdesc->titre = $title; $dossierdesc->postscriptum = $postscriptum; $dossierdesc->description = $description; $this->maj(); $dossierdesc->maj(); $dossierdesc->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("moddos", $this); if ($urlsuiv) { redirige('listdos.php?parent=' . $this->dossier); } else { redirige('dossier_modifier.php?id=' . $this->id . '&tab=' . $tab . '&lang=' . $lang); } }