"; $blocsdispos .= "
"; $blocsdispos .= ""; $blocsdispos .= ""; if ($type == "rubrique" && $id == 0) { $leslangues_menu=explode(",",$GLOBALS['meta']['langues_utilisees']); $def = $GLOBALS['meta']['langue_site']; $blocsdispos .= "
"._T('arty:langue_bloc_assoc'); $blocsdispos .= '

"; } $blocsdispos .= "
"; // liste des blocs associŽs $resultat=spip_query("SELECT * FROM spip_arty_bloclibreassoc WHERE type='$type' AND id=$id"); if (spip_mysql_count($resultat)) { $blocsdispos .= "


"._T('arty:blocs_libres_deja_associes'); $blocsdispos .= ""; if (_SPIP_AJAX) { $blocsdispos .= ""; } } $balancemoica .= cadre_depliable(_DIR_PLUGIN_ARTY."images/bouton-arty.png", _T('arty:associer_un_bloc_libre'), false, $blocsdispos, 'blocs_libres_dispos', 'r'); } // nouveau bloc $texte .= _T('arty:entrez_donnees_nouveau_bloc'); $texte .= "
\n"; $texte .= ""; $texte .= ""; $texte .= "
"; $texte .= "
"._T('arty:bloc_lien')."
"; $texte .= ""; $texte .= "
"._T('arty:bloc_image')."
"; $texte .= "
"; if ($type == "rubrique" && $id == 0) { $leslangues_menu=explode(",",$GLOBALS['meta']['langues_utilisees']); $def = $GLOBALS['meta']['langue_site']; $texte .= "
"._T('arty:langue_bloc'); $texte .= '
"; } $texte .= "
"; $texte .= "
"; $balancemoica .= cadre_depliable(_DIR_PLUGIN_ARTY."images/bouton-arty.png", _T('arty:creer_un_bloc_libre'), false, $texte, 'creer_bloc_libre', 'r'); return $balancemoica; } // formulaire d'ajout/remplacement/suppression d'un bandeau à la rubrique function formulaire_logo($id_groupe) { $texte = "

"._T('arty:intro_up_logo')."

"; traiter_suppression_logo($id_groupe); $message = _T(traiter_upload_image('logo','logo-groupe',$id_groupe)); $texte .= ($message) ? "

".$message."

" : ""; $visible = false; $chem = creer_repertoire_documents("logo-groupe"); $handle = @opendir($chem); while($fichier = @readdir($handle)) { if (ereg("^logo-$id_groupe\.(jpg|png|gif)$", $fichier)) { $logo = $fichier; } } if (!isset($logo)){ $texte .= "

"._T("arty:aucun_logo_rub")."

"; } else { $visible = true; $result = _T("arty:logo_actuel").":
"; // le nombre aléatoire permet d'éviter que le navigateur affiche la version en cache de l'image. $result .= "

["._T('arty:supprimer_logo')."]

"; $texte .= $result; } $texte .= "
"; $texte .= "
"; $texte .= "
"; $texte .= "
"; $data = debut_cadre_couleur("bouton-arty.png", true, "", _T('arty:titre_up_rub_logo')); $data .= block_parfois_visible("logo", _T("arty:invit_up_rub_logo"), $texte, '', $visible); $data .= fin_cadre_couleur(true); return $data; } function bloc_gabarit($type, $id, $url_retour) { if (isset($_POST['action_form']) && isset($_POST['gabarit'])) { if($_POST['action_form'] == 'changer_gabarit' && trim($_POST['gabarit'])!="") { //on peut sauver spip_query("DELETE FROM spip_arty_gabaritassoc WHERE type='$type' AND id=$id"); if ($_POST['gabarit'] !='gabarit_default') { spip_query("INSERT INTO spip_arty_gabaritassoc (gabarit, type, id) VALUES ('".addslashes(trim($_POST['gabarit']))."','$type',$id)"); } } } $resultat = spip_query("SELECT * FROM spip_arty_gabaritassoc WHERE type='$type' AND id=$id"); if (spip_mysql_count($resultat)) { $row=spip_fetch_array($resultat); $gabarit_actuel=$row['gabarit']; } else { $gabarit_actuel='gabarit_default'; } $ignore_liste = Array(".svn", ".", ".."); $rep = _DIR_PLUGIN_ARTY."definitions-gabarits"; $handle = opendir($rep); $balancemoica = debut_cadre_relief(_DIR_PLUGIN_ARTY."/images/bouton-arty.png", true, "", _T('arty:associer_un_gabarit')); $balancemoica .= _T('arty:intro_associer_gabarit')."

