X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Fexec%2Fsites.php;fp=www%2Fecrire%2Fexec%2Fsites.php;h=a27bdbd12e3ff9b7a522539633c242d5c5351b18;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c
diff --git a/www/ecrire/exec/sites.php b/www/ecrire/exec/sites.php
new file mode 100644
index 0000000..a27bdbd
--- /dev/null
+++ b/www/ecrire/exec/sites.php
@@ -0,0 +1,348 @@
+array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''));
+
+ $commencer_page = charger_fonction('commencer_page', 'inc');
+ echo $commencer_page("$titre_page","naviguer","sites", $id_rubrique);
+ afficher_site($id_syndic, $id_rubrique, $nom_site, $row);
+ echo fin_gauche();
+ echo fin_page();
+ }
+}
+
+
+// http://doc.spip.org/@afficher_site
+function afficher_site($id_syndic, $id_rubrique, $nom_site, $row){
+
+ global $spip_lang_left,
+$spip_lang_right;
+
+ $cherche_mot = _request('cherche_mot');
+ $select_groupe = _request('select_groupe');
+ $id_secteur = $row["id_secteur"];
+ $url_site = $row["url_site"];
+ $url_syndic = $row["url_syndic"];
+ $descriptif = $row["descriptif"];
+ $syndication = $row["syndication"];
+ $statut = $row["statut"];
+ $date_heure = $row["date"];
+ $date_syndic = $row['date_syndic'];
+ $mod = $row['moderation'];
+ $extra=$row["extra"];
+
+ $flag_administrable = autoriser('modifier','site',$id_syndic);
+ $flag_editable = ($flag_administrable OR ($GLOBALS['meta']["proposer_sites"] > 0 AND ($statut == 'prop')));
+
+ $meme_rubrique = charger_fonction('meme_rubrique', 'inc');
+ $iconifier = charger_fonction('iconifier', 'inc');
+ if ($flag_editable AND ($statut == 'publie'))
+ $dater = charger_fonction('dater', 'inc');
+ $editer_mots = charger_fonction('editer_mots', 'inc');
+ if ($flag_administrable)
+ $instituer_site = charger_fonction('instituer_site','inc');
+
+ echo debut_grand_cadre(true);
+ echo afficher_hierarchie($id_rubrique);
+ echo fin_grand_cadre(true);
+
+ echo debut_gauche('', true);
+ echo debut_boite_info(true);
+ echo pipeline ('boite_infos', array('data' => '',
+ 'args' => array(
+ 'type'=>'site',
+ 'id' => $id_syndic,
+ 'row' => $row
+ )
+ ));
+ echo fin_boite_info(true);
+ echo $iconifier('id_syndic', $id_syndic, 'sites', false, $flag_administrable);
+
+ echo pipeline('affiche_gauche',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''));
+
+ echo creer_colonne_droite('', true);
+ echo $meme_rubrique($id_rubrique, $id_syndic, 'syndic');
+ echo pipeline('affiche_droite',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''));
+
+ echo bloc_des_raccourcis(
+ icone_horizontale(_T('icone_voir_sites_references'), generer_url_ecrire("sites_tous",""), "site-24.gif","rien.gif", false)
+ );
+
+
+ echo debut_droite('', true);
+
+ if ($syndication == 'off' OR $syndication == 'sus')
+ $droit = $id_rubrique;
+ else $droit = 0;
+
+ $url_affichee = $url_site;
+ if (strlen($url_affichee) > 40) $url_affichee = substr($url_affichee, 0, 30)."...";
+
+ $actions =
+ ($flag_editable ? icone_inline(_T('icone_modifier_site'), generer_url_ecrire('sites_edit',"id_syndic=$id_syndic"), "site-24.gif", "edit.gif",$spip_lang_right) : "");
+
+ $haut =
+ "
$actions
".
+ gros_titre($nom_site?$nom_site:"("._T('info_sans_titre_2').")", '' , false)
+ . "$url_affichee";
+
+ $type = 'site';
+ $contexte = array('id'=>$id_syndic,'id_rubrique'=>$id_rubrique);
+ $fond = recuperer_fond("prive/contenu/$type",$contexte);
+ // permettre aux plugin de faire des modifs ou des ajouts
+ $fond = pipeline('afficher_contenu_objet',
+ array(
+ 'args'=>array(
+ 'type'=>$type,
+ 'id_objet'=>$id_syndic,
+ 'contexte'=>$contexte),
+ 'data'=> $fond));
+
+ $fond = "$fond
";
+
+ $onglet_contenu =
+ (_INTERFACE_ONGLETS?
+ ($statut == 'prop' ? ""._T('info_site_propose')." ".affdate($date_heure)."
" : "")
+ . $fond:"")
+
+ . (($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") ?
+ ""
+ . http_img_pack('feed.png', 'RSS'). ''._T('info_site_syndique').'
'
+
+ . (($syndication == "off" OR $syndication=="sus") ?
+ "" . _T('avis_site_syndique_probleme', array('url_syndic' => quote_amp($url_syndic)))
+ . redirige_action_auteur('editer_site', $id_syndic, 'sites', '',
+ "
+ ")
+ . "
"
+ : "")
+
+ . afficher_objets('syndic_article',_T('titre_articles_syndiques'), array('FROM' => 'spip_syndic_articles', 'WHERE' => "id_syndic=$id_syndic", 'ORDER BY' => "date DESC"), $id_syndic)
+
+ . ($date_syndic ? "" . _T('info_derniere_syndication').' '.affdate_heure($date_syndic) .".
" : "")
+ . ""
+ . redirige_action_post('editer_site', $id_syndic, 'sites', "id_syndic=$id_syndic",
+ "
+ ")
+ . "
"
+
+ : choix_feed($id_syndic, $id_rubrique, $nom_site, $row))
+ . (_INTERFACE_ONGLETS?"":($flag_administrable ? options_moderation($row) : ""))
+
+ ;
+
+ $onglet_proprietes =
+ (_INTERFACE_ONGLETS?"":
+ $fond
+ . ($statut == 'prop' ? ""._T('info_site_propose')." ".affdate($date_heure)."
" : "")
+ )
+ . afficher_site_rubrique($id_syndic, $id_rubrique, $id_secteur)
+ . ($dater ? $dater($id_syndic, $flag_editable, $statut, 'syndic', 'sites', $date_heure) : "")
+ . $editer_mots('syndic', $id_syndic, $cherche_mot, $select_groupe, $flag_editable, true, 'sites')
+ . (_INTERFACE_ONGLETS?($flag_administrable ? options_moderation($row) : ""):"")
+ . pipeline('affiche_milieu',array('args'=>array('exec'=>'sites','id_syndic'=>$id_syndic),'data'=>''))
+ ;
+
+ $discuter = charger_fonction('discuter', 'inc');
+ $onglet_discuter = $discuter($id_syndic, 'sites', 'id_syndic');
+ $onglet_documents = "" ;
+ $onglet_interactivite = "";
+
+ echo
+ ""
+ . $haut
+ . afficher_onglets_pages(array(
+ 'voir' => _T('onglet_contenu'),
+ 'props' => _T('onglet_proprietes'),
+ 'docs' => _T('onglet_documents'),
+ 'interactivite' => _T('onglet_interactivite'),
+ 'discuter' => _T('onglet_discuter')),
+ _INTERFACE_ONGLETS?
+ array(
+ 'voir'=>$onglet_contenu,
+ 'props'=>$onglet_proprietes,
+ 'docs'=>$onglet_documents,
+ 'interactivite'=>$onglet_interactivite,
+ 'discuter'=>$onglet_discuter)
+ :array(
+ 'props'=>$onglet_proprietes,
+ 'voir'=>$onglet_contenu )
+ )
+ . "
"
+ . (_INTERFACE_ONGLETS?"":$onglet_discuter);
+}
+
+// http://doc.spip.org/@options_moderation
+function options_moderation($row) {
+
+ global $spip_lang_left;
+
+ if ($row['syndication'] == 'non' or $row['syndication'] == '') return '';
+
+ $id_syndic = $row['id_syndic'];
+ $moderation = $row['moderation'];
+ if ($moderation != 'oui') $moderation='non';
+
+ $res = '';
+ $res .= "".
+ _T('syndic_choix_moderation')
+ . "
"
+ . afficher_choix('moderation', $moderation,
+ array(
+ 'non' => _T('info_publier') .' ('._T('bouton_radio_modere_posteriori').')',
+ 'oui' => _T('info_bloquer') .' ('._T('bouton_radio_modere_priori').')' ))
+ . "
\n";
+
+ // Oublier les vieux liens ?
+ // Depublier les liens qui ne figurent plus ?
+
+ $res .= "\n
"
+ . "\n"._T('syndic_choix_oublier'). '
'
+ . "\n\n";
+
+ $on = array('oui' => _T('item_oui'), 'non' => _T('item_non'));
+ if (!$miroir = $row['miroir'])
+ $miroir = 'non';
+
+ $res .= "\n- "._T('syndic_option_miroir').' '
+ . afficher_choix('miroir', $miroir, $on, " ")
+ . "
\n";
+
+ if (!$oubli = $row['oubli'])
+ $oubli = 'non';
+ $res .= "\n- "
+ . _T('syndic_option_oubli', array('mois' => 2)).' '
+ . afficher_choix('oubli', $oubli, $on," ")
+ . "
\n"
+ . "
\n";
+
+ // Prendre les resumes ou le texte integral ?
+ if (!$resume = $row['resume'])
+ $resume = 'oui';
+
+ $res .= "\n"
+ . _T('syndic_choix_resume')
+ . "\n
"
+ . afficher_choix('resume', $resume,
+ array( 'oui' => _T('syndic_option_resume_oui'),
+ 'non' => _T('syndic_option_resume_non') ))
+ . "
\n";
+
+ // Bouton "Valider"
+ $res .= "\n\n";
+
+ return
+ debut_cadre_relief('feed.png', true, "", _T('syndic_options').aide('artsyn'))
+ . redirige_action_post('editer_site', "options/$id_syndic", 'sites', '', $res)
+ . fin_cadre_relief(true);
+}
+
+// Site pour lesquels feedfinder a un ou plusieurs flux,
+// et l'on propose de choisir
+
+// http://doc.spip.org/@choix_feed
+function choix_feed($id_syndic, $id_rubrique, $nom_site, $row) {
+
+ global $spip_lang_left, $spip_lang_right;
+
+ if (!preg_match(',^\s*select: (.*),', $row['url_syndic'], $regs))
+ return '';
+
+ $url_site = $row["url_site"];
+ $descriptif = $row["descriptif"];
+ $statut = $row["statut"];
+
+ $date_heure = $row["date"];
+ $date_syndic = $row['date_syndic'];
+ $mod = $row['moderation'];
+ $extra=$row["extra"];
+
+ $res = "";
+
+ foreach (array('id_rubrique', 'nom_site', 'url_site', 'descriptif', 'statut') as $var) {
+ $res .= "\n";
+ }
+ $res .= "\n";
+
+ $res = redirige_action_post('editer_site', $id_syndic, 'sites','', $res);
+
+ return debut_cadre_relief('', true) . $res . fin_cadre_relief(true);
+}
+
+// http://doc.spip.org/@afficher_site_rubrique
+function afficher_site_rubrique($id_syndic, $id_rubrique, $id_secteur)
+{
+ global $spip_lang_right;
+
+ if (!_INTERFACE_ONGLETS) return "";
+
+ $chercher_rubrique = charger_fonction('chercher_rubrique', 'inc');
+
+ $form = $chercher_rubrique($id_rubrique, 'site', false);
+ if (strpos($form,''
+ . "";
+ }
+
+ $msg = _T('titre_cadre_interieur_rubrique');
+
+ $form = "\n" . $form;
+ $form = redirige_action_post("editer_site", $id_syndic, 'sites', $form, " class='submit_plongeur'");
+
+ if ($id_rubrique == 0) $logo = "racine-site-24.gif";
+ elseif ($id_secteur == $id_rubrique) $logo = "secteur-24.gif";
+ else $logo = "rubrique-24.gif";
+
+ return debut_cadre_couleur($logo, true, "", $msg) . $form .fin_cadre_couleur(true);
+}
+?>