Public Member Functions

ilObjiLincClassroom Class Reference

Inheritance diagram for ilObjiLincClassroom:
Collaboration diagram for ilObjiLincClassroom:

Public Member Functions

 ilObjiLincClassroom ($a_icla_id, $a_icrs_id)
 Constructor public.
 _lookupiCourseId ($a_ref_id)
 read ()
 private
 joinClass (&$a_user_obj, $a_ilinc_class_id)
 findUser (&$a_user_obj)
 update ($a_data="")
 update object data
 delete ()
 delete object and all related data
 getDocentList ()
 _getDocent ($a_ilinc_user_id)
 _setFullname ($a_title="", $a_firstname="", $a_lastname="")
 setDocentId ($a_ilinc_user_id)
 getDocentName ()
 getDocentId ()
 setStatus ($a_status)
 getStatus ()
 getErrorMsg ()

Detailed Description

Definition at line 37 of file class.ilObjiLincClassroom.php.


Member Function Documentation

ilObjiLincClassroom::_getDocent ( a_ilinc_user_id  ) 

Definition at line 241 of file class.ilObjiLincClassroom.php.

References ilObject::$lng, $q, $row, and _setFullname().

Referenced by getDocentName(), and ilObjiLincClassroomListGUI::getProperties().

        {
                global $ilDB, $lng;
                
                $fullname = false;
                
                $q = "SELECT title,firstname,lastname FROM usr_data WHERE ilinc_id = ".$ilDB->quote($a_ilinc_user_id)." LIMIT 1";
                $r = $ilDB->query($q);
                
                while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $fullname = ilObjiLincClassroom::_setFullname($row->title,$row->firstname,$row->lastname);
                }
                
                return $fullname;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjiLincClassroom::_lookupiCourseId ( a_ref_id  ) 

Definition at line 73 of file class.ilObjiLincClassroom.php.

References $q.

Referenced by getDocentList(), and ilObjiLincClassroomGUI::save().

        {
                global $ilDB;

                $q = "SELECT course_id FROM ilinc_data ".
                         "LEFT JOIN object_reference ON object_reference.obj_id=ilinc_data.obj_id ".
                         "WHERE object_reference.ref_id = ".$ilDB->quote($a_ref_id);
                $obj_set = $ilDB->query($q);
                $obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);

                return $obj_rec["course_id"];
        }

Here is the caller graph for this function:

ilObjiLincClassroom::_setFullname ( a_title = "",
a_firstname = "",
a_lastname = "" 
)

Definition at line 258 of file class.ilObjiLincClassroom.php.

Referenced by _getDocent().

        {
                $fullname = "";

                if ($a_title)
                {
                        $fullname = $a_title." ";
                }

                if ($a_firstname)
                {
                        $fullname .= $a_firstname." ";
                }

                if ($a_lastname)
                {
                        return $fullname.$a_lastname;
                }
        }

Here is the caller graph for this function:

ilObjiLincClassroom::delete (  ) 

delete object and all related data

public

Returns:
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 203 of file class.ilObjiLincClassroom.php.

        {               
                $this->ilincAPI->removeClass($this->id);
                $response = $this->ilincAPI->sendRequest();

                if ($response->isError())
                {
                        if (!$response->getErrorMsg())
                        {
                                $this->error_msg = "err_delete_classroom";
                        }
                        else
                        {
                                $this->error_msg = $response->getErrorMsg();
                        }
                        
                        return false;
                }
                
                return true;
        }

ilObjiLincClassroom::findUser ( &$  a_user_obj  ) 

Definition at line 143 of file class.ilObjiLincClassroom.php.

References exit.

        {
                $this->ilincAPI->findUser($a_user_obj);
                $response = $this->ilincAPI->sendRequest();
                
                var_dump($response->data);
                exit;
        }

ilObjiLincClassroom::getDocentId (  ) 

Definition at line 293 of file class.ilObjiLincClassroom.php.

Referenced by update().

        {
                return $this->docent_id;
        }

Here is the caller graph for this function:

ilObjiLincClassroom::getDocentList (  ) 

Definition at line 226 of file class.ilObjiLincClassroom.php.

References _lookupiCourseId().

        {
                $ilinc_crs_id = ilObjiLincClassroom::_lookupiCourseId($this->parent);
                
                $this->ilincAPI->findRegisteredUsersByRole($ilinc_crs_id,true);
                $response = $this->ilincAPI->sendRequest();
                        
                if (is_array($response->data['users']))
                {
                                return $response->data['users'];
                }
                
                return array();
        }

Here is the call graph for this function:

ilObjiLincClassroom::getDocentName (  ) 

Definition at line 283 of file class.ilObjiLincClassroom.php.

References _getDocent().

        {
                if (!$this->docent_name)
                {
                        $this->docent_name = $this->_getDocent($this->docent_id);
                }
                
                return $this->docent_name;
        }

Here is the call graph for this function:

ilObjiLincClassroom::getErrorMsg (  ) 

