X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fexec%2Fbrouteur_frame.php;fp=www%2Fecrire%2Fexec%2Fbrouteur_frame.php;h=ad15107da49a069f2450f276794dbcbf5a9953f6;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/exec/brouteur_frame.php b/www/ecrire/exec/brouteur_frame.php new file mode 100644 index 0000000..ad15107 --- /dev/null +++ b/www/ecrire/exec/brouteur_frame.php @@ -0,0 +1,255 @@ +\n" + . "brouteur_frame\n" + . "\n" + . envoi_link(_T('info_mon_site_spip')) + . http_script('jQuery(function(){ + jQuery("a.iframe").click(function(){ + window.open(this.href,"iframe"+this.rel); + return false; + }); +});') + . "\n") + .""; + + if ($spip_ecran == "large") { + $nb_col = 4; + } else { + $nb_col = 3; + } + + if ($effacer_suivant == "oui" && $frame < $nb_col) { + $res = ''; + for ($i = $frame+1; $i < $nb_col; $i++) { + $res .= "\nparent.iframe$i.location.href='" . generer_url_ecrire('brouteur_frame',"frame=$i$profile") . "'"; + } + echo http_script($res); + } + echo "\n
"; + + if ($special == "redac") { + $result=sql_select("articles.id_article, articles.id_rubrique, articles.titre, articles.statut", "spip_articles AS articles LEFT JOIN spip_auteurs_articles AS lien ON articles.id_article=lien.id_article", "articles.statut = 'prepa' AND lien.id_auteur = $connect_id_auteur ", " id_article ", " articles.date DESC"); + $res = ''; + while($row=sql_fetch($result)){ + $id_article=$row['id_article']; + if (autoriser('voir','article',$id_article)){ + $titre = typo($row['titre']); + $statut = $row['statut']; + $h = generer_url_ecrire('articles',"id_article=$id_article"); + $res .= "$titre"; + } + } + if ($res) { + echo "\n
"._T("info_cours_edition")."
"; + echo "\n
", $res, "
"; + } + + } else if ($special == "valider") { + $result=sql_select("id_article, id_rubrique, titre, statut", "spip_articles", "statut = 'prop'", "", "date DESC"); + $res = ''; + while($row=sql_fetch($result)){ + $id_article=$row['id_article']; + if (autoriser('voir','article',$id_article)){ + $titre = typo($row['titre']); + $statut = $row['statut']; + $h = generer_url_ecrire('articles',"id_article=$id_article"); + $res .= "$titre"; + } + } + + if ($res) { + echo "\n
"._T("info_articles_proposes")."
"; + echo "\n
", $res, "
"; + } + + $result=sql_select("*", "spip_breves", "statut = 'prop'", "", "date_heure DESC", "20"); + $res = ''; + while($row=sql_fetch($result)){ + $id_breve=$row['id_breve']; + if (autoriser('voir','breve',$id_breve)){ + $titre = typo($row['titre']); + $statut = $row['statut']; + $h = generer_url_ecrire('breves_voir',"id_breve=$id_breve"); + $res .= "$titre"; + } + } + if ($res) { + echo "\n
"._T("info_breves_valider")."
"; + echo "\n
", $res, "
"; + } + + } + else { + if ($id_rubrique !== "" AND autoriser('voir','rubrique',$id_rubrique)) { + + $row = sql_fetsel("id_rubrique, titre, id_parent", "spip_rubriques", "id_rubrique=$id_rubrique",'', '0+titre,titre'); + + if ($row){ + $titre = typo($row['titre']); + $id_parent=$row['id_parent']; + + if ($id_parent == 0) $icone = "secteur-24.gif"; + else $icone = "rubrique-24.gif"; + + echo "\n
"; + echo icone_horizontale($titre, "javascript:window.parent.location=\"" . generer_url_ecrire('naviguer',"id_rubrique=$id_rubrique") .'"', $icone, "", false); + echo "
"; + } else if ($frame == 0) { + echo "\n
"; + echo icone_horizontale(_T('info_racine_site'), "javascript:window.parent.location=\"" . generer_url_ecrire('naviguer') . '"', "racine-site-24.gif","", false); + echo "
"; + } + + $result = sql_select("id_rubrique, titre, id_parent", "spip_rubriques", "id_parent=$id_rubrique",'', '0+titre,titre'); + + while($row=sql_fetch($result)){ + $ze_rubrique=$row['id_rubrique']; + if (autoriser('voir','rubrique',$ze_rubrique)){ + $titre = typo($row['titre']); + $id_parent=$row['id_parent']; + + echo "\n
"; + + if ($id_parent == '0') { + echo "\n
", + $titre, + "
"; + } + else { + if ($frame+1 < $nb_col) + echo "\n
$titre
"; + else echo "\n
",$titre,"
"; + } + echo "
\n"; + } + } + + + if ($id_rubrique > 0) { + if ($peutpub) + $result = sql_select("id_article, id_rubrique, titre, statut", "spip_articles", "id_rubrique=$id_rubrique", "", "date DESC"); + else + $result = sql_select("articles.id_article, articles.id_rubrique, articles.titre, articles.statut", "spip_articles AS articles, spip_auteurs_articles AS lien", "articles.id_rubrique=$id_rubrique AND (articles.statut = 'publie' OR articles.statut = 'prop' OR (articles.statut = 'prepa' AND articles.id_article = lien.id_article AND lien.id_auteur = $connect_id_auteur)) ", " id_article ", " articles.date DESC"); + $res = ''; + while($row=sql_fetch($result)){ + $id_article=$row['id_article']; + if (autoriser('voir','article',$id_article)){ + $titre = typo($row['titre']); + $statut = $row['statut']; + $h = generer_url_ecrire('articles',"id_article=$id_article"); + $res .= "$titre"; + } + } + if ($res) { + echo "\n
"._T('info_articles')."
"; + echo "\n
", $res, "
"; + } + + $result=sql_select("*", "spip_breves", "id_rubrique=$id_rubrique", "", "date_heure DESC", "20"); + $res = ''; + while($row=sql_fetch($result)){ + $id_breve=$row['id_breve']; + if (autoriser('voir','breve',$id_breve)){ + $titre = typo($row['titre']); + $statut = $row['statut']; + $h = generer_url_ecrire('breves_voir',"id_breve=$id_breve"); + $res .= "$titre"; + } + } + if ($res) { + echo "\n
"._T('info_breves_02')."
"; + echo "\n
", $res, "
"; + + } + + $result=sql_select("*", "spip_syndic", "id_rubrique=$id_rubrique AND statut!='refuse'", "", "nom_site"); + $res = ''; + while($row=sql_fetch($result)){ + $id_syndic=$row['id_syndic']; + if (autoriser('voir','site',$id_syndic)){ + $titre = typo($row['nom_site']); + $statut = $row['statut']; + $h = generer_url_ecrire('sites',"id_syndic=$id_syndic"); + $res .= "\n
$titre
"; + } + } + if ($res) + echo "\n
"._T('icone_sites_references')."
", $res; + } + + // en derniere colonne, afficher articles et breves + if ($frame == 0 AND $id_rubrique==0) { + + $cpt = sql_fetsel('A.id_article', "spip_auteurs_articles AS A LEFT JOIN spip_articles AS L ON A.id_article = L.id_article", "L.statut = 'prepa' AND A.id_auteur=$connect_id_auteur", "A.id_article"); + + if ($cpt) { + + echo "\n
", + _T("info_cours_edition"),"
"; + } + + $cpt = sql_countsel("spip_articles AS articles", "articles.statut = 'prop'"); + if (!$cpt) + $cpt = sql_countsel("spip_breves", "statut = 'prop'"); + if ($cpt) + echo "\n
", + _T("info_articles_proposes"), + " / "._T("info_breves_valider")."
"; + } + } + } + echo "
"; + + echo ""; +} + +// http://doc.spip.org/@frame_background_image +function frame_background_image($f) +{ + return "background-image: url(" . + chemin_image($f) . + ")"; +} +?>