2012-08-28 08:34:14 +00:00
|
|
|
<?php
|
|
|
|
class Zend_View_Helper_Editable extends Zend_View_Helper_Abstract
|
|
|
|
{
|
2013-02-04 12:27:04 +00:00
|
|
|
public function Editable($name, $value, $category)
|
2012-08-28 08:34:14 +00:00
|
|
|
{
|
2012-09-03 08:06:20 +00:00
|
|
|
$class = 'editable-change';
|
2013-02-04 12:27:04 +00:00
|
|
|
if ( null === $value ) {
|
|
|
|
$value = $name;
|
2012-09-03 08:06:20 +00:00
|
|
|
$class = 'editable';
|
2012-08-28 08:34:14 +00:00
|
|
|
}
|
2012-09-03 08:06:20 +00:00
|
|
|
if ( !empty($class) ) {
|
|
|
|
$class = 'class="'.$class.' '.$category.'"';
|
|
|
|
}
|
|
|
|
$html = '<span id="'.$name.'" '.$class.'>';
|
|
|
|
$html.= $value;
|
2012-08-28 08:34:14 +00:00
|
|
|
$html.= '</span>';
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
}
|