| Line |   | 
|---|
| 1 | <?php
 | 
|---|
| 2 | 
 | 
|---|
| 3 | include_once(dirname(__FILE__).'/Base.php');
 | 
|---|
| 4 | 
 | 
|---|
| 5 | class TypeBoolean extends TypeBase
 | 
|---|
| 6 | {
 | 
|---|
| 7 |   var $DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=');
 | 
|---|
| 8 | 
 | 
|---|
| 9 |   function OnView($Item)
 | 
|---|
| 10 |   {
 | 
|---|
| 11 |     if($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = '';
 | 
|---|
| 12 |     return('<input type="checkbox" name="'.$Item['Name'].'" disabled="1"'.$Checked.'/>');
 | 
|---|
| 13 |   }
 | 
|---|
| 14 | 
 | 
|---|
| 15 |   function OnEdit($Item)
 | 
|---|
| 16 |   {
 | 
|---|
| 17 |     if($Item['Value'] == 1) $Checked = ' checked="1"'; else $Checked = '';
 | 
|---|
| 18 |     return('<input type="checkbox" name="'.$Item['Name'].'"'.$Checked.'/>');
 | 
|---|
| 19 |   }
 | 
|---|
| 20 | 
 | 
|---|
| 21 |   function OnLoad($Item)
 | 
|---|
| 22 |   {
 | 
|---|
| 23 |     if(array_key_exists($Item['Name'], $_POST)) return(1); 
 | 
|---|
| 24 |       else return(0);
 | 
|---|
| 25 |   }
 | 
|---|
| 26 | }
 | 
|---|
| 27 | 
 | 
|---|
| 28 | ?>
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.