Public Member Functions | Data Fields

ilCalInterface Class Reference

Public Member Functions

 ilCalInterface ($ilias, $nb="")
 showLocator ($tpl, $lng, $app)
 showLocator($tpl, $lng, $app) genarate the locater for ilias3 public
 getUId ()
 read UserID public
 getLang ()
 read current language, the user selected public
 getSkin ()
 read current skin-name, the user selected public
 getStyle ()
 read current style(-sheet)-name, the user selected public
 getStyleFname ()
 read current style(-sheet)-name including path, the user selected public
 getGroupIds ()
 read GroupIDs of the current UserID (stub) public
 getIliasDbName ()
 Returns the Ilias-Databasename.
 getCscwDbName ()
 Returns the CSCW-Databasename.
 getMysqlHostName ()
 Returns the mysql-Host for database-access.
 getMysqlUserName ()
 Returns the mysql-Username for database-access.
 getMysqlPass ()
 Returns the mysql-Password for database-access.
 getAllUserId ()
 Returns the userID which stands for 'all Users'.
 getrelCSCWDir ()
 Returns the relative path where cscw is located.
 getFrameDec ()
 Returns the string for the menue is the DP runs in no-frames modus.
 getUserGroups ($userId)
 Returns all groups which are owned by the user.
 getOtherMembers ($groupId, $userId)
 Returns all user-ID's which are in the given group ($groupId) except the given $userId.
 getMemberGroups ($userId)
 Returns all groups where the user is member in.
 getGroupName ($groupId)
 Fetches the name of a group according to its group_ID from the database.
 getNumOfMembers ($group_id)
 Returns number of members in the Group with $group_id.
 getDpDBHandler ()
 Returns dte Dtateplane DB handler fo database conectivity.

Data Fields

 $ilias
 The following Variables do not need to be kept up to date manually.
 $iliasRootDir
 ilias-root-directory (including the whole path beginning from system-root!) @ var string @ access private
 $modulDir
 ilias module directory (up to the ilias root dir) @ var string @ access private
 $relCSCWDir
 relative path of the cscw dir @ var string @ access private
 $dbaseIlias
 $dbaseCscw
 $host
 $mysqlUser
 $mysqlPass
 $allUserId
 $usingFrames
 $uId
 $uPrefs
 $templPath
 $skinPath
 $pBuf
 $GroupIds
 $sock = FALSE
 Constructor fetch userspecific data from ilias and store them in local variables public.

Detailed Description

Definition at line 38 of file class.ilCalInterface.php.


Member Function Documentation

ilCalInterface::getAllUserId (  ) 

Returns the userID which stands for 'all Users'.

Returns:
array

Definition at line 407 of file class.ilCalInterface.php.

        {
                return $this->allUserId; 
        }//end function

ilCalInterface::getCscwDbName (  ) 

Returns the CSCW-Databasename.

Returns:
array

Definition at line 371 of file class.ilCalInterface.php.

        {
                return $this->dbaseCscw; 
        }//end function

ilCalInterface::getDpDBHandler (  ) 

Returns dte Dtateplane DB handler fo database conectivity.

Returns:

Definition at line 587 of file class.ilCalInterface.php.

                                   {
                
                $dbase_ilias    = $this->getIliasDbName();              //Get all constants from the interface
                $dbase_cscw             = $this->getCscwDbName();               //                              /
                $host                   = $this->getMysqlHostName();    //                      /
                $user                   = $this->getMysqlUserName();    //              /
                $pass                   = $this->getMysqlPass();                //      /
                $alluser_id             = $this->getAllUserId();                //      
                $dlI                    = @mysql_connect ($host, $user, $pass); //Connect to database

                if (isset($dlI))
                {
                        if (mysql_select_db ($dbase_ilias, $dlI) == false)      //Select the database
                        {
                                mysql_close ($dlI);
                                $dlI = false;
                        }
                }

                Return $dlI ;
        }// end func

ilCalInterface::getFrameDec (  ) 

Returns the string for the menue is the DP runs in no-frames modus.

Returns:
String

Definition at line 425 of file class.ilCalInterface.php.

        {
                switch($this->usingFrames) {
                        case 1 :
                                $uptext = "";
                                break;
                        case 0 :
                                $uptext = ereg_replace ('HREF="', 'HREF="../../', $this->upText);
                                $uptext = ereg_replace ('SRC="', 'SRC="../../', $uptext);
                                $uptext = ereg_replace ('= "images/navbar/', '= "../../images/navbar/', $uptext);
                                break;
                        case -1:
                                // not now implemented in Ilias3 and Ilias2
                                break;
                        default :
                                $uptext = "";
                }
                //$uptext = htmlspecialchars($uptext);
                return $uptext;
        }//end function 

