Completed
Pull Request — master (#26)
by Lars
14:13
created
src/Intraface/modules/cms/TemplateSection.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
             throw new Exception('TemplateSection::__construct skal bruge CMS_Template');
32 32
         }
33 33
         $this->error    = new Intraface_Error;
34
-        $this->id       = (int) $id;
34
+        $this->id       = (int)$id;
35 35
         $this->template = $template;
36 36
         $this->kernel   = $template->kernel;
37 37
 
38
-        $this->value['identify_as'] = 'cms_template_section';  // bruges af parameter
38
+        $this->value['identify_as'] = 'cms_template_section'; // bruges af parameter
39 39
 
40 40
         $this->parameter = $this->createParameterObject();
41 41
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 // validering p� value
76 76
                 // kun v�re gyldige elementtyper
77 77
                 // object skal vre cmspage
78
-                $class = $class_prefix . ucfirst($value);
78
+                $class = $class_prefix.ucfirst($value);
79 79
                 return new $class($object);
80 80
                 break;
81 81
             case 'id':
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
                 $section_types = $cms_module->getSetting('section_types');
85 85
 
86 86
                 $db = new DB_Sql;
87
-                $db->query("SELECT id, type_key, template_id FROM cms_template_section WHERE id = " . $value . " AND intranet_id = " . $object->intranet->get('id'));
87
+                $db->query("SELECT id, type_key, template_id FROM cms_template_section WHERE id = ".$value." AND intranet_id = ".$object->intranet->get('id'));
88 88
                 if (!$db->nextRecord()) {
89 89
                     return false;
90 90
                 }
91 91
 
92
-                $class = $class_prefix . ucfirst($section_types[$db->f('type_key')]);
92
+                $class = $class_prefix.ucfirst($section_types[$db->f('type_key')]);
93 93
                 return new $class(CMS_Template::factory($object, 'id', $db->f('template_id')), $db->f('id'));
94 94
 
95 95
                 break;
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
                 $section_types = $cms_module->getSetting('section_types');
100 100
 
101 101
                 $db = new DB_Sql;
102
-                $db->query("SELECT id, type_key FROM cms_template_section WHERE id = " . $value . " AND intranet_id = " . $object->kernel->intranet->get('id'));
102
+                $db->query("SELECT id, type_key FROM cms_template_section WHERE id = ".$value." AND intranet_id = ".$object->kernel->intranet->get('id'));
103 103
                 if (!$db->nextRecord()) {
104 104
                     return false;
105 105
                 }
106 106
 
107
-                $class = $class_prefix . ucfirst($section_types[$db->f('type_key')]);
107
+                $class = $class_prefix.ucfirst($section_types[$db->f('type_key')]);
108 108
                 return new $class($object, $db->f('id'));
109 109
 
110 110
                 break;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     function load()
