Ignore:
Timestamp:
Apr 6, 2020, 11:56:19 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Do not use parenthesis around returned value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Form/Types/Date.php

    r873 r874  
    1111    global $MonthNames;
    1212
    13     if ($Item['Value'] == null) return ('');
     13    if ($Item['Value'] == null) return '';
    1414    if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time();
    1515    $Parts = getdate($Item['Value']);
    1616
    1717    $Output = $Parts['mday'].'.'.$Parts['mon'].'.'.$Parts['year'];
    18     return ($Output);
     18    return $Output;
    1919  }
    2020
     
    7171    }
    7272    $Output .= '</select>';
    73     return ($Output);
     73    return $Output;
    7474  }
    7575
    7676  function OnLoad($Item)
    7777  {
    78     if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return (null);
    79       else return (mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']));
     78    if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null;
     79      else return mktime(0, 0, 0, $_POST[$Item['Name'].'-month'], $_POST[$Item['Name'].'-day'], $_POST[$Item['Name'].'-year']);
    8080  }
    8181
    8282  function OnLoadDb($Item)
    8383  {
    84     return (MysqlDateToTime($Item['Value']));
     84    return MysqlDateToTime($Item['Value']);
    8585  }
    8686
    8787  function OnSaveDb($Item)
    8888  {
    89     if ($Item['Value'] == null) return (null);
    90       else return (date('Y-m-d', $Item['Value']));
     89    if ($Item['Value'] == null) return null;
     90      else return date('Y-m-d', $Item['Value']);
    9191  }
    9292
    9393  function DatabaseEscape($Value)
    9494  {
    95     return ('"'.addslashes($Value).'"');
     95    return '"'.addslashes($Value).'"';
    9696  }
    9797}
Note: See TracChangeset for help on using the changeset viewer.