19 lines
524 B
PHP
19 lines
524 B
PHP
<?php
|
|
class Zend_View_Helper_Editable extends Zend_View_Helper_Abstract
|
|
{
|
|
public function Editable($name, $value, $defaultValue, $category)
|
|
{
|
|
$class = 'editable-change';
|
|
if ($value===null) {
|
|
$value = $defaultValue;
|
|
$class = 'editable';
|
|
}
|
|
if ( !empty($class) ) {
|
|
$class = 'class="'.$class.' '.$category.'"';
|
|
}
|
|
$html = '<span id="'.$name.'" '.$class.'>';
|
|
$html.= $value;
|
|
$html.= '</span>';
|
|
return $html;
|
|
}
|
|
} |