<?php
if (!defined('_DIR_PLUGIN_EVAECRITURE')){
	$p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(dirname(__FILE__)))));
	define('_DIR_PLUGIN_EVAECRITURE',(_DIR_PLUGINS.end($p)));
}

	include_spip('base/db_mysql');
	include_spip('base/abstract_sql');
  	include_spip('inc/presentation'); 

#############
function exec_eva_ecriture() {
	$bloc = 0;

  GLOBAL $connect_statut;
  if ($connect_statut != '0minirezo') {
    debut_page();
    echo _T('avis_non_acces_page');
    fin_page();
    exit;
  }
	
$icone = _DIR_PLUGIN_EVAECRITURE."/img_pack/logo_ecriture.png";

debut_page(_T('titre'), "saveauto_admin", "plugin"); 
  echo "<br />";
  echo gros_titre(_T('evaecriture:gros_titre_page'));
   
debut_gauche();
debut_boite_info();
	echo '<img src="'._DIR_PLUGIN_EVAECRITURE.'/img_pack/logo_ecriture.png" border="0" alt="logo du plugin eva_ecriture"><br/>';
        echo _T('evaecriture:Gestion des polices de caractères du plugin');
	echo '<br/><br/>';
  	echo _T('evaecriture:siteoff1');
	echo _T('evaecriture:lienoff1');
fin_boite_info();

debut_droite();

################
debut_cadre_enfonce('', false, '', _T('evaecriture:eva_ecriture'));
	echo _T('evaecriture:presentation');
	echo "<ecriture1|texte=Ma première phrase.|police=Boite_pleine.ttf|left>";
        
	debut_cadre_trait_couleur();
		echo bouton_block_invisible($bloc);
   	echo _T('evaecriture:Liste des polices présentes dans le plugin :');
   	echo debut_block_invisible($bloc);
		
$rep = _DIR_PLUGIN_EVAECRITURE."/polices/";
echo "répertoire d'installation des polices :".$rep;
$dir = opendir($rep);

while ($f = readdir($dir)) {
   if(is_file($rep.$f)) {
      echo "<li>Nom de la police: <strong>".$f."</strong></li>";
      echo "<li>Taille du fichier: ".filesize($rep.$f)." octets</li>";
      echo "<li>Exemple : bientot ici</li>";
      echo "<br><br>";
   }
   }
closedir($dir);
   
	fin_block();
	fin_cadre_trait_couleur();

fin_cadre_enfonce();
fin_gauche();
fin_page();
}

?>