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

svn at limb-project.com svn at limb-project.com
Tue Jan 22 11:49:45 MSK 2008


Author: serega
Date: 2008-01-22 11:49:45 +0300 (Tue, 22 Jan 2008)
New Revision: 6725
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6725

Added:
   3.x/trunk/limb/calendar/src/wact/date3select.tag.php
   3.x/trunk/limb/calendar/src/wact/datetime.tag.php
Removed:
   3.x/trunk/limb/calendar/src/wact/tags/
Log:
-- WACT related folders renaming and movements in CALENDAR package


Copied: 3.x/trunk/limb/calendar/src/wact/date3select.tag.php (from rev 6724, 3.x/trunk/limb/calendar/src/wact/tags/date3select.tag.php)
===================================================================
--- 3.x/trunk/limb/calendar/src/wact/date3select.tag.php	                        (rev 0)
+++ 3.x/trunk/limb/calendar/src/wact/date3select.tag.php	2008-01-22 08:49:45 UTC (rev 6725)
@@ -0,0 +1,64 @@
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+require_once('limb/wact/src/tags/form/input.tag.php');
+require_once('limb/calendar/src/lmbDate3SelectWidget.class.php');
+
+/**
+ * @tag date3select
+ * @forbid_end_tag
+ * @req_attributes id
+ * @package calendar
+ * @version $Id: $
+*/
+class lmbDate3SelectTag extends WactInputTag
+{
+  function getRenderedTag()
+  {
+    return 'input';
+  }
+
+  function prepare()
+  {
+    $this->setAttribute('type', 'hidden');
+    parent :: prepare();
+  }
+
+  function generateAfterCloseTag($code)
+  {
+    parent :: generateAfterCloseTag($code);
+
+    if(!$lang = $this->getAttribute('lang'))
+      $lang = 'en';
+
+    $year_class = $this->getAttribute('year_class');
+    $month_class = $this->getAttribute('year_class');
+    $day_class = $this->getAttribute('year_class');
+    $show_default = $this->getBoolAttribute('show_default');
+    $min_year = $this->getAttribute('min_year');
+    $max_year = $this->getAttribute('max_year');
+
+    $widget = new lmbDate3SelectWidget($lang, $year_class, $month_class, $day_class, $show_default);
+    if ($min_year)
+    {
+      $widget -> setMinYear(intval($min_year));
+    }
+    if ($max_year)
+    {
+      $widget -> setMaxYear(intval($max_year));
+    }
+    
+
+    $code->writeHTML($widget->loadFiles() .
+                     $widget->makeFields($this->getAttribute('id') ));
+
+  }
+
+}
+
+

Copied: 3.x/trunk/limb/calendar/src/wact/datetime.tag.php (from rev 6724, 3.x/trunk/limb/calendar/src/wact/tags/datetime.tag.php)
===================================================================
--- 3.x/trunk/limb/calendar/src/wact/datetime.tag.php	                        (rev 0)
+++ 3.x/trunk/limb/calendar/src/wact/datetime.tag.php	2008-01-22 08:49:45 UTC (rev 6725)
@@ -0,0 +1,65 @@
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+require_once('limb/wact/src/tags/form/input.tag.php');
+require_once('limb/calendar/src/lmbCalendarWidget.class.php');
+
+/**
+ * @tag datetime
+ * @forbid_end_tag
+ * @package calendar
+ * @version $Id$
+ */
+class lmbDatetimeTag extends WactInputTag
+{
+  function getRenderedTag()
+  {
+    return 'input';
+  }
+
+  function prepare()
+  {
+    $this->setAttribute('type', 'text');
+    parent :: prepare();
+  }
+
+  function generateAfterCloseTag($code)
+  {
+    parent :: generateAfterCloseTag($code);
+
+    if(!$lang = $this->getAttribute('lang'))
+      $lang = 'en';
+
+    if(!$this->hasAttribute('stripped'))
+      $stripped = true;
+    else
+      $stripped = $this->getBoolAttribute('stripped');
+
+    $widget = new lmbCalendarWidget($lang, $stripped);
+
+    if($format = $this->getAttribute('format'))
+    {
+      $widget->setOption('ifFormat', $format);
+      $widget->setOption('daFormat', $format);
+    }
+    else
+    {
+      $widget->setOption('ifFormat', '%Y-%m-%d');
+      $widget->setOption('daFormat', '%Y-%m-%d');
+    }
+
+    $code->writeHTML($widget->loadFiles() .
+                     $widget->makeButton($this->getAttribute('id'), 
+                                         array(),
+                                         array('src' => $this->getAttribute('src'))));
+
+  }
+
+}
+
+



More information about the limb-svn mailing list