diff --git a/html/extension.php b/html/extension.php deleted file mode 100644 index 4874a5f9c..000000000 --- a/html/extension.php +++ /dev/null @@ -1,76 +0,0 @@ -'; -@html_page_start($_SESSION['g_theme']); -$cn=new Database(dossier::id()); -$user=new User($cn); -$user->check(); -$only_plugin=$user->check_dossier(dossier::id()); - - -/* javascript file */ -echo load_all_script(); - -/* show button to return to access */ - -/* show all the extension we can access */ -$a=new ISelect('plugin_code'); -$a->value=Extension::make_array($cn); -$a->selected=(isset($_REQUEST['plugin_code']))?strtoupper($_REQUEST['plugin_code']):''; - -/* no plugin available */ -if ( count($a->value) == 0 ) -{ - alert(j(_("Aucune extension disponible"))); - exit; -} - -/* only one plugin available then we don't propose a choice*/ -if ( count($a->value)==1 ) -{ - $_REQUEST['plugin_code']=$a->value[0]['value']; -} -else -{ - echo '
'; - echo Dossier::hidden(); - echo _('Extension').$a->input().HtmlInput::submit('go',_("Choix de l'extension")); - echo '
'; - echo '
'; -} - -require_once('ext_inc.php'); diff --git a/include/ext_inc.php b/include/ext_inc.php index 797149c21..c87b7c497 100644 --- a/include/ext_inc.php +++ b/include/ext_inc.php @@ -1,5 +1,54 @@ '; +@html_page_start($_SESSION['g_theme']); +$cn=new Database(dossier::id()); +$user=new User($cn); +$user->check(); +$only_plugin=$user->check_dossier(dossier::id()); + + +/* javascript file */ +echo load_all_script(); + +/* show button to return to access */ + +/* show all the extension we can access */ +$a=new ISelect('plugin_code'); +$a->value=Extension::make_array($cn); +$a->selected=(isset($_REQUEST['plugin_code']))?strtoupper($_REQUEST['plugin_code']):''; + +/* no plugin available */ +if ( count($a->value) == 0 ) +{ + alert(j(_("Aucune extension disponible"))); + exit; +} + +/* only one plugin available then we don't propose a choice*/ +if ( count($a->value)==1 ) +{ + $_REQUEST['plugin_code']=$a->value[0]['value']; +} +else +{ + echo '
'; + echo Dossier::hidden(); + echo HtmlInput::request_to_hidden(array('plugin_code','ac')); + echo _('Extension').$a->input().HtmlInput::submit('go',_("Choix de l'extension")); + echo '
'; + echo '
'; +} /* if a code has been asked */ if (isset($_REQUEST['plugin_code']) ) { @@ -14,12 +63,7 @@ if (isset($_REQUEST['plugin_code']) ) alert(j(_("Vous ne pouvez pas utiliser cette extension. Contactez votre responsable"))); exit(); } - /* show name of extension */ - echo '
'; - echo '

'.$ext->get_parameter('name').'

'; - - - echo '
'; + if ( ! file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath')))) { alert(j(_("Ce fichier n'existe pas ")));