32 $ilDB = $DIC->database();
40 include_once(
"./Services/COPage/exceptions/class.ilCOPageException.php");
45 include_once(
"./Services/COPage/exceptions/class.ilCOPageException.php");
59 $this->parent_type = $a_val;
79 $this->parent_id = $a_val;
99 $this->master_lang = $a_val;
119 $this->languages = $a_val;
139 if ($a_lang !=
"" && !in_array($a_lang, $this->languages)) {
140 $this->languages[] = $a_lang;
152 $this->activated = $a_val;
170 $set = $this->db->query(
171 "SELECT * FROM copg_multilang " .
172 " WHERE parent_type = " . $this->db->quote($this->getParentType(),
"text") .
173 " AND parent_id = " . $this->db->quote($this->getParentId(),
"integer")
175 if ($rec = $this->db->fetchAssoc($set)) {
183 $set = $this->db->query(
184 "SELECT * FROM copg_multilang_lang " .
185 " WHERE parent_type = " . $this->db->quote($this->getParentType(),
"text") .
186 " AND parent_id = " . $this->db->quote($this->getParentId(),
"integer")
188 while ($rec = $this->db->fetchAssoc($set)) {
196 public function delete()
198 $this->db->manipulate(
199 "DELETE FROM copg_multilang " .
200 " WHERE parent_type = " . $this->db->quote($this->getParentType(),
"text") .
201 " AND parent_id = " . $this->db->quote($this->getParentId(),
"integer")
203 $this->db->manipulate(
204 "DELETE FROM copg_multilang_lang " .
205 " WHERE parent_type = " . $this->db->quote($this->getParentType(),
"text") .
206 " AND parent_id = " . $this->db->quote($this->getParentId(),
"integer")
217 $this->db->manipulate(
"INSERT INTO copg_multilang " .
218 "(parent_type, parent_id, master_lang) VALUES (" .
219 $this->db->quote($this->getParentType(),
"text") .
"," .
220 $this->db->quote($this->getParentId(),
"integer") .
"," .
221 $this->db->quote($this->getMasterLanguage(),
"text") .
225 $this->db->manipulate(
"INSERT INTO copg_multilang_lang " .
226 "(parent_type, parent_id, lang) VALUES (" .
227 $this->db->quote($this->getParentType(),
"text") .
"," .
228 $this->db->quote($this->getParentId(),
"integer") .
"," .
229 $this->db->quote(
$lang,
"text") .
241 public function copy($a_target_parent_type, $a_target_parent_id)
244 $target_ml =
new ilPageMultiLang($a_target_parent_type, $a_target_parent_id);
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Multi-language properties.
setParentType($a_val)
Set parent type.
addLanguage($a_lang)
Add language.
getMasterLanguage()
Get master language.
setMasterLanguage($a_val)
Set master language.
getParentId()
Get parent id.
setParentId($a_val)
Set parent id.
setActivated($a_val)
Set activated.
Create styles array
The data for the language used.
__construct($a_parent_type, $a_parent_id)
Constructor.
getActivated()
Get activated.
getParentType()
Get parent type.
setLanguages(array $a_val)
Set languages.
getEffectiveLang($a_lang)
Get effective language for given language.
getLanguages()
Get languages.
copy($a_target_parent_type, $a_target_parent_id)
Copy multilinguality settings.
Base exception class for copage service.