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/Time.php

    r873 r874  
    99  function OnView($Item)
    1010  {
    11     if ($Item['Value'] == 0) return ('');
     11    if ($Item['Value'] == 0) return '';
    1212    if ((strtolower($Item['Value']) == 'now') or (strtolower($Item['Value']) == '')) $Item['Value'] = time();
    1313    $TimeParts = getdate($Item['Value']);
    1414
    1515    $Output = sprintf('%02d', $TimeParts['hours']).':'.sprintf('%02d', $TimeParts['minutes']).':'.sprintf('%02d', $TimeParts['seconds']);
    16     return ($Output);
     16    return $Output;
    1717  }
    1818
     
    6767    }
    6868    $Output .= '</select>';
    69     return ($Output);
     69    return $Output;
    7070  }
    7171
    7272  function OnLoad($Item)
    7373  {
    74     if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return (null);
    75       return (mktime($_POST[$Item['Name'].'-hour'], $_POST[$Item['Name'].'-minute'], $_POST[$Item['Name'].'-second']));
     74    if (!array_key_exists($Item['Name'].'-null', $_POST) and array_key_exists('Null', $Item) and ($Item['Null'] == true)) return null;
     75      return mktime($_POST[$Item['Name'].'-hour'], $_POST[$Item['Name'].'-minute'], $_POST[$Item['Name'].'-second']);
    7676  }
    7777
    7878  function OnLoadDb($Item)
    7979  {
    80     return (MysqlTimeToTime($Item['Value']));
     80    return MysqlTimeToTime($Item['Value']);
    8181  }
    8282
    8383  function OnSaveDb($Item)
    8484  {
    85     if ($Item['Value'] == null) return (null);
    86       else return (date('H:i:s', $Item['Value']));
     85    if ($Item['Value'] == null) return null;
     86      else return date('H:i:s', $Item['Value']);
    8787  }
    8888
    8989  function DatabaseEscape($Value)
    9090  {
    91     return ('"'.addslashes($Value).'"');
     91    return '"'.addslashes($Value).'"';
    9292  }
    9393}
Note: See TracChangeset for help on using the changeset viewer.