Ejemplo n.º 1
0
function substitdossier($texte)
{
    global $id_dossier;
    $tdossier = new Dossier();
    $tdossierdesc = new Dossierdesc();
    $url = "";
    if ($id_dossier) {
        if ($tdossier->charger($id_dossier)) {
            $tdossierdesc->charger($tdossier->id);
            $url = $tdossierdesc->getUrl();
        }
    }
    $racine = new Dossier();
    $racine->charger($tdossier->id);
    while ($racine->parent) {
        $racine->charger($racine->parent);
    }
    $texte = str_replace("#DOSSIER_URL", $url, $texte);
    $texte = str_replace("#DOSSIER_CHAPO", "{$tdossierdesc->chapo}", $texte);
    $texte = str_replace("#DOSSIER_DESCRIPTION", "{$tdossierdesc->description}", $texte);
    $texte = str_replace("#DOSSIER_POSTSCRIPTUM", "{$tdossierdesc->postscriptum}", $texte);
    $texte = str_replace("#DOSSIER_ID", "{$tdossier->id}", $texte);
    $texte = str_replace("#DOSSIER_NOM", "{$tdossierdesc->titre}", $texte);
    $texte = str_replace("#DOSSIER_PARENT", "{$tdossier->parent}", $texte);
    $texte = str_replace("#DOSSIER_RACINE", "{$racine->id}", $texte);
    return $texte;
}
Ejemplo n.º 2
0
function lister_contenuassoc($type, $objet)
{
    if ($type == 1) {
        $obj = new Produit();
        $obj->charger($objet);
    } else {
        $obj = new Rubrique();
        $obj->charger($objet);
    }
    $contenuassoc = new Contenuassoc();
    $contenua = new Contenu();
    $contenuadesc = new Contenudesc();
    $query = "select * from {$contenuassoc->table} where type='{$type}' and objet='{$obj->id}' order by classement";
    $resul = $contenuassoc->query($query);
    $i = 0;
    while ($resul && ($row = $contenuassoc->fetch_object($resul))) {
        $fond = $i++ % 2 ? "fonce" : "claire";
        $contenua->charger($row->contenu);
        $contenuadesc->charger($contenua->id);
        $dossierdesc = new Dossierdesc();
        $dossierdesc->charger($contenua->dossier);
        ?>
		<li class="<?php 
        echo $fond;
        ?>
">
				<div class="cellule" style="width:260px;"><?php 
        echo $dossierdesc->titre;
        ?>
</div>
				<div class="cellule" style="width:260px;"><?php 
        echo $contenuadesc->titre;
        ?>
</div>
				<div class="cellule_supp"><a href="javascript:contenuassoc_supprimer(<?php 
        echo $row->id;
        ?>
, <?php 
        echo $type;
        ?>
,'<?php 
        echo $objet;
        ?>
')"><img src="gfx/supprimer.gif" /></a></div>
		</li>
<?php 
    }
}
 public function getList($type, $objet)
 {
     $return = array();
     if ($type == 1) {
         $objectInstance = new Produit();
         $objectInstance->charger($objet);
     } else {
         $objectInstance = new Rubrique();
         $objectInstance->charger($objet);
     }
     $qList = "SELECT * FROM " . self::TABLE . " WHERE type='{$type}' AND objet='{$objectInstance->id}' ORDER BY classement";
     $rList = $this->query($qList);
     while ($rList && ($theAssociatedContent = $this->fetch_object($rList))) {
         $content = new Contenu($theAssociatedContent->contenu);
         $contentDescription = new Contenudesc();
         $contentDescription->charger($content->id);
         $folderDescription = new Dossierdesc();
         $folderDescription->charger($content->dossier);
         $return[] = array('id' => $theAssociatedContent->id, 'folder_id' => $folderDescription->dossier, 'folder_titre' => $folderDescription->titre, 'content_id' => $contentDescription->contenu, 'content_titre' => $contentDescription->titre);
     }
     return $return;
 }
Ejemplo n.º 4
0
	<?php 
