424 : plugin dans les menus ou modules
This commit is contained in:
parent
21aa029521
commit
d30bfb2b3b
3 changed files with 504 additions and 392 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -21,8 +21,6 @@ $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);
|
||||
|
|
@ -36,7 +34,7 @@ if ( count($a->value) == 0 )
|
|||
}
|
||||
|
||||
/* only one plugin available then we don't propose a choice*/
|
||||
if ( count($a->value)==1 )
|
||||
if ( count($a->value)==1 )
|
||||
{
|
||||
$_REQUEST['plugin_code']=$a->value[0]['value'];
|
||||
}
|
||||
|
|
@ -49,33 +47,6 @@ else
|
|||
echo '</form>';
|
||||
echo '<hr>';
|
||||
}
|
||||
/* if a code has been asked */
|
||||
if (isset($_REQUEST['plugin_code']) )
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$ext=new Extension($cn);
|
||||
$ext->search('code',$_REQUEST['plugin_code']);
|
||||
if ( $ext->get_parameter('id') != 0 )
|
||||
{
|
||||
/* security */
|
||||
if ( $ext->can_request($_SESSION['g_user']) == 0 )
|
||||
{
|
||||
alert(j(_("Vous ne pouvez pas utiliser cette extension. Contactez votre responsable")));
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( ! file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath'))))
|
||||
{
|
||||
alert(j(_("Ce fichier n'existe pas ")));
|
||||
exit();
|
||||
}
|
||||
require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath')));
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(j(_("Cette extension n'existe pas ")));
|
||||
exit();
|
||||
}
|
||||
require_once 'extension_get.inc.php';
|
||||
|
||||
}
|
||||
?>
|
||||
42
include/extension_get.inc.php
Normal file
42
include/extension_get.inc.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
require_once('class_database.php');
|
||||
require_once('class_dossier.php');
|
||||
require_once("ac_common.php");
|
||||
require_once("constant.php");
|
||||
require_once('function_javascript.php');
|
||||
require_once('class_extension.php');
|
||||
require_once ('class_html_input.php');
|
||||
require_once('class_iselect.php');
|
||||
require_once ('constant.security.php');
|
||||
require_once ('class_user.php');
|
||||
|
||||
/* if a code has been asked */
|
||||
if (isset($_REQUEST['plugin_code']) )
|
||||
{
|
||||
$cn=new Database(dossier::id());
|
||||
$ext=new Extension($cn);
|
||||
$ext->search('code',$_REQUEST['plugin_code']);
|
||||
if ( $ext->get_parameter('id') != 0 )
|
||||
{
|
||||
/* security */
|
||||
if ( $ext->can_request($_SESSION['g_user']) == 0 )
|
||||
{
|
||||
alert(j(_("Vous ne pouvez pas utiliser cette extension. Contactez votre responsable")));
|
||||
exit();
|
||||
}
|
||||
|
||||
if ( ! file_exists('../include/ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath'))))
|
||||
{
|
||||
alert(j(_("Ce fichier n'existe pas ")));
|
||||
exit();
|
||||
}
|
||||
require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath')));
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(j(_("Cette extension n'existe pas ")));
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue