@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | $this->value['search'] = $this->parameter->get('search'); |
16 | 16 | $this->value['number'] = $this->parameter->get('number'); |
17 | - $twitterSearch = new Zend_Service_Twitter_Search('json'); |
|
17 | + $twitterSearch = new Zend_Service_Twitter_Search('json'); |
|
18 | 18 | $this->value['results'] = serialize($twitterSearch->search($this->parameter->get('search'), array('rpp' => $this->parameter->get('number')))); |
19 | 19 | } |
20 | 20 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | // validering p� value // kun v�re gyldige elementtyper |
17 | 17 | // object skal vre cmspage |
18 | - $class = $this->class_prefix . ucfirst($type); |
|
18 | + $class = $this->class_prefix.ucfirst($type); |
|
19 | 19 | return new $class($page); |
20 | 20 | } |
21 | 21 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | $cms_module = $this->kernel->getModule('cms'); |
26 | 26 | $section_types = $cms_module->getSetting('section_types'); |
27 | 27 | |
28 | - $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
28 | + $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
29 | 29 | |
30 | 30 | if (!$this->db->nextRecord()) { |
31 | 31 | return false; |
32 | 32 | } |
33 | - $class = $this->class_prefix . ucfirst($section_types[$this->db->f('type_key')]); |
|
33 | + $class = $this->class_prefix.ucfirst($section_types[$this->db->f('type_key')]); |
|
34 | 34 | return new $class(CMS_Page::factory($this->kernel, 'id', $this->db->f('page_id')), $this->db->f('id')); |
35 | 35 | |
36 | 36 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $cms_module = $this->kernel->getModule('cms'); |
42 | 42 | $section_types = $cms_module->getSetting('section_types'); |
43 | 43 | |
44 | - $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
44 | + $this->db->query("SELECT id, page_id, type_key FROM cms_section WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
45 | 45 | if (!$this->db->nextRecord()) { |
46 | 46 | return false; |
47 | 47 | } |
48 | - $class = $this->class_prefix . ucfirst($section_types[$this->db->f('type_key')]); |
|
48 | + $class = $this->class_prefix.ucfirst($section_types[$this->db->f('type_key')]); |
|
49 | 49 | return new $class($page, $this->db->f('id')); |
50 | 50 | } |
51 | 51 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | $this->addPreloadFile('Section.php'); |
45 | 45 | |
46 | - $this->includeSettingFile('settings.php'); |
|
46 | + $this->includeSettingFile('settings.php'); |
|
47 | 47 | |
48 | 48 | $this->addSetting('status', array( |
49 | 49 | 1 => 'draft', |
@@ -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()) { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | function findById($id) |
14 | 14 | { |
15 | - $this->db->query("SELECT site_id, id FROM cms_template WHERE id = " . $id . " AND intranet_id = " . $this->kernel->intranet->get('id')); |
|
15 | + $this->db->query("SELECT site_id, id FROM cms_template WHERE id = ".$id." AND intranet_id = ".$this->kernel->intranet->get('id')); |
|
16 | 16 | if (!$this->db->nextRecord()) { |
17 | 17 | return false; |
18 | 18 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * When %CKEditor is created with the editor() method, a HTML <textarea> element is created, |
74 | 74 | * it will be displayed to anyone with JavaScript disabled or with incompatible browser. |
75 | 75 | */ |
76 | - public $textareaAttributes = array( "rows" => 8, "cols" => 60 ); |
|
76 | + public $textareaAttributes = array("rows" => 8, "cols" => 60); |
|
77 | 77 | /** |
78 | 78 | * A string indicating the creation date of %CKEditor. |
79 | 79 | * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor. |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | { |
133 | 133 | $attr = ""; |
134 | 134 | foreach ($this->textareaAttributes as $key => $val) { |
135 | - $attr.= " " . $key . '="' . str_replace('"', '"', $val) . '"'; |
|
135 | + $attr .= " ".$key.'="'.str_replace('"', '"', $val).'"'; |
|
136 | 136 | } |
137 | - $out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n"; |
|
137 | + $out = "<textarea name=\"".$name."\"".$attr.">".htmlspecialchars($value)."</textarea>\n"; |
|
138 | 138 | if (!$this->initialized) { |
139 | 139 | $out .= $this->init(); |
140 | 140 | } |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | $classDetection = ""; |
236 | 236 | $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; |
237 | 237 | if (!empty($className)) { |
238 | - $js .= " var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n"; |
|
238 | + $js .= " var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n"; |
|
239 | 239 | $js .= " if (!classRegex.test(textarea.className))\n"; |
240 | 240 | $js .= " return false;\n"; |
241 | 241 | } |
242 | - $js .= " CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);"; |
|
242 | + $js .= " CKEDITOR.tools.extend(config, ".$this->jsEncode($_config).", true);"; |
|
243 | 243 | $js .= "} );"; |
244 | 244 | |
245 | 245 | } |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | // Return only new events |
420 | 420 | if (!in_array($code, $returnedEvents[$eventName])) { |
421 | - $out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);"; |
|
421 | + $out .= ($code ? "\n" : "")."CKEDITOR.on('".$eventName."', $code);"; |
|
422 | 422 | $returnedEvents[$eventName][] = $code; |
423 | 423 | } |
424 | 424 | } |
@@ -449,19 +449,19 @@ discard block |
||
449 | 449 | $ckeditorPath = $this->ckeditorPath(); |
450 | 450 | |
451 | 451 | if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") { |
452 | - $args = '?t=' . $this->timestamp; |
|
452 | + $args = '?t='.$this->timestamp; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | // Skip relative paths... |
456 | 456 | if (strpos($ckeditorPath, '..') !== 0) { |
457 | - $out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';"); |
|
457 | + $out .= $this->script("window.CKEDITOR_BASEPATH='".$ckeditorPath."';"); |
|
458 | 458 | } |
459 | 459 | |
460 | - $out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n"; |
|
460 | + $out .= "<script type=\"text/javascript\" src=\"".$ckeditorPath.'ckeditor.js'.$args."\"></script>\n"; |
|
461 | 461 | |
462 | 462 | $extraCode = ""; |
463 | 463 | if ($this->timestamp != self::timestamp) { |
464 | - $extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';"; |
|
464 | + $extraCode .= ($extraCode ? "\n" : "")."CKEDITOR.timestamp = '".$this->timestamp."';"; |
|
465 | 465 | } |
466 | 466 | if ($extraCode) { |
467 | 467 | $out .= $this->script($extraCode); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | /** |
494 | 494 | * realpath — Returns canonicalized absolute pathname |
495 | 495 | */ |
496 | - $realPath = realpath( './' ) ; |
|
496 | + $realPath = realpath('./'); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | |
557 | 557 | $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val); |
558 | 558 | |
559 | - return '"' . $val . '"'; |
|
559 | + return '"'.$val.'"'; |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | $isList = true; |
@@ -572,12 +572,12 @@ discard block |
||
572 | 572 | if ($isList) |
573 | 573 | { |
574 | 574 | foreach ($val as $v) $result[] = $this->jsEncode($v); |
575 | - return '[ ' . join(', ', $result) . ' ]'; |
|
575 | + return '[ '.join(', ', $result).' ]'; |
|
576 | 576 | } |
577 | 577 | else |
578 | 578 | { |
579 | 579 | foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
580 | - return '{ ' . join(', ', $result) . ' }'; |
|
580 | + return '{ '.join(', ', $result).' }'; |
|
581 | 581 | } |
582 | 582 | } |
583 | 583 | } |
@@ -142,10 +142,11 @@ discard block |
||
142 | 142 | $_config = $this->configSettings($config, $events); |
143 | 143 | |
144 | 144 | $js = $this->returnGlobalEvents(); |
145 | - if (!empty($_config)) |
|
146 | - $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | - else |
|
148 | - $js .= "CKEDITOR.replace('".$name."');"; |
|
145 | + if (!empty($_config)) { |
|
146 | + $js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");"; |
|
147 | + } else { |
|
148 | + $js .= "CKEDITOR.replace('".$name."');"; |
|
149 | + } |
|
149 | 150 | |
150 | 151 | $out .= $this->script($js); |
151 | 152 | |
@@ -182,8 +183,7 @@ discard block |
||
182 | 183 | $js = $this->returnGlobalEvents(); |
183 | 184 | if (!empty($_config)) { |
184 | 185 | $js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");"; |
185 | - } |
|
186 | - else { |
|
186 | + } else { |
|
187 | 187 | $js .= "CKEDITOR.replace('".$id."');"; |
188 | 188 | } |
189 | 189 | $out .= $this->script($js); |
@@ -226,12 +226,10 @@ discard block |
||
226 | 226 | if (empty($_config)) { |
227 | 227 | if (empty($className)) { |
228 | 228 | $js .= "CKEDITOR.replaceAll();"; |
229 | - } |
|
230 | - else { |
|
229 | + } else { |
|
231 | 230 | $js .= "CKEDITOR.replaceAll('".$className."');"; |
232 | 231 | } |
233 | - } |
|
234 | - else { |
|
232 | + } else { |
|
235 | 233 | $classDetection = ""; |
236 | 234 | $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n"; |
237 | 235 | if (!empty($className)) { |
@@ -289,8 +287,7 @@ discard block |
||
289 | 287 | { |
290 | 288 | if (!empty($event)) { |
291 | 289 | $this->events[$event] = array(); |
292 | - } |
|
293 | - else { |
|
290 | + } else { |
|
294 | 291 | $this->events = array(); |
295 | 292 | } |
296 | 293 | } |
@@ -329,8 +326,7 @@ discard block |
||
329 | 326 | { |
330 | 327 | if (!empty($event)) { |
331 | 328 | $this->globalEvents[$event] = array(); |
332 | - } |
|
333 | - else { |
|
329 | + } else { |
|
334 | 330 | $this->globalEvents = array(); |
335 | 331 | } |
336 | 332 | } |
@@ -381,11 +377,9 @@ discard block |
||
381 | 377 | foreach ($_events as $eventName => $handlers) { |
382 | 378 | if (empty($handlers)) { |
383 | 379 | continue; |
384 | - } |
|
385 | - else if (count($handlers) == 1) { |
|
380 | + } else if (count($handlers) == 1) { |
|
386 | 381 | $_config['on'][$eventName] = '@@'.$handlers[0]; |
387 | - } |
|
388 | - else { |
|
382 | + } else { |
|
389 | 383 | $_config['on'][$eventName] = '@@function (ev){'; |
390 | 384 | foreach ($handlers as $handler => $code) { |
391 | 385 | $_config['on'][$eventName] .= '('.$code.')(ev);'; |
@@ -488,8 +482,7 @@ discard block |
||
488 | 482 | */ |
489 | 483 | if (isset($_SERVER['SCRIPT_FILENAME'])) { |
490 | 484 | $realPath = dirname($_SERVER['SCRIPT_FILENAME']); |
491 | - } |
|
492 | - else { |
|
485 | + } else { |
|
493 | 486 | /** |
494 | 487 | * realpath — Returns canonicalized absolute pathname |
495 | 488 | */ |
@@ -544,8 +537,7 @@ discard block |
||
544 | 537 | // Use @@ to not use quotes when outputting string value |
545 | 538 | if (strpos($val, '@@') === 0) { |
546 | 539 | return substr($val, 2); |
547 | - } |
|
548 | - else { |
|
540 | + } else { |
|
549 | 541 | // All scalars are converted to strings to avoid indeterminism. |
550 | 542 | // PHP's "1" and 1 are equal for all PHP operators, but |
551 | 543 | // JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend, |
@@ -571,12 +563,15 @@ discard block |
||
571 | 563 | $result = array(); |
572 | 564 | if ($isList) |
573 | 565 | { |
574 | - foreach ($val as $v) $result[] = $this->jsEncode($v); |
|
566 | + foreach ($val as $v) { |
|
567 | + $result[] = $this->jsEncode($v); |
|
568 | + } |
|
575 | 569 | return '[ ' . join(', ', $result) . ' ]'; |
576 | - } |
|
577 | - else |
|
570 | + } else |
|
578 | 571 | { |
579 | - foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
572 | + foreach ($val as $k => $v) { |
|
573 | + $result[] = $this->jsEncode($k).': '.$this->jsEncode($v); |
|
574 | + } |
|
580 | 575 | return '{ ' . join(', ', $result) . ' }'; |
581 | 576 | } |
582 | 577 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | function getAll() |
24 | 24 | { |
25 | - $this->db->query("SELECT id, name FROM cms_site WHERE intranet_id = " . $this->kernel->intranet->get('id'). " AND active = 1"); |
|
25 | + $this->db->query("SELECT id, name FROM cms_site WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1"); |
|
26 | 26 | $i = 0; |
27 | 27 | $sites = array(); |
28 | 28 | while ($this->db->nextRecord()) { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | function map($name) |
5 | 5 | { |
6 | 6 | if (is_numeric($name)) { |
7 | - return 'Intraface_modules_cms_Controller_TemplateSectionEdit'; |
|
7 | + return 'Intraface_modules_cms_Controller_TemplateSectionEdit'; |
|
8 | 8 | } elseif ($name == 'create') { |
9 | 9 | return 'Intraface_modules_cms_Controller_TemplateSectionEdit'; |
10 | 10 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'translation' => $this->getKernel()->getTranslation('cms') |
56 | 56 | ); |
57 | 57 | |
58 | - $tpl = $this->template->create(dirname(__FILE__) . '/templates/section-html-edit'); |
|
58 | + $tpl = $this->template->create(dirname(__FILE__).'/templates/section-html-edit'); |
|
59 | 59 | return $tpl->render($this, $data); |
60 | 60 | } |
61 | 61 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | $redirect = Intraface_Redirect::factory($this->getKernel(), 'go'); |
73 | 73 | $module_filemanager = $this->getKernel()->useModule('filemanager'); |
74 | 74 | if ($element->get('type') == 'picture') { |
75 | - return new k_SeeOther($this->url($element->get('id') . '/filehandler/selectfile', array('images' => 1))); |
|
75 | + return new k_SeeOther($this->url($element->get('id').'/filehandler/selectfile', array('images' => 1))); |
|
76 | 76 | } elseif ($element->get('type') == 'gallery') { |
77 | - return new k_SeeOther($this->url($element->get('id') . '/filehandler/selectfile', array('images' => 1, 'multiple_choice' => 'true'))); |
|
77 | + return new k_SeeOther($this->url($element->get('id').'/filehandler/selectfile', array('images' => 1, 'multiple_choice' => 'true'))); |
|
78 | 78 | } elseif ($element->get('type') == 'filelist') { |
79 | - return new k_SeeOther($this->url($element->get('id') . '/filehandler/selectfile', array('images' => 0, 'multiple_choice' => 'true'))); |
|
79 | + return new k_SeeOther($this->url($element->get('id').'/filehandler/selectfile', array('images' => 0, 'multiple_choice' => 'true'))); |
|
80 | 80 | } else { |
81 | 81 | throw new Exception("Det er ikke en gyldig elementtype til at lave redirect fra"); |
82 | 82 | } |