[limb-svn] r6280 - in 3.x/trunk/limb/macro: src src/tags tests/cases/tags
svn at limb-project.com
svn at limb-project.com
Mon Sep 10 09:14:50 MSD 2007
Author: pachanga
Date: 2007-09-10 09:14:49 +0400 (Mon, 10 Sep 2007)
New Revision: 6280
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6280
Added:
3.x/trunk/limb/macro/src/tags/slot.tag.php
Modified:
3.x/trunk/limb/macro/src/lmbMacroTag.class.php
3.x/trunk/limb/macro/src/lmbMacroTreeBuilder.class.php
3.x/trunk/limb/macro/src/tags/include.tag.php
3.x/trunk/limb/macro/src/tags/wrap.tag.php
3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php
Log:
-- fixing some bugs in wrap tag test(still not working)
Modified: 3.x/trunk/limb/macro/src/lmbMacroTag.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroTag.class.php 2007-09-09 21:46:57 UTC (rev 6279)
+++ 3.x/trunk/limb/macro/src/lmbMacroTag.class.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -122,7 +122,7 @@
$this->raise('Missing required attribute', array('attribute' => $attribute_name));
}
- function preParse()
+ function preParse($compiler)
{
foreach($this->tag_info->getRequiredAttributes() as $attr_name)
{
Modified: 3.x/trunk/limb/macro/src/lmbMacroTreeBuilder.class.php
===================================================================
--- 3.x/trunk/limb/macro/src/lmbMacroTreeBuilder.class.php 2007-09-09 21:46:57 UTC (rev 6279)
+++ 3.x/trunk/limb/macro/src/lmbMacroTreeBuilder.class.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -23,8 +23,9 @@
* @version $Id$
*/
+lmb_require('limb/macro/src/lmbMacroTextNode.class.php');
-lmb_require('limb/macro/src/lmbMacroTextNode.class.php');class lmbMacroTreeBuilder
+class lmbMacroTreeBuilder
{
protected $compiler;
protected $node;
Modified: 3.x/trunk/limb/macro/src/tags/include.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/include.tag.php 2007-09-09 21:46:57 UTC (rev 6279)
+++ 3.x/trunk/limb/macro/src/tags/include.tag.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -12,7 +12,7 @@
lmb_require('limb/macro/src/lmbMacroTagInfo.class.php');
lmb_require('limb/macro/src/lmbMacroTag.class.php');
-lmbMacroTagDictionary :: instance()->register(new lmbMacroTagInfo('include', 'lmbMacroIncludeTag'), __FILE__);
+lmbMacroTagDictionary :: instance()->register(new lmbMacroTagInfo('include', 'lmbMacroIncludeTag', true), __FILE__);
/**
* class lmbMacroIncludeTag.
Added: 3.x/trunk/limb/macro/src/tags/slot.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/slot.tag.php (rev 0)
+++ 3.x/trunk/limb/macro/src/tags/slot.tag.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright Copyright © 2004-2007 BIT(http://bit-creative.com)
+ * @license LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+
+//temporary includes, make it more flexible later
+lmb_require('limb/macro/src/lmbMacroTagDictionary.class.php');
+lmb_require('limb/macro/src/lmbMacroTagInfo.class.php');
+lmb_require('limb/macro/src/lmbMacroTag.class.php');
+
+lmbMacroTagDictionary :: instance()->register(new lmbMacroTagInfo('slot', 'lmbMacroSlotTag'), __FILE__);
+
+/**
+ * class lmbMacroSlotTag.
+ *
+ * @package macro
+ * @version $Id$
+ */
+class lmbMacroSlotTag extends lmbMacroTag
+{
+}
+
Modified: 3.x/trunk/limb/macro/src/tags/wrap.tag.php
===================================================================
--- 3.x/trunk/limb/macro/src/tags/wrap.tag.php 2007-09-09 21:46:57 UTC (rev 6279)
+++ 3.x/trunk/limb/macro/src/tags/wrap.tag.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -12,7 +12,7 @@
lmb_require('limb/macro/src/lmbMacroTagInfo.class.php');
lmb_require('limb/macro/src/lmbMacroTag.class.php');
-lmbMacroTagDictionary :: instance()->register(new lmbMacroTagInfo('wrap', 'lmbMacroWrapTag'), __FILE__);
+lmbMacroTagDictionary :: instance()->register(new lmbMacroTagInfo('wrap', 'lmbMacroWrapTag', false), __FILE__);
/**
* class lmbMacroWrapTag.
@@ -24,6 +24,8 @@
{
function preParse($compiler)
{
+ parent :: preParse($compiler);
+
$tree_builder = $compiler->getTreeBuilder();
$file = $this->get('with');
@@ -57,14 +59,14 @@
$insertionPoint = $wrapper->findChild($point);
if(empty($insertionPoint))
{
- $params = array('placeholder' => $point);
+ $params = array('slot' => $point);
if($wrapper !== $this)
{
$params['parent_wrap_tag_file'] = $wrapper->getTemplateFile();
$params['parent_wrap_tag_line'] = $wrapper->getTemplateLine();
}
- $this->raise('Wrap placeholder not found', $params);
+ $this->raise('Wrap slot not found', $params);
}
if($replace)
Modified: 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php
===================================================================
--- 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php 2007-09-09 21:46:57 UTC (rev 6279)
+++ 3.x/trunk/limb/macro/tests/cases/tags/lmbMacroWrapTagTest.class.php 2007-09-10 05:14:49 UTC (rev 6280)
@@ -9,6 +9,7 @@
lmb_require('limb/macro/src/lmbMacroTemplate.class.php');
lmb_require('limb/macro/src/tags/wrap.tag.php');
+lmb_require('limb/macro/src/tags/slot.tag.php');
lmb_require('limb/fs/src/lmbFs.class.php');
class lmbMacroWrapTagTest extends UnitTestCase
@@ -21,7 +22,7 @@
function testSimpleWrap()
{
- $bar = '<%wrap with="foo.html into="slot1"%>Bob<%/wrap%>';
+ $bar = '<%wrap with="foo.html" into="slot1"%>Bob<%/wrap%>';
$foo = '<p>Hello, <%slot id="slot1"/%></p>';
$bar_tpl = $this->_createTemplate($bar, 'bar.html');
More information about the limb-svn
mailing list