Completed
Pull Request — master (#26)
by Lars
14:13
created
src/Intraface/modules/cms/Controller/Pages.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             'news' => $news
93 93
         );
94 94
 
95
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/pages');
95
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/pages');
96 96
         return $tpl->render($this, $data);
97 97
     }
98 98
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             'kernel' => $this->getKernel(),
147 147
             'cmspages' => $cmspages);
148 148
 
149
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/page-edit');
149
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/page-edit');
150 150
         return $tpl->render($this, $data);
151 151
     }
152 152
 
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
 
159 159
         if ($cmspage->save($_POST)) {
160 160
             if (!empty($_POST['choose_file']) && $this->getKernel()->user->hasModuleAccess('filemanager')) {
161
-                return new k_SeeOther($this->url($cmspage->get('id') . '/filehandler/selectfile', array('images' => 1)));
161
+                return new k_SeeOther($this->url($cmspage->get('id').'/filehandler/selectfile', array('images' => 1)));
162 162
             } elseif (!empty($_POST['close'])) {
163 163
                 return new k_SeeOther($this->url($cmspage->get('id')));
164 164
             } elseif (!empty($_POST['add_keywords'])) {
165 165
                 $keyword_shared = $this->getKernel()->useShared('keyword');
166
-                return new k_SeeOther($this->url($cmspage->get('id') . '/keyword/connect'));
166
+                return new k_SeeOther($this->url($cmspage->get('id').'/keyword/connect'));
167 167
             } else {
168 168
                 return new k_SeeOther($this->url(null, array('type' => $cmspage->get('type'))));
169 169
             }
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/Templates.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             'templates' => $templates
38 38
         );
39 39
 
40
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/templates');
40
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/templates');
41 41
         return $tpl->render($this, $data);
42 42
     }
43 43
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             'translation' => $this->getKernel()->getTranslation()
55 55
         );
56 56
 
57
-        $tpl = $this->template->create(dirname(__FILE__) . '/templates/template-edit');
57
+        $tpl = $this->template->create(dirname(__FILE__).'/templates/template-edit');
58 58
         return $tpl->render($this, $data);
59 59
     }
60 60
 
Please login to merge, or discard this patch.
src/Intraface/modules/cms/HTML/Editor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     function setEditor($editor)
25 25
     {
26 26
         if (!in_array($editor, $this->implemented_editors)) {
27
-            throw new Exception($editor . 'editor not implemented');
27
+            throw new Exception($editor.'editor not implemented');
28 28
         }
29 29
 
30 30
         $this->editor = $editor;
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
                     }
88 88
 
89 89
                     if (in_array('a', $this->allowed_tags)) {
90
-                        $button[]= 'link';
91
-                        $button[]= 'unlink';
90
+                        $button[] = 'link';
91
+                        $button[] = 'unlink';
92 92
                     }
93 93
 
94 94
                     if (in_array('ul', $this->allowed_tags)) {
Please login to merge, or discard this patch.
src/Intraface/modules/cms/HTML_Parser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 $element['extra_style'] = ' style="'.$element['extra_style'].'"';
59 59
             }
60 60
 
61
-            $function =  'parse'.$element['type'] . 'Element';
61
+            $function = 'parse'.$element['type'].'Element';
62 62
             $output = $this->$function($element);
63 63
 
64 64
             $display .= '<div id="element-'.$element['id'].'"'.$element['extra_class'].$element['extra_style'].'>';
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
             } else {
77 77
                 $display .= '		<li><a href="'.url(null).'?action=move&amp;element_id='.$element['id'].'&amp;id='.$element['section_id'].'">'.$this->t('move').'</a></li>';
78 78
             }
79
-            $display .= '		<li><a class="confirm" href="' . url(null) . '?delete='.$element['id'].'">'.$this->t('delete').'</a></li>';
80
-            $display .=     '	</ul>';
81
-            $display .= '<div>' .           $output . '</div>';
79
+            $display .= '		<li><a class="confirm" href="'.url(null).'?delete='.$element['id'].'">'.$this->t('delete').'</a></li>';
80
+            $display .= '	</ul>';
81
+            $display .= '<div>'.$output.'</div>';
82 82
             $display .= '</div>';
83 83
         }
84 84
         return $display;
Please login to merge, or discard this patch.
src/Intraface/modules/cms/CKEditor.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; 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.
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $attr = "";
135 135
         foreach ($this->textareaAttributes as $key => $val) {
136
-            $attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
136
+            $attr .= " ".$key.'="'.str_replace('"', '&quot;', $val).'"';
137 137
         }
