Ignore:
Timestamp:
Feb 28, 2022, 8:53:22 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Do not determine form submit from URL but directly from submit variable and filled form variables.
  • Added: Use system config from /etc/isp-central directory if standard config is not available.
  • Modified: Form file code cleanup. FormManager class moved to separate file.
Location:
trunk/Common/Form/Types
Files:
6 edited

Legend:

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

    r887 r922  
    2828  {
    2929    return '';
     30  } 
     31
     32  function OnCanLoad(array $Item): bool
     33  {
     34    return array_key_exists($Item['Name'], $_POST);
    3035  }
    31 
     36 
    3237  function OnLoadDb(array $Item): ?string
    3338  {
  • trunk/Common/Form/Types/Boolean.php

    r887 r922  
    2828      else return 0;
    2929  }
     30
     31  function OnCanLoad(array $Item): bool
     32  {
     33    return true;
     34  }
    3035}
  • trunk/Common/Form/Types/Date.php

    r887 r922  
    8282  }
    8383
     84  function OnCanLoad(array $Item): bool
     85  {
     86    return array_key_exists($Item['Name'].'-null', $_POST) or (array_key_exists($Item['Name'].'-day', $_POST) and
     87      array_key_exists($Item['Name'].'-month', $_POST) and array_key_exists($Item['Name'].'-year', $_POST));
     88  }
     89
    8490  function OnLoadDb(array $Item): ?string
    8591  {
  • trunk/Common/Form/Types/DateTime.php

    r887 r922  
    108108  }
    109109
     110  function OnCanLoad(array $Item): bool
     111  {
     112    return array_key_exists($Item['Name'].'-null', $_POST) or (array_key_exists($Item['Name'].'-day', $_POST) and
     113      array_key_exists($Item['Name'].'-month', $_POST) and array_key_exists($Item['Name'].'-year', $_POST) and
     114      array_key_exists($Item['Name'].'-hour', $_POST) and array_key_exists($Item['Name'].'-minute', $_POST) and
     115      array_key_exists($Item['Name'].'-second', $_POST)
     116    );
     117  }
     118
    110119  function OnLoadDb(array $Item): ?string
    111120  {
  • trunk/Common/Form/Types/GPS.php

    r908 r922  
    4747  }
    4848
     49  function OnCanLoad(array $Item): bool
     50  {
     51    return array_key_exists($Item['Name'].'-lat-deg', $_POST) and array_key_exists($Item['Name'].'-lat-sec', $_POST) and
     52    array_key_exists($Item['Name'].'-lat-min', $_POST) and array_key_exists($Item['Name'].'-lon-deg', $_POST) and
     53      array_key_exists($Item['Name'].'-lon-min', $_POST) and array_key_exists($Item['Name'].'-lon-sec', $_POST);
     54  }
     55
     56
    4957  function Explode(float $Float): array
    5058  {
  • trunk/Common/Form/Types/Time.php

    r887 r922  
    8080  }
    8181
     82  function OnCanLoad(array $Item): bool
     83  {
     84    return array_key_exists($Item['Name'].'-null', $_POST) or (array_key_exists($Item['Name'].'-hour', $_POST) and
     85    array_key_exists($Item['Name'].'-minute', $_POST) and array_key_exists($Item['Name'].'-second', $_POST)
     86    );
     87  }
     88
    8289  function OnLoadDb(array $Item): ?string
    8390  {
Note: See TracChangeset for help on using the changeset viewer.