Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function __construct($options = null) {
- if ($options == null) $this->data = isset($_POST['options']) ? stripslashes_deep($_POST['options']) : null;
- else $this->data = $options;
- $this->action = isset($_REQUEST['act']) ? $_REQUEST['act'] : null;
- if (isset($_REQUEST['btn'])) $this->button_data = $_REQUEST['btn'];
- // Fields analysis
- $fields = isset($_REQUEST['fields']) ? $_REQUEST['fields'] : null;
- if (is_array($fields)) {
- foreach ($fields as $name=>$type) {
- if ($type == 'datetime') {
- // Ex. The user insert 01/07/2012 14:30 and it set the time zone to +2. We cannot use the
- // mktime, since it uses the time zone of the machine. We create the time as if we are on
- // GMT 0 and then we subtract the GMT offset (the example date and time on GMT+2 happens
- // "before").
- $time = gmmktime($_REQUEST[$name . '_hour'], 0, 0,
- $_REQUEST[$name . '_month'], $_REQUEST[$name . '_day'], $_REQUEST[$name . '_year']);
- $time -= get_option('gmt_offset') * 3600;
- $this->data[$name] = $time;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement