Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

users.php

Go to the documentation of this file.
00001 
00002 /** @file users.php
00003 * Definition of class users.
00004 */
00005 #include "xml_event_parser_user.php"
00006 #include "ranks.php"
00007 /**
00008 * Users definitions.
00009 * This class represents users database.
00010 */
00011 class users : public  xml_event_parser_user
00012 {
00013 public:
00014   var users = array();
00015   var current_user = '';
00016 
00017   /** Return array with users names. */
00018   function get_users_list()
00019   {
00020     list = array();
00021     foreach( this->users as name => account )
00022     {
00023       list[] = name;
00024     }
00025     return list;
00026   }
00027   /** Return user`s fullname.
00028   * @param name - name of user to return fullname
00029   */
00030   function get_fullname( name )
00031   {
00032     return this->users[ name ][ 'fullname' ];
00033   }
00034   /** Return user`s skills.
00035   * @param name - name of user to return skills
00036   * @return array with skills id`s
00037   */
00038   function get_skills( name )
00039   {
00040     if( isset( this->users[ name ] ) )
00041       return this->users[ name ][ 'skills' ];
00042     else
00043       return array();
00044   }
00045   /** Return user`s rank.
00046   * @param name - name of user to return skills
00047   */
00048   function get_rank( name )
00049   {
00050     if( isset( this->users[ name ] ) )
00051       return this->users[ name ][ 'rank' ];
00052     else
00053       return array();
00054   }
00055 
00056   function xep_open_users_user( attributes )
00057   {
00058     this->current_user = attributes[ 'name' ];
00059     this->users[ this->current_user ] = array( 
00060       'fullname' => isset( attributes[ 'fullname' ] ) ? 
00061         attributes[ 'fullname' ] : 
00062         '',
00063       'rank' => attributes[ 'rank' ],
00064       'skills' => array() );
00065   }
00066 
00067   function xep_close_users_user()
00068   {
00069     this->current_user = '';
00070   }
00071 
00072   function xep_open_users_user_skills_skill( attributes )
00073   {
00074     this->users[ this->current_user ][ 'skills' ][] = attributes[ 'id' ];
00075   }
00076 }
00077 X-Powered-By: PHP/4.0.8-dev
00078 Content-type: text/html
00079 
00080 

Generated on Tue Mar 11 08:35:13 2003 for SES by doxygen1.2.16