* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team * */ // {{{ICINGA_LICENSE_HEADER}}} use \Zend_View_Helper_FormElement; /** * Helper to generate a "datetime" element */ class Zend_View_Helper_FormTriStateCheckbox extends Zend_View_Helper_FormElement { /** * Generate a tri-state checkbox * * @param string $name The element name * @param int $value The checkbox value * @param array $attribs Attributes for the element tag * * @return string The element XHTML */ public function formTriStateCheckbox($name, $value = null, $attribs = null) { $class = ""; $xhtml = '
' . '
' . ($value == 1 ? '{{ICON_ENABLED}}' : ($value === 'unchanged' ? '{{ICON_MIXED}}' : '{{ICON_DISABLED}}' )) . '
' . 'On ' . 'Off '; if ($value === 'unchanged') { $xhtml = $xhtml . ' Mixed '; }; return $xhtml . '
'; } }