@@ -38,7 +38,7 @@ |
||
38 | 38 | # If there is subcategories to the category |
39 | 39 | if (is_array($category['categories']) && count($category['categories']) > 0) { |
40 | 40 | # We make the items for the next level the sub categories of this category |
41 | - $level_categories[$level+1] = $category['categories']; |
|
41 | + $level_categories[$level + 1] = $category['categories']; |
|
42 | 42 | |
43 | 43 | # We move to next level |
44 | 44 | $level++; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if (!is_null($options)) { |
28 | 28 | $config = HTMLPurifier_Config::createDefault(); |
29 | 29 | foreach ($options as $option) { |
30 | - $config->set($option[0] . '.' . $option[1], $option[2]); |
|
30 | + $config->set($option[0].'.'.$option[1], $option[2]); |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | $this->_htmlPurifier = new HTMLPurifier($config); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $options = array( |
47 | 47 | array('Cache', 'SerializerPath', |
48 | - PATH_CACHE . '/htmlpurifier' |
|
48 | + PATH_CACHE.'/htmlpurifier' |
|
49 | 49 | ), |
50 | 50 | //array('HTML', 'Doctype', 'XHTML 1.0 Strict'), |
51 | 51 | array('HTML', 'Allowed', |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | $shops = Doctrine::getTable('Intraface_modules_shop_Shop')->findByIntranetId($this->getKernel()->intranet->getId()); |
150 | 150 | |
151 | 151 | if (count($shops) == 0) { |
152 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/empty-table'); |
|
152 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/empty-table'); |
|
153 | 153 | return $tpl->render($this, array('message' => 'No shops has been created yet.')); |
154 | 154 | } |
155 | 155 | |
156 | 156 | $data = array('shops' => $shops); |
157 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/shops'); |
|
157 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/shops'); |
|
158 | 158 | return $tpl->render($this, $data); |
159 | 159 | } |
160 | 160 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | 'settings' => $settings, |
193 | 193 | 'currencies' => $currencies, |
194 | 194 | 'languages' => $langs); |
195 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/edit'); |
|
195 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/edit'); |
|
196 | 196 | return $tpl->render($this, $data); |
197 | 197 | } |
198 | 198 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | function wrapHtml($content) |
244 | 244 | { |
245 | - $tpl = $this->template->create(dirname(__FILE__) . '/tpl/content'); |
|
245 | + $tpl = $this->template->create(dirname(__FILE__).'/tpl/content'); |
|
246 | 246 | return $tpl->render($this, array('content' => $content)); |
247 | 247 | } |
248 | 248 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->id = (int)$id; |
83 | - $this->cmssite = $cmssite; |
|
83 | + $this->cmssite = $cmssite; |
|
84 | 84 | $this->navigation = new CMS_Navigation($this); |
85 | 85 | $this->template = new CMS_Template($this->cmssite); |
86 | 86 | $this->kernel = $this->cmssite->kernel; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | if ($this->dbquery) { |
121 | 121 | return $this->dbquery; |
122 | 122 | } |
123 | - return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = ' . $this->cmssite->get('id'))); |
|
123 | + return ($this->dbquery = new Intraface_DBQuery($this->kernel, 'cms_page', 'cms_page.intranet_id = '.$this->kernel->intranet->get('id').' AND cms_page.active = 1 AND site_id = '.$this->cmssite->get('id'))); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $validator->isNumeric($var['allow_comments'], 'error in comments - allowed values are 0 and 1'); |
213 | 213 | $validator->isNumeric($var['hidden'], 'error in hidden - allowed values are 0 and 1'); |
214 | 214 | |
215 | - if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA . VALIDATE_NUM . '-_'))) { |
|
215 | + if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA.VALIDATE_NUM.'-_'))) { |
|
216 | 216 | $this->error->set('error in unique page address. allowed values are a-z 1-9 _ -'); |
217 | 217 | } |
218 | 218 | if (!$this->isIdentifierAvailable($var['identifier'])) { |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | function isIdentifierAvailable($identifier) |
229 | 229 | { |
230 | 230 | $db = new DB_Sql; |
231 | - $db->query("SELECT * FROM cms_page WHERE site_id = " . $this->cmssite->get('id') . " AND identifier = '".$identifier."' AND active = 1 AND id != " . (int)$this->get('id')); |
|
231 | + $db->query("SELECT * FROM cms_page WHERE site_id = ".$this->cmssite->get('id')." AND identifier = '".$identifier."' AND active = 1 AND id != ".(int)$this->get('id')); |
|
232 | 232 | return ($db->numRows() == 0); |
233 | 233 | } |
234 | 234 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | } |
269 | 269 | |
270 | 270 | if (empty($var['identifier'])) { |
271 | - $var['identifier'] = md5(date('d-m-Y H:i:s') . $type_key . serialize($var)); |
|
271 | + $var['identifier'] = md5(date('d-m-Y H:i:s').$type_key.serialize($var)); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | settype($var['date_expire'], 'string'); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $sql_end = ", date_created = NOW()"; |
283 | 283 | } else { |
284 | 284 | $sql_type = "UPDATE "; |
285 | - $sql_end = ", date_updated = NOW() WHERE id = " . $this->id; |
|
285 | + $sql_end = ", date_updated = NOW() WHERE id = ".$this->id; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | $sql_extra = ''; |
@@ -295,11 +295,11 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | // if the page is to updated |
298 | - $sql = $sql_type . " cms_page SET |
|
298 | + $sql = $sql_type." cms_page SET |
|
299 | 299 | intranet_id = '".$this->kernel->intranet->get('id')."', |
300 | 300 | user_id = '".$this->kernel->user->get('id')."', |
301 | - title = '" .$var['title']. "', |
|
302 | - keywords = '" .$var['keywords']. "', |
|
301 | + title = '" .$var['title']."', |
|
302 | + keywords = '" .$var['keywords']."', |
|
303 | 303 | description = '".$var['description']."', |
304 | 304 | date_publish = ".$sql_publish.", |
305 | 305 | allow_comments = ".$var['allow_comments'].", |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | site_id = '".(int)$this->cmssite->get('id')."', |
312 | 312 | template_id = ".$var['template_id'].", |
313 | 313 | pic_id = ".intval($var['pic_id']).", |
314 | - identifier = '".$var['identifier']."'" . $sql_end; |
|
314 | + identifier = '".$var['identifier']."'".$sql_end; |
|
315 | 315 | // password = '".$var['password']."', |
316 | 316 | $db = new DB_Sql; |
317 | 317 | $db->query($sql); |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | |
327 | 327 | |
328 | 328 | //position |
329 | - $db->query("SELECT position FROM cms_page WHERE id = " . $this->id); |
|
329 | + $db->query("SELECT position FROM cms_page WHERE id = ".$this->id); |
|
330 | 330 | if ($db->nextRecord()) { |
331 | 331 | if ($db->f('position') == 0 and count($this->getList($this->value['type']) > 0)) { |
332 | 332 | $next_pos = $this->getPosition(MDB2::singleton(DB_DSN))->getMaxPosition() + 1; |
333 | - $db->query("UPDATE cms_page SET position = " . $next_pos . " WHERE id = " . $this->id); |
|
333 | + $db->query("UPDATE cms_page SET position = ".$next_pos." WHERE id = ".$this->id); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | $sql_publish = " AND date_publish < NOW() AND status_key > 0"; |
368 | 368 | } |
369 | 369 | |
370 | - $sql = "SELECT *, DATE_FORMAT(date_publish, '%d-%m-%Y') AS date_publish_dk FROM cms_page WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = " .$this->id . $sql_expire . $sql_publish; |
|
370 | + $sql = "SELECT *, DATE_FORMAT(date_publish, '%d-%m-%Y') AS date_publish_dk FROM cms_page WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = ".$this->id.$sql_expire.$sql_publish; |
|
371 | 371 | |
372 | 372 | $db = new DB_Sql(); |
373 | 373 | $db->query($sql); |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | if (empty($this->value['identifier'])) { |
387 | 387 | $this->value['identifier'] = $db->f('id'); |
388 | 388 | } |
389 | - $this->value['url'] = $this->cmssite->get('url') . $this->value['identifier'] . '/'; |
|
390 | - $this->value['url_self'] = $this->value['identifier'] . '/'; |
|
389 | + $this->value['url'] = $this->cmssite->get('url').$this->value['identifier'].'/'; |
|
390 | + $this->value['url_self'] = $this->value['identifier'].'/'; |
|
391 | 391 | |
392 | 392 | $this->value['child_of_id'] = $db->f('child_of_id'); |
393 | 393 | $this->value['name'] = $db->f('title'); // bruges til keywords - m�ske skulle vi have et felt ogs�, s� title var webrelateret? |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | |
465 | 465 | foreach ($template_sections as $template_section) { |
466 | 466 | $db = new DB_Sql; |
467 | - $db->query("SELECT id FROM cms_section WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND page_id = ".$this->get('id')." AND site_id = ".$this->cmssite->get('id')." AND template_section_id = " . $template_section['id']); |
|
467 | + $db->query("SELECT id FROM cms_section WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND page_id = ".$this->get('id')." AND site_id = ".$this->cmssite->get('id')." AND template_section_id = ".$template_section['id']); |
|
468 | 468 | |
469 | 469 | // opretter de sektioner der ikke er oprettet p� siden |
470 | 470 | if (!$db->nextRecord()) { |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $db = new DB_Sql; |
481 | 481 | $db->query("SELECT cms_section.id FROM cms_section INNER JOIN cms_template_section ON cms_section.template_section_id = cms_template_section.id |
482 | 482 | WHERE cms_section.intranet_id = ".$this->kernel->intranet->get('id')." |
483 | - AND cms_section.page_id = " . $this->id . " ORDER BY cms_template_section.position ASC"); |
|
483 | + AND cms_section.page_id = " . $this->id." ORDER BY cms_template_section.position ASC"); |
|
484 | 484 | $i = 0; |
485 | 485 | $section = array(); |
486 | 486 | while ($db->nextRecord()) { |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | return false; |
756 | 756 | } |
757 | 757 | $db = new DB_Sql; |
758 | - $db->query("UPDATE cms_page SET status_key = " . array_search($status, $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
758 | + $db->query("UPDATE cms_page SET status_key = ".array_search($status, $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
759 | 759 | $this->value['status_key'] = array_search($status, $this->status); |
760 | 760 | return true; |
761 | 761 | } |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | // @todo: BUT it can be a mess and the position of the pages is not corrected |
800 | 800 | $db->query('UPDATE cms_page SET child_of_id = '.intval($this->get('child_of_id')).' WHERE child_of_id = '.intval($this->id)); |
801 | 801 | |
802 | - $sql = "UPDATE cms_page SET active = 0 WHERE id=" . $this->id . " AND site_id = ".$this->cmssite->get('id'); |
|
802 | + $sql = "UPDATE cms_page SET active = 0 WHERE id=".$this->id." AND site_id = ".$this->cmssite->get('id'); |
|
803 | 803 | $db->query($sql); |
804 | 804 | $this->value['active'] = 0; |
805 | 805 | $this->load(); |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | function publish() |
859 | 859 | { |
860 | 860 | $db = new DB_Sql; |
861 | - $db->query("UPDATE cms_page SET status_key = " . array_search('published', $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
861 | + $db->query("UPDATE cms_page SET status_key = ".array_search('published', $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
862 | 862 | $this->value['status_key'] = 1; |
863 | 863 | $this->load(); |
864 | 864 | return true; |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | function unpublish() |
868 | 868 | { |
869 | 869 | $db = new DB_Sql; |
870 | - $db->query("UPDATE cms_page SET status_key = " . array_search('draft', $this->status) . " WHERE id = " . $this->id . " AND intranet_id = " . $this->cmssite->kernel->intranet->get('id')); |
|
870 | + $db->query("UPDATE cms_page SET status_key = ".array_search('draft', $this->status)." WHERE id = ".$this->id." AND intranet_id = ".$this->cmssite->kernel->intranet->get('id')); |
|
871 | 871 | $this->value['status_key'] = 0; |
872 | 872 | $this->load(); |
873 | 873 | return true; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | function __construct($cmssite) |
11 | 11 | { |
12 | 12 | if (!is_object($cmssite) or strtolower(get_class($cmssite)) != 'cms_site') { |
13 | - throw new Exception('CMS_Stylesheet::__construct needs CMS_Site - got ' . get_class($cmssite)); |
|
13 | + throw new Exception('CMS_Stylesheet::__construct needs CMS_Site - got '.get_class($cmssite)); |
|
14 | 14 | } |
15 | 15 | $this->cmssite = $cmssite; |
16 | 16 | $this->error = new Intraface_Error; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->db = MDB2::singleton(DB_DSN); |
31 | 31 | $this->cmspage = $cmspage; |
32 | 32 | $this->kernel = $cmspage->kernel; |
33 | - $this->id = (int) $id; |
|
33 | + $this->id = (int)$id; |
|
34 | 34 | //$template_class = 'CMS_Template_' . $this->value['type']; |
35 | 35 | |
36 | 36 | $this->error = new Intraface_Error(); |
@@ -184,16 +184,16 @@ discard block |
||
184 | 184 | if ($this->id == 0) { |
185 | 185 | $sql_type = "INSERT INTO "; |
186 | 186 | $sql_end = ", date_created = NOW(), |
187 | - type_key = ".$var['type_key'] . ", |
|
187 | + type_key = ".$var['type_key'].", |
|
188 | 188 | template_section_id = ".$var['template_section_id']; |
189 | 189 | } else { |
190 | 190 | $sql_type = "UPDATE "; |
191 | - $sql_end = " WHERE id = " . $this->id; |
|
191 | + $sql_end = " WHERE id = ".$this->id; |
|
192 | 192 | } |
193 | - $sql = $sql_type . " cms_section SET |
|
193 | + $sql = $sql_type." cms_section SET |
|
194 | 194 | intranet_id = ".$this->cmspage->kernel->intranet->get('id').", |
195 | - page_id=". (int)$this->cmspage->get('id') . ", |
|
196 | - site_id=". (int)$this->cmspage->cmssite->get('id') . ", |
|
195 | + page_id=". (int)$this->cmspage->get('id').", |
|
196 | + site_id=". (int)$this->cmspage->cmssite->get('id').", |
|
197 | 197 | date_updated = NOW() |
198 | 198 | " . $sql_end; |
199 | 199 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | function getPosition($db) |
69 | 69 | { |
70 | - return new Ilib_Position($db, 'cms_template', $this->id, 'site_id = ' . $this->cmssite->get('id'), 'id', 'position'); |
|
70 | + return new Ilib_Position($db, 'cms_template', $this->id, 'site_id = '.$this->cmssite->get('id'), 'id', 'position'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | switch ($type) { |
79 | 79 | case 'id': |
80 | 80 | $db = new DB_Sql; |
81 | - $db->query("SELECT site_id, id FROM cms_template WHERE id = " . $id . " AND intranet_id = " . $kernel->intranet->get('id')); |
|
81 | + $db->query("SELECT site_id, id FROM cms_template WHERE id = ".$id." AND intranet_id = ".$kernel->intranet->get('id')); |
|
82 | 82 | if (!$db->nextRecord()) { |
83 | 83 | return false; |
84 | 84 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | function load() |
98 | 98 | { |
99 | 99 | $db = new DB_Sql; |
100 | - $db->query("SELECT id, name, site_id, identifier, for_page_type FROM cms_template WHERE intranet_id = " . $this->cmssite->kernel->intranet->get('id') . " AND id = " . $this->id); |
|
100 | + $db->query("SELECT id, name, site_id, identifier, for_page_type FROM cms_template WHERE intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND id = ".$this->id); |
|
101 | 101 | |
102 | 102 | if (!$db->nextRecord()) { |
103 | 103 | return 0; |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $db = new DB_Sql; |
147 | 147 | if ($this->id > 0) { |
148 | 148 | $sql_type = "UPDATE "; |
149 | - $sql_end = " WHERE id = " . $this->id; |
|
149 | + $sql_end = " WHERE id = ".$this->id; |
|
150 | 150 | } else { |
151 | 151 | $sql_type = "INSERT INTO "; |
152 | 152 | $sql_end = ", date_created = NOW()"; |
153 | 153 | } |
154 | - $db->query($sql_type . " cms_template SET |
|
154 | + $db->query($sql_type." cms_template SET |
|
155 | 155 | name = '".safeToDb($var['name'])."', |
156 | 156 | date_updated = NOW(), |
157 | 157 | intranet_id = ".safeToDb($this->cmssite->kernel->intranet->get('id')).", |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $sql_extra = ''; |
180 | 180 | } |
181 | 181 | |
182 | - $db->query("SELECT id, name, identifier, for_page_type FROM cms_template WHERE ".$sql_extra." intranet_id = " . $this->cmssite->kernel->intranet->get('id') . " AND site_id = " . $this->cmssite->get('id') . " AND active = 1 ORDER BY name"); |
|
182 | + $db->query("SELECT id, name, identifier, for_page_type FROM cms_template WHERE ".$sql_extra." intranet_id = ".$this->cmssite->kernel->intranet->get('id')." AND site_id = ".$this->cmssite->get('id')." AND active = 1 ORDER BY name"); |
|
183 | 183 | $i = 0; |
184 | 184 | $templates = array(); |
185 | 185 | while ($db->nextRecord()) { |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | function delete() |
213 | 213 | { |
214 | 214 | $db = new DB_Sql; |
215 | - $db->query("UPDATE cms_template SET active = 0 WHERE id = " . $this->id); |
|
215 | + $db->query("UPDATE cms_template SET active = 0 WHERE id = ".$this->id); |
|
216 | 216 | return true; |
217 | 217 | } |
218 | 218 | |
219 | 219 | function isIdentifierUnique($identifier) |
220 | 220 | { |
221 | 221 | $db = new DB_Sql; |
222 | - $db->query("SELECT id FROM cms_template WHERE site_id = " . $this->cmssite->get('id') . " AND identifier = '".$identifier."' AND active = 1 AND id != " . $this->id); |
|
222 | + $db->query("SELECT id FROM cms_template WHERE site_id = ".$this->cmssite->get('id')." AND identifier = '".$identifier."' AND active = 1 AND id != ".$this->id); |
|
223 | 223 | if ($db->numRows() == 0) { |
224 | 224 | return true; |
225 | 225 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function save($parameter, $value) |
80 | 80 | { |
81 | 81 | if ($this->object->get('id') == 0) { |
82 | - throw new Exception('Parameter::save() object cannot be 0 - problems in ' . get_class($this->object)); |
|
82 | + throw new Exception('Parameter::save() object cannot be 0 - problems in '.get_class($this->object)); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | # mangler noget validering - skal sikkert kunne s�ttes fra elementet? |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | |
92 | 92 | // hvis parameteren tidligere er oprettet opdateres den! |
93 | 93 | if (!empty($old_parameter)) { |
94 | - $db->query("UPDATE cms_parameter SET value='".$value."' WHERE type_key = ".$this->type_key." AND intranet_id = ".$this->object->kernel->intranet->get('id')." AND belong_to_id=". $this->object->get('id') . " AND parameter='".$parameter."'"); |
|
94 | + $db->query("UPDATE cms_parameter SET value='".$value."' WHERE type_key = ".$this->type_key." AND intranet_id = ".$this->object->kernel->intranet->get('id')." AND belong_to_id=".$this->object->get('id')." AND parameter='".$parameter."'"); |
|
95 | 95 | } elseif (!empty($value) and empty($old_parameter)) { |
96 | 96 | // hvis parameteren ikke findes oprettes den |
97 | 97 | $db->query("INSERT INTO cms_parameter SET type_key=".$this->type_key.", belong_to_id = '".$this->object->get('id')."', parameter='".$parameter."', value='".$value."', intranet_id = ".$this->object->kernel->intranet->get('id')); |
98 | 98 | } elseif (empty($value) and !empty($old_parameter)) { |
99 | 99 | // hvis parametervvalue er tom skal den gamle parameter slettes |
100 | - $db->query("DELETE FROM cms_parameter WHERE belong_to_id = '".$this->object->get('id')."' AND parameter='".$parameter."' AND intranet_id = ".$this->object->kernel->intranet->get('id') . " AND type_key =" .$this->type_key); |
|
100 | + $db->query("DELETE FROM cms_parameter WHERE belong_to_id = '".$this->object->get('id')."' AND parameter='".$parameter."' AND intranet_id = ".$this->object->kernel->intranet->get('id')." AND type_key =".$this->type_key); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $this->load(); |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | private function load() |
115 | 115 | { |
116 | 116 | if ($this->object->get('id') == 0) { |
117 | - throw new Exception('Parameter::save() object cannot be 0 - problems with ' . get_class($this->object)); |
|
117 | + throw new Exception('Parameter::save() object cannot be 0 - problems with '.get_class($this->object)); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $db = new DB_Sql; |
121 | - $sql = "SELECT parameter, value FROM cms_parameter WHERE intranet_id = ".$this->object->kernel->intranet->get('id')." AND belong_to_id = " . $this->object->get('id') . " AND type_key = " . $this->type_key; // . " AND parameter = '" .$parameter . "'" |
|
121 | + $sql = "SELECT parameter, value FROM cms_parameter WHERE intranet_id = ".$this->object->kernel->intranet->get('id')." AND belong_to_id = ".$this->object->get('id')." AND type_key = ".$this->type_key; // . " AND parameter = '" .$parameter . "'" |
|
122 | 122 | $db->query($sql); |
123 | 123 | |
124 | 124 | while ($db->nextRecord()) { |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function __construct($section, $id = 0) |
43 | 43 | { |
44 | - $this->value['identify_as'] = 'cms_element'; // bruges af parameter |
|
44 | + $this->value['identify_as'] = 'cms_element'; // bruges af parameter |
|
45 | 45 | |
46 | - $this->id = (int) $id; |
|
46 | + $this->id = (int)$id; |
|
47 | 47 | $this->kernel = $section->kernel; |
48 | 48 | $this->section = $section; |
49 | 49 | $this->error = new Intraface_Error; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | function getPosition(DB_Sql $db) |
65 | 65 | { |
66 | - return new Ilib_Position($db, "cms_element", $this->id, "section_id=".$this->section->get('id')." AND active = 1 AND intranet_id = " . $this->kernel->intranet->get('id'), "position", "id"); |
|
66 | + return new Ilib_Position($db, "cms_element", $this->id, "section_id=".$this->section->get('id')." AND active = 1 AND intranet_id = ".$this->kernel->intranet->get('id'), "position", "id"); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | $db = new DB_Sql; |
128 | - $db->query("SELECT id, section_id, date_expire, date_publish, type_key, position FROM cms_element WHERE intranet_id = ".$this->section->kernel->intranet->get('id')." AND id = " . $this->id); |
|
128 | + $db->query("SELECT id, section_id, date_expire, date_publish, type_key, position FROM cms_element WHERE intranet_id = ".$this->section->kernel->intranet->get('id')." AND id = ".$this->id); |
|
129 | 129 | if (!$db->nextRecord()) { |
130 | 130 | return 0; |
131 | 131 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->value['extra_class'] = ''; |
148 | 148 | |
149 | 149 | if ($this->get('elm_width')) { |
150 | - $this->value['extra_style'] .= 'width: ' . $this->get('elm_width') . ';'; |
|
150 | + $this->value['extra_style'] .= 'width: '.$this->get('elm_width').';'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | if ($this->get('elm_properties') == 'float') { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $this->value['extra_style'] .= ' clear: both;'; |
162 | 162 | } |
163 | 163 | if ($this->get('elm_adjust')) { |
164 | - $this->value['extra_class'] .= ' cms-align-' . $this->get('elm_adjust'); |
|
164 | + $this->value['extra_class'] .= ' cms-align-'.$this->get('elm_adjust'); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | if ($this->get('elm_box') == 'box') { |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | $sql_end = ", date_created = NOW()"; |
238 | 238 | } else { |
239 | 239 | $sql_type = "UPDATE "; |
240 | - $sql_end = " WHERE id = " . $this->id; |
|
240 | + $sql_end = " WHERE id = ".$this->id; |
|
241 | 241 | } |
242 | - $sql = $sql_type . " cms_element SET |
|
242 | + $sql = $sql_type." cms_element SET |
|
243 | 243 | intranet_id = ".$this->section->kernel->intranet->get('id').", |
244 | - section_id=". (int)$this->section->get('id') . ", |
|
244 | + section_id=". (int)$this->section->get('id').", |
|
245 | 245 | type_key = ".safeToDb($this->value['type_key']).", |
246 | 246 | date_changed = NOW(), |
247 | 247 | date_publish = ".$date_publish.", |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $this->id = $db->insertedId(); |
255 | 255 | |
256 | 256 | $next_pos = $this->getPosition($db)->getMaxPosition() + 1; |
257 | - $db->query("UPDATE cms_element SET position = " . $next_pos . " WHERE id = " . $this->id); |
|
257 | + $db->query("UPDATE cms_element SET position = ".$next_pos." WHERE id = ".$this->id); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | $this->load(); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public function delete() |
291 | 291 | { |
292 | 292 | $db = new DB_Sql; |
293 | - $db->query("UPDATE cms_element SET active = 0 WHERE id = " . $this->id); |
|
293 | + $db->query("UPDATE cms_element SET active = 0 WHERE id = ".$this->id); |
|
294 | 294 | return true; |
295 | 295 | } |
296 | 296 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | public function undelete() |
303 | 303 | { |
304 | 304 | $db = new DB_Sql; |
305 | - $db->query("UPDATE cms_element SET active = 1 WHERE id = " . $this->id); |
|
305 | + $db->query("UPDATE cms_element SET active = 1 WHERE id = ".$this->id); |
|
306 | 306 | return true; |
307 | 307 | } |
308 | 308 |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | |
72 | 72 | if ($this->id > 0) { |
73 | 73 | $sql_type = "UPDATE "; |
74 | - $sql_end = " WHERE id = " . $this->id; |
|
74 | + $sql_end = " WHERE id = ".$this->id; |
|
75 | 75 | } else { |
76 | 76 | $sql_type = "INSERT INTO "; |
77 | 77 | $sql_end = " , date_created = NOW()"; |
78 | 78 | } |
79 | 79 | |
80 | 80 | $db = new DB_Sql; |
81 | - $db->query($sql_type . " cms_site |
|
81 | + $db->query($sql_type." cms_site |
|
82 | 82 | SET intranet_id = ".$this->kernel->intranet->get('id').", |
83 | 83 | name = '".$var['name']."', |
84 | 84 | url = '".$var['url']."', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->id = $db->insertedId(); |
89 | 89 | } |
90 | 90 | |
91 | - $this->kernel->setting->set('intranet', 'cc_license', intval($var['cc_license']), 'site_id_' . $this->id); |
|
91 | + $this->kernel->setting->set('intranet', 'cc_license', intval($var['cc_license']), 'site_id_'.$this->id); |
|
92 | 92 | |
93 | 93 | $this->load(); |
94 | 94 | |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | function load() |
99 | 99 | { |
100 | 100 | $db = new DB_Sql; |
101 | - $db->query("SELECT id, name, url FROM cms_site WHERE id = " . $this->id . " AND intranet_id = ".$this->kernel->intranet->get('id')." LIMIT 1"); |
|
101 | + $db->query("SELECT id, name, url FROM cms_site WHERE id = ".$this->id." AND intranet_id = ".$this->kernel->intranet->get('id')." LIMIT 1"); |
|
102 | 102 | if (!$db->nextRecord()) { |
103 | 103 | return 0; |
104 | 104 | } |
105 | 105 | $this->value['id'] = $db->f('id'); |
106 | 106 | $this->value['name'] = $db->f('name'); |
107 | 107 | $this->value['url'] = $db->f('url'); |
108 | - $this->value['cc_license'] = $this->kernel->setting->get('intranet', 'cc_license', 'site_id_' . $this->get('id')); |
|
108 | + $this->value['cc_license'] = $this->kernel->setting->get('intranet', 'cc_license', 'site_id_'.$this->get('id')); |
|
109 | 109 | |
110 | 110 | } |
111 | 111 | |
@@ -116,14 +116,14 @@ discard block |
||
116 | 116 | return 0; |
117 | 117 | } |
118 | 118 | $db = new Db_Sql; |
119 | - $db->query("UPDATE cms_site SET active = 0 WHERE intranet_id=".$this->kernel->intranet->get('id')." AND id = " . $this->id); |
|
119 | + $db->query("UPDATE cms_site SET active = 0 WHERE intranet_id=".$this->kernel->intranet->get('id')." AND id = ".$this->id); |
|
120 | 120 | return 1; |
121 | 121 | } |
122 | 122 | |
123 | 123 | function getList() |
124 | 124 | { |
125 | 125 | $db = new DB_Sql; |
126 | - $db->query("SELECT id, name FROM cms_site WHERE intranet_id = " . $this->kernel->intranet->get('id'). " AND active = 1"); |
|
126 | + $db->query("SELECT id, name FROM cms_site WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1"); |
|
127 | 127 | $i = 0; |
128 | 128 | $sites = array(); |
129 | 129 | while ($db->nextRecord()) { |