Changeset 887 for trunk/Common/Form/Types/Date.php
- Timestamp:
- Nov 20, 2020, 12:08:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Types/Date.php
r874 r887 5 5 class TypeDate extends TypeBase 6 6 { 7 var $DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 7 function __construct(FormManager $FormManager) 8 { 9 parent::__construct($FormManager); 10 $this->DatabaseCompareOperators = array('Rovno' => '=', 'Nerovno' => '!=', 'Menší' => '<', 'Větší' => '>'); 11 } 8 12 9 function OnView( $Item)13 function OnView(array $Item): ?string 10 14 { 11 global $MonthNames;12 13 15 if ($Item['Value'] == null) return ''; 14 16 if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time(); … … 19 21 } 20 22 21 function OnEdit( $Item)23 function OnEdit(array $Item): string 22 24 { 23 25 global $MonthNames; … … 74 76 } 75 77 76 function OnLoad( $Item)78 function OnLoad(array $Item): ?string 77 79 { 78 80 if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null; … … 80 82 } 81 83 82 function OnLoadDb( $Item)84 function OnLoadDb(array $Item): ?string 83 85 { 84 86 return MysqlDateToTime($Item['Value']); 85 87 } 86 88 87 function OnSaveDb( $Item)89 function OnSaveDb(array $Item): ?string 88 90 { 89 91 if ($Item['Value'] == null) return null; … … 91 93 } 92 94 93 function DatabaseEscape( $Value)95 function DatabaseEscape(string $Value): string 94 96 { 95 97 return '"'.addslashes($Value).'"';
Note:
See TracChangeset
for help on using the changeset viewer.