Author: cedric.morin@yterium.com
Date: Wed Apr 26 15:20:25 2006
New Revision: 2904
Log:
retablir le commit que trac a avalé : je t'ai a l'oeil ce coup ci !
Modified:
_plugins_/_amelioration_admin_/skel_editor/exec/skeleditor.php
_plugins_/_amelioration_admin_/skel_editor/inc_skeleditor.php
Modified: _plugins_/_amelioration_admin_/skel_editor/exec/skeleditor.php
--- _plugins_/_amelioration_admin_/skel_editor/exec/skeleditor.php (original)
+++ _plugins_/_amelioration_admin_/skel_editor/exec/skeleditor.php Wed Apr 26 15:20:25 2006
@@ -1,5 +1,8 @@
<?php
// display all skel files and folders
+
+define('_DIR_PLUGIN_SKELEDITOR',(_DIR_PLUGINS.end(explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(dirname(__FILE__))))))));
+
function show_skel_file($path,$current_file) {
$listed_extension = array("htm","html","xml","svg","php","php3","php4","py","sh","sql","css","rdf","txt","nfo","log","js","as");
$img_extension = array("jpg","png","gif","ico","bmp");
@@ -17,7 +20,7 @@
// directory of file ?
if (is_dir($entirePath)) {
$output .= bouton_block_invisible(md5($myfile));
- $output .= "<img src='../plugins/skel_editor/img_pack/folder.png' alt='directory' /> $myfile";
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/folder.png' alt='directory' /> $myfile";
if(!strstr($current_file,$entirePath)) $output .= debut_block_invisible(md5($myfile));
$output .= show_skel_file(substr($path,3)."/".$myfile,$current_file); // recursive !
if(!strstr($current_file,$entirePath)) $output .= fin_block();
@@ -26,13 +29,13 @@
else $expose="";
$extension = strtolower(substr($myfile, strrpos($myfile,".")+1));
if (in_array($extension,$listed_extension)) {
- $output .= "<img src='../plugins/skel_editor/img_pack/file.png' alt='file' /> ";
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/file.png' alt='file' /> ";
$output .= "<a href=\"?exec=skeleditor&f=".urlencode($entirePath)."\"$expose>$myfile</a>";
} else if (in_array($extension,$img_extension)) {
- $output .= "<img src='../plugins/skel_editor/img_pack/img.png' alt='file' /> ";
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/img.png' alt='file' /> ";
$output .= "<a href=\"?exec=skeleditor&f=".urlencode($entirePath)."\"$expose>$myfile</a>";
} else {
- $output .= "<img src='../plugins/skel_editor/img_pack/unknown.png' alt='unknown' /> ";
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/unknown.png' alt='unknown' /> ";
$output .= "<span style='color:#aaa'>$myfile</span>";
}
}
@@ -65,7 +68,7 @@
function editor_addfile() {
global $dossier_squelettes;
$output = bouton_block_invisible('editor_newfile');
- $output .= "<img src='../plugins/skel_editor/img_pack/action_add.png' alt='new' />"._T("skeleditor:fichier_nouveau");
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/action_add.png' alt='new' />"._T("skeleditor:fichier_nouveau");
$output .= debut_block_invisible('editor_newfile');
$output .= "<form method='get'>\n";
$output .= "<input type='hidden' name='exec' value='skeleditor' />";
@@ -85,7 +88,7 @@
function editor_uploadfile() {
global $dossier_squelettes;
$output = "<br />".bouton_block_invisible('editor_uploadfile');
- $output .= "<img src='../plugins/skel_editor/img_pack/action_add.png' alt='new' />"._T("skeleditor:fichier_upload");
+ $output .= "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/action_add.png' alt='new' />"._T("skeleditor:fichier_upload");
$output .= debut_block_invisible('editor_uploadfile');
$output .= "<form method='post' enctype='multipart/form-data' >\n";
@@ -365,8 +368,8 @@
} else {
// tools bar
echo "<div id='skel_toolbar' style='width:100%;text-align:right;'>\n";
- echo "<img src='../plugins/skel_editor/img_pack/action_dl.png' alt='download' /><a href=\"?exec=skeleditor&f=".urlencode($file_name)."&action=download\">"._T("skeleditor:telecharger")."</a>";
- echo "<img src='../plugins/skel_editor/img_pack/action_del.png' alt='delete' /><a href=\"?exec=skeleditor&f=".urlencode($file_name)."&action=delete\" onclick=\"javascript:return confirm('"._T("skeleditor:effacer_confirme")."');\">"._T("skeleditor:effacer")."</a>";
+ echo "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/action_dl.png' alt='download' /><a href=\"?exec=skeleditor&f=".urlencode($file_name)."&action=download\">"._T("skeleditor:telecharger")."</a>";
+ echo "<img src='"._DIR_PLUGIN_SKELEDITOR."/img_pack/action_del.png' alt='delete' /><a href=\"?exec=skeleditor&f=".urlencode($file_name)."&action=delete\" onclick=\"javascript:return confirm('"._T("skeleditor:effacer_confirme")."');\">"._T("skeleditor:effacer")."</a>";
echo "</div>\n";
// img or text ?
$extension = strtolower(substr($file_name, strrpos($file_name,".")+1));
Modified: _plugins_/_amelioration_admin_/skel_editor/inc_skeleditor.php
--- _plugins_/_amelioration_admin_/skel_editor/inc_skeleditor.php (original)
+++ _plugins_/_amelioration_admin_/skel_editor/inc_skeleditor.php Wed Apr 26 15:20:25 2006
@@ -1,11 +1,13 @@
<?php
+define('_DIR_PLUGIN_SKELEDITOR',(_DIR_PLUGINS.end(explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__)))))));
+
// ajout bouton ds interface admin
function SkelEditor_ajouterBoutons($boutons_admin) {
// si on est admin
if ($GLOBALS['connect_statut'] == "0minirezo") {
$boutons_admin['naviguer']->sousmenu['skeleditor']= new Bouton(
- '../'._DIR_PLUGINS.'skel_editor/img_pack/icon.png', // icone
+ '../'._DIR_PLUGIN_SKELEDITOR.'/img_pack/icon.png', // icone
_L("Editer les squelettes") // titre
);
}