]> git.andy128k.dev Git - ipf.git/commitdiff
0.4 beta
authoravl <alex.litovchenko@gmail.com>
Mon, 1 Sep 2008 03:23:59 +0000 (06:23 +0300)
committeravl <alex.litovchenko@gmail.com>
Mon, 1 Sep 2008 03:23:59 +0000 (06:23 +0300)
ipf/admin/model.php
ipf/auth/forms/profile.php [new file with mode: 0644]
ipf/version.php

index e13306a84c80b2dfee86113d51445dbb6a4458a8..6326be083cbcd98c68faeba99f1f5ba3b33daf62 100644 (file)
@@ -88,27 +88,29 @@ class IPF_Admin_Model{
     }
 
     public function ListItemsQuery(){
-        $query = IPF_ORM_Query::create();
-        $this->q = $query->select("o.*")->from($this->modelName.' o');
+        $this->q = IPF_ORM_Query::create()->from($this->modelName);
     }
     
     public function ListRow($o){
         $row = array();
         
         foreach($this->header as &$h){
-            $t = $o->getTable()->getTypeOf($h['name']);
-            $str = $o->$h['name'];
-            if ($t=='boolean'){
-                if ($str) 
-                    $str = '<img src="'.IPF::get('admin_media_url').'img/icon-yes.gif" alt="True">';
-                else 
-                    $str = '<img src="'.IPF::get('admin_media_url').'img/icon-no.gif" alt="True">';
+            $listMethod = 'column_'.$h['name'];
+            if (method_exists($this,$listMethod))
+                $str = $this->$listMethod(&$o);
+            else{
+                $t = $o->getTable()->getTypeOf($h['name']);
+                $str = $o->$h['name'];
+                if ($t=='boolean'){
+                    if ($str) 
+                        $str = '<img src="'.IPF::get('admin_media_url').'img/icon-yes.gif" alt="True" />';
+                    else 
+                        $str = '<img src="'.IPF::get('admin_media_url').'img/icon-no.gif" alt="False" />';
+                }
             }
             $row[$h['name']] = $str;
         }
         $this->LinksRow(&$row, &$o);
-        
-    
         return $row;
     }
     
diff --git a/ipf/auth/forms/profile.php b/ipf/auth/forms/profile.php
new file mode 100644 (file)
index 0000000..f7a059a
--- /dev/null
@@ -0,0 +1,18 @@
+<?php 
+
+class IPF_Auth_Forms_Profile extends IPF_Form_Model{
+    function __construct($data=null, $extra=array(), $label_suffix=null){
+        $extra['model'] = new User();
+        parent::__construct($data, $extra, $label_suffix);
+    }
+    
+    function fields(){ 
+        return array('username','email','first_name','last_name'); 
+    }
+    
+    function addDBField($name,$col){
+        parent::addDBField($name, $col);
+        if ($name=='username')
+            $this->fields['username']->help_text = 'Required. 32 characters or fewer. Alphanumeric characters only (letters, digits and underscores).';
+    }
+}
index 8fb3868d57c58cbe42be6c001fb16a123b6f9318..ad59e8fe1a7dc5db51d4fcfac3ad11660057efb7 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 
 final class IPF_Version{
-    static $name = '0.3 alpha';
+    static $name = '0.4 beta';
 }
\ No newline at end of file