]> git.andy128k.dev Git - ipf.git/commitdiff
code style changes
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 11 Aug 2013 20:25:32 +0000 (23:25 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 11 Aug 2013 20:25:32 +0000 (23:25 +0300)
ipf/admin/app.php
ipf/admin/views.php
ipf/form/field.php

index 36c241e71b14dca594b9974f4f74a26fb00c814a..0ef099915f0298461859c8cc5a9fd6a4a7cf4b9f 100644 (file)
@@ -52,7 +52,7 @@ class IPF_Admin_App extends IPF_Application
     {
         foreach (IPF_Project::getInstance()->appList() as $app) {
             if ($app->getSlug() == $lapp) {
-                foreach($app->modelList() as $m) {
+                foreach ($app->modelList() as $m) {
                     if (strtolower($m) == $lmodel)
                         return array('app' => $app, 'modelname' => $m);
                 }
@@ -60,7 +60,7 @@ class IPF_Admin_App extends IPF_Application
         }
         return null;
     }
-    
+
     static function GetAdminModelPermissions($adminModel, $request, $lapp, $lmodel)
     {
         $adminPerms = $adminModel->getPerms($request);
index f471f26d7366e38191c1edacbbdc8c7f56eb3198..03c1f7ec823599bcaadf4c782ae6660ece1edc81 100644 (file)
@@ -113,25 +113,18 @@ function IPF_Admin_Views_EditItem($request, $match)
     $lapp = $match[1];
     $lmodel = $match[2];
     $id = $match[3];
-    
+
     $am = IPF_Admin_App::GetAppModelFromSlugs($lapp, $lmodel);
-    
-    if ($am !== null)
-    {    
-        $app = $am['app'];
-        $m   = $am['modelname'];
-    
+
+    if ($am !== null) {
+        $m = $am['modelname'];
         $ma = IPF_Admin_Model::getModelAdmin($m);
-        
-        if ($ma !== null)
-        {
-            $o = new $m();
-            $item = $o->getTable()->find($id);
-            
+        if ($ma !== null) {
+            $item = IPF_ORM::getTable($m)->find($id);
             return $ma->EditItem($request, $lapp, $lmodel, $item);
         }
     }
-    
+
     return new IPF_HTTP_Response_NotFound($request);
 }
 
index 85d225f92f8db0f8aab9f1a06f2b516a3b2d41f8..bd0f10a9c56c6d1e745e4d5472bc24fdaa95382f 100644 (file)
@@ -40,7 +40,8 @@ class IPF_Form_Field
         return $value;
     }
 
-    function LateClean($data, &$cleaned_data){
+    function LateClean($data, &$cleaned_data)
+    {
     }
 
     protected function createWidget($args)