Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Commit

Permalink
Fixed totally broken design data format.
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxist committed Jun 27, 2010
1 parent 82f1e40 commit 81ac46c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/Opf/View/Format/Design.php
Expand Up @@ -29,7 +29,7 @@ class Opf_View_Format_Design extends Opt_Format_Abstract
* @var array
*/
protected $_properties = array(
'variable:captureAll' => true,
'variable:capture' => true,
'variable:capture.assign' => true,
'variable:assign' => true,
'variable:useReference' => false,
Expand All @@ -48,7 +48,9 @@ protected function _build($hookName)
switch($hookName)
{
case 'variable:capture':
$last = $this -> _getVar('item');
$ns = $this -> _getVar('items');
$last = end($ns);

if($last == 'valid' || $last == 'invalid')
{
$method = ($last == 'valid' ? 'getValidClass' : 'getInvalidClass');
Expand All @@ -58,10 +60,12 @@ protected function _build($hookName)
{
$method = 'getValidClass';
}
array_shift($ns);
return 'Opf_Design::'.$method.'(\''.implode('.', $ns).'\')';
// case 'variable:item.assign':
case 'variable:item.assign':
$last = $this -> _getVar('item');
case 'variable:capture.assign':
$ns = $this -> _getVar('items');
$last = end($ns);
if($last == 'valid' || $last == 'invalid')
{
$method = ($last == 'valid' ? 'setValidClass' : 'setInvalidClass');
Expand All @@ -71,8 +75,8 @@ protected function _build($hookName)
{
$method = 'setValidClass';
}
static $i = 0;
return '$set' . ++$i . ' = Opf_Design::'.$method.'(\''.$this->_getVar('item') . '.' . substr($this->_getVar('value'), 1, -1) . '\', '.$this->_getVar('value') . '); $set' . $i;
array_shift($ns);
return 'Opf_Design::'.$method.'(\''.implode('.', $ns).'\', '.$this->_getVar('value') . ')';
}
} // end _build();
} // end Opf_View_Format_Design;

0 comments on commit 81ac46c

Please sign in to comment.