}
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;
}
--- /dev/null
+<?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).';
+ }
+}