<?php
App::import('Core', 'Helper');

class AppHelper extends Helper {

    /* to be used in HTMLHelper */
    function display_bool($value, $as = null) {
        
        if ($as === null)
            $as = Configure::read('Project.display_boolean_as');

		switch($as) {
			case 'icon':
				return $this->image('bool_'.($value?1:0).'.png', array('alt' => __(($value ? 'yes' : 'no'), true)));
			case 'yesno':
				return "(" . __(($value ? 'yes' : 'no'), true) . ")";
			default:
				return "({$value})";
		}
		    
    }
    
}
?>