"; $balancemoica .= _T('arty:choisissez_un_gabarit').":
"; $balancemoica .="
"; $gabarits=array(); $gabaritpardefaut=array("sommaire","rubrique","article"); $ignore_liste=array(".","..",".DS_Store"); $rep = _DIR_PLUGIN_ARTY."definitions-gabarits"; $handle = opendir($rep); while($fichier = readdir($handle)) { if (!in_array($fichier, $ignore_liste) && eregi('^[a-zA-Z0-9_-]*\.xml$',$fichier)) { $p =& new xmlParser(); $p->parse($rep.'/'.$fichier); if (!in_array(ereg_replace("\.xml$","",$fichier),$gabaritpardefaut)) { $gabarits[$p->output[0]['attrs']['TYPE']][] = ereg_replace("\.xml$","",$fichier); } $liste_gabarit[]=ereg_replace("\.xml$","",$fichier); } } //gabarits du dossier "pages-custom" (surclassage) $rep_custom = _DIR_RACINE."pages-custom/gabarits"; if (file_exists($rep_custom)) { $handle = opendir($rep_custom); while($fichier = readdir($handle)) { if (!in_array($fichier, $ignore_liste) && eregi('^[a-zA-Z0-9_-]*\.xml$',$fichier) && !in_array($fichier, $liste_gabarit)) { $p =& new xmlParser(); $p->parse($rep_custom.'/'.$fichier); $nom_gabarit = ereg_replace("\.xml$","",$fichier); $type_gabarit = $p->output[0]['attrs']['TYPE']; if (!in_array($nom_gabarit, $gabaritpardefaut) && !in_array($nom_gabarit, $gabarits[$type_gabarit])) { $gabarits[$type_gabarit][] = ereg_replace("\.xml$","",$fichier); } $liste_gabarit[] = ereg_replace("\.xml$","",$fichier); } } } //gabarits de la base de données $query = spip_query('SELECT * FROM spip_arty_gabarit_perso'); while ($row = spip_fetch_array($query)) { if (!in_array($row['nom'], $liste_gabarit)) { $liste_gabarit[] = $row['nom']; $donnees = $row['type']; $gabarits[$donnees][] = $row['nom']; } } // faire le menu deroulant $leselect=""; $leselect .=""; $balancemoica .= $leselect; $balancemoica .=""; $balancemoica .= "

"; $balancemoica .="
"; // bouton de modification du gabarit + retour $balancemoica .= "
"; $balancemoica .= ""; $balancemoica .= "
"; $balancemoica .= "
"; $balancemoica .= fin_cadre_couleur(true); // formulaire de creation d'un gabarit à partir de la page $balancemoica .= debut_cadre_relief(_DIR_PLUGIN_ARTY."/images/bouton-arty.png", true, "", _T('arty:creer_gabarit_et_associer')); $balancemoica .= "
\n"; $balancemoica .= ""; $balancemoica .= "

"._T("arty:deriver_gabarit")."

"; $balancemoica .= ""; $balancemoica .= ""; $balancemoica .= "
"; $balancemoica .= "

"._T("arty:baser_gabarit_sur")."

"; $balancemoica .= ""; $balancemoica .= "
"; $balancemoica .= "
"; $balancemoica .= ""; $balancemoica .= fin_cadre_relief(true); closedir($handle); return $balancemoica; } function bloc_formulaire_themes($type, $id, $url_retour) { if (isset($_POST['action_form']) && isset($_POST['theme'])) { if($_POST['action_form'] == 'changer_theme' && trim($_POST['theme'])!="") { //print_r($_POST); //on peut sauver spip_query("DELETE FROM spip_arty_themeassoc WHERE type='$type' AND id=$id"); if ($_POST['theme'] !='theme_default') { spip_query("INSERT INTO spip_arty_themeassoc (theme, type, id) VALUES ('".addslashes(trim($_POST['theme']))."','$type',$id)"); } } } $resultat = spip_query("SELECT * FROM spip_arty_themeassoc WHERE type='$type' AND id=$id"); if (spip_mysql_count($resultat)) { $row=spip_fetch_array($resultat); $theme=$row['theme']; } else { $theme='theme_default'; } $ignore_liste = Array(".svn", ".", "..",".DS_Store"); $rep = _DIR_PLUGIN_ARTY."themes"; $handle = opendir($rep); $balancemoica = debut_cadre_relief(_DIR_PLUGIN_ARTY."/images/bouton-arty.png", true, "", _T('arty:associer_un_theme')); $balancemoica .="
"; $balancemoica .=""; $balancemoica .=""; $balancemoica .= ""; $balancemoica .= fin_cadre_relief(true); $balancemoica .="
"; closedir($handle); return $balancemoica; } // formulaire d'ajout/remplacement/suppression d'un bandeau à la rubrique function formulaire_bandeau($id_rubrique) { $texte = "

"._T('arty:intro_up_rub_bandeau')."

"; //$message = _T(traiter_upload_bandeau($id_rubrique)); //$texte .= ($message) ? "

".$message."

" : ""; $visible = false; $chem = creer_repertoire_documents("bandeau"); $handle = @opendir($chem); while($fichier = @readdir($handle)) { if (ereg("^bandeau-$id_rubrique\.(jpg|png|gif)$", $fichier)) { $bandeau = $fichier; } } if (!$bandeau){ # Formulaire à la mode CVT $contexte = array('id_rubrique'=>$id_rubrique,'largeurMax'=>186,'hauteurMax'=>186); $texte .= recuperer_fond('prive/upload_bandeau', $contexte); } else { # le nombre aléatoire permet d'éviter que le navigateur affiche la version en cache de l'image. $reducImg = image_reduire("", "186", "186"); $texte .= "
".$reducImg; $request = "?exec=naviguer&id_rubrique=".$id_rubrique."&action=supprimer_bandeau&id_check=".$_SESSION['id_check']; $AjAxtion = ajax_action_declencheur ($request, "bandeau_icone", $fct_ajax=""); $texte .= "

["._T('lien_supprimer')."]

"; $texte .= "
"; } $visible = (($bandeau != "")?true:false); $bouton = bouton_block_depliable(_T("arty:titre_up_rub_bandeau"), $visible, "bandeau"); $data = debut_cadre('r', _DIR_PLUGIN_ARTY."images/bouton-arty.png", '', $bouton, '', '', false); $data .= debut_block_depliable($visible, "bandeau")."
".$texte."
".fin_block(); $data .= fin_cadre_relief(true); return $data; } ?>