Make sure Horde_Core_Ui_JsCalendar::init() is only run once.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 20:25:25 +0000 (14:25 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 21:45:45 +0000 (15:45 -0600)
framework/Core/lib/Horde/Core/Ui/JsCalendar.php

index e694622..0212519 100644 (file)
 class Horde_Core_Ui_JsCalendar
 {
     /**
+     * Make sure init() is only run once.
+     *
+     * @var boolean
+     */
+    static protected $_initRun = false;
+
+    /**
      * Output the necessary javascript code to allow display of the calendar
      * widget.
      *
@@ -31,6 +38,11 @@ class Horde_Core_Ui_JsCalendar
      */
     static public function init(array $params = array())
     {
+        if (self::$_initRun) {
+            return;
+        }
+        self::$_initRun = true;
+
         $params = array_merge(array(
             'full_weekdays' => false,
             'short_weekdays' => false