if ($id) {
    ?>
    <tr class="claire">
        <th class="designation"><?php 
    echo trad('Changer_langue', 'admin');
    ?>
</th>
        <th>
        <?php 
    $langl = new Lang();
    $query = "select * from {$langl->table}";
    $resul = mysql_query($query);
    while ($row = mysql_fetch_object($resul)) {
        $langl->charger($row->id);
        $ttrad = new Dossierdesc();
        if (!$ttrad->charger($contenu->dossier, $row->id) && ActionsLang::instance()->get_action_si_trad_absente() == ActionsLang::UTILISER_LANGUE_INDIQUEE) {
            continue;
        }
        ?>
		<div class="flag<?php 
        if ($lang == $langl->id) {
            ?>
Selected<?php 
        }
        ?>
">
		<a href="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?id=<?php 
Ejemplo n.º 5
0
function ancien_rewrite_dos($id, $lang = 1)
{
    $chem = chemin_dos($id);
    if (!empty($chem)) {
        $dossierdesc = new Dossierdesc();
        $listdos = "";
        if (!$dossierdesc->charger($chem[count($chem) - 1]->dossier, $lang)) {
            return "";
        }
        $listdos .= $dossierdesc->titre . "__";
        $dossierdesc->charger($chem[0]->dossier, $lang);
        $listdos .= $dossierdesc->dossier . "_";
        for ($i = count($chem) - 2; $i >= 0; $i--) {
            $dossierdesc->charger($chem[$i]->dossier, $lang);
            $listdos .= $dossierdesc->titre . "_";
        }
        $listdos .= ".html";
        return eregurl($listdos);
    } else {
        return "";
    }
}
Ejemplo n.º 6
0
/*      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_contenu")) {
    exit;
}
header('Content-Type: text/html; charset=utf-8');
list($modif, $id) = explode("_", lireParam("id", "string"));
if (strstr($modif, "dos") !== false) {
    $obj = new Dossier();
    $obj->charger($id);
    $objdesc = new Dossierdesc();
    $objdesc->charger($obj->id);
    $point_entree = "moddcont";
    $champ_parent = "parent";
} else {
    if (strstr($modif, "cont") !== false) {
        $obj = new Contenu();
        $obj->charger($id);
        $objdesc = new Contenudesc();
        $objdesc->charger($obj->id);
        $point_entree = "moddos";
        $champ_parent = "dossier";
    } else {
        exit;
    }
}
Ejemplo n.º 7
0
function arbreOption_dos($depart, $niveau, $pdossier, $dossier, $ok = 1, $lang = false)
{
    $niveau++;
    $tdossier = new Dossier();
    $query = "select * from {$tdossier->table} where parent=\"{$depart}\"";
    $resul = CacheBase::getCache()->query($query);
    for ($i = 0; $i < $niveau; $i++) {
        $espace .= "&nbsp;&nbsp;&nbsp;";
    }
    if ($resul == "" || count($resul) == 0) {
        return "";
    }
    foreach ($resul as $row) {
        $tdossierdesc = new Dossierdesc();
        $tdossierdesc->charger($row->id, $lang);
        if (!$tdossierdesc->affichage_back_office_permis()) {
            continue;
        }
        if ($pdossier == $row->id) {
            $selected = "selected=\"selected\"";
        } else {
            $selected = "";
        }
        if ($ok == 0 || $row->id == $dossier && $ok != -1) {
            $disabled = "disabled=\"disabled\"";
        } else {
            $disabled = "";
        }
        $rec .= "<option value=\"{$row->id}\" {$disabled} {$selected}>" . $espace . $tdossierdesc->titre . "</option>";
        if ($dossier == $row->id && $ok != -1 || $ok == 0) {
            $rec .= arbreOption_dos($row->id, $niveau, $pdossier, $dossier, 0, $lang);
        } else {
            $rec .= arbreOption_dos($row->id, $niveau, $pdossier, $dossier, $ok, $lang);
        }
    }
    return $rec;
}
Ejemplo n.º 8
0
function boucleChemindos($texte, $args)
{
    global $id_dossier;
    // récupération des arguments
    $dossier = lireTag($args, "dossier", "int");
    $profondeur = lireTag($args, "profondeur", "int");
    $niveau = lireTag($args, "niveau", "int");
    if ($dossier == "") {
        return "";
    }
    $res = "";
    $tdossier = new Dossier();
    $tdossier->charger($dossier);
    $tdossierdesc = new Dossierdesc();
    $i = 0;
    if (!$tdossier->parent) {
        return "";
    }
    $dostab = "";
    $tmp = new Dossier();
    $tmp->charger($tdossier->parent);
    $dostab[$i] = new Dossier();
    $dostab[$i++] = $tmp;
    while ($tmp->parent != 0) {
        $tmp = new Dossier();
        $tmp->charger($dostab[$i - 1]->parent);
        $dostab[$i] = new Dossier();
        $dostab[$i++] = $tmp;
    }
    $compt = 0;
    for ($i = count($dostab) - 1; $i >= 0; $i--) {
        if ($profondeur != "" && $compt == $profondeur) {
            break;
        }
        if ($niveau != "" && $niveau != $compt + 1) {
            $compt++;
            continue;
        }
        $tdossierdesc->charger($dostab[$i]->id);
        $temp = str_replace("#ID", $dostab[$i]->id, $texte);
        $temp = str_replace("#TITRE", "{$tdossierdesc->titre}", $temp);
        $temp = str_replace("#URL", $tdossierdesc->getUrl(), $temp);
        $temp = str_replace("#REWRITEURL", $tdossierdesc->getUrl(), $temp);
        $compt++;
        $res .= $temp;
    }
    return $res;
}
Ejemplo n.º 9
0
function lister_dossiers($parent, $critere, $order, $alpha)
{
    $dossier = new Dossier();
    $dossierdesc = new Dossierdesc();
    if ($alpha == "alpha") {
        $query = "select d.id, d.ligne, d.classement from {$dossier->table} d LEFT JOIN {$dossierdesc->table} dd ON dd.dossier=d.id and lang=" . ActionsLang::instance()->get_id_langue_courante() . " where parent=\"{$parent}\" order by dd.{$critere} {$order}";
    } else {
        $query = "select id, ligne, classement from {$dossier->table} where parent=\"{$parent}\" order by {$critere} {$order}";
    }
    $resul = $dossier->query($query);
    $i = 0;
    while ($resul && ($row = $dossier->fetch_object($resul))) {
        $dossierdesc = new Dossierdesc();
        $dossierdesc->charger($row->id);
        if (!$dossierdesc->affichage_back_office_permis()) {
            continue;
        }
        $fond = "ligne_" . ($i++ % 2 ? "claire" : "fonce") . "_rub";
        ?>

<ul class="<?php 
        echo $fond;
        ?>
">
	<li style="width:629px;"><span id="titredos_<?php 
        echo $row->id;
        ?>
" <?php 
        if ($dossierdesc->est_langue_courante()) {
            echo 'class="texte_edit"';
        }
        ?>
><?php 
        echo substr($dossierdesc->titre, 0, 90);
        if (strlen($dossierdesc->titre) > 90) {
            echo " ...";
        }
        ?>
</span></li>
	<li style="width:54px;">
		<input type="checkbox" id="dos_ligne_<?php 
        echo $row->id;
        ?>
" name="ligne[]" class="sytle_checkbox" onchange="checkvalues('lignedos','<?php 
        echo $row->id;
        ?>
')" <?php 
        if ($row->ligne) {
            ?>
 checked="checked" <?php 
        }
        ?>
 />
	</li>
	<li style="width:54px;"><a href="listdos.php?parent=<?php 
        echo $row->id;
        ?>
" class="txt_vert_11"><?php 
        echo trad('parcourir', 'admin');
        ?>
</a></li>
	<li style="width:34px;"><a href="dossier_modifier.php?id=<?php 
        echo $row->id;
        ?>
" class="txt_vert_11"><?php 
        echo trad('editer', 'admin');
        ?>
</a></li>

	<li style="width:71px;">
	 <div class="bloc_classement">
	    <div class="classement"><a href="dossier_modifier.php?id=<?php 
        echo $row->id;
        ?>
&action=modclassement&parent=<?php 
        echo $parent;
        ?>
&type=M"><img src="gfx/up.gif" border="0" /></a></div>
	    <div class="classement"><span id="classementdossier_<?php 
        echo $row->id;
        ?>
" class="classement_edit"><?php 
        echo $row->classement;
        ?>
</span></div>
	    <div class="classement"><a href="dossier_modifier.php?id=<?php 
        echo $row->id;
        ?>
&action=modclassement&parent=<?php 
        echo $parent;
        ?>
&type=D"><img src="gfx/dn.gif" border="0" /></a></div>
	 </div>
	</li>
	<li style="width:37px; text-align:center;"><a href="javascript:supprimer_dossier('<?php 
        echo $row->id;
        ?>
', '<?php 
        echo $parent;
        ?>
')"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
</ul>

<?php 
    }
}
Ejemplo n.º 10
0
$parentnom = $parentdesc->titre;
$res = chemin_dos($parent);
$tot = count($res) - 1;
while ($tot--) {
    ?>
		<img src="gfx/suivant.gif" width="12" height="9" border="0" />
		<a href="listdos.php?parent=<?php 
    echo $res[$tot + 1]->dossier;
    ?>
" class="lien04"><?php 
    echo $res[$tot + 1]->titre;
    ?>
</a>
		<?php 
}
$parentdesc = new Dossierdesc();
$parentdesc->charger($parent);
$parentnom = $parentdesc->titre;
if ($parent != "") {
    ?>
		<img src="gfx/suivant.gif" width="12" height="9" border="0" />
		<?php 
}
?>

	<a href="listdos.php?parent=<?php 
echo $parentdesc->dossier;
?>
" class="lien04"><?php 
echo $parentdesc->titre;
?>
Ejemplo n.º 11
0
function rewrite_dos($id, $lang = false)
{
    $desc = new Dossierdesc($id, $lang);
    return $desc->charger_reecriture()->url;
}
Ejemplo n.º 12
0
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);
}
Ejemplo n.º 13
0
 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);
     }
 }