You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.2 KiB
76 lines
3.2 KiB
<?php
|
|
#-----------------------------------------------------#
|
|
# Plugin : Couteau Suisse - Licence : GPL #
|
|
# Auteur : Patrice Vanneufville, 2006 #
|
|
# Contact : patrice¡.!vanneufville¡@!laposte¡.!net #
|
|
# Infos : https://contrib.spip.net/?article2166 #
|
|
#-----------------------------------------------------#
|
|
if (!defined("_ECRIRE_INC_VERSION"))
|
|
return;
|
|
|
|
// Ici se definissent les constantes du Couteau Suisse
|
|
|
|
// Ressources distantes
|
|
@define('_URL_CS_GIT', 'https://git.spip.net/');
|
|
@define('_URL_CS_GIT_EXT', _URL_CS_GIT . 'spip-contrib-extensions/');
|
|
@define('_URL_ZONE_EXTRACT', 'https://zone.spip.net/trac/spip-zone/export/');
|
|
@define('_CS_RSS_SOURCE', _URL_CS_GIT_EXT . 'couteau_suisse/commits/branch/master');
|
|
// Doc de contrib.spip.net
|
|
@define('_URL_CONTRIB', 'https://contrib.spip.net/?article');
|
|
// Revisions du CS
|
|
@define('_URL_CS_PLUGIN_XML', _URL_CS_GIT_EXT . 'couteau_suisse/raw/branch/master/plugin.xml');
|
|
@define('_URL_CS_PLUGIN_ZIP', _URL_CS_GIT_EXT . 'couteau_suisse/archive/master.zip');
|
|
|
|
// On met a jour le flux rss toutes les 4 heures
|
|
define('_CS_RSS_UPDATE', 4 * 3600);
|
|
define('_CS_RSS_COUNT', 15);
|
|
// Fichier
|
|
define('_CS_TMP_RSS', _DIR_TMP . 'rss_couteau_suisse.html');
|
|
// Traductions des modules
|
|
define('_CS_TRAD_ACCUEIL', 'https://trad.spip.net/');
|
|
define('_CS_TRAD_MODULE', _CS_TRAD_ACCUEIL . 'tradlang_module/');
|
|
|
|
//define('_MAJ_ECRAN_SECU', _MAJ_ZONE.'browser/_core_/securite/ecran_securite.php?format=txt');
|
|
//define('_MAJ_ECRAN_SECU', _URL_CS_GIT . 'spip/spip/raw/branch/master/config/ecran_securite.php');
|
|
define('_MAJ_ECRAN_SECU', _URL_CS_GIT . 'spip-contrib-outils/securite/raw/branch/master/ecran_securite.php');
|
|
|
|
//puces vertes et rouges pour les outils
|
|
if(defined('_SPIP30300')) { // SPIP >= 3.3
|
|
define('_CS_PUCE_VERTE', chemin_image('puce-publier-8.png'));
|
|
define('_CS_PUCE_ROUGE', chemin_image('puce-refuser-8.png'));
|
|
} else {
|
|
define('_CS_PUCE_VERTE', _DIR_IMG_PACK . 'puce-verte.gif');
|
|
define('_CS_PUCE_ROUGE', _DIR_IMG_PACK . 'puce-rouge.gif');
|
|
}
|
|
|
|
// Qui sont les webmestres et les administrateurs ?
|
|
function get_liste_administrateurs() {
|
|
include_spip('inc/autoriser');
|
|
include_spip('inc/texte');
|
|
$admins = $webmestres = array();
|
|
$s = spip_query("SELECT * FROM spip_auteurs WHERE statut='0minirezo'");
|
|
$fetch = function_exists('sql_fetch') ? 'sql_fetch' : 'spip_fetch_array'; // compatibilite SPIP 1.92
|
|
while ($qui = $fetch($s)) {
|
|
$nom = '<a href="' . generer_url_ecrire(defined('_SPIP30000') ? 'auteur' : 'auteur_infos', "id_auteur=$qui[id_auteur]") . '">' . typo($qui['nom']) . "</a> (id_auteur=$qui[id_auteur])";
|
|
if (autoriser('webmestre', '', '', $qui))
|
|
$webmestres[$qui['id_auteur']] = $nom;
|
|
elseif (autoriser('configurer', 'plugins', '', $qui))
|
|
$admins[$qui['id_auteur']] = $nom;
|
|
}
|
|
return array(
|
|
count($webmestres) ? implode(', ', $webmestres) : _T('couteauprive:variable_vide'),
|
|
count($admins) ? implode(', ', $admins) : _T('couteauprive:variable_vide')
|
|
);
|
|
}
|
|
|
|
// Polices disponibles
|
|
function get_liste_fonts() {
|
|
return array_keys(find_all_in_path('polices/', '\w+\.ttf$'));
|
|
}
|
|
|
|
// Montrer le fichier mes_options.php en cours
|
|
function show_file_options() {
|
|
return cs_root_canonicalize(cs_spip_file_options(3));
|
|
}
|
|
|
|
?>
|