Definition at line 315 of file class.ilObjiLincClassroom.php.

        {
                $err_msg = $this->error_msg;
                $this->error_msg = "";

                return $err_msg;
        }

ilObjiLincClassroom::getStatus (  ) 

Definition at line 310 of file class.ilObjiLincClassroom.php.

Referenced by update().

        {
                return $this->status;
        }

Here is the caller graph for this function:

ilObjiLincClassroom::ilObjiLincClassroom ( a_icla_id,
a_icrs_id 
)

Constructor public.

Parameters:
integer ilinc class id
boolean ilias ref id of ilinc course object

Definition at line 45 of file class.ilObjiLincClassroom.php.

References $ilErr, ilObject::$ilias, ilObject::$lng, and read().

        {
                global $ilErr,$ilias,$lng;
                
                $this->type = "icla";
                $this->id = $a_icla_id;         
                $this->parent = $a_icrs_id;
                $this->ilincAPI = new ilnetucateXMLAPI();

                $this->ilErr =& $ilErr;
                $this->ilias =& $ilias;
                $this->lng =& $lng;

                $this->max_title = MAXLENGTH_OBJ_TITLE;
                $this->max_desc = MAXLENGTH_OBJ_DESC;
                $this->add_dots = true;

                $this->referenced = false;
                $this->call_by_reference = false;

                if (!empty($this->id))
                {
                        $this->read();
                }
                
                return $this;
        }

Here is the call graph for this function:

ilObjiLincClassroom::joinClass ( &$  a_user_obj,
a_ilinc_class_id 
)

Definition at line 115 of file class.ilObjiLincClassroom.php.

        {
                
                include_once ('class.ilObjiLincUser.php');
                $ilinc_user = new ilObjiLincUser($a_user_obj);
                
                $this->ilincAPI->joinClass($ilinc_user,$a_ilinc_class_id);
                $response = $this->ilincAPI->sendRequest("joinClass");
                
                if ($response->isError())
                {
                        if (!$response->getErrorMsg())
                        {
                                $this->error_msg = "err_join_classroom";
                        }
                        else
                        {
                                $this->error_msg = $response->getErrorMsg();
                        }
                        
                        return false;
                }
                
                // return URL to join class room
                return trim($response->data['url']['cdata']);
        }

ilObjiLincClassroom::read (  ) 

private

Definition at line 90 of file class.ilObjiLincClassroom.php.

References ilObject::setDescription(), setDocentId(), setStatus(), and ilObject::setTitle().

Referenced by ilObjiLincClassroom().

        {
                $this->ilincAPI->findClass($this->id);
                $response = $this->ilincAPI->sendRequest();

                if ($response->isError())
                {
                        if (!$response->getErrorMsg())
                        {
                                $this->error_msg = "err_read_class";
                        }
                        else
                        {
                                $this->error_msg = $response->getErrorMsg();
                        }
                        
                        return false;
                }
                //var_dump($response->data['classes']);
                $this->setTitle($response->data['classes'][$this->id]['name']);
                $this->setDescription($response->data['classes'][$this->id]['description']);
                $this->setDocentId($response->data['classes'][$this->id]['instructoruserid']);
                $this->setStatus($response->data['classes'][$this->id]['alwaysopen']);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjiLincClassroom::setDocentId ( a_ilinc_user_id  ) 

Definition at line 278 of file class.ilObjiLincClassroom.php.

Referenced by read().

        {
                $this->docent_id = $a_ilinc_user_id;
        }

Here is the caller graph for this function:

ilObjiLincClassroom::setStatus ( a_status  ) 

Definition at line 298 of file class.ilObjiLincClassroom.php.

Referenced by read().

        {
                if ($a_status == "Wahr" or $a_status == "1" or $a_status == true)
                {
                        $this->status = "1";
                }
                else
                {
                        $this->status = "0";
                }
        }

Here is the caller graph for this function:

ilObjiLincClassroom::update ( a_data = ""  ) 

update object data

public

Returns:
boolean

Definition at line 158 of file class.ilObjiLincClassroom.php.

References $data, $result, ilObject::getDescription(), getDocentId(), getStatus(), and ilObject::getTitle().

        {
                $data = array(
                                                "name" => $this->getTitle(),
                                                "description" => $this->getDescription(), 
                                                "instructoruserid" => $this->getDocentId(), 
                                                "alwaysopen" => $this->getStatus()
                                        );
                                
                if (!is_array($a_data))
                {
                        $a_data = array();
                }
                
                $result = array_merge($data,$a_data);

                $this->ilincAPI->editClass($this->id,$result);

                $response = $this->ilincAPI->sendRequest("editClass");

                if ($response->isError())
                {
                        if (!$response->getErrorMsg())
                        {
                                $this->error_msg = "err_edit_classroom";
                        }
                        else
                        {
                                $this->error_msg = $response->getErrorMsg();
                        }
                        
                        return false;
                }
                
                $this->result_msg = $response->getResultMsg();

                return true;
        }

Here is the call graph for this function:


The documentation for this class was generated from the following file: