Public Member Functions | |
ilObjContainer ($a_id=0, $a_call_by_reference=true) | |
Constructor public. | |
createContainerDirectory () | |
getContainerDirectory () | |
_getContainerDirectory ($a_id) | |
getBigIconPath () | |
getSmallIconPath () | |
_lookupContainerSetting ($a_id, $a_keyword) | |
_writeContainerSetting ($a_id, $a_keyword, $a_value) | |
_lookupIconPath ($a_id, $a_size) | |
lookup icon path | |
saveIcons ($a_big_icon, $a_small_icon) | |
save container icons | |
removeBigIcon () | |
remove big icon | |
removeSmallIcon () | |
remove small icon |
Definition at line 39 of file class.ilContainer.php.
ilContainer::_getContainerDirectory | ( | $ | a_id | ) |
Definition at line 72 of file class.ilContainer.php.
References ilUtil::getWebspaceDir().
Referenced by _lookupIconPath(), and getContainerDirectory().
{ return ilUtil::getWebspaceDir()."/container_data/obj_".$a_id; }
ilContainer::_lookupContainerSetting | ( | $ | a_id, | |
$ | a_keyword | |||
) |
Definition at line 87 of file class.ilContainer.php.
Referenced by _lookupIconPath(), ilObjAdvancedEditingGUI::clearCategoryPageObject(), ilContainerGUI::editPageContentObject(), ilContainerGUI::renderItemList(), ilContainerGUI::savePageContentObject(), and ilObjAdvancedEditingGUI::undoLastCategoryChangeObject().
{ global $ilDB; $q = "SELECT * FROM container_settings WHERE ". " id = ".$ilDB->quote($a_id)." AND ". " keyword = ".$ilDB->quote($a_keyword); $set = $ilDB->query($q); $rec = $set->fetchRow(DB_FETCHMODE_ASSOC); return $rec["value"]; }
ilContainer::_lookupIconPath | ( | $ | a_id, | |
$ | a_size | |||
) |
lookup icon path
int | $a_id container object id | |
string | $a_size "big" | "small" |
Definition at line 118 of file class.ilContainer.php.
References $file_name, _getContainerDirectory(), and _lookupContainerSetting().
Referenced by ilPersonalDesktopGUI::addParentRow(), ilPersonalDesktopGUI::addStandardRow(), ilContainerGUI::addStandardRow(), getBigIconPath(), ilRepositoryExplorer::getImage(), ilAdministrationExplorer::getImage(), getSmallIconPath(), and ilContainerGUI::setTitleAndDescription().
{ $size = ($a_size == "small") ? "small" : "big"; if (ilContainer::_lookupContainerSetting($a_id, "icon_".$size)) { $cont_dir = ilContainer::_getContainerDirectory($a_id); $file_name = $cont_dir."/icon_".$a_size.".gif"; if (is_file($file_name)) { return $file_name; } } return ""; }
ilContainer::_writeContainerSetting | ( | $ | a_id, | |
$ | a_keyword, | |||
$ | a_value | |||
) |
Definition at line 100 of file class.ilContainer.php.
References $q.
Referenced by removeBigIcon(), removeSmallIcon(), saveIcons(), and ilContainerGUI::savePageContentObject().
{ global $ilDB; $q = "REPLACE INTO container_settings (id, keyword, value) VALUES". " (".$ilDB->quote($a_id).", ". $ilDB->quote($a_keyword).", ". $ilDB->quote($a_value).")"; $ilDB->query($q); }
ilContainer::createContainerDirectory | ( | ) |
Definition at line 52 of file class.ilContainer.php.
References ilObject::getId(), ilUtil::getWebspaceDir(), and ilUtil::makeDir().
Referenced by saveIcons().
{ $webspace_dir = ilUtil::getWebspaceDir(); $cont_dir = $webspace_dir."/container_data"; if (!is_dir($cont_dir)) { ilUtil::makeDir($cont_dir); } $obj_dir = $cont_dir."/obj_".$this->getId(); if (!is_dir($obj_dir)) { ilUtil::makeDir($obj_dir); } }
ilContainer::getBigIconPath | ( | ) |
Definition at line 77 of file class.ilContainer.php.
References _lookupIconPath(), and ilObject::getId().
{ return ilContainer::_lookupIconPath($this->getId(), "big"); }
ilContainer::getContainerDirectory | ( | ) |
Definition at line 67 of file class.ilContainer.php.
References _getContainerDirectory(), and ilObject::getId().
Referenced by removeBigIcon(), removeSmallIcon(), and saveIcons().
{ return $this->_getContainerDirectory($this->getId()); }
ilContainer::getSmallIconPath | ( | ) |
Definition at line 82 of file class.ilContainer.php.
References _lookupIconPath(), and ilObject::getId().
{ return ilContainer::_lookupIconPath($this->getId(), "small"); }
ilContainer::ilObjContainer | ( | $ | a_id = 0 , |
|
$ | a_call_by_reference = true | |||
) |
Constructor public.
integer | reference_id or object_id | |
boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 47 of file class.ilContainer.php.
References ilObject::ilObject().
{ $this->ilObject($a_id, $a_call_by_reference); }
ilContainer::removeBigIcon | ( | ) |
remove big icon
Definition at line 195 of file class.ilContainer.php.
References _writeContainerSetting(), getContainerDirectory(), and ilObject::getId().
{ $cont_dir = $this->getContainerDirectory(); $big_file_name = $cont_dir."/icon_big.gif"; @unlink($big_file_name); ilContainer::_writeContainerSetting($this->getId(), "icon_big", 0); }
ilContainer::removeSmallIcon | ( | ) |
remove small icon
Definition at line 206 of file class.ilContainer.php.
References _writeContainerSetting(), getContainerDirectory(), and ilObject::getId().
{ $cont_dir = $this->getContainerDirectory(); $small_file_name = $cont_dir."/icon_small.gif"; @unlink($small_file_name); ilContainer::_writeContainerSetting($this->getId(), "icon_small", 0); }
ilContainer::saveIcons | ( | $ | a_big_icon, | |
$ | a_small_icon | |||
) |
save container icons
Definition at line 141 of file class.ilContainer.php.
References $cmd, _writeContainerSetting(), createContainerDirectory(), ilUtil::escapeShellArg(), getContainerDirectory(), ilUtil::getConvertCmd(), and ilObject::getId().
{ global $ilDB; $this->createContainerDirectory(); $cont_dir = $this->getContainerDirectory(); // save big icon $big_geom = $this->ilias->getSetting("custom_icon_big_width")."x". $this->ilias->getSetting("custom_icon_big_height"); $big_file_name = $cont_dir."/icon_big.gif"; if (is_file($a_big_icon["tmp_name"])) { $a_big_icon["tmp_name"] = ilUtil::escapeShellArg($a_big_icon["tmp_name"]); $big_file_name = ilUtil::escapeShellArg($big_file_name); $cmd = ilUtil::getConvertCmd()." ".$a_big_icon["tmp_name"]."[0] -geometry $big_geom GIF:$big_file_name"; system($cmd); } if (is_file($cont_dir."/icon_big.gif")) { ilContainer::_writeContainerSetting($this->getId(), "icon_big", 1); } else { ilContainer::_writeContainerSetting($this->getId(), "icon_big", 0); } // save small icon $small_geom = $this->ilias->getSetting("custom_icon_small_width")."x". $this->ilias->getSetting("custom_icon_small_height"); $small_file_name = $cont_dir."/icon_small.gif"; if (is_file($a_small_icon["tmp_name"])) { $a_small_icon["tmp_name"] = ilUtil::escapeShellArg($a_small_icon["tmp_name"]); $small_file_name = ilUtil::escapeShellArg($small_file_name); $cmd = ilUtil::getConvertCmd()." ".$a_small_icon["tmp_name"]."[0] -geometry $small_geom GIF:$small_file_name"; system($cmd); } if (is_file($cont_dir."/icon_small.gif")) { ilContainer::_writeContainerSetting($this->getId(), "icon_small", 1); } else { ilContainer::_writeContainerSetting($this->getId(), "icon_small", 0); } }