altocompta/include/ext_inc.php
Dany De Bontridder 0e5fcddfc1 Reformat the code with
- astyle --style=ansi
Broke : the <<<<EOF
.
2010-09-14 15:27:31 +00:00

37 lines
1.1 KiB
PHP

<?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();
}
/* show name of extension */
echo '<div style="position:absolute;left:3px;top:3px;margin:0;z-index:10" class="noprint">';
echo '<h2 class="error" style="display:inline;padding:0px;margin:0px">'.$ext->get_parameter('name').'</h2>';
echo '</div>';
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();
}
}
?>