[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4278 - in phpcompta/trunk: html include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4278 - in phpcompta/trunk: html include |
Date: |
Sun, 30 Oct 2011 20:32:17 +0100 (CET) |
Author: danydb
Date: 2011-10-30 20:32:17 +0100 (Sun, 30 Oct 2011)
New Revision: 4278
Modified:
phpcompta/trunk/html/do.php
phpcompta/trunk/include/ac_common.php
phpcompta/trunk/include/function_javascript.php
Log:
html_page and load_all_script can be called only once. Otherwise, there are
problem with calendar.js
Modified: phpcompta/trunk/html/do.php
===================================================================
--- phpcompta/trunk/html/do.php 2011-10-30 19:31:06 UTC (rev 4277)
+++ phpcompta/trunk/html/do.php 2011-10-30 19:32:17 UTC (rev 4278)
@@ -30,7 +30,9 @@
require_once('ac_common.php');
require_once 'function_javascript.php';
if (isset ($_POST["style_user"])){$_SESSION['g_theme']=$_POST['style_user'];}
-html_page_start();
+
+html_page_start($_SESSION['g_theme']);
+
global $g_user, $cn;
// if gDossier is not set redirect to form to choose a folder
@@ -50,7 +52,6 @@
exit();
}
-html_page_start($_SESSION['g_theme']);
load_all_script();
/* Check Browser version if < IE6 then unsupported */
$browser = $_SERVER['HTTP_USER_AGENT'];
Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php 2011-10-30 19:31:06 UTC (rev
4277)
+++ phpcompta/trunk/include/ac_common.php 2011-10-30 19:32:17 UTC (rev
4278)
@@ -245,12 +245,16 @@
* \param p_theme default theme
* \param $p_script
* \param $p_script2 another js script
- *
+ * Must be called only once
* \return none
*/
function html_page_start($p_theme="", $p_script="", $p_script2="")
{
+ // check not called twiced
+ static $already_call=0;
+ if ( $already_call==1)return;
+ $already_call=1;
$cn = new Database();
if ($p_theme != "")
Modified: phpcompta/trunk/include/function_javascript.php
===================================================================
--- phpcompta/trunk/include/function_javascript.php 2011-10-30 19:31:06 UTC
(rev 4277)
+++ phpcompta/trunk/include/function_javascript.php 2011-10-30 19:32:17 UTC
(rev 4278)
@@ -2708,7 +2708,7 @@
}
/*!\brief When data are transfered thanks ajax in a xml document, the xml
* can not contains some character, to escape those characters, we must use
this
- * function
+ * function
*\param $p_xml the xml to escape
*\return the xml string with the forbidden char escaped
*\see ajax_card.js ajaxFid
@@ -2728,6 +2728,11 @@
*/
function load_all_script()
{
+ // check not called twiced
+ static $already_call=0;
+ if ( $already_call==1)return;
+ $already_call=1;
+
echo JS_INFOBULLE;
echo js_include('prototype.js');
echo js_include('scriptaculous.js');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4278 - in phpcompta/trunk: html include,
phpcompta-dev <=