118 118
     {
119 119
         $db = new DB_Sql;
120
-        $db->query("SELECT id, name, identifier, type_key, locked FROM cms_template_section WHERE cms_template_section.intranet_id = ".$this->template->cmssite->kernel->intranet->get('id')." AND cms_template_section.id = " . $this->id);
120
+        $db->query("SELECT id, name, identifier, type_key, locked FROM cms_template_section WHERE cms_template_section.intranet_id = ".$this->template->cmssite->kernel->intranet->get('id')." AND cms_template_section.id = ".$this->id);
121 121
         if (!$db->nextRecord()) {
122 122
             return 0;
123 123
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $this->error->set('error in identifier - cannot be empty');
146 146
         }
147 147
 
148
-        if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA . VALIDATE_NUM . '-_'))) {
148
+        if (!Validate::string($var['identifier'], array('format' => VALIDATE_ALPHA.VALIDATE_NUM.'-_'))) {
149 149
             $this->error->set('error in identfier - allowed characters are a-z and 1-9');
150 150
         }
151 151
         if ($this->isIdentifierUnique($var['identifier'])) {
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
             $sql_end = ", date_created = NOW()";
177 177
         } else {
178 178
             $sql_type = "UPDATE ";
179
-            $sql_end = " WHERE id = " . $this->id;
179
+            $sql_end = " WHERE id = ".$this->id;
180 180
         }
181
-        $sql = $sql_type . " cms_template_section SET
181
+        $sql = $sql_type." cms_template_section SET
182 182
                 name = '".safeToDb($var['name'])."',
183 183
                 identifier = '".safeToDb($var['identifier'])."',
184
-                site_id = " . $this->template->cmssite->get('id') . ",
184
+                site_id = " . $this->template->cmssite->get('id').",
185 185
                 intranet_id = ".$this->template->kernel->intranet->get('id').",
186 186
                 template_id = ".$this->template->get('id').",
187 187
                 type_key = ".$this->value['type_key'].",
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
     function delete()
212 212
     {
213 213
         $db = new DB_Sql;
214
-        $db->query("UPDATE cms_template_section SET active = 0 WHERE id = " . $this->id);
214
+        $db->query("UPDATE cms_template_section SET active = 0 WHERE id = ".$this->id);
215 215
         return true;
216 216
     }
217 217
 
218 218
     function getList()
219 219
     {
220 220
         $db = new DB_Sql;
221
-        $db->query("SELECT id, name, identifier, type_key FROM cms_template_section WHERE template_id = " . $this->template->get('id') . " AND intranet_id = " . $this->kernel->intranet->get('id') . " AND active = 1 ORDER BY position ASC");
221
+        $db->query("SELECT id, name, identifier, type_key FROM cms_template_section WHERE template_id = ".$this->template->get('id')." AND intranet_id = ".$this->kernel->intranet->get('id')." AND active = 1 ORDER BY position ASC");
222 222
 
223 223
         $i = 0;
224 224
         $sections = array();
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     function isIdentifierUnique($identifier)
238 238
     {
239 239
         $db = new DB_Sql;
240
-        $db->query("SELECT count(*) AS antal FROM cms_template_section WHERE identifier = '".$identifier."' AND intranet_id = " . $this->kernel->intranet->get('id') . " AND template_id = " . $this->template->get('id') . " AND active = 1 AND id != " . $this->id);
240
+        $db->query("SELECT count(*) AS antal FROM cms_template_section WHERE identifier = '".$identifier."' AND intranet_id = ".$this->kernel->intranet->get('id')." AND template_id = ".$this->template->get('id')." AND active = 1 AND id != ".$this->id);
241 241
         if (!$db->nextRecord()) {
242 242
             return 0;
243 243
         }
Please login to merge, or discard this patch.
Intraface/modules/cms/Controller/templates/template-section-edit.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
     case 'longtext':
45 45
         if (empty($value['html_format'])) {
46
-            $value['html_format'] = array ();
46
+            $value['html_format'] = array();
47 47
         }
48 48
 ?>
49 49
         <fieldset>
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/pages.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 </ul>
27 27
 
28 28
 <ul class="options">
29
-    <li><a class="new" href="<?php e(url(null, array('create' => '', 'type' => $type)));?>"><?php e(t('create '.$type)); ?></a></li>
29
+    <li><a class="new" href="<?php e(url(null, array('create' => '', 'type' => $type))); ?>"><?php e(t('create '.$type)); ?></a></li>
30 30
     <li><a  href="<?php e(url('../')); ?>"><?php e(t('go to site overview')); ?></a></li>
31 31
 </ul>
32 32
 
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/navigation.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
             <tr>
27 27
                 <td><input id="category_<?php e($category['id']); ?>" type="checkbox" name="category[]" value="<?php e($category['id']); ?>" /></td>
28 28
                 <td><?php e(str_repeat('- ', $level)); ?><a href="<?php e(url($category['id'])); ?>"><?php e($category['name']); ?></a></td>
29
-                <td><a href="<?php e(url($category['id'] . '/edit')); ?>"><?php e(t('Edit')); ?></a></td>
29
+                <td><a href="<?php e(url($category['id'].'/edit')); ?>"><?php e(t('Edit')); ?></a></td>
30 30
             </tr>
31 31
             <?php
32 32
             # If there is subcategories to the category
33 33
             if (is_array($category['categories']) && count($category['categories']) > 0) {
34 34
                 # We make the items for the next level the sub categories of this category
35
-                $level_categories[$level+1] = $category['categories'];
35
+                $level_categories[$level + 1] = $category['categories'];
36 36
 
37 37
                 # We move to next level
38 38
                 $level++;
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/page-edit.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
                 }
123 123
                     $context->getKernel()->useModule('filemanager');
124 124
                     $filehandler = new FileHandler($kernel, $value['pic_id']);
125
-                    e('file_id ' . $filehandler->get('id') . ' chosen');
125
+                    e('file_id '.$filehandler->get('id').' chosen');
126 126
                     //$filehandler_html = new FileHandlerHTML($filehandler);
127 127
                     //$filehandler_html->printFormUploadTag('pic_id', 'new_pic', 'choose_file', array('image_size' => 'small'));
128 128
                 ?>
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/templates.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
 <?php foreach ($templates as $s) : ?>
28 28
     <tr>
29
-        <td><a href="<?php e(url($s['id'])); ?>"><?php e($s['name']);  ?></a></td>
29
+        <td><a href="<?php e(url($s['id'])); ?>"><?php e($s['name']); ?></a></td>
30 30
         <td><?php e($s['identifier']); ?></td>
31 31
         <td>
32 32
             <?php
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/template.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
             <td><?php e($s['type']); ?></td>
31 31
             <td class="options"><a href="<?php e(url(null, array('moveup' =>  $s['id']))); ?>"><?php e(t('Up')); ?></a>
32 32
             <a href="<?php e(url(null, array('movedown' =>  $s['id']))); ?>"><?php e(t('Down')); ?></a>
33
-            <a class="edit" href="<?php e(url('section/' . $s['id'], array('edit'))); ?>"><?php e(t('Edit settings')); ?></a>
34
-            <a class="delete" href="<?php e(url('section/' . $s['id'], array('delete'))); ?>"><?php e(t('Delete')); ?></a></td>
33
+            <a class="edit" href="<?php e(url('section/'.$s['id'], array('edit'))); ?>"><?php e(t('Edit settings')); ?></a>
34
+            <a class="delete" href="<?php e(url('section/'.$s['id'], array('delete'))); ?>"><?php e(t('Delete')); ?></a></td>
35 35
         </tr>
36 36
     <?php endforeach; ?>
37 37
         </tbody>
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/page.tpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
         href="<?php e(url('../../', array('type' => $cmspage->get('type')))); ?>"><?php e(t('close')); ?></a></li>
7 7
         <?php if ($kernel->user->hasSubAccess('cms', 'edit_templates')) : ?>
8 8
     <li><a
9
-        href="<?php e(url('../../../templates/' . $cmspage->get('template_id'))); ?>"><?php e(t('edit template')); ?></a></li>
9
+        href="<?php e(url('../../../templates/'.$cmspage->get('template_id'))); ?>"><?php e(t('edit template')); ?></a></li>
10 10
         <?php endif; ?>
11 11
 </ul>
12 12
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 <p class="warning"><?php echo e(t('no sections added to the template')); ?>
29 29
         <?php if ($kernel->user->hasSubAccess('cms', 'edit_templates')) :
30 30
 ?> <a
31
-    href="<?php e(url('../../template/' . $cmspage->get('template_id'))); ?>"><?php e(t('edit template')); ?></a>.
31
+    href="<?php e(url('../../template/'.$cmspage->get('template_id'))); ?>"><?php e(t('edit template')); ?></a>.
32 32
     <?php else :
33 33
 ?> <strong><?php echo e(t('you cannot edit templates')); ?></strong>
34 34
     <?php endif; ?></p>
Please login to merge, or discard this patch.
src/Intraface/modules/cms/Controller/templates/index.tpl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
 <tbody>
20 20
 <?php foreach ($sites as $s) : ?>
21 21
 <tr>
22
-    <td><a href="<?php e(url($s['id'])); ?>"><?php e($s['name']);  ?></a></td>
22
+    <td><a href="<?php e(url($s['id'])); ?>"><?php e($s['name']); ?></a></td>
23 23
     <td>
24
-        <a href="<?php e(url($s['id'] . '/pages', array('type' => 'page'))); ?>"><?php e(t('pages'));  ?></a>,
25
-        <a href="<?php e(url($s['id'] . '/pages', array('type' => 'article'))); ?>"><?php e(t('articles'));  ?></a>,
26
-        <a href="<?php e(url($s['id'] . '/pages', array('type' => 'news'))); ?>"><?php e(t('news'));  ?></a>
24
+        <a href="<?php e(url($s['id'].'/pages', array('type' => 'page'))); ?>"><?php e(t('pages')); ?></a>,
25
+        <a href="<?php e(url($s['id'].'/pages', array('type' => 'article'))); ?>"><?php e(t('articles')); ?></a>,
26
+        <a href="<?php e(url($s['id'].'/pages', array('type' => 'news'))); ?>"><?php e(t('news')); ?></a>
27 27
     </td>
28 28
     <td class="options">
29 29
         <a class="edit" href="<?php e(url($s['id'], array('edit'))); ?>"><?php e(t('edit settings')); ?></a>
Please login to merge, or discard this patch.