ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCopyWizardSettingsXMLParser Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilCopyWizardSettingsXMLParser:
+ Collaboration diagram for ilCopyWizardSettingsXMLParser:

Public Member Functions

 __construct (string $xml)
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, string $a_name, array $a_attribs)
 
 getOptions ()
 
 getSourceId ()
 
 getTargetId ()
 
 handlerEndTag ($a_xml_parser, string $a_name)
 
 handlerCharacterData ($a_xml_parser, string $a_data)
 
- Public Member Functions inherited from ilSaxParser
 __construct (?string $path_to_file='', ?bool $throw_exception=false)
 
 setXMLContent (string $a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 
 setHandlers ($a_xml_parser)
 
 parse ($a_xml_parser, $a_fp=null)
 

Static Private Member Functions

static getActionForString ($s)
 

Private Attributes

array $options = []
 
int $source_id = 0
 
int $target_id = 0
 

Additional Inherited Members

- Data Fields inherited from ilSaxParser
string $xml_file
 
bool $throw_exception = false
 
- Protected Member Functions inherited from ilSaxParser
 openXMLFile ()
 
 handleError (string $message)
 
 setThrowException (bool $throw_exception)
 
- Protected Attributes inherited from ilSaxParser
ilLanguage $lng = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Constructor & Destructor Documentation

◆ __construct()

ilCopyWizardSettingsXMLParser::__construct ( string  $xml)

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

References ILIAS\GlobalScreen\Provider\__construct(), and ilSaxParser\setXMLContent().

26  {
27  parent::__construct('', true);
28  $this->setXMLContent($xml);
29  }
__construct(Container $dic, ilPlugin $plugin)
setXMLContent(string $a_xml_content)
+ Here is the call graph for this function:

Member Function Documentation

◆ getActionForString()

static ilCopyWizardSettingsXMLParser::getActionForString (   $s)
staticprivate

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

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

120  : int
121  {
122  if ($s === "COPY") {
124  }
125 
126  if ($s === "LINK") {
128  }
129 
131  }

◆ getOptions()

ilCopyWizardSettingsXMLParser::getOptions ( )

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

References $options.

105  : array
106  {
107  return $this->options;
108  }

◆ getSourceId()

ilCopyWizardSettingsXMLParser::getSourceId ( )

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

References $source_id.

110  : ?int
111  {
112  return $this->source_id;
113  }

◆ getTargetId()

ilCopyWizardSettingsXMLParser::getTargetId ( )

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

References $target_id.

115  : ?int
116  {
117  return $this->target_id;
118  }

◆ handlerBeginTag()

ilCopyWizardSettingsXMLParser::handlerBeginTag (   $a_xml_parser,
string  $a_name,
array  $a_attribs 
)
Parameters
XMLParser | resource$a_xml_parser

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

References $DIC, $id, ilObject\_isInTrash(), ilCopyWizardOptions\COPY_WIZARD_COPY, ilCopyWizardOptions\COPY_WIZARD_LINK, ilObjectFactory\getTypeByRefId(), and ILIAS\Repository\int().

Referenced by setHandlers().

44  : void
45  {
46  global $DIC;
47 
48  $objDefinition = $DIC['objDefinition'];
49  $ilAccess = $DIC['ilAccess'];
50  $tree = $DIC['tree'];
51 
52  switch ($a_name) {
53  case 'Settings':
54  $this->options = array();
55  $this->source_id = (int) $a_attribs["source_id"];
56  if (ilObject::_isInTrash($this->source_id)) {
57  throw new ilSaxParserException("Source id " . $this->source_id . " is in trash");
58  }
59  $this->target_id = (int) $a_attribs["target_id"];
60  if (ilObject::_isInTrash($this->target_id)) {
61  throw new ilSaxParserException("target id" . $this->target_id . " is in trash");
62  }
63  break;
64  case 'Option':
65  $id = (int) $a_attribs["id"];
67  throw new ilSaxParserException("Id $id is in trash");
68  }
69  if (!$tree->isInTree($id)) {
70  throw new ilSaxParserException("Id $id does not exist");
71  }
72 
73  $action = self::getActionForString($a_attribs["action"]);
75 
76  switch ($action) {
78  $perm_copy = $ilAccess->checkAccess('copy', '', $id);
79  $copy = $objDefinition->allowCopy($type);
80 
81  if ($perm_copy && $copy) {
82  $this->options [$id] = array("type" => $action);
83  } elseif ($copy && !$perm_copy) {
84  throw new ilSaxParserException("Missing copy permission for object " . $id);
85  } elseif (!$copy) {
86  throw new ilSaxParserException("Copy for object " . $id . " of type " . $type . " is not supported");
87  }
88  break;
90  $perm_link = $ilAccess->checkAccess('write', '', $id);
91  $link = $objDefinition->allowLink($type);
92 
93  if ($perm_link && $link) {
94  $this->options [$id] = array("type" => $action);
95  } elseif ($link && !$perm_link) {
96  throw new ilSaxParserException("Missing write permission for object " . $id);
97  } elseif (!$link) {
98  throw new ilSaxParserException("Link for object " . $id . " of type " . $type . " is not supported");
99  }
100  break;
101  }
102  }
103  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getTypeByRefId(int $ref_id, bool $stop_on_error=true)
get object type by reference id
static _isInTrash(int $ref_id)
global $DIC
Definition: shib_login.php:22
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerCharacterData()

ilCopyWizardSettingsXMLParser::handlerCharacterData (   $a_xml_parser,
string  $a_data 
)
Parameters
XMLParser | resource$a_xml_parser

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

Referenced by setHandlers().

143  : void
144  {
145  }
+ Here is the caller graph for this function:

◆ handlerEndTag()

ilCopyWizardSettingsXMLParser::handlerEndTag (   $a_xml_parser,
string  $a_name 
)
Parameters
XMLParser | resource$a_xml_parser

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

Referenced by setHandlers().

136  : void
137  {
138  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilCopyWizardSettingsXMLParser::setHandlers (   $a_xml_parser)
Parameters
XMLParser | resource$a_xml_parser
Returns
void

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

References handlerBeginTag(), handlerCharacterData(), and handlerEndTag().

35  : void
36  {
37  xml_set_element_handler($a_xml_parser, $this->handlerBeginTag(...), $this->handlerEndTag(...));
38  xml_set_character_data_handler($a_xml_parser, $this->handlerCharacterData(...));
39  }
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handlerCharacterData($a_xml_parser, string $a_data)
+ Here is the call graph for this function:

Field Documentation

◆ $options

array ilCopyWizardSettingsXMLParser::$options = []
private

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

Referenced by getOptions().

◆ $source_id

int ilCopyWizardSettingsXMLParser::$source_id = 0
private

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

Referenced by getSourceId().

◆ $target_id

int ilCopyWizardSettingsXMLParser::$target_id = 0
private

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

Referenced by getTargetId().


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