本文整理汇总了PHP中ilObject::_getObjectsDataForType方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::_getObjectsDataForType方法的具体用法?PHP ilObject::_getObjectsDataForType怎么用?PHP ilObject::_getObjectsDataForType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::_getObjectsDataForType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addMissingStyleClassesToAllStyles
/**
* Add missing style classes to all styles
*/
static function _addMissingStyleClassesToAllStyles($a_styles = "")
{
global $ilDB;
if ($a_styles == "") {
$styles = ilObject::_getObjectsDataForType("sty");
} else {
$styles = $a_styles;
}
$core_styles = ilObjStyleSheet::_getCoreStyles();
$bdom = ilObjStyleSheet::_getBasicStyleDom();
// get all core image files
$core_images = array();
$core_dir = self::$basic_style_image_dir;
if (is_dir($core_dir)) {
$dir = opendir($core_dir);
while ($file = readdir($dir)) {
if (substr($file, 0, 1) != "." && is_file($core_dir . "/" . $file)) {
$core_images[] = $file;
}
}
}
foreach ($styles as $style) {
$id = $style["id"];
foreach ($core_styles as $cs) {
// check, whether core style class exists
$set = $ilDB->queryF("SELECT * FROM style_char WHERE style_id = %s " . "AND type = %s AND characteristic = %s", array("integer", "text", "text"), array($id, $cs["type"], $cs["class"]));
// if not, add core style class
if (!($rec = $ilDB->fetchAssoc($set))) {
$ilDB->manipulateF("INSERT INTO style_char (style_id, type, characteristic) " . " VALUES (%s,%s,%s) ", array("integer", "text", "text"), array($id, $cs["type"], $cs["class"]));
$xpath = new DOMXPath($bdom);
$par_nodes = $xpath->query("/StyleSheet/Style[@Tag = '" . $cs["tag"] . "' and @Type='" . $cs["type"] . "' and @Class='" . $cs["class"] . "']/StyleParameter");
foreach ($par_nodes as $par_node) {
// check whether style parameter exists
$set = $ilDB->queryF("SELECT * FROM style_parameter WHERE style_id = %s " . "AND type = %s AND class = %s AND tag = %s AND parameter = %s", array("integer", "text", "text", "text", "text"), array($id, $cs["type"], $cs["class"], $cs["tag"], $par_node->getAttribute("Name")));
// if not, create style parameter
if (!($rec = $ilDB->fetchAssoc($set))) {
$spid = $ilDB->nextId("style_parameter");
$st = $ilDB->manipulateF("INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value) " . " VALUES (%s,%s,%s,%s,%s,%s,%s)", array("integer", "integer", "text", "text", "text", "text", "text"), array($spid, $id, $cs["type"], $cs["class"], $cs["tag"], $par_node->getAttribute("Name"), $par_node->getAttribute("Value")));
}
}
}
}
// now check, whether some core image files are missing
ilObjStyleSheet::_createImagesDirectory($id);
$imdir = ilObjStyleSheet::_getImagesDirectory($id);
reset($core_images);
foreach ($core_images as $cim) {
if (!is_file($imdir . "/" . $cim)) {
copy($core_dir . "/" . $cim, $imdir . "/" . $cim);
}
}
}
}
示例2:
final function _getObjectsDataForType($a_type, $a_omit_trash = false)
{
return parent::_getObjectsDataForType($a_type, $a_omit_trash);
}