Source for file classes_user_type.php

Documentation is available at classes_user_type.php

  1. <?php
  2.  
  3. class user_type extends b_object {
  4. //NOTE - object type definition "user types"
  5. var $name;
  6. var $description;
  7. var $icon;
  8.  
  9. function user_type( $constructID = NULL ) {
  10. parent::b_object( $constructID, 'user-types' );
  11. }
  12. //NOTE: these functions are here to overload the base class functions if special data validation etc is needed
  13. //function &get_attribute( $attribute ) { }
  14. //function set_attribute( $attribute, $value ) { }
  15. //function set( $values ) { }
  16. //function set_db( $values ) { }
  17. //function set_object( $values ) { }
  18. //function delete() { }
  19. function get_contents( $navArray = NULL ) {
  20. //format navigation array
  21. //unset( $navArray['permissions'] );
  22. //format object diplay fields
  23. $rawFieldArray = $this->type->get_attribute( 'type_object_field_list' );
  24. return parent::get_contents( $navArray, $rawFieldArray );
  25. }
  26.  
  27. function get_index() {
  28. if( $this->name ) {
  29. $objectIndex = $this->name;
  30. } else {
  31. $objectIndex = "new user type";
  32. }
  33. return $objectIndex;
  34. }
  35.  
  36. function verify_set( $post ) {
  37. //verifies data before setting the object's values - returns an error array if problems are found
  38. $returnArray = array();
  39.  
  40. if( $post['description'] && !($post['name'] || $this->name) ) {
  41. $returnArray['name'] = 'no name specified';
  42. $returnArray['description'] = 'no name specified';
  43. }
  44. if( !count($returnArray) ) {
  45. //THIS IS CRITICAL if you want to be able to relate things to the object
  46. parent::verify_set( $post );
  47. } else {
  48. $GLOBALS['errorArray'] = $returnArray;
  49. $this->set_object( $post );
  50. }
  51. }
  52. }
  53.  
  54. ?>

Documentation generated on Tue, 24 May 2005 03:57:19 -0400 by phpDocumentor 1.3.0RC3