本文整理匯總了PHP中ilObjStyleSheet::_writeUpToDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObjStyleSheet::_writeUpToDate方法的具體用法?PHP ilObjStyleSheet::_writeUpToDate怎麽用?PHP ilObjStyleSheet::_writeUpToDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilObjStyleSheet
的用法示例。
在下文中一共展示了ilObjStyleSheet::_writeUpToDate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateColor
/**
* Update color
*/
function updateColor($a_name, $a_new_name, $a_code)
{
global $ilDB;
// todo: update names in parameters as well
$ilDB->manipulate("UPDATE style_color SET " . "color_name = " . $ilDB->quote($a_new_name, "text") . ", " . "color_code = " . $ilDB->quote($a_code, "text") . " WHERE style_id = " . $ilDB->quote($this->getId(), "integer") . " AND color_name = " . $ilDB->quote($a_name, "text"));
ilObjStyleSheet::_writeUpToDate($this->getId(), false);
// rename also the name in the style parameter values
if ($a_name != $a_new_name) {
$set = $ilDB->query("SELECT * FROM style_parameter " . " WHERE style_id = " . $ilDB->quote($this->getId(), "integer") . " AND (" . " parameter = " . $ilDB->quote("background-color", "text") . " OR " . " parameter = " . $ilDB->quote("color", "text") . " OR " . " parameter = " . $ilDB->quote("border-color", "text") . " OR " . " parameter = " . $ilDB->quote("border-top-color", "text") . " OR " . " parameter = " . $ilDB->quote("border-bottom-color", "text") . " OR " . " parameter = " . $ilDB->quote("border-left-color", "text") . " OR " . " parameter = " . $ilDB->quote("border-right-color", "text") . ")");
while ($rec = $ilDB->fetchAssoc($set)) {
if ($rec["value"] == "!" . $a_name || is_int(strpos($rec["value"], "!" . $a_name . "("))) {
// parameter is based on color -> rename it
$this->replaceStylePar($rec["tag"], $rec["class"], $rec["parameter"], str_replace($a_name, $a_new_name, $rec["value"]), $rec["type"]);
}
}
}
}
示例2: pasteCharacteristicsObject
/**
* Paste characteristics
*
* @param
* @return
*/
function pasteCharacteristicsObject()
{
global $ilCtrl, $lng;
if (is_array($_POST["title"])) {
foreach ($_POST["title"] as $from_char => $to_title) {
$fc = explode(".", $from_char);
if ($_POST["conflict_action"][$from_char] == "overwrite" || !$this->object->characteristicExists($to_title, $fc[0])) {
$this->object->copyCharacteristic($_POST["from_style_id"], $fc[0], $fc[2], $to_title);
}
}
ilObjStyleSheet::_writeUpToDate($this->object->getId(), false);
unset($_SESSION["sty_copy"]);
ilUtil::sendSuccess($lng->txt("sty_style_classes_copied"), true);
}
$ilCtrl->redirect($this, "edit");
}