[limb-svn] r5819 - 3.x/trunk/limb/calendar/src

svn at limb-project.com svn at limb-project.com
Mon May 7 13:08:30 MSD 2007


Author: tony
Date: 2007-05-07 13:08:30 +0400 (Mon, 07 May 2007)
New Revision: 5819
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5819

Modified:
   3.x/trunk/limb/calendar/src/lmbCalendarWidget.class.php
Log:
-- <datetime> tag widget generates js code require lines only once

Modified: 3.x/trunk/limb/calendar/src/lmbCalendarWidget.class.php
===================================================================
--- 3.x/trunk/limb/calendar/src/lmbCalendarWidget.class.php	2007-05-07 08:22:58 UTC (rev 5818)
+++ 3.x/trunk/limb/calendar/src/lmbCalendarWidget.class.php	2007-05-07 09:08:30 UTC (rev 5819)
@@ -55,18 +55,28 @@
 
   function loadFiles()
   {
-    $code  = '<link rel="stylesheet" type="text/css" media="all" href="' .
-              $this->calendar_lib_path . $this->calendar_theme_file .
-               '" />' . $this->newline;
-    $code .=  '<script type="text/javascript" src="' .
-              $this->calendar_lib_path . $this->calendar_file .
-              '"></script>' . $this->newline;
-    $code .= '<script type="text/javascript" src="' .
-              $this->calendar_lib_path . $this->calendar_lang_file .
-              '"></script>' . $this->newline;
-    $code .= '<script type="text/javascript" src="' .
-             $this->calendar_lib_path . $this->calendar_setup_file .
-             '"></script>';
+    static $rendered = false;
+
+    $code  = '';
+
+    if(!$rendered)
+    {
+      $code  = '<link rel="stylesheet" type="text/css" media="all" href="' .
+                $this->calendar_lib_path . $this->calendar_theme_file .
+                 '" />' . $this->newline;
+      $code .=  '<script type="text/javascript" src="' .
+                $this->calendar_lib_path . $this->calendar_file .
+                '"></script>' . $this->newline;
+      $code .= '<script type="text/javascript" src="' .
+                $this->calendar_lib_path . $this->calendar_lang_file .
+                '"></script>' . $this->newline;
+      $code .= '<script type="text/javascript" src="' .
+               $this->calendar_lib_path . $this->calendar_setup_file .
+               '"></script>';
+    }
+
+    $rendered = true;
+
     return $code;
   }
 



More information about the limb-svn mailing list