138
-        $out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
138
+        $out = "<textarea name=\"".$name."\"".$attr.">".htmlspecialchars($value)."</textarea>\n";
139 139
         if (!$this->initialized) {
140 140
             $out .= $this->init();
141 141
         }
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
             $classDetection = "";
235 235
             $js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
236 236
             if (!empty($className)) {
237
-                $js .= "    var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
237
+                $js .= "    var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
238 238
                 $js .= "    if (!classRegex.test(textarea.className))\n";
239 239
                 $js .= "        return false;\n";
240 240
             }
241
-            $js .= "    CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
241
+            $js .= "    CKEDITOR.tools.extend(config, ".$this->jsEncode($_config).", true);";
242 242
             $js .= "} );";
243 243
         }
244 244
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                     }
413 413
                     // Return only new events
414 414
                     if (!in_array($code, $returnedEvents[$eventName])) {
415
-                        $out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
415
+                        $out .= ($code ? "\n" : "")."CKEDITOR.on('".$eventName."', $code);";
416 416
                         $returnedEvents[$eventName][] = $code;
417 417
                     }
418 418
                 }
@@ -443,19 +443,19 @@  discard block
 block discarded – undo
443 443
         $ckeditorPath = $this->ckeditorPath();
444 444
 
445 445
         if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
446
-            $args = '?t=' . $this->timestamp;
446
+            $args = '?t='.$this->timestamp;
447 447
         }
448 448
 
449 449
         // Skip relative paths...
450 450
         if (strpos($ckeditorPath, '..') !== 0) {
451
-            $out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
451
+            $out .= $this->script("window.CKEDITOR_BASEPATH='".$ckeditorPath."';");
452 452
         }
453 453
 
454
-        $out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
454
+        $out .= "<script type=\"text/javascript\" src=\"".$ckeditorPath.'ckeditor.js'.$args."\"></script>\n";
455 455
 
456 456
         $extraCode = "";
457 457
         if ($this->timestamp != self::timestamp) {
458
-            $extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
458
+            $extraCode .= ($extraCode ? "\n" : "")."CKEDITOR.timestamp = '".$this->timestamp."';";
459 459
         }
460 460
         if ($extraCode) {
461 461
             $out .= $this->script($extraCode);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             /**
487 487
              * realpath — Returns canonicalized absolute pathname
488 488
              */
489
-            $realPath = realpath('./') ;
489
+            $realPath = realpath('./');
490 490
         }
491 491
 
492 492
         /**
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 
547 547
                 $val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
548 548
 
549
-                return '"' . $val . '"';
549
+                return '"'.$val.'"';
550 550
             }
551 551
         }
552 552
         $isList = true;
@@ -561,12 +561,12 @@  discard block
 block discarded – undo
561 561
             foreach ($val as $v) {
562 562
                 $result[] = $this->jsEncode($v);
563 563
             }
564
-            return '[ ' . join(', ', $result) . ' ]';
564
+            return '[ '.join(', ', $result).' ]';
565 565
         } else {
566 566
             foreach ($val as $k => $v) {
567 567
                 $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
568 568
             }
569
-            return '{ ' . join(', ', $result) . ' }';
569
+            return '{ '.join(', ', $result).' }';
570 570
         }
571 571
     }
572 572
 }
Please login to merge, or discard this patch.
src/Intraface/modules/cms/PageGateway.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         if ($this->dbquery) {
41 41
             return $this->dbquery;
42 42
         }
43
-        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')));
43
+        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')));
44 44
     }
45 45
 
46 46
     function setDBQuery($dbquery)
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     function findById($id)
52 52
     {
53
-        $this->db->query("SELECT id, site_id FROM cms_page WHERE id = " . (int)$id . " AND intranet_id = " . $this->kernel->intranet->get('id'));
53
+        $this->db->query("SELECT id, site_id FROM cms_page WHERE id = ".(int)$id." AND intranet_id = ".$this->kernel->intranet->get('id'));
54 54
         if (!$this->db->nextRecord()) {
55 55
             return false;
56 56
         }
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
         $identifier = strip_tags($identifier);
65 65
 
66 66
         if (!empty($identifier)) {
67
-            $this->db->query("SELECT site_id, id FROM cms_page WHERE identifier = '" . $identifier . "' AND intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND site_id = " . $site_id);
67
+            $this->db->query("SELECT site_id, id FROM cms_page WHERE identifier = '".$identifier."' AND intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND site_id = ".$site_id);
68 68
         } else {
69 69
             // @todo choose the default page - vi skal lige have noget med publish og expire date her ogs�
70
-            $this->db->query("SELECT site_id, id FROM cms_page WHERE intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND status_key = 1 AND site_id = " . $site_id . " ORDER BY position ASC LIMIT 1");
70
+            $this->db->query("SELECT site_id, id FROM cms_page WHERE intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND status_key = 1 AND site_id = ".$site_id." ORDER BY position ASC LIMIT 1");
71 71
         }
72 72
         if (!$this->db->nextRecord()) {
73
-            $this->db->query("SELECT site_id, id FROM cms_page WHERE id = " . (int)$identifier . " AND intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 AND site_id = " . $site_id);
73
+            $this->db->query("SELECT site_id, id FROM cms_page WHERE id = ".(int)$identifier." AND intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 AND site_id = ".$site_id);
74 74
             if (!$this->db->nextRecord()) {
75 75
                 return false;
76 76
             }
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
                 // til google sitemaps
212 212
                 // sp�rgsm�let er om vi ikke skal starte et objekt op for hver pages
213 213
 
214
-                $pages[$i]['url'] = $this->cmssite->get('url') . $pages[$i]['identifier'] . '/';
215
-                $pages[$i]['url_self'] = $pages[$i]['identifier'] . '/';
214
+                $pages[$i]['url'] = $this->cmssite->get('url').$pages[$i]['identifier'].'/';
215
+                $pages[$i]['url_self'] = $pages[$i]['identifier'].'/';
216 216
                 $pages[$i]['changefreq'] = 'weekly';
217 217
                 $pages[$i]['priority'] = 0.5;
218 218
 
Please login to merge, or discard this patch.
src/Intraface/modules/cms/element/Map.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 $api = $this->get('api_key');
36 36
             }
37 37
 
38
-                $this->value['map']  = '<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?'.htmlentities('v=2.0&appid=' . $api) .'"></script>';
38
+                $this->value['map'] = '<script type="text/javascript" src="http://api.maps.yahoo.com/ajaxymap?'.htmlentities('v=2.0&appid='.$api).'"></script>';
39 39
                 /* flash version
40 40
                 $this->value['map'] .= '<script type="text/javascript">';
41 41
                 $this->value['map'] .= '    var latlon = new LatLon(' .$a['ResultSet']['Result']['Latitude'] . ', '. $a['ResultSet']['Result']['Longitude'].');';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 $this->value['map'] .= '		var words = "title";';
52 52
                 $this->value['map'] .= '		marker.openSmartWindow(words);';
53 53
                 $this->value['map'] .= '	} ';
54
-                $this->value['map'] .= '	var latlon = new YGeoPoint(' .$this->get('latitude') . ', '. $this->get('longitude').');';
54
+                $this->value['map'] .= '	var latlon = new YGeoPoint('.$this->get('latitude').', '.$this->get('longitude').');';
55 55
                 $this->value['map'] .= '	var mymap = new  YMap(document.getElementById("mapContainer"));';
56 56
                 $this->value['map'] .= '	var marker = new YMarker(latlon);';
57 57
                 $this->value['map'] .= '	marker.addLabel("<b>A</b>"); ';
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 $this->value['map'] .= '    }';
85 85
                 $this->value['map'] .= '}';
86 86
                 $this->value['map'] .= 'load();';
87
-                $this->value['map'] .= '    var latlon = new YGeoPoint(' .$this->get('latitude') . ', '. $this->get('longitude').');';
87
+                $this->value['map'] .= '    var latlon = new YGeoPoint('.$this->get('latitude').', '.$this->get('longitude').');';
88 88
                 $this->value['map'] .= '    var mymap = new  YMap(document.getElementById("mapContainer"));';
89 89
                 $this->value['map'] .= '    var marker = new YMarker(latlon);';
90 90
                 $this->value['map'] .= '    marker.addLabel("<b>A</b>"); ';
Please login to merge, or discard this patch.
src/Intraface/modules/cms/element/Delicious.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
         $url = parse_url($var['url']);
61 61
 
62 62
         // cleans up url
63
-        $var['url'] = $url['scheme'] . '://' . $url['host'] . $url['path'];
63
+        $var['url'] = $url['scheme'].'://'.$url['host'].$url['path'];
64 64
 
65 65
         $this->parameter->save('url', $var['url']);
66 66
 
Please login to merge, or discard this patch.
src/Intraface/modules/cms/section/Mixed.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
52 52
         $db = new DB_Sql;
53 53
         $db->query("SELECT id FROM cms_element
54 54
             WHERE intranet_id = ".$this->kernel->intranet->get('id')."
55
-                AND section_id = " . $this->id . "
56
-                AND active = 1 " . $sql_expire . $sql_publish . "
55
+                AND section_id = " . $this->id."
56
+                AND active = 1 " . $sql_expire.$sql_publish."
57 57
             ORDER BY position ASC");
58 58
         $i = 0;
59 59
 
Please login to merge, or discard this patch.