44 $this->db =
$DIC->database();
81 $this->auto_generated = $a_status;
101 $this->title = $a_val;
121 $this->type = $a_val;
141 $this->description = $a_val;
161 public function setSetting($a_setting, $a_value, $a_hide =
false)
164 $settings = $this->
getConfig()->getSettings();
167 if (is_array($a_value)) {
168 $a_value = serialize($a_value);
170 $a_value = unserialize($a_value);
175 $this->setting[$a_setting] = array(
188 unset($this->setting[$a_setting]);
196 $this->setting = array();
215 $this->hidden_tab[$a_tab_id] = $a_tab_id;
223 $this->hidden_tab = array();
268 "SELECT * FROM adm_settings_template WHERE " .
269 " id = " .
$ilDB->quote($this->getId(),
"integer")
271 $rec =
$ilDB->fetchAssoc($set);
281 "SELECT * FROM adm_set_templ_value WHERE " .
282 " template_id = " .
$ilDB->quote($this->getId(),
"integer")
284 while ($rec =
$ilDB->fetchAssoc($set)) {
294 "SELECT * FROM adm_set_templ_hide_tab WHERE " .
295 " template_id = " .
$ilDB->quote($this->getId(),
"integer")
297 while ($rec =
$ilDB->fetchAssoc($set)) {
309 $this->
setId(
$ilDB->nextId(
"adm_settings_template"));
312 $ilDB->insert(
"adm_settings_template", array(
313 "id" => array(
"integer", $this->
getId()),
314 "title" => array(
"text", $this->
getTitle()),
315 "type" => array(
"text", $this->
getType()),
337 $ilDB->update(
"adm_settings_template", array(
338 "title" => array(
"text", $this->
getTitle()),
339 "type" => array(
"text", $this->
getType()),
344 "id" => array(
"integer", $this->
getId()),
349 "DELETE FROM adm_set_templ_value WHERE "
350 .
" template_id = " .
$ilDB->quote($this->getId(),
"integer")
353 "DELETE FROM adm_set_templ_hide_tab WHERE "
354 .
" template_id = " .
$ilDB->quote($this->getId(),
"integer")
370 $ilDB->manipulate(
"INSERT INTO adm_set_templ_value " .
371 "(template_id, setting, value, hide) VALUES (" .
372 $ilDB->quote($this->getId(),
"integer") .
"," .
373 $ilDB->quote(
$s,
"text") .
"," .
374 $ilDB->quote($set[
"value"],
"text") .
"," .
375 $ilDB->quote($set[
"hide"],
"integer") .
388 $ilDB->manipulate(
"INSERT INTO adm_set_templ_hide_tab " .
389 "(template_id, tab_id) VALUES (" .
390 $ilDB->quote($this->getId(),
"integer") .
"," .
391 $ilDB->quote($tab_id,
"text") .
399 public function delete()
404 "DELETE FROM adm_settings_template WHERE "
405 .
" id = " .
$ilDB->quote($this->getId(),
"integer")
408 "DELETE FROM adm_set_templ_value WHERE "
409 .
" template_id = " .
$ilDB->quote($this->getId(),
"integer")
412 "DELETE FROM adm_set_templ_hide_tab WHERE "
413 .
" template_id = " .
$ilDB->quote($this->getId(),
"integer")
429 if ($a_include_auto_generated) {
430 $set =
$ilDB->query(
"SELECT * FROM adm_settings_template " .
434 $set =
$ilDB->query(
"SELECT * FROM adm_settings_template " .
436 'AND auto_generated = ' .
$ilDB->quote(0,
'integer') .
' ' .
442 $settings_template = array();
443 while ($rec =
$ilDB->fetchAssoc($set)) {
444 $settings_template[] = $rec;
446 return $settings_template;
462 "SELECT $a_prop FROM adm_settings_template WHERE " .
463 " id = " .
$ilDB->quote($a_id,
"integer")
465 $rec =
$ilDB->fetchAssoc($set);
466 return $rec[$a_prop];
494 if (substr($a_title_desc, 0, 3) ==
'il_') {
495 return $GLOBALS[
'lng']->txt($a_title_desc);
497 return $a_title_desc;
An exception for terminatinating execution or to throw for unit testing.
Settings template config class.
Settings template application class.
setAutoGenerated($a_status)
Set auto generated status.
getConfig()
Returns the template config associated with this template or NULL if none is given.
getHiddenTabs()
Get hidden tabs.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
static translate($a_title_desc)
setTitle($a_val)
Set title.
create()
Create settings template.
addHiddenTab($a_tab_id)
Add hidden tab.
__construct($a_id=0, $config=null)
Constructor.
getAutoGenerated()
Get auto generated status.
setSetting($a_setting, $a_value, $a_hide=false)
Set setting.
removeSetting($a_setting)
Remove setting.
insertSettings()
Insert settings to db.
getDescription()
Get description.
removeAllHiddenTabs()
Remove all hidden tabs.
static lookupDescription($a_id)
Lookup title.
update()
Update settings template.
static lookupTitle($a_id)
Lookup title.
setConfig(ilSettingsTemplateConfig $config)
Sets the template config for this template.
setDescription($a_val)
Set description.
getSettings()
Get settings.
static lookupProperty($a_id, $a_prop)
Lookup property.
insertHiddenTabs()
Insert hidden tabs.
removeAllSettings()
Remove all settings.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.