<?php

if (!defined('XOOPS_ROOT_PATH')) exit();

class UserUser_field_detailObject extends XoopsSimpleObject
{	
	function UserUser_field_detailObject()
	{
		$this->initVar('user_detail_id', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('released', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('preselect', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('table_name', XOBJ_DTYPE_STRING, '', true, 50);
		$this->initVar('column_name', XOBJ_DTYPE_STRING, '', true, 50);
		$this->initVar('group_id', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('weight', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('name',  XOBJ_DTYPE_STRING, '', true, 255);
		$this->initVar('xml',  XOBJ_DTYPE_STRING, '', true, 30);
		$this->initVar('view_type_id', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('data_type_id', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('data_length', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('data_decimal_places', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('default_value',  XOBJ_DTYPE_STRING, '', true, 30);
		$this->initVar('list',  XOBJ_DTYPE_STRING, '', true, 50);
		$this->initVar('essential', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('list_display', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('list_sort_key', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('list_width', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('detail_display', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('registry_user', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('edit_user', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('target_user', XOBJ_DTYPE_INT, 0, false);
		$this->initVar('scope_search',  XOBJ_DTYPE_INT, 0, false);
		$this->initVar('nondisplay',  XOBJ_DTYPE_INT, 0, false);
		$this->initVar('update_id', XOBJ_DTYPE_INT, 0, false);
	}
}

class UserUser_field_detailHandler extends XoopsObjectGenericHandler
{
	var $mTable = "user_field_detail";
	var $mPrimary = "user_detail_id";
	var $mClass = "UserUser_field_detailObject";
		
	function update($name,$newName)
	{
		$sql = "UPDATE " . $this->mTable . " set list ='${newName}' WHERE list ='${name}'";
		$result = $this->db->query($sql);
		if ( ! $result ) {
			return false;
			}
		return true;
	}
}



