/** * This adds a shortcut pointing to an existing folder to the current folder * * @author KnowledgeTree Team * @access public * @param int $folder_id The ID of the folder to create a shortcut to * @return KTAPI_Folder */ function add_folder_shortcut($folder_id) { $user = $this->can_user_access_object_requiring_permission($this->folder, KTAPI_PERMISSION_WRITE); if (PEAR::isError($user)) { return $user; } $oFolder = Folder::get($folder_id); if (PEAR::isError($oFolder)) { return $oFolder; } $user = $this->can_user_access_object_requiring_permission($oFolder, KTAPI_PERMISSION_READ); if (PEAR::isError($user)) { return $user; } $folder =& KTFolderUtil::createSymbolicLink($folder_id, $this->folder, $user); if (PEAR::isError($folder)) { return new PEAR_Error(KTAPI_ERROR_INTERNAL_ERROR . ' : ' . $folder->getMessage()); } return new KTAPI_Folder($this->ktapi, $folder); }