Author: danydb
Date: 2011-11-04 22:27:21 +0100 (Fri, 04 Nov 2011)
New Revision: 4312
Modified:
phpcompta/trunk/include/ac_common.php
Log:
Modularit?\195?\169 : ajout du javascript
Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php 2011-11-04 21:23:17 UTC (rev
4311)
+++ phpcompta/trunk/include/ac_common.php 2011-11-04 21:27:21 UTC (rev
4312)
@@ -747,7 +747,7 @@
if ($selected != -1)
{
require_once('template/module.php');
- $file = $cn->get_array("select me_file,me_parameter from v_all_menu
+ $file = $cn->get_array("select me_file,me_parameter,me_javascript from
v_all_menu
where me_code=$1 and user_name=$2",
array($selected,$g_user->login));
if ( count($file ) == 0 )
{
@@ -769,6 +769,10 @@
require_once $file[0]['me_file'];
exit();
}
+ if ( $file[0]['me_javascript'] != '')
+ {
+ create_script($file[0]['me_javascript']);
+ }
}
else
{
@@ -845,11 +849,12 @@
* @todo add security
* check if user can access this module
*/
- $file = $cn->get_array("select me_file,me_parameter
+ $file = $cn->get_array("select
me_file,me_parameter,me_javascript
from menu_ref
where
- me_code=$1 and
- (me_file is not null or trim(me_file) <>'')",
array($module[$idx]));
+ me_code=$1 and
+ (me_file is not null or trim(me_file) <>'' or
+ me_javascript is not null or trim (me_javascript) <> '')",
array($module[$idx]));
if (count($file)==0)
{
@@ -870,6 +875,10 @@
echo '</div>';
exit();
}
+ if ( $file[0]['me_javascript'] != '')
+ {
+ echo create_script($file[0]['me_javascript']);
+ }
}
}
/**
_______________________________________________
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev