[cvs] [Wiki] changed: NewFieldType

Wiki Guest wiki at wiki.horde.org
Sun Aug 21 20:07:32 PDT 2005


guest [65.19.150.231]  Sun, 21 Aug 2005 20:07:32 -0700

Modified page: http://wiki.horde.org/NewFieldType
New Revision:  14.0
Change log:  Revert

@@ -93,21 +93,11 @@
 
 +++ Jay's Field:: Class from Cadre Framework
 
 This is an example from the Cadre framework.  I'm certainly not suggesting just taking this and using it, but this class has weathered almost four years of service, so I'm posting it here for discussion in this context.
-
-Here are some notes:
-* The Get_Field() function at the end is equivalent to Horde's ::singleton() method.
-* Data describing the field is stored in a table in the database.  Fields are loaded by name.  We design our database schemas so that all fields have unique names (we prepend the field name with the table name, except with foreign keys where we use the same name as the referenced field).  This way we can just say to our framework "get me a user_id" and it will return a class which can:
- * Render the value as text (::Get_Display_Text()), HTML (::Get_Display_Html()), or TeX (::Get_Display_TeX())
- * Render the value as an HTML field for input. (::Get_Edit_Html())
- * Convert the HTML representation back into the data representation (::Get_Db_Value()).
- * Render a search field for the value (::Get_Filter_Html()).  For a date field, this might render a start date and end date fields.
- * Convert the HTML filter representation into an SQL filter expression.  (In the previous example, it might return "$field_name >= <date> AND $field_name <= <date2>".  If all blank, it will return "TRUE".  (::Get_Filter_SQL()).
- * Validate the field input and return an error message if it doesn't pass (::Validate()).
-* "Options" and "Flags" control how the field behaves, and these are stored in the database.  You can override them when calling Get_Field() if necessary.
 
 <php>
+<?php // vi:set sts=4 sw=4 ai:
 /* CADRE - Cronosys web application framework.
  * Copyright (C) 2002 Cronosys, LLC.
  *
  * $Id: class.Field.php,v 1.23 2004/01/22 13:52:39 jasonf Exp $


More information about the cvs mailing list