48 $this->db =
$DIC->database();
49 $this->export_id = $a_export_id;
50 if ($this->export_id) {
57 if (self::$instance) {
75 $query =
'SELECT MAX(export_id) exp FROM export_options ' .
76 'GROUP BY export_id ';
80 $exp_id = $row->exp + 1;
82 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value) ' .
84 $ilDB->quote($exp_id,
'integer') .
', ' .
85 $ilDB->quote(self::KEY_INIT,
'integer') .
', ' .
86 $ilDB->quote(0,
'integer') .
', ' .
87 $ilDB->quote(0,
'integer') .
', ' .
88 $ilDB->quote(0,
'integer') .
' ' .
90 $ilDB->manipulate($query);
100 foreach ((array) $this->ref_options[self::KEY_ITEM_MODE] as
$ref_id => $mode) {
101 if ($mode == self::EXPORT_BUILD) {
115 foreach ((array) $this->ref_options[self::KEY_ITEM_MODE] as
$ref_id => $mode) {
116 if ($mode != self::EXPORT_OMIT) {
134 public function addOption(
int $a_keyword,
int $a_ref_id,
int $a_obj_id, $a_value): void
136 $query =
"SELECT MAX(pos) position FROM export_options";
137 $res = $this->db->query($query);
141 $pos = (
int) $row->position;
145 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value,pos) ' .
154 $this->db->manipulate($query);
165 $items_selected =
false;
166 foreach ($child_nodes as $node) {
167 if ($node[
'type'] ===
'rolf') {
170 if ((
int) $node[
'ref_id'] === $parent_ref_id) {
173 (
int) $node[
'ref_id'],
174 (
int) $node[
'obj_id'],
183 (
int) $node[
'ref_id']
187 (
int) $node[
'ref_id'],
188 (
int) $node[
'obj_id'],
197 (
int) $node[
'ref_id'],
198 (
int) $node[
'obj_id'],
202 $items_selected =
true;
205 return $items_selected;
214 return $this->options[$a_keyword] ??
null;
225 return $this->obj_options[$a_keyword][$a_obj_id] ??
null;
236 return $this->ref_options[$a_keyword][$a_ref_id] ??
null;
239 public function delete():
void
241 $query =
"DELETE FROM export_options " .
243 $this->db->manipulate($query);
248 $this->options = array();
249 $this->obj_options = array();
250 $this->ref_options = array();
252 $query =
"SELECT * FROM export_options " .
255 $res = $this->db->query($query);
258 $this->ref_options[(
int) $row->keyword][(
int) $row->ref_id] = $row->value;
261 $this->obj_options[(
int) $row->keyword][(
int) $row->obj_id] = $row->value;
263 if (!$row->ref_id and !$row->obj_id) {
264 $this->options[(
int) $row->keyword] = $row->value;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getOptionByRefId(int $a_ref_id, int $a_keyword)
Get option by.
getSubitemsForCreation(int $a_source_id)
Get all subitems with mode ilExportOptions::EXPORT_BUILD
addOptions(int $parent_ref_id, ilObjectDefinition $object_definition, ilAccessHandler $il_access, array $child_nodes, array $cp_options)
__construct(int $a_export_id)
static newInstance(int $a_export_id)
getSubitemsForExport()
Get all subitems with mode != self::EXPORT_OMIT.
getOption(int $a_keyword)
getOptionByObjId(int $a_obj_id, int $a_keyword)
Get option by.
static ilExportOptions $instance
addOption(int $a_keyword, int $a_ref_id, int $a_obj_id, $a_value)
static allocateExportId()
parses the objects.xml it handles the xml-description of all ilias objects
allowExport(string $obj_name)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)