ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 27 of file class.ilCopyWizardSettingsXMLParser.php.

References $xml, and ilSaxParser\setXMLContent().

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

Member Function Documentation

◆ getActionForString()

static ilCopyWizardSettingsXMLParser::getActionForString (   $s)
staticprivate

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

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

Referenced by handlerBeginTag().

145  {
146  if ($s == "COPY") {
148  }
149  if ($s == "LINK") {
151  }
153  }
$s
Definition: pwgen.php:45
+ 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 119 of file class.ilCopyWizardSettingsXMLParser.php.

References array.

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

◆ getSourceId()

ilCopyWizardSettingsXMLParser::getSourceId ( )

read access to source id

Returns
int

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

References $source_id.

◆ getTargetId()

ilCopyWizardSettingsXMLParser::getTargetId ( )

read access to target id

Returns
int

Definition at line 139 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 53 of file class.ilCopyWizardSettingsXMLParser.php.

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

54  {
55  global $objDefinition, $ilAccess, $tree;
56 
57  switch ($a_name) {
58  case 'Settings':
59  $this->options = array();
60  $this->source_id = (int) $a_attribs["source_id"];
61  if (ilObject::_isInTrash($this->source_id)) {
62  throw new ilSaxParserException("Source id " . $this->source_id . " is in trash");
63  }
64  $this->target_id = (int) $a_attribs["target_id"];
65  if (ilObject::_isInTrash($this->target_id)) {
66  throw new ilSaxParserException("target id" . $this->target_id . " is in trash");
67  }
68 
69  $this->default_action = ilCopyWizardSettingsXMLParser::getActionForString($a_attribs["default_action"]);
70  break;
71  case 'Option':
72  $id = (int) $a_attribs["id"];
74  throw new ilSaxParserException("Id $id is in trash");
75  }
76  if (!$tree->isInTree($id)) {
77  throw new ilSaxParserException("Id $id does not exist");
78  }
79 
82 
83 
84  switch ($action) {
86  $perm_copy = $ilAccess->checkAccess('copy', '', $id);
87  $copy = $objDefinition->allowCopy($type);
88 
89  if ($perm_copy && $copy) {
90  $this->options [$id] = array("type" => $action);
91  } elseif ($copy && !$perm_copy) {
92  throw new ilSaxParserException("Missing copy permission for object " . $id);
93  } elseif (!$copy) {
94  throw new ilSaxParserException("Copy for object " . $id . " of type " . $type . " is not supported");
95  }
96  break;
98  $perm_link = $ilAccess->checkAccess('write', '', $id);
99  $link = $objDefinition->allowLink($type);
100 
101  if ($perm_link && $link) {
102  $this->options [$id] = array("type" => $action);
103  } elseif ($copy && !$perm_link) {
104  throw new ilSaxParserException("Missing write permission for object " . $id);
105  } elseif (!$link) {
106  throw new ilSaxParserException("Link for object " . $id . " of type " . $type . " is not supported");
107  }
108  break;
109  }
110  }
111  }
$action
$type
if(!array_key_exists('StateId', $_REQUEST)) $id
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 165 of file class.ilCopyWizardSettingsXMLParser.php.

166  {
167  }

◆ handlerEndTag()

ilCopyWizardSettingsXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

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

156  {
157  }

◆ setHandlers()

ilCopyWizardSettingsXMLParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser private

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

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

Field Documentation

◆ $default_action

ilCopyWizardSettingsXMLParser::$default_action
private

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

◆ $options

ilCopyWizardSettingsXMLParser::$options
private

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

◆ $source_id

ilCopyWizardSettingsXMLParser::$source_id
private

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

Referenced by getSourceId().

◆ $target_id

ilCopyWizardSettingsXMLParser::$target_id
private

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

Referenced by getTargetId().


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