]> git.andy128k.dev Git - ipf.git/commitdiff
time zone
authoravl <alex.litovchenko@gmail.com>
Fri, 18 Sep 2009 09:45:27 +0000 (12:45 +0300)
committeravl <alex.litovchenko@gmail.com>
Fri, 18 Sep 2009 09:45:27 +0000 (12:45 +0300)
ipf.php
ipf/admin/model.php
ipf/admin/modelinline.php
ipf/admin/views.php
ipf/auth/models/User.php
ipf/form/widget/treeselectinput.php
ipf/utils.php

diff --git a/ipf.php b/ipf.php
index 49e9b3e0ae38b404edd636ff893193e5a90b4f75..f24c4406c1ba02bbea87e5b975b66e11009202db 100644 (file)
--- a/ipf.php
+++ b/ipf.php
@@ -101,7 +101,9 @@ final class IPF{
         if (!isset(IPF::$settings['file_permission']))
             IPF::$settings['file_permission'] = 0666;
 
-        //print_r(IPF::$settings);
+        if (!isset(IPF::$settings['time_zome'])){
+            IPF::$settings['time_zone'] = 'America/Toronto';
+        }
     }
 
     public static function boot($ipf_path, $project_path)
@@ -110,6 +112,7 @@ final class IPF{
         IPF::$settings['project_path']=$project_path;
         try{
             IPF::loadSettings();
+                       date_default_timezone_set(IPF::$settings['time_zone']);            
         }catch(IPF_Exception_Settings $e){
             die('Setting Error: '.$e->getMessage()."\n");
         }
index 560b6cb4908236d0c721d0943d6848c4373a2828..a9423e05a4cd221a5074a38111a29d7bf194cc92 100644 (file)
@@ -110,7 +110,7 @@ class ListTreeFilter extends BaseListFilter{
                if (isset($request->GET[$param_name])){
                    $id = $request->GET[$param_name];
                    if ($this->IsChoice($id)){
-                       $l = split("\.",$id);
+                       $l = explode("\.",$id);
                        $wh = array();
                        for($i=0; $i<count($this->fields); $i++){
                                if ($i>=(count($l)))
index bf99e82fb7d0916a1ed04778e285f15cb9dbd303..2bcd7a414774715f8ebdbffff99e18a8c04d3c79 100644 (file)
@@ -133,7 +133,7 @@ abstract class IPF_Admin_ModelInline{
                     if ($form->isAdd)
                         continue;
 
-                    @list($x1,$x2,$id,$x3) = @split('_',$form->prefix);
+                    @list($x1,$x2,$id,$x3) = @explode('_',$form->prefix);
                     if ($id==$obj->id){
                         if ($form->cleaned_data[0]==true)
                             $obj->delete();
index 32cc8205537a72db220cda77bb34262e302c5aa5..103a8af5b828dcf276481c530d0ff54b8ae8a935 100644 (file)
@@ -103,8 +103,8 @@ function IPF_Admin_Views_Reorder($request, $match){
                 else
                     return new IPF_HTTP_Response_NotFound();
 
-                $ids      = split(',',(string)$request->POST['ids']);
-                $prev_ids = split(',',(string)$request->POST['prev_ids']);
+                $ids      = explode(',',(string)$request->POST['ids']);
+                $prev_ids = explode(',',(string)$request->POST['prev_ids']);
                 $drop_id  = $request->POST['drop_id'];
 
                 $o = new $m();
@@ -371,7 +371,7 @@ function IPF_Admin_Views_FileBrowser($request, $match){
     
     $dirtree = dir_recursive($upload_path);
         
-    $pth = split(DIRECTORY_SEPARATOR,$curr_dir);
+    $pth = explode(DIRECTORY_SEPARATOR,$curr_dir);
     $path = array();
     $cd = '/admin/filebrowser/';
     foreach($pth as $p){
index 5dfea91d5843032246d747cf98c82097551fd1b1..5d3bd96b817cad119d90e9a2dc5324435335a298 100644 (file)
@@ -118,7 +118,7 @@ class User extends BaseUser
     function checkPassword($password){
         if ( ($this->password=='') || ($this->password==User::UNUSABLE_PASSWORD) )
             return false;
-        list($algo, $salt, $hash) = split(':', $this->password);
+        list($algo, $salt, $hash) = explode(':', $this->password);
         if ($hash == $algo($salt.$password))
             return true;
         else
index b39da2489f973cbda02652297c0e0fdbf505bc54..f22019311c8c12c6258384a978fac30961e8fa1b 100644 (file)
@@ -27,7 +27,7 @@ class IPF_Form_Widget_TreeSelectInput extends IPF_Form_Widget_SelectInput
        public function valueFromFormData($name, $data)
     {
         if (isset($data[$name])) {
-               $vals = split("\.",(string)$data[$name]);
+               $vals = explode("\.",(string)$data[$name]);
                for($i=0; $i<count($this->_levels); $i++){
                        if ( ($i<count($vals)) && ($data[$name]!='')){
                                $data[$this->_levels[$i]] = $vals[$i];
index c56cd9f9370ca5125a20e1d76ead85accf419ffa..584b82b69a90cc4b8dbb056b663f80426b1e35d4 100644 (file)
@@ -51,7 +51,7 @@ class IPF_Utils {
         while(file_exists($path.$name)){
             $pathinfo = pathinfo($name);
             $filename = $pathinfo['filename'];
-            $split = split('_', $filename);
+            $split = explode('_', $filename);
 
             $n = count($split);
             if ($n<2){
@@ -230,7 +230,7 @@ class IPF_Utils {
     }
 
     public static function timestamp(){
-               list($f,$i) = split(' ',microtime());
+               list($f,$i) = explode(' ',microtime());
                return $i.substr((string)$f,2,6);
     }