30 public function init(): void
34 $this->
access = $DIC->access();
35 $this->
ctrl = $DIC->ctrl();
36 $this->
lng = $DIC->language();
49 [
"Characteristic" =>
"Block"]
55 $this->dom_util->setAttribute($this->getChildNode(),
"Characteristic", $a_char);
60 if (is_object($this->getChildNode())) {
61 $char = $this->getChildNode()->getAttribute(
"Characteristic");
62 if (substr($char, 0, 4) ==
"ilc_") {
63 $char = substr($char, 4);
72 return array(
"ed_insert_section");
80 DOMDocument $a_domdoc,
84 self::saveTimings($a_page);
93 bool $a_abstract_only =
false
95 $a_output = self::insertTimings($a_output);
96 $a_output = $this->handleAccess($a_output, $a_mode);
103 $a_unix_ts = ($a_unix_ts > 0) ? (
string) $a_unix_ts :
null;
104 $this->dom_util->setAttribute($this->getChildNode(),
"ActiveFrom", $a_unix_ts);
112 if (is_object($this->getChildNode())) {
113 return (
int) $this->getChildNode()->getAttribute(
"ActiveFrom");
123 $a_unix_ts = ($a_unix_ts > 0) ? (
string) $a_unix_ts :
null;
124 $this->dom_util->setAttribute($this->getChildNode(),
"ActiveTo", $a_unix_ts);
129 if (is_object($this->getChildNode())) {
130 return (
int) $this->getChildNode()->getAttribute(
"ActiveTo");
141 $this->dom_util->setAttribute($this->getChildNode(),
"Permission", $a_val);
146 return $this->getChildNode()->getAttribute(
"Permission");
151 $this->dom_util->setAttribute($this->getChildNode(),
"PermissionRefId",
"il__ref_" . $a_ref_id);
156 $id = explode(
"_", $this->getChildNode()->getAttribute(
"PermissionRefId"));
168 $this->dom_util->deleteAllChildsByName($this->getChildNode(), [
"IntLink",
"ExtLink"]);
177 if (trim($a_href) !=
"") {
178 $attributes = array(
"Href" => trim($a_href));
179 $this->dom_util->setFirstOptionalElement(
180 $this->getChildNode(),
195 string $a_target_frame,
196 string $a_anchor =
""
199 $attributes = array(
"Type" => $a_type,
"Target" => $a_target,
200 "TargetFrame" => $a_target_frame);
201 if ($a_anchor !==
"") {
202 $attributes[
"Anchor"] = trim($a_anchor);
204 $this->dom_util->setFirstOptionalElement(
205 $this->getChildNode(),
215 $childs = $this->getChildNode()->childNodes;
216 foreach ($childs as $child) {
217 if ($child->nodeName ===
"ExtLink") {
218 return array(
"LinkType" =>
"ExtLink",
219 "Href" => $child->getAttribute(
"Href"));
221 if ($child->nodeName ===
"IntLink") {
222 return array(
"LinkType" =>
"IntLink",
223 "Target" => $child->getAttribute(
"Target"),
224 "Type" => $child->getAttribute(
"Type"),
225 "TargetFrame" => $child->getAttribute(
"TargetFrame"),
226 "Anchor" => $child->getAttribute(
"Anchor")
230 return array(
"LinkType" =>
"NoLink");
238 $ilAccess = $this->
access;
240 while (($start = strpos($a_html,
"{{{{{Section;Access;")) > 0) {
241 $end = strpos($a_html,
"}}}}}", $start);
242 $access_attr = explode(
";", substr($a_html, $start, $end - $start));
243 $id = explode(
"_", $access_attr[3]);
244 $section_nr = $access_attr[6];
247 if ($access_attr[5] ==
"no_read") {
256 $end_limiter =
"{{{{{Section;AccessEnd;" . $section_nr .
"}}}}}";
258 $a_html = substr($a_html, 0, $start) . substr($a_html, $end + 5);
259 $a_html = str_replace($end_limiter,
"", $a_html);
261 $end = strpos($a_html, $end_limiter, $start);
262 $a_html = substr($a_html, 0, $start) . substr($a_html, $end + strlen($end_limiter));
266 $a_html = str_replace(
"{{{{{Section;Access}}}}}",
"", $a_html);
276 $dom_util =
$DIC->copage()->internal()->domain()->domUtil();
279 "DELETE FROM copg_section_timings WHERE " .
280 " page_id = " .
$ilDB->quote($a_page->
getId(),
"integer") .
288 $nodes = $dom_util->path($doc,
$path);
289 foreach ($nodes as $node) {
290 $from = $node->getAttribute(
"ActiveFrom");
293 "copg_section_timings",
295 "page_id" => array(
"integer", $a_page->
getId()),
297 "unix_ts" => array(
"integer", $from)
302 $to = $node->getAttribute(
"ActiveTo");
305 "copg_section_timings",
307 "page_id" => array(
"integer", $a_page->
getId()),
309 "unix_ts" => array(
"integer", $to)
330 "SELECT * FROM copg_section_timings " .
331 " WHERE page_id = " .
$ilDB->quote($a_page->
getId(),
"integer") .
337 while ($rec =
$ilDB->fetchAssoc($set)) {
338 $unix_ts = $rec[
"unix_ts"];
339 if ($unix_ts < $current_ts) {
342 $str .=
"-" . $unix_ts;
358 $start = strpos($a_html,
"{{{{{Section;ActiveFrom");
359 if (is_int($start)) {
360 $end = strpos($a_html,
"}}}}}", $start);
364 $param = substr($a_html, $start + 13, $end - $start - 13);
379 $h2 = substr($a_html, 0, $start) .
381 substr($a_html, $end + 5);
385 $start = strpos($a_html,
"{{{{{Section;ActiveFrom;", $start + 5);
387 if (is_int($start)) {
388 $end = strpos($a_html,
"}}}}}", $start);
396 if (is_object($this->getChildNode())) {
397 return ($this->getChildNode()->getAttribute(
"Protected") ===
"1");
406 $this->getChildNode()->setAttribute(
"Protected",
"1");
408 $this->getChildNode()->setAttribute(
"Protected",
"0");
414 if ($this->getChildNode()->nodeName !==
"Section") {
417 $model =
new stdClass();
418 $model->protected = $this->getProtected();
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class ilCtrl provides processing control methods.
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setExtLink(string $a_href)
Set link of area to an external one.
static getCacheTriggerString(ilPageObject $a_page)
Get page cache update trigger string.
handleAccess(string $a_html, string $a_mode)
setIntLink(string $a_type, string $a_target, string $a_target_frame, string $a_anchor="")
Set link of area to an internal one.
setCharacteristic(string $a_char)
insertTimings(string $a_html)
Insert timings (in edit mode)
static saveTimings(ilPageObject $a_page)
setPermissionRefId(int $a_ref_id)
setActiveTo(int $a_unix_ts)
Set activation to.
setPermission(string $a_val)
Set permission.
setActiveFrom(int $a_unix_ts)
static getLangVars()
Get lang vars needed for editing.
modifyPageContentPostXsl(string $a_output, string $a_mode, bool $a_abstract_only=false)
getModel()
Get model as needed for the front-end editor.
static afterPageUpdate(ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
After page has been updated (or created)
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
getActiveFrom()
Get activation from.
Content object of ilPageObject (see ILIAS DTD).
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])
setType(string $a_type)
Set Type.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getDomDoc()
Get dom doc (DOMDocument)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)