Passed
Branch feature/2.0 (9789a8)
by Jonathan
14:17
created
src/Webtrees/Functions/FunctionsPrintLists.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@
 block discarded – undo
35 35
         $surn = str_replace('@N.N.', 'AAAA', $surn);
36 36
 
37 37
         return array(
38
-            $surn . 'AAAA' . $givn,
39
-            $givn . 'AAAA' . $surn,
38
+            $surn.'AAAA'.$givn,
39
+            $givn.'AAAA'.$surn,
40 40
         );
41 41
     }
42 42
 
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Views/CertificatesListView.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,13 +39,13 @@  discard block
 block discarded – undo
39 39
     			<input type="hidden" name="ged" value="<?= $this->data->get('url_ged') ?>">
40 40
     			<select name="city">
41 41
     			<?php foreach ($cities as $city) { ?>
42
-    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if(trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?= $city ?></option>
42
+    				<option value="<?= Functions::encryptToSafeBase64($city) ?>" <?php if (trim($city) == trim($selected_city)) echo 'selected="selected"'?> ><?= $city ?></option>
43 43
     			<?php } ?>
44 44
     			</select>
45 45
     			<input type="submit" value="<?= I18N::translate('Show') ?>" />
46 46
     		</form>
47 47
     		
48
-    		<?php if($this->data->get('has_list', false)) { ?>
48
+    		<?php if ($this->data->get('has_list', false)) { ?>
49 49
     		<div class="loading-image">&nbsp;</div>
50 50
     		<div class="certificate-list">
51 51
     			<table id="<?= $this->data->get('table_id') ?>">
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     				    ?>
63 63
     					<tr>
64 64
     						<!-- Certificate date -->
65
-    						<?php if($date = $certificate->getCertificateDate()) { ?>
65
+    						<?php if ($date = $certificate->getCertificateDate()) { ?>
66 66
     						<td data-sort="<?= $date->julianDay() ?>"><?= $date->display() ?></td>
67 67
     						<?php } else { ?>
68 68
     						<td data-sort="0">&nbsp;</td>
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     						<?php 
74 74
     						$name = $certificate->getCertificateDetails() ?: '';
75 75
     						$sortname = "";
76
-    						$ct_names=preg_match("/([A-Z]{2,})/", $name, $match);
77
-    						if($ct_names > 0) $sortname = $match[1].'_';
76
+    						$ct_names = preg_match("/([A-Z]{2,})/", $name, $match);
77
+    						if ($ct_names > 0) $sortname = $match[1].'_';
78 78
     						$sortname .= $name;
79 79
     						?>
80 80
     						<td data-sort="<?= Filter::escapeHtml($sortname) ?>">
Please login to merge, or discard this patch.
src/Webtrees/Module/HooksModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     public function getConfigLink() {
58 58
         Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
59 59
         
60
-        return 'module.php?mod=' . $this->getName() . '&amp;mod_action=AdminConfig';
60
+        return 'module.php?mod='.$this->getName().'&amp;mod_action=AdminConfig';
61 61
     }
62 62
     
63 63
     /**
Please login to merge, or discard this patch.
src/Webtrees/Fact.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	*
39 39
 	* @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40 40
 	*/
41
-	public function __construct(\Fisharebest\Webtrees\Fact $fact_in){
41
+	public function __construct(\Fisharebest\Webtrees\Fact $fact_in) {
42 42
 		$this->fact = $fact_in;
43 43
 	}
44 44
 	
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
 	*
55 55
 	* @return int Level of sources
56 56
 	*/
57
-	public function isSourced(){
58
-		$isSourced=0;
57
+	public function isSourced() {
58
+		$isSourced = 0;
59 59
 		$date = $this->fact->getDate();
60
-		if($date->isOK()) {
61
-			$isSourced=-1;
62
-			if($date->qual1=='' && $date->minimumJulianDay() == $date->maximumJulianDay()){
63
-				$isSourced=-2;
60
+		if ($date->isOK()) {
61
+			$isSourced = -1;
62
+			if ($date->qual1 == '' && $date->minimumJulianDay() == $date->maximumJulianDay()) {
63
+				$isSourced = -2;
64 64
 				$citations = $this->fact->getCitations();
65
-				foreach($citations as $citation){
66
-					$isSourced=max($isSourced, 1);
67
-					if(preg_match('/3 _ACT (.*)/', $citation) ){
68
- 						$isSourced=max($isSourced, 2);
65
+				foreach ($citations as $citation) {
66
+					$isSourced = max($isSourced, 1);
67
+					if (preg_match('/3 _ACT (.*)/', $citation)) {
68
+ 						$isSourced = max($isSourced, 2);
69 69
  						preg_match_all("/4 DATE (.*)/", $citation, $datessource, PREG_SET_ORDER);
70
- 						foreach($datessource as $daterec){
70
+ 						foreach ($datessource as $daterec) {
71 71
  							$datesource = new Date($daterec[1]);
72
- 							if(abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN){
72
+ 							if (abs($datesource->julianDay() - $date->julianDay()) < self::DATE_PRECISION_MARGIN) {
73 73
  								$isSourced = max($isSourced, 3); //If this level increases, do not forget to change the constant MAX_IS_SOURCED_LEVEL
74 74
  							}
75 75
  						}
Please login to merge, or discard this patch.
src/Webtrees/Module/IsSourcedModule.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\IndividualHeaderExtenderInterface::hExtendIndiHeaderIcons()
64 64
 	 */
65 65
 	public function hExtendIndiHeaderIcons(IndividualController $ctrlIndi) {
66
-	    if($ctrlIndi){
66
+	    if ($ctrlIndi) {
67 67
 	        $dindi = new Individual($ctrlIndi->getSignificantIndividual());
68 68
 	        if ($dindi->canDisplayIsSourced()) 
69 69
 	            return FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, 'large');
@@ -87,19 +87,19 @@  discard block
 block discarded – undo
87 87
 	 * {@inheritDoc}
88 88
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNamePrepend()
89 89
 	 */
90
-	public function hRecordNamePrepend(GedcomRecord $grec, $size){ }
90
+	public function hRecordNamePrepend(GedcomRecord $grec, $size) { }
91 91
 	
92 92
 	/**
93 93
 	 * {@inheritDoc}
94 94
 	 * @see \MyArtJaub\Webtrees\Hook\HookInterfaces\RecordNameTextExtenderInterface::hRecordNameAppend()
95 95
 	 */
96
-	public function hRecordNameAppend(GedcomRecord $grec, $size = 'small'){
96
+	public function hRecordNameAppend(GedcomRecord $grec, $size = 'small') {
97 97
 	    $html = '';
98
-	    if($grec instanceof \Fisharebest\Webtrees\Individual){
98
+	    if ($grec instanceof \Fisharebest\Webtrees\Individual) {
99 99
 	        $dindi = new Individual($grec);
100 100
 	        $html .= FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1, $size);
101 101
 	        $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1, $size);
102
-	        if($grec->isDead())
102
+	        if ($grec->isDead())
103 103
 	            $html .= FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1, $size);
104 104
 	    }
105 105
 	    return $html;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * {@inheritDoc}
118 118
 	 * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::hasSidebarContent()
119 119
 	 */
120
-	public function hasSidebarContent(){ 
120
+	public function hasSidebarContent() { 
121 121
 	    return true;
122 122
 	}
123 123
 	
@@ -147,24 +147,24 @@  discard block
 block discarded – undo
147 147
 	            echo '
148 148
 	                <table class="issourcedtable">
149 149
 	                   <tr>
150
-	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI') . '</td>
150
+	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI').'</td>
151 151
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1).'</td>
152 152
 	                   </tr>
153 153
 	                   <tr>
154
-	                       <td class="slabel">' . GedcomTag::getLabel('BIRT') . '</td>
154
+	                       <td class="slabel">' . GedcomTag::getLabel('BIRT').'</td>
155 155
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1).'</td>
156 156
 	                   </tr>';
157 157
 	            
158 158
 	            $fams = $root->getSpouseFamilies();
159
-	            ($ct = count($fams)) > 1 ? $nb=1 : $nb=' ';	            
160
-	            foreach($fams as $fam){
159
+	            ($ct = count($fams)) > 1 ? $nb = 1 : $nb = ' ';	            
160
+	            foreach ($fams as $fam) {
161 161
 	                $dfam = new Family($fam);
162 162
 	                echo '
163 163
 	                    <tr>
164 164
 	                       <td class="slabel right">
165
-	                           <a href="' . $fam->getHtmlUrl() . '"> '. GedcomTag::getLabel('MARR');
166
-	                if($ct > 1){
167
-	                    echo ' ',$nb;
165
+	                           <a href="' . $fam->getHtmlUrl().'"> '.GedcomTag::getLabel('MARR');
166
+	                if ($ct > 1) {
167
+	                    echo ' ', $nb;
168 168
 	                    $nb++;
169 169
 	                }
170 170
 	                echo '     </a>
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
 	                   </tr>';
174 174
 	            }
175 175
 	            
176
-	            if( $root->isDead() )
176
+	            if ($root->isDead())
177 177
 	                echo '
178 178
 	                    <tr>
179
-	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
179
+	                       <td class="slabel">' . GedcomTag::getLabel('DEAT').'</td>
180 180
 	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1).'</td>
181 181
 	                   </tr>';
182 182
 	            
Please login to merge, or discard this patch.
src/Webtrees/Hook/Hook.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param string $hook_function_in Hook function to be subscribed or executed
32 32
 	 * @param string $hook_context_in Hook context to be subscribed or executed
33 33
 	 */
34
-	public function __construct($hook_function_in, $hook_context_in = 'all'){
34
+	public function __construct($hook_function_in, $hook_context_in = 'all') {
35 35
 		$this->hook_function = $hook_function_in;
36 36
 		$this->hook_context = $hook_context_in;
37 37
 	}
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 *
48 48
 	 * @param string $hsubscriber Name of the subscriber module
49 49
 	 */
50
-	public function subscribe($hsubscriber){
51
-		if(HookProvider::getInstance()->isModuleOperational()){
50
+	public function subscribe($hsubscriber) {
51
+		if (HookProvider::getInstance()->isModuleOperational()) {
52 52
 			Database::prepare(
53 53
 					"INSERT IGNORE INTO `##maj_hooks` (majh_hook_function, majh_hook_context, majh_module_name)".
54 54
 					" VALUES (?, ?, ?)"
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 * @param string $hsubscriber Name of the subscriber module
63 63
 	 * @param int $priority Priority of execution
64 64
 	 */
65
-	public function setPriority($hsubscriber, $priority){
66
-		if(HookProvider::getInstance()->isModuleOperational()){
65
+	public function setPriority($hsubscriber, $priority) {
66
+		if (HookProvider::getInstance()->isModuleOperational()) {
67 67
 			Database::prepare(
68 68
 			"UPDATE `##maj_hooks`".
69 69
 			" SET majh_module_priority=?".
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 	 *
80 80
 	 * @param string $hsubscriber Name of the subscriber module
81 81
 	 */
82
-	public function enable($hsubscriber){
83
-		if(HookProvider::getInstance()->isModuleOperational()){
82
+	public function enable($hsubscriber) {
83
+		if (HookProvider::getInstance()->isModuleOperational()) {
84 84
 		Database::prepare(
85 85
 			"UPDATE `##maj_hooks`".
86 86
 			" SET majh_status='enabled'".
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @param string $hsubscriber Name of the subscriber module
98 98
 	 */
99
-	public function disable($hsubscriber){
100
-		if(HookProvider::getInstance()->isModuleOperational()){
99
+	public function disable($hsubscriber) {
100
+		if (HookProvider::getInstance()->isModuleOperational()) {
101 101
 		Database::prepare(
102 102
 			"UPDATE `##maj_hooks`".
103 103
 			" SET majh_status='disabled'".
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 	 *
114 114
 	 * @param string $hsubscriber Name of the subscriber module
115 115
 	 */
116
-	public function remove($hsubscriber){
117
-		if(HookProvider::getInstance()->isModuleOperational()){
116
+	public function remove($hsubscriber) {
117
+		if (HookProvider::getInstance()->isModuleOperational()) {
118 118
 		Database::prepare(
119 119
 			"DELETE FROM `##maj_hooks`".
120 120
 			" WHERE majh_hook_function=?".
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function executeOnlyFor(array $module_names) {
140 140
 	    $result = array();
141
-	    if(HookProvider::getInstance()->isModuleOperational()){
141
+	    if (HookProvider::getInstance()->isModuleOperational()) {
142 142
 	       $params = func_get_args();
143 143
 	       array_shift($params);
144 144
     	    foreach ($module_names as $module_name) {
145
-    	        if($module = Module::getModuleByName($module_name)) {
145
+    	        if ($module = Module::getModuleByName($module_name)) {
146 146
     	            $result[] = call_user_func_array(array($module, $this->hook_function), $params);
147 147
     	        }
148 148
     	    }
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	 *
157 157
 	 * @return array Results of the hook executions
158 158
 	 */
159
-	public function execute(){
159
+	public function execute() {
160 160
 		$result = array();
161
-		if(HookProvider::getInstance()->isModuleOperational()){
161
+		if (HookProvider::getInstance()->isModuleOperational()) {
162 162
 			$params = func_get_args();
163 163
 			$sqlquery = '';
164 164
 			$sqlparams = array($this->hook_function);
165
-			if($this->hook_context != 'all') {
165
+			if ($this->hook_context != 'all') {
166 166
 				$sqlparams = array($this->hook_function, $this->hook_context);
167 167
 				$sqlquery = " OR majh_hook_context=?";
168 168
 			}
169
-			$module_names=Database::prepare(
169
+			$module_names = Database::prepare(
170 170
 					"SELECT majh_module_name AS module, majh_module_priority AS priority FROM `##maj_hooks`".
171 171
 					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'".
172 172
 					" ORDER BY majh_module_priority ASC, module ASC"
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
 	 *
184 184
 	 * @return int Number of active modules
185 185
 	 */
186
-	public function getNumberActiveModules(){
187
-		if(HookProvider::getInstance()->isModuleOperational()){
186
+	public function getNumberActiveModules() {
187
+		if (HookProvider::getInstance()->isModuleOperational()) {
188 188
 			$sqlquery = '';
189 189
 			$sqlparams = array($this->hook_function);
190
-			if($this->hook_context != 'all') {
190
+			if ($this->hook_context != 'all') {
191 191
 				$sqlparams = array($this->hook_function, $this->hook_context);
192 192
 				$sqlquery = " OR majh_hook_context=?";
193 193
 			}
194
-			$module_names=Database::prepare(
194
+			$module_names = Database::prepare(
195 195
 					"SELECT majh_module_name AS modules FROM `##maj_hooks`".
196 196
 					" WHERE majh_hook_function = ? AND (majh_hook_context='all'".$sqlquery.") AND majh_status='enabled'"
197 197
 			)->execute($sqlparams)->fetchOneColumn();
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @return bool True is active modules exist, false otherwise
207 207
 	 */
208
-	public function hasAnyActiveModule(){
209
-		return ($this->getNumberActiveModules()>0);
208
+	public function hasAnyActiveModule() {
209
+		return ($this->getNumberActiveModules() > 0);
210 210
 	}
211 211
 
212 212
 }
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/AbstractView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     public function render() {
46 46
         global $controller;        
47 47
         
48
-        if(!$this->ctrl) throw new \Exception('Controller not initialised');
48
+        if (!$this->ctrl) throw new \Exception('Controller not initialised');
49 49
         
50 50
 		$controller = $this->ctrl;
51 51
         $this->ctrl->pageHeader();
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/CertificateController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $cid = Filter::get('cid');
70 70
         
71 71
         $certificate = null;
72
-        if(!empty($cid) && strlen($cid) > 22){
72
+        if (!empty($cid) && strlen($cid) > 22) {
73 73
             $certificate = Certificate::getInstance($cid, $tree, null, $this->provider);
74 74
         }
75 75
         
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $data->set('title', $controller->getPageTitle());
78 78
         
79 79
         $data->set('has_certif', false);
80
-        if($certificate) {
80
+        if ($certificate) {
81 81
             $controller->restrictAccess($certificate->canShow());
82 82
             $data->set('title', $certificate->getTitle());
83 83
             $data->set('has_certif', true);
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
             
86 86
             $data->set(
87 87
                 'url_certif_city', 
88
-                'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . 
89
-                    '&mod_action=Certificate@listAll' .
90
-                    '&ged=' . $tree->getNameUrl() .
91
-                    '&city=' . Functions::encryptToSafeBase64($certificate->getCity())
88
+                'module.php?mod='.Constants::MODULE_MAJ_CERTIF_NAME. 
89
+                    '&mod_action=Certificate@listAll'.
90
+                    '&ged='.$tree->getNameUrl().
91
+                    '&city='.Functions::encryptToSafeBase64($certificate->getCity())
92 92
             );
93 93
             
94 94
             $controller->addInlineJavascript('
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             $linked_indis = $certificate->linkedIndividuals();
103 103
             $linked_fams = $certificate->linkedFamilies();
104 104
                         
105
-            if($linked_indis && count($linked_indis) > 0) {
105
+            if ($linked_indis && count($linked_indis) > 0) {
106 106
                 $data->set('has_linked_indis', true);
107 107
                 $data->set('linked_indis', $linked_indis);
108 108
             }
109 109
             
110
-            if(!empty($linked_fams)) {
110
+            if (!empty($linked_fams)) {
111 111
                 $data->set('has_linked_fams', true);
112 112
                 $data->set('linked_fams', $linked_fams);
113 113
             }
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function image() {
123 123
         $tree = Globals::getTree();
124
-        $cid   = Filter::get('cid');
124
+        $cid = Filter::get('cid');
125 125
         $certificate = null;
126
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $tree, null, $this->provider);
126
+        if (!empty($cid)) $certificate = Certificate::getInstance($cid, $tree, null, $this->provider);
127 127
         
128 128
         $imageBuilder = new ImageBuilder($certificate);
129 129
         
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         
156 156
         $city = Filter::get('city');
157 157
         
158
-        if(!empty($city) && strlen($city) > 22){
158
+        if (!empty($city) && strlen($city) > 22) {
159 159
             $city = Functions::decryptFromSafeBase64($city);
160 160
             $controller->setPageTitle(I18N::translate('Certificates for %s', $city));
161 161
         }
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
         $data->set('selected_city', $city);
171 171
         
172 172
         $data->set('has_list', false);        
173
-        if(!empty($city)) {            
174
-            $table_id = 'table-certiflist-' . Uuid::uuid4();
173
+        if (!empty($city)) {            
174
+            $table_id = 'table-certiflist-'.Uuid::uuid4();
175 175
             
176 176
             $certif_list = $this->provider->getCertificatesList($city);            
177
-            if(!empty($certif_list)) {                
177
+            if (!empty($certif_list)) {                
178 178
                 $data->set('has_list', true);
179 179
                 $data->set('table_id', $table_id);
180 180
                 $data->set('certificate_list', $certif_list);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 				        jQuery.fn.dataTableExt.oSort["text-desc"] = textCompareDesc;
187 187
                         
188 188
                         jQuery("#'.$table_id.'").dataTable( {
189
-        					dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
189
+        					dom: \'<"H"<"filtersH_' . $table_id.'">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
190 190
     					    '.I18N::datatablesI18N().',
191 191
     					    jQueryUI: true,
192 192
         					autoWidth: false,
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/AdminConfigController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,39 +34,39 @@  discard block
 block discarded – undo
34 34
      */
35 35
     protected function update() {
36 36
         
37
-        if(Auth::isAdmin()){
37
+        if (Auth::isAdmin()) {
38 38
             
39 39
             $this->module->setSetting('MAJ_SHOW_CERT', Filter::post('MAJ_SHOW_CERT'));
40 40
             $this->module->setSetting('MAJ_SHOW_NO_WATERMARK', Filter::post('MAJ_SHOW_NO_WATERMARK'));
41 41
             
42
-            if($MAJ_WM_DEFAULT = Filter::post('MAJ_WM_DEFAULT')) {
42
+            if ($MAJ_WM_DEFAULT = Filter::post('MAJ_WM_DEFAULT')) {
43 43
                 $this->module->setSetting('MAJ_WM_DEFAULT', $MAJ_WM_DEFAULT);
44 44
             }
45 45
             
46
-            if($MAJ_WM_FONT_MAXSIZE = Filter::postInteger('MAJ_WM_FONT_MAXSIZE')) {
46
+            if ($MAJ_WM_FONT_MAXSIZE = Filter::postInteger('MAJ_WM_FONT_MAXSIZE')) {
47 47
                 $this->module->setSetting('MAJ_WM_FONT_MAXSIZE', $MAJ_WM_FONT_MAXSIZE);
48 48
             }
49 49
             
50 50
             // Only accept valid color for MAJ_WM_FONT_COLOR
51 51
             $MAJ_WM_FONT_COLOR = Filter::post('MAJ_WM_FONT_COLOR', '#([a-fA-F0-9]{3}){1,2}');            
52
-            if($MAJ_WM_FONT_COLOR) {
52
+            if ($MAJ_WM_FONT_COLOR) {
53 53
                 $this->module->setSetting('MAJ_WM_FONT_COLOR', $MAJ_WM_FONT_COLOR);
54 54
             }
55 55
             
56 56
             // Only accept valid folders for MAJ_CERT_ROOTDIR
57
-            $MAJ_CERT_ROOTDIR = preg_replace('/[\/\\\\]+/', '/', Filter::post('MAJ_CERT_ROOTDIR') . '/');
57
+            $MAJ_CERT_ROOTDIR = preg_replace('/[\/\\\\]+/', '/', Filter::post('MAJ_CERT_ROOTDIR').'/');
58 58
             if (substr($MAJ_CERT_ROOTDIR, 0, 1) === '/') {
59 59
                 $MAJ_CERT_ROOTDIR = substr($MAJ_CERT_ROOTDIR, 1);
60 60
             }
61 61
             
62 62
             if ($MAJ_CERT_ROOTDIR) {
63
-                if (is_dir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) {
63
+                if (is_dir(WT_DATA_DIR.$MAJ_CERT_ROOTDIR)) {
64 64
                     $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR);
65
-                } elseif (File::mkdir(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)) {
65
+                } elseif (File::mkdir(WT_DATA_DIR.$MAJ_CERT_ROOTDIR)) {
66 66
                     $this->module->setSetting('MAJ_CERT_ROOTDIR', $MAJ_CERT_ROOTDIR);
67
-                    FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'info');
67
+                    FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR.$MAJ_CERT_ROOTDIR)), 'info');
68 68
                 } else {
69
-                    FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MAJ_CERT_ROOTDIR)), 'danger');
69
+                    FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR.$MAJ_CERT_ROOTDIR)), 'danger');
70 70
                 }
71 71
             }
72 72
             
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function index() {        
87 87
         $action = Filter::post('action');        
88
-        if($action == 'update' && Filter::checkCsrf()) $this->update();
88
+        if ($action == 'update' && Filter::checkCsrf()) $this->update();
89 89
         
90 90
         Theme::theme(new AdministrationTheme)->init(Globals::getTree());        
91 91
         $ctrl = new PageController();
Please login to merge, or discard this patch.