ilCalInterface::getGroupIds (  ) 

read GroupIDs of the current UserID (stub) public

Parameters:
@return array of integers

Definition at line 342 of file class.ilCalInterface.php.

        {
                $IliasArryGroups        = ilUtil::GetObjectsByOperations ("grp", "read", False,False);
                $IliasArryGroups = array_merge($IliasArryGroups,ilUtil::GetObjectsByOperations ("crs", "read", False,False));

                if($IliasArryGroups[0]!="") {
                        $i = 0;
                        foreach ($IliasArryGroups as $Row){
                                $groupContainer = $Row[ref_id];
                                $groups[$i]=$groupContainer ;
                        $i++;
                        }
                }
                return $groups; 
        }//end function

ilCalInterface::getGroupName ( groupId  ) 

Fetches the name of a group according to its group_ID from the database.

Parameters:
int group_IDs
Returns:
string

Definition at line 529 of file class.ilCalInterface.php.

        {
                        
                $IliasArryGroups        = ilUtil::GetObjectsByOperations ("grp", "read", False,False);
                $IliasArryGroups = array_merge($IliasArryGroups,ilUtil::GetObjectsByOperations("crs", "read", False,False));
                if($IliasArryGroups[0]!="") {
                        $i = 0;
                        foreach ($IliasArryGroups as $Row){
                                $groupContainer = $Row[ref_id];
                                $groups[$i][id]=$groupContainer ;
                        $groups[$i][title]=$Row[title] ;
                        $i++;
                        }
                }

                if($groups) {
                        foreach ($groups as $Row ){
                                $groupContainer = $Row[id];
                                if ($groupId == $groupContainer ){
                                        $groupname = $Row[title] ;
                                }
                }
                }
                return $groupname;
        }//end function

ilCalInterface::getIliasDbName (  ) 

Returns the Ilias-Databasename.

Returns:
array

Definition at line 362 of file class.ilCalInterface.php.

        {
                return $this->dbaseIlias; 
        }//end function

ilCalInterface::getLang (  ) 

read current language, the user selected public

Parameters:
@return string

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

        {
                return $this->uPrefs["language"];
        }//end function

ilCalInterface::getMemberGroups ( userId  ) 

Returns all groups where the user is member in.

Parameters:
int user_ID
Returns:
array

Definition at line 518 of file class.ilCalInterface.php.

Referenced by Database::getDates(), Database::getFullDayDates(), Database::getFullDayRotationDates(), and Database::getRotationDates().

        {
                $GroupIds                               = ilCalInterface::getGroupIds();
                return $GroupIds;
        }//end function

Here is the caller graph for this function:

ilCalInterface::getMysqlHostName (  ) 

Returns the mysql-Host for database-access.

Returns:
array

Definition at line 380 of file class.ilCalInterface.php.

        {
                return $this->host; 
        }//end function

ilCalInterface::getMysqlPass (  ) 

Returns the mysql-Password for database-access.

Returns:
array

Definition at line 398 of file class.ilCalInterface.php.

        {
                return $this->mysqlPass; 
        }//end function

ilCalInterface::getMysqlUserName (  ) 

Returns the mysql-Username for database-access.

Returns:
array

Definition at line 389 of file class.ilCalInterface.php.

        {
                return $this->mysqlUser; 
        }//end function

ilCalInterface::getNumOfMembers ( group_id  ) 

Returns number of members in the Group with $group_id.

Parameters:
$group_id (int)
Returns:
int

Definition at line 560 of file class.ilCalInterface.php.

Referenced by Database::delDate(), and Database::discardChangedDate().

        {
                $tmp_obj =& ilObjectFactory::getInstanceByRefId($group_id);

                switch($tmp_obj->getType())
                {
                        case 'grp':
                                return count($tmp_obj->getGroupMemberIds());

                        case 'crs':
                                $tmp_obj->initCourseMemberObject();

                                return count($tmp_obj->members_obj->getAssignedUsers()); 
                }

                #//gain access to ilias-variables
                #include_once("./classes/class.ilObjGroup.php");
                #$group = new ilObjGroup($group_id);
                #$members = $group->getGroupMemberIds($group_id);
                #return count($members);

        }//end function

Here is the caller graph for this function:

ilCalInterface::getOtherMembers ( groupId,
userId 
)

Returns all user-ID's which are in the given group ($groupId) except the given $userId.

Parameters:
int group_ID
int user_ID
Returns:
array

