ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilCopyWizardSettingsXMLParser Class Reference
+ Inheritance diagram for ilCopyWizardSettingsXMLParser:
+ Collaboration diagram for ilCopyWizardSettingsXMLParser:

Public Member Functions

 __construct ($xml)
 constructor More...
 
 setHandlers ($a_xml_parser)
 set event handlers More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 getOptions ()
 read access to options array More...
 
 getSourceId ()
 read access to source id More...
 
 getTargetId ()
 read access to target id More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Static Private Member Functions

static getActionForString ($s)
 

Private Attributes

 $options
 
 $source_id
 
 $target_id
 
 $default_action
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Definition at line 13 of file class.ilCopyWizardSettingsXMLParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilCopyWizardSettingsXMLParser::__construct (   $xml)

constructor

Parameters
stringxml version
stringoutput encoding
stringinput encoding public

Definition at line 28 of file class.ilCopyWizardSettingsXMLParser.php.

References ilSaxParser\setXMLContent().

29  {
30  parent::__construct('', true);
31  $this->setXMLContent($xml);
32  }
setXMLContent($a_xml_content)
+ Here is the call graph for this function:

Member Function Documentation

◆ getActionForString()

static ilCopyWizardSettingsXMLParser::getActionForString (   $s)
staticprivate

Definition at line 145 of file class.ilCopyWizardSettingsXMLParser.php.

References ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, and ilCopyWizardOptions\COPY_WIZARD_OMIT.

Referenced by handlerBeginTag().

145  {
146  if ($s == "COPY")
148  if ($s == "LINK")
151  }
+ Here is the caller graph for this function:

◆ getOptions()

ilCopyWizardSettingsXMLParser::getOptions ( )

read access to options array

Returns
array key is reference id, value is assoc. array with type and action

Definition at line 123 of file class.ilCopyWizardSettingsXMLParser.php.

References array.

123  {
124  return is_array($this->options) ? $this->options : array();
125  }
Create styles array
The data for the language used.

◆ getSourceId()

ilCopyWizardSettingsXMLParser::getSourceId ( )

read access to source id

Returns
int

Definition at line 132 of file class.ilCopyWizardSettingsXMLParser.php.

References $source_id.

◆ getTargetId()

ilCopyWizardSettingsXMLParser::getTargetId ( )

read access to target id

Returns
int

Definition at line 141 of file class.ilCopyWizardSettingsXMLParser.php.

References $target_id.

◆ handlerBeginTag()

ilCopyWizardSettingsXMLParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Parameters
resource$a_xml_parserxml parser
string$a_nameelement name
array$a_attribselement attributes array

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

References ilObject\_isInTrash(), array, ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, getActionForString(), and ilObjectFactory\getTypeByRefId().

55  {
56  global $objDefinition, $ilAccess, $tree;
57 
58  switch($a_name)
59  {
60  case 'Settings':
61  $this->options = array();
62  $this->source_id = (int) $a_attribs["source_id"];
63  if(ilObject::_isInTrash($this->source_id))
64  {
65  throw new ilSaxParserException("Source id ".$this->source_id." is in trash");
66  }
67  $this->target_id = (int) $a_attribs["target_id"];
68  if(ilObject::_isInTrash($this->target_id))
69  {
70  throw new ilSaxParserException("target id".$this->target_id." is in trash");
71  }
72 
73  $this->default_action = ilCopyWizardSettingsXMLParser::getActionForString($a_attribs["default_action"]);
74  break;
75  case 'Option':
76  $id = (int) $a_attribs["id"];
77  if(ilObject::_isInTrash($id))
78  {
79  throw new ilSaxParserException("Id $id is in trash");
80  }
81  if(!$tree->isInTree($id))
82  {
83  throw new ilSaxParserException("Id $id does not exist");
84  }
85 
86  $action = ilCopyWizardSettingsXMLParser::getActionForString($a_attribs["action"]);
88 
89 
90  switch ($action) {
92  $perm_copy = $ilAccess->checkAccess('copy','',$id);
93  $copy = $objDefinition->allowCopy($type);
94 
95  if ($perm_copy && $copy)
96  $this->options [$id] = array("type" => $action);
97  elseif ($copy && !$perm_copy)
98  throw new ilSaxParserException("Missing copy permission for object ".$id);
99  elseif (!$copy)
100  throw new ilSaxParserException("Copy for object ".$id." of type ".$type." is not supported");
101  break;
103  $perm_link = $ilAccess->checkAccess('write','',$id);
104  $link = $objDefinition->allowLink($type);
105 
106  if ($perm_link && $link)
107  $this->options [$id] = array("type" => $action);
108  elseif ($copy && !$perm_link)
109  throw new ilSaxParserException("Missing write permission for object ".$id);
110  elseif (!$link)
111  throw new ilSaxParserException("Link for object ".$id." of type ".$type." is not supported");
112  break;
113  }
114  }
115  }
static _isInTrash($a_ref_id)
checks wether object is in trash
SaxParserException thrown by ilSaxParser if property throwException is set.
static getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilCopyWizardSettingsXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Parameters
resource$a_xml_parserxml parser
string$a_datacharacter data

Definition at line 163 of file class.ilCopyWizardSettingsXMLParser.php.

163  {
164  }

◆ handlerEndTag()

ilCopyWizardSettingsXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

Definition at line 153 of file class.ilCopyWizardSettingsXMLParser.php.

154  {
155  }

◆ setHandlers()

ilCopyWizardSettingsXMLParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser private

Definition at line 40 of file class.ilCopyWizardSettingsXMLParser.php.

41  {
42  xml_set_object($a_xml_parser,$this);
43  xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
44  xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
45  }

Field Documentation

◆ $default_action

ilCopyWizardSettingsXMLParser::$default_action
private

Definition at line 19 of file class.ilCopyWizardSettingsXMLParser.php.

◆ $options

ilCopyWizardSettingsXMLParser::$options
private

Definition at line 16 of file class.ilCopyWizardSettingsXMLParser.php.

◆ $source_id

ilCopyWizardSettingsXMLParser::$source_id
private

Definition at line 17 of file class.ilCopyWizardSettingsXMLParser.php.

Referenced by getSourceId().

◆ $target_id

ilCopyWizardSettingsXMLParser::$target_id
private

Definition at line 18 of file class.ilCopyWizardSettingsXMLParser.php.

Referenced by getTargetId().


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