4 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
20 parent::__construct();
34 if (!$this->__checkSession($sid)) {
37 if (!strlen($ref_id)) {
39 'No ref id given. Aborting!',
43 global $rbacsystem, $tree,
$ilLog;
48 'No weblink found for id: ' . $ref_id,
54 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'Client');
58 $permission_ok =
false;
59 $write_permission_ok =
false;
61 if ($rbacsystem->checkAccess(
'edit', $ref_id)) {
62 $write_permission_ok =
true;
65 if ($rbacsystem->checkAccess(
'read', $ref_id)) {
66 $permission_ok =
true;
71 if (!$permission_ok && !$write_permission_ok) {
73 'No permission to edit the object with id: ' . $ref_id,
79 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlWriter.php';
81 $writer->setObjId($obj_id);
84 return $writer->xmlDumpMem(
true);
104 if (!$this->__checkSession($sid)) {
107 global $rbacsystem, $tree,
$ilLog;
110 return $this->
__raiseError(
'No valid target given.',
'Client');
114 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_OBJECT_DELETED');
119 $allowed_types =
array(
'cat',
'grp',
'crs',
'fold',
'root');
120 if (!in_array($target_obj->getType(), $allowed_types)) {
121 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, root, category or folder"',
'Client');
124 if (!$rbacsystem->checkAccess(
'create',
$target_id,
"webr")) {
130 include_once
'./Modules/WebResource/classes/class.ilObjLinkResource.php';
131 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlParser.php';
134 $webl->setTitle(
'XML Import');
136 $webl->createReference();
146 }
catch (ilWebLinkXMLParserException $e) {
151 return $webl->getRefId();
168 if (!$this->__checkSession($sid)) {
171 global $rbacsystem, $tree,
$ilLog;
174 return $this->
__raiseError(
'Cannot perform update since weblink has been deleted.',
'CLIENT_OBJECT_DELETED');
179 'No weblink found for id: ' . $ref_id,
180 'CLIENT_OBJECT_NOT_FOUND' 185 $permission_ok =
false;
187 if ($rbacsystem->checkAccess(
'edit', $ref_id)) {
188 $permission_ok =
true;
193 if (!$permission_ok) {
195 'No permission to edit the weblink with id: ' . $ref_id,
201 if (!is_object($webl) or $webl->getType()!=
"webr") {
203 'Wrong obj id or type for weblink with id ' . $ref_id,
209 include_once
'./Modules/WebResource/classes/class.ilWebLinkXmlParser.php';
215 }
catch (ilWebLinkXMLParserException $e) {
XML parser for weblink xml.
__construct()
Constructor.
updateWebLink($sid, $ref_id, $weblink_xml)
update a weblink with id.
static _isInTrash($a_ref_id)
checks wether object is in trash
SaxParserException thrown by ilSaxParser if property throwException is set.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
Soap methods for adminstrating web links.
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
createWebLink($sid, $target_id, $weblink_xml)
add an exercise with id.
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
readWebLink($sid, $ref_id)
Get Weblink xml.