Definition at line 476 of file class.ilCalInterface.php.

Referenced by Database::addDate(), Database::delDate(), Database::getGroupDates(), Database::getGroupRotationDates(), and Database::updateDate().

        {
                $tmp_obj =& ilObjectFactory::getInstanceByRefId($groupId);

                switch($tmp_obj->getType())
                {
                        case 'grp':
                                $members = $tmp_obj->getGroupMemberIds($groupId);
                                break;

                        case 'crs':
                                $tmp_obj->initCourseMemberObject();

                                $members = $tmp_obj->members_obj->getAssignedUsers();
                                break;
                }                               



                //gain access to ilias-variables
                #include_once("./classes/class.ilObjGroup.php");
                #$group = new ilObjGroup($groupId);
                #$members = $group->getGroupMemberIds($groupId);

                if($members[0] == $userId and count($members) == 1) {
                        $members = FALSE;
                }elseif ($userId != "-1") {
                        array_unshift ($members, $userId);
                        $members = array_unique ($members);
                        $members = array_reverse ($members);
                        array_pop ($members);
                }
                return $members;
        }//end function

Here is the caller graph for this function:

ilCalInterface::getrelCSCWDir (  ) 

Returns the relative path where cscw is located.

Returns:
String

Definition at line 416 of file class.ilCalInterface.php.

        {
                return $this->relCSCWDir;       
        }//end function

ilCalInterface::getSkin (  ) 

read current skin-name, the user selected public

Parameters:
@return string

Definition at line 309 of file class.ilCalInterface.php.

        {
                return $this->uPrefs["skin"];
        }//end function

ilCalInterface::getStyle (  ) 

read current style(-sheet)-name, the user selected public

Parameters:
@return string

Definition at line 320 of file class.ilCalInterface.php.

        {
                return $this->uPrefs["style"]; 
        }//end function

ilCalInterface::getStyleFname (  ) 

read current style(-sheet)-name including path, the user selected public

Parameters:
@return string

Definition at line 331 of file class.ilCalInterface.php.

        {
                return ilUtil::getStyleSheetLocation();
        }//end function

ilCalInterface::getUId (  ) 

read UserID public

Parameters:
@return integer

Definition at line 287 of file class.ilCalInterface.php.

        {
                return $this->uId;
        }//end function

ilCalInterface::getUserGroups ( userId  ) 

Returns all groups which are owned by the user.

Parameters:
int user_ID
Returns:
array

Definition at line 451 of file class.ilCalInterface.php.

        {
        
                $IliasArryGroups        = ilUtil::GetObjectsByOperations ("grp", "read", False,False);
                $IliasArryGroups = array_merge($IliasArryGroups,ilUtil::GetObjectsByOperations ("crs", "read", False,False));

                if($IliasArryGroups[0]!="") {
                        $i = 0;
                        foreach (@$IliasArryGroups as $Row){
                        $groupContainer = $Row[ref_id];
                    $groups[$i][0]=$groupContainer ;
                        $groups[$i][1]=$Row[title] ;
                        $i++;
                        }           
                }
                return $groups;
        }//end function

ilCalInterface::ilCalInterface ( ilias,
nb = "" 
)

Definition at line 186 of file class.ilCalInterface.php.

        {
                
                global $tpl;
                //include manual edited variables
                include ('.'.DATEPLANER_ROOT_DIR.'/config/conf.dateplaner.php');
    
                /*generate a copy of the ilias object*/
                $this->ilias            = $ilias;
    
                $this->modulDir         = $modulDir;
                $this->relCSCWDir       = $relCSCWDir;  
                
                define("ALLUSERID", $allUserId); /* All USER ID */

                
                //gain access to ilias-variables
                if($dbaseIlias != "-1") {$this->dbaseIlias=$dbaseIlias;}else {$this->dbaseIlias =$this->ilias->ini->readVariable("db", "name");}
                if($dbaseCscw != "-1")  {$this->dbaseCscw=$dbaseCscw;}  else {$this->dbaseCscw  =$this->ilias->ini->readVariable("db", "name");}
                if($host != "-1")               {$this->host=$host;}                    else {$this->host               =$this->ilias->ini->readVariable("db", "host");}
                if($mysqlUser != "-1")  {$this->mysqlUser=$mysqlUser;}  else {$this->mysqlUser  =$this->ilias->ini->readVariable("db", "user");}
                if($mysqlPass != "-1")  {$this->mysqlPass=$mysqlPass;}  else {$this->mysqlPass  =$this->ilias->ini->readVariable("db", "pass");}
    
                $this->sock = @mysql_connect ($this->host, $this->mysqlUser, $this->mysqlPass);
                //connect to database
                if ($this->sock)
                {
                        if (mysql_select_db ($this->dbaseCscw, $this->sock) == FALSE)
                        {
                                mysql_close ($this->sock);
                                $this->sock = FALSE;
                        }
                }
    
                //gain further access to ilias-variables
                $this->uId                                      = $ilias->account->getId();
                $this->uPrefs["language"]       = $ilias->account->getPref("language");
                $this->uPrefs["skin"]           = $ilias->account->getPref("skin");
                $this->uPrefs["style"]          = $ilias->account->getPref("style");
                $this->GroupIds                         = $this->getGroupIds();


                $this->upText                           = "";   //menue string not developed in ilias3

                //$this->tpl            =& $tpl;
                //$this->__showLocator();


        }//end Constructor

