[limb-svn] r6009 - in 3.x/trunk/limb/wysiwyg/src/template: components tags

svn at limb-project.com svn at limb-project.com
Thu Jun 21 13:19:18 MSD 2007


Author: serega
Date: 2007-06-21 13:19:18 +0400 (Thu, 21 Jun 2007)
New Revision: 6009
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6009

Modified:
   3.x/trunk/limb/wysiwyg/src/template/components/lmbWysiwygComponent.class.php
   3.x/trunk/limb/wysiwyg/src/template/tags/wysiwyg.tag.php
Log:
-- <wysywig> tag now supports dynamic "name" attribute and also supports "given_value" functionality

Modified: 3.x/trunk/limb/wysiwyg/src/template/components/lmbWysiwygComponent.class.php
===================================================================
--- 3.x/trunk/limb/wysiwyg/src/template/components/lmbWysiwygComponent.class.php	2007-06-20 08:32:14 UTC (rev 6008)
+++ 3.x/trunk/limb/wysiwyg/src/template/components/lmbWysiwygComponent.class.php	2007-06-21 09:19:18 UTC (rev 6009)
@@ -1,19 +1,19 @@
 <?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 
+/*
+ * 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
  */
-lmb_require('limb/wact/src/components/form/form.inc.php');
-
+lmb_require('limb/wact/src/components/form/form.inc.php');
+
 /**
  * class lmbWysiwygComponent.
  *
  * @package wysiwyg
  * @version $Id$
- */
+ */
 class lmbWysiwygComponent extends WactTextAreaComponent
 {
   var $ini = null;
@@ -51,7 +51,6 @@
 
     if(!$this->getAttribute('height'))
       $this->setAttribute('height', $this->getIniOption('height'));
-
   }
 }
 ?>
\ No newline at end of file

Modified: 3.x/trunk/limb/wysiwyg/src/template/tags/wysiwyg.tag.php
===================================================================
--- 3.x/trunk/limb/wysiwyg/src/template/tags/wysiwyg.tag.php	2007-06-20 08:32:14 UTC (rev 6008)
+++ 3.x/trunk/limb/wysiwyg/src/template/tags/wysiwyg.tag.php	2007-06-21 09:19:18 UTC (rev 6009)
@@ -1,19 +1,19 @@
 <?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 
+/*
+ * 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/control.inc.php');
 define('LIMB_WYSIWYG_DIR', dirname(__FILE__) . '/../../../');
 
-/**
- * @tag richedit,wysiwyg
- * @package wysiwyg
- * @version $Id$
- */
+/**
+ * @tag richedit,wysiwyg
+ * @package wysiwyg
+ * @version $Id$
+ */
 class lmbWysiwygTag extends WactControlTag
 {
   var $runtimeComponentName = 'lmbWysiwygComponent';
@@ -44,19 +44,24 @@
 
   }
 
-  function generateBeforeContent($code)
+  protected function _renderOpenTag($code_writer)
   {
   }
 
-  function generateTagContent($code)
+  protected function _renderCloseTag($code_writer)
   {
-    $code->writePhp($this->getComponentRefCode() . '->initWysiwyg("'. $this->ini_file_name . '","'.$this->profile.'" );');
-    $code->writePhp($this->getComponentRefCode() . '->renderContents();');
   }
 
-  function generateAfterContent($code)
+  function generateTagContent($code)
   {
+    if(isset($this->attributeNodes['name']) && !$this->attributeNodes['name']->isConstant())
+    {
+      $code->writePhp($this->getComponentRefCode() . '->setAttribute("name", ');
+      $code->writePhp($this->attributeNodes['name']->generateExpression($code));
+      $code->writePhp(');' . "\n");
+    }
+    $code->writePhp($this->getComponentRefCode() . '->initWysiwyg("'. $this->ini_file_name . '","'.$this->profile.'" );' . "\n");
+    $code->writePhp($this->getComponentRefCode() . '->renderContents();' . "\n");
   }
-
 }
 ?>
\ No newline at end of file



More information about the limb-svn mailing list