38 $this->wiki_id = $a_wiki_id;
39 $this->db = $DIC->database();
43 int $a_type = self::TYPE_ALL
46 if ($a_type === self::TYPE_NEW_PAGES) {
47 $and =
" AND t.new_pages = " . $this->db->quote(1,
"integer");
49 if ($a_type === self::TYPE_ADD_TO_PAGE) {
50 $and =
" AND t.add_to_page = " . $this->db->quote(1,
"integer");
53 $set = $this->db->query(
54 $q =
"SELECT t.wiki_id, t.wpage_id, p.title, t.new_pages, t.add_to_page FROM wiki_page_template t JOIN il_wiki_page p ON " .
55 " (t.wpage_id = p.id) " .
56 " WHERE t.wiki_id = " . $this->db->quote($this->wiki_id,
"integer") .
60 while ($rec = $this->db->fetchAssoc($set)) {
73 int $a_add_to_page = 0
79 $set = $this->db->query(
80 "SELECT * FROM wiki_page_template " .
81 " WHERE wiki_id = " . $this->db->quote($this->wiki_id,
"integer") .
82 " AND wpage_id = " . $this->db->quote($a_id,
"integer")
84 if (!$this->db->fetchAssoc($set)) {
85 $this->db->manipulate(
"INSERT INTO wiki_page_template " .
86 "(wiki_id, wpage_id, new_pages, add_to_page) VALUES (" .
87 $this->db->quote($this->wiki_id,
"integer") .
"," .
88 $this->db->quote($a_id,
"integer") .
"," .
89 $this->db->quote($a_new_pages,
"integer") .
"," .
90 $this->db->quote($a_add_to_page,
"integer") .
93 $this->db->manipulate(
94 "UPDATE wiki_page_template SET " .
95 " new_pages = " . $this->db->quote($a_new_pages,
"integer") .
"," .
96 " add_to_page = " . $this->db->quote($a_add_to_page,
"integer") .
97 " WHERE wiki_id = " . $this->db->quote($this->wiki_id,
"integer") .
98 " AND wpage_id = " . $this->db->quote($a_id,
"integer")
107 public function remove(
110 $this->db->manipulate(
111 "DELETE FROM wiki_page_template WHERE " .
112 " wiki_id = " . $this->db->quote($this->wiki_id,
"integer") .
113 " AND wpage_id = " . $this->db->quote($a_id,
"integer")
122 $set = $this->db->query(
"SELECT t.wpage_id" .
123 " FROM wiki_page_template t" .
124 " JOIN il_wiki_page p ON " .
125 " (t.wpage_id = p.id) " .
126 " WHERE t.wiki_id = " . $this->db->quote($this->wiki_id,
"integer") .
127 " AND p.id = " . $this->db->quote($a_id,
"integer"));
128 return (
bool) $this->db->numRows($set);
__construct(int $a_wiki_id)
isPageTemplate(int $a_id)
Is page set as template?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
save(int $a_id, int $a_new_pages=0, int $a_add_to_page=0)
Add wiki page template.
getAllInfo(int $a_type=self::TYPE_ALL)