ilCalInterface::showLocator ( tpl,
lng,
app 
)

showLocator($tpl, $lng, $app) genarate the locater for ilias3 public

Parameters:
@return integer

Definition at line 244 of file class.ilCalInterface.php.

        {

                $tpl = new ilTemplate("tpl.locator.html", true, true);
                $tpl->addBlockFile("LOCATOR","locator","tpl.locator.html");
                $tpl->setCurrentBlock("locator_item");
                $tpl->setVariable("LINK_ITEM","./dateplaner.php");
                $tpl->setVariable("LINK_TARGET","bottom");
                $tpl->setVariable("ITEM",$lng->txt("dateplaner"));
                $tpl->parseCurrentBlock();

                $tpl->touchBlock("locator_separator_prefix");
                $tpl->setCurrentBlock("locator_item");
                $tpl->setVariable("LINK_ITEM","./dateplaner.php?app=".$app);
                $tpl->setVariable("LINK_TARGET","bottom");
                $tpl->setVariable("ITEM",$lng->txt("app_".$app));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("locator");
                $tpl->setVariable("TXT_LOCATOR",$lng->txt("locator"));
                $tpl->parseCurrentBlock();
                $locator = '
                <div class="il_Locator">
                <table border="0" cellpadding="0" cellspacing="0" width="100%" >
                        <tr><td>'.$tpl->get().'</td>
                                <td align="right">
                                </td>
                        </tr>
                </table>
                </div>';
                
                Return $locator;


        }


Field Documentation

ilCalInterface::$allUserId

Definition at line 119 of file class.ilCalInterface.php.

ilCalInterface::$dbaseCscw

Definition at line 91 of file class.ilCalInterface.php.

ilCalInterface::$dbaseIlias

Definition at line 84 of file class.ilCalInterface.php.

ilCalInterface::$GroupIds

Definition at line 175 of file class.ilCalInterface.php.

ilCalInterface::$host

Definition at line 98 of file class.ilCalInterface.php.

ilCalInterface::$ilias

The following Variables do not need to be kept up to date manually.

This versions should autodetect the needed values automatically. The needed values are read within the Constructor from "/config/conf.dateplaner.php" into teh module dir. Therefore all Values should be edited in conf.dateplaner.php. private copy of the ilias object @ var object @ access private

Definition at line 54 of file class.ilCalInterface.php.

ilCalInterface::$iliasRootDir

ilias-root-directory (including the whole path beginning from system-root!) @ var string @ access private

Definition at line 61 of file class.ilCalInterface.php.

ilCalInterface::$modulDir

ilias module directory (up to the ilias root dir) @ var string @ access private

Definition at line 68 of file class.ilCalInterface.php.

ilCalInterface::$mysqlPass

Definition at line 112 of file class.ilCalInterface.php.

ilCalInterface::$mysqlUser

Definition at line 105 of file class.ilCalInterface.php.

ilCalInterface::$pBuf

Definition at line 168 of file class.ilCalInterface.php.

ilCalInterface::$relCSCWDir

relative path of the cscw dir @ var string @ access private

Definition at line 76 of file class.ilCalInterface.php.

ilCalInterface::$skinPath

Definition at line 161 of file class.ilCalInterface.php.

ilCalInterface::$sock = FALSE

Constructor fetch userspecific data from ilias and store them in local variables public.

Definition at line 183 of file class.ilCalInterface.php.

ilCalInterface::$templPath

Definition at line 154 of file class.ilCalInterface.php.

ilCalInterface::$uId

Definition at line 140 of file class.ilCalInterface.php.

ilCalInterface::$uPrefs

Definition at line 147 of file class.ilCalInterface.php.

ilCalInterface::$usingFrames

Definition at line 129 of file class.ilCalInterface.php.


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