36 $this->export_id = $a_export_id;
46 if (self::$instance) {
47 return self::$instance;
70 $query =
'SELECT MAX(export_id) exp FROM export_options ' .
71 'GROUP BY export_id ';
75 $exp_id =
$row->exp + 1;
77 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value) ' .
79 $ilDB->quote($exp_id,
'integer') .
', ' .
80 $ilDB->quote(self::KEY_INIT,
'integer') .
', ' .
81 $ilDB->quote(0,
'integer') .
', ' .
82 $ilDB->quote(0,
'integer') .
', ' .
83 $ilDB->quote(0,
'integer') .
' ' .
99 foreach ((
array) $this->ref_options[self::KEY_ITEM_MODE] as $ref_id => $mode) {
100 if ($mode == self::EXPORT_BUILD) {
114 foreach ((
array) $this->ref_options[self::KEY_ITEM_MODE] as $ref_id => $mode) {
115 if ($mode != self::EXPORT_OMIT) {
131 public function addOption($a_keyword, $a_ref_id, $a_obj_id, $a_value)
135 $query =
"SELECT MAX(pos) position FROM export_options";
140 $pos =
$row->position;
144 $query =
'INSERT INTO export_options (export_id,keyword,ref_id,obj_id,value,pos) ' .
146 $ilDB->quote($this->
getExportId(),
'integer') .
', ' .
147 $ilDB->quote($a_keyword,
'integer') .
', ' .
148 $ilDB->quote($a_ref_id,
'integer') .
', ' .
149 $ilDB->quote($a_obj_id,
'integer') .
', ' .
150 $ilDB->quote($a_value,
'integer') .
', ' .
151 $ilDB->quote($pos,
'integer') .
' ' .
153 $ilDB->manipulate(
$query);
163 return isset($this->options[$a_keyword]) ? $this->options[$a_keyword] : null;
174 return isset($this->obj_options[$a_keyword][$a_obj_id]) ? $this->obj_options[$a_keyword][$a_obj_id] : null;
185 return isset($this->ref_options[$a_keyword][$a_ref_id]) ? $this->ref_options[$a_keyword][$a_ref_id] : null;
192 public function delete()
196 $query =
"DELETE FROM export_options " .
197 "WHERE export_id = " . $ilDB->quote($this->
getExportId(),
'integer');
198 $ilDB->manipulate(
$query);
210 $this->options =
array();
211 $this->obj_options =
array();
212 $this->ref_options =
array();
214 $query =
"SELECT * FROM export_options " .
215 "WHERE export_id = " . $ilDB->quote($this->
getExportId(),
'integer') .
' ' .
220 $this->ref_options[
$row->keyword][
$row->ref_id] =
$row->value;
223 $this->obj_options[
$row->keyword][
$row->obj_id] =
$row->value;
225 if (!
$row->ref_id and !
$row->obj_id) {
226 $this->options[
$row->keyword] =
$row->value;
getExportId()
Get export id.
static getInstance()
Get singelton instance.
getOptionByRefId($a_ref_id, $a_keyword)
Get option by.
getSubitemsForExport()
Get all subitems with mode != self::EXPORT_OMIT.
static newInstance($a_export_id)
Create new instance.
getOptionByObjId($a_obj_id, $a_keyword)
Get option by.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
getSubitemsForCreation($a_source_id)
Get all subitems with mode ilExportOptions::EXPORT_BUILD
addOption($a_keyword, $a_ref_id, $a_obj_id, $a_value)
__construct($a_export_id)
Singleton constructor.
getOption($a_keyword)
Get option.
static allocateExportId()
Allocate a new export id.