Public Member Functions

ilObjRootFolder Class Reference

Class ilObjRootFolder. More...

Inheritance diagram for ilObjRootFolder:
Collaboration diagram for ilObjRootFolder:

Public Member Functions

 ilObjRootFolder ($a_id, $a_call_by_reference=true)
 Constructor public.
 delete ()
 delete rootfolder and all related data
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts.
 getTranslations ()
 get all translations from this category
 removeTranslations ()
 addTranslation ($a_title, $a_desc, $a_lang, $a_lang_default)

Detailed Description

Class ilObjRootFolder.

Author:
Stefan Meyer <smeyer@databay.de>
Version:
Id:
class.ilObjRootFolder.php 13414 2007-03-08 12:41:48Z smeyer

Id: class.ilObjRootFolder.php,v 1.12 2003/11/20 17:04:19 shofmann Exp $

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


Member Function Documentation

ilObjRootFolder::addTranslation ( a_title,
a_desc,
a_lang,
a_lang_default 
)

Definition at line 174 of file class.ilObjRootFolder.php.

References ilObject::getId().

        {
                global $ilDB;

                if (empty($a_title))
                {
                        $a_title = "NO TITLE";
                }

                $q = "INSERT INTO object_translation ".
                         "(obj_id,title,description,lang_code,lang_default) ".
                         "VALUES ".
                         "(".$ilDB->quote($this->getId()).",".
                         $ilDB->quote($a_title).",".
                         $ilDB->quote($a_desc).",".
                         $ilDB->quote($a_lang).",".
                         $ilDB->quote($a_lang_default).")";
                $this->ilias->db->query($q);

                return true;
        }

Here is the call graph for this function:

ilObjRootFolder::delete (  ) 

delete rootfolder 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 59 of file class.ilObjRootFolder.php.

        {
                // delete is disabled

                $message = get_class($this)."::delete(): Can't delete root folder!";
                $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                return false;

                // always call parent delete function first!!
                if (!parent::delete())
                {
                        return false;
                }

                // put here rootfolder specific stuff

                return true;;
        }

ilObjRootFolder::getTranslations (  ) 

get all translations from this category

public

Returns:
array

Definition at line 137 of file class.ilObjRootFolder.php.

References $data, and ilObject::getId().

        {
                global $ilDB;

                $q = "SELECT * FROM object_translation WHERE obj_id = ".
                        $ilDB->quote($this->getId())." ORDER BY lang_default DESC";
                $r = $this->ilias->db->query($q);

                $num = 0;

                $data["Fobject"] = array();
                while ($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        $data["Fobject"][$num]= array("title"   => $row->title,
                                                                                  "desc"        => $row->description,
                                                                                  "lang"        => $row->lang_code
                                                                                  );
                        $num++;
                }

                // first entry is always the default language
                $data["default_language"] = 0;

                return $data ? $data : array();
        }

Here is the call graph for this function:

ilObjRootFolder::ilObjRootFolder ( a_id,
a_call_by_reference = true 
)

Constructor public.

Parameters:
integer reference_id or object_id
boolean treat the id as reference_id (true) or object_id (false)

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

References ilObject::ilObject().

        {
                $this->type = "root";
                $this->ilObject($a_id,$a_call_by_reference);
        }

Here is the call graph for this function:

ilObjRootFolder::notify ( a_event,
a_ref_id,
a_parent_non_rbac_id,
a_node_id,
a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

public

Parameters:
string event
integer reference id of object where the event occured
array passes optional parameters if required
Returns:
boolean

Reimplemented from ilObject.

Definition at line 88 of file class.ilObjRootFolder.php.

        {
                global $tree;

                switch ($a_event)
                {
                        case "link":

                                //var_dump("<pre>",$a_params,"</pre>");
                                //echo "RootFolder ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
                                //exit;
                                break;

                        case "cut":

                                //echo "RootFolder ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
                                //exit;
                                break;

                        case "copy":

                                //var_dump("<pre>",$a_params,"</pre>");
                                //echo "RootFolder ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
                                //exit;
                                break;

                        case "paste":

                                //echo "RootFolder ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
                                //exit;
                                break;

                        case "new":

                                //echo "RootFolder ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
                                //exit;
                                break;
                }


                return true;
        }

ilObjRootFolder::removeTranslations (  ) 

Definition at line 164 of file class.ilObjRootFolder.php.

References ilObject::getId().

        {
                global $ilDB;

                $q = "DELETE FROM object_translation WHERE obj_id= ".
                        $ilDB->quote($this->getId());
                $this->ilias->db->query($q);
        }

Here is the call graph for this function:


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