Completed
Push — feature/code-analysis ( 0f93c5...1158f1 )
by Jonathan
03:21
created
src/Webtrees/Hook/HookInterfaces/PageHeaderExtenderInterface.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook\HookInterfaces;
12 12
 
13 13
 /**
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
  */
16 16
 interface PageHeaderExtender {
17 17
 		
18
-    /**
19
-     * Get HTML code for extending the header of a page.
20
-     * 
21
-     * @return string HTML code extension
22
-     */
23
-    public function hPrintHeader();
18
+	/**
19
+	 * Get HTML code for extending the header of a page.
20
+	 * 
21
+	 * @return string HTML code extension
22
+	 */
23
+	public function hPrintHeader();
24 24
 	
25 25
 }
26 26
 
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookInterfaces/IndividualHeaderExtenderInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
  /**
3
- * webtrees-lib: MyArtJaub library for webtrees
4
- *
5
- * @package MyArtJaub\Webtrees
6
- * @subpackage Hook
7
- * @author Jonathan Jaubart <[email protected]>
8
- * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
- */
3
+  * webtrees-lib: MyArtJaub library for webtrees
4
+  *
5
+  * @package MyArtJaub\Webtrees
6
+  * @subpackage Hook
7
+  * @author Jonathan Jaubart <[email protected]>
8
+  * @copyright Copyright (c) 2011-2016, Jonathan Jaubart
9
+  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
10
+  */
11 11
 namespace MyArtJaub\Webtrees\Hook;
12 12
 
13 13
 use \Fisharebest\Webtrees as fw;
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/CertificateController.php 3 patches
Indentation   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -32,158 +32,158 @@  discard block
 block discarded – undo
32 32
  */
33 33
 class CertificateController extends MvcController
34 34
 {
35
-    /**
36
-     * Certificate Provider
37
-     * @var CertificateProviderInterface $provider
38
-     */
39
-    protected $provider;
35
+	/**
36
+	 * Certificate Provider
37
+	 * @var CertificateProviderInterface $provider
38
+	 */
39
+	protected $provider;
40 40
     
41
-    /**
42
-     * Constructor for Certificate controller
43
-     * @param AbstractModule $module
44
-     */
45
-    public function __construct(AbstractModule $module) {
46
-        parent::__construct($module);
47
-        
48
-        $this->provider = $this->module->getProvider();
49
-    }
41
+	/**
42
+	 * Constructor for Certificate controller
43
+	 * @param AbstractModule $module
44
+	 */
45
+	public function __construct(AbstractModule $module) {
46
+		parent::__construct($module);
47
+        
48
+		$this->provider = $this->module->getProvider();
49
+	}
50 50
     
51 51
     
52
-    /**
53
-     * Pages
54
-     */
55
-        
56
-    /**
57
-     * Certificate@index
58
-     */
59
-    public function index() {
60
-        global $WT_TREE;
61
-        
62
-        $controller = new PageController();
63
-        $controller
64
-        ->setPageTitle(I18N::translate('Certificate'))
65
-        ->restrictAccess(
66
-            $this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)
67
-        );
68
-        
69
-        $cid = Filter::get('cid');
70
-        
71
-        $certificate = null;
72
-        if(!empty($cid) && strlen($cid) > 22){
73
-            $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
74
-        }
75
-        
76
-        $data = new ViewBag();
77
-        $data->set('title', $controller->getPageTitle());
78
-        
79
-        $data->set('has_certif', false);
80
-        if($certificate) {
81
-            $controller->restrictAccess($certificate->canShow());
82
-            $data->set('title', $certificate->getTitle());
83
-            $data->set('has_certif', true);
84
-            $data->set('certificate', $certificate);
52
+	/**
53
+	 * Pages
54
+	 */
55
+        
56
+	/**
57
+	 * Certificate@index
58
+	 */
59
+	public function index() {
60
+		global $WT_TREE;
61
+        
62
+		$controller = new PageController();
63
+		$controller
64
+		->setPageTitle(I18N::translate('Certificate'))
65
+		->restrictAccess(
66
+			$this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)
67
+		);
68
+        
69
+		$cid = Filter::get('cid');
70
+        
71
+		$certificate = null;
72
+		if(!empty($cid) && strlen($cid) > 22){
73
+			$certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
74
+		}
75
+        
76
+		$data = new ViewBag();
77
+		$data->set('title', $controller->getPageTitle());
78
+        
79
+		$data->set('has_certif', false);
80
+		if($certificate) {
81
+			$controller->restrictAccess($certificate->canShow());
82
+			$data->set('title', $certificate->getTitle());
83
+			$data->set('has_certif', true);
84
+			$data->set('certificate', $certificate);
85 85
             
86
-            $data->set(
87
-                'url_certif_city', 
88
-                'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . 
89
-                    '&mod_action=Certificate@listAll' .
90
-                    '&ged=' . $WT_TREE->getNameUrl() .
91
-                    '&city=' . Functions::encryptToSafeBase64($certificate->getCity())
92
-            );
86
+			$data->set(
87
+				'url_certif_city', 
88
+				'module.php?mod=' . Constants::MODULE_MAJ_CERTIF_NAME . 
89
+					'&mod_action=Certificate@listAll' .
90
+					'&ged=' . $WT_TREE->getNameUrl() .
91
+					'&city=' . Functions::encryptToSafeBase64($certificate->getCity())
92
+			);
93 93
             
94
-            $controller->addInlineJavascript('
94
+			$controller->addInlineJavascript('
95 95
                 jQuery("#certificate-tabs").tabs();
96 96
 			    jQuery("#certificate-tabs").css("visibility", "visible");    
97 97
             ');
98 98
             
99
-            $data->set('has_linked_indis', false);
100
-            $data->set('has_linked_fams', false);
99
+			$data->set('has_linked_indis', false);
100
+			$data->set('has_linked_fams', false);
101 101
             
102
-            $linked_indis = $certificate->linkedIndividuals();
103
-            $linked_fams = $certificate->linkedFamilies();
102
+			$linked_indis = $certificate->linkedIndividuals();
103
+			$linked_fams = $certificate->linkedFamilies();
104 104
                         
105
-            if($linked_indis && count($linked_indis) > 0) {
106
-                $data->set('has_linked_indis', true);
107
-                $data->set('linked_indis', $linked_indis);
108
-            }
105
+			if($linked_indis && count($linked_indis) > 0) {
106
+				$data->set('has_linked_indis', true);
107
+				$data->set('linked_indis', $linked_indis);
108
+			}
109 109
             
110
-            if(!empty($linked_fams)) {
111
-                $data->set('has_linked_fams', true);
112
-                $data->set('linked_fams', $linked_fams);
113
-            }
114
-        }
115
-        
116
-        ViewFactory::make('Certificate', $this, $controller, $data)->render();
117
-    }
110
+			if(!empty($linked_fams)) {
111
+				$data->set('has_linked_fams', true);
112
+				$data->set('linked_fams', $linked_fams);
113
+			}
114
+		}
115
+        
116
+		ViewFactory::make('Certificate', $this, $controller, $data)->render();
117
+	}
118 118
     
119
-    /**
120
-     * Certificate@image
121
-     */
122
-    public function image() {      
123
-        global $WT_TREE;
119
+	/**
120
+	 * Certificate@image
121
+	 */
122
+	public function image() {      
123
+		global $WT_TREE;
124 124
         
125
-        $cid   = Filter::get('cid');
126
-        $certificate = null;
127
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
125
+		$cid   = Filter::get('cid');
126
+		$certificate = null;
127
+		if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
128 128
         
129
-        $imageBuilder = new ImageBuilder($certificate);
129
+		$imageBuilder = new ImageBuilder($certificate);
130 130
         
131
-        if (!empty(Filter::get('cb'))) {
132
-            $imageBuilder->setExpireOffset($imageBuilder->getExpireOffset() * 7);
133
-        }
131
+		if (!empty(Filter::get('cb'))) {
132
+			$imageBuilder->setExpireOffset($imageBuilder->getExpireOffset() * 7);
133
+		}
134 134
         
135
-        $imageBuilder
136
-            ->setShowWatermark(Auth::accessLevel($WT_TREE) >= $this->module->getSetting('MAJ_SHOW_NO_WATERMARK', Auth::PRIV_HIDE))
137
-            ->setFontMaxSize($this->module->getSetting('MAJ_WM_FONT_MAXSIZE', 18))
138
-            ->setFontColor($this->module->getSetting('MAJ_WM_FONT_COLOR', '#4D6DF3'))
139
-        ;
135
+		$imageBuilder
136
+			->setShowWatermark(Auth::accessLevel($WT_TREE) >= $this->module->getSetting('MAJ_SHOW_NO_WATERMARK', Auth::PRIV_HIDE))
137
+			->setFontMaxSize($this->module->getSetting('MAJ_WM_FONT_MAXSIZE', 18))
138
+			->setFontColor($this->module->getSetting('MAJ_WM_FONT_COLOR', '#4D6DF3'))
139
+		;
140 140
         
141
-        $imageBuilder->render();
141
+		$imageBuilder->render();
142 142
         
143
-    }
143
+	}
144 144
     
145
-    /**
146
-     * Certificate@listAll
147
-     */
148
-    public function listAll() {
149
-        global $WT_TREE;
150
-        
151
-        $controller = new PageController();
152
-        $controller
153
-            ->setPageTitle(I18N::translate('Certificates'))
154
-            ->restrictAccess(
155
-                $this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)
156
-            );
157
-        
158
-        $city = Filter::get('city');
159
-        
160
-        if(!empty($city) && strlen($city) > 22){
161
-            $city = Functions::decryptFromSafeBase64($city);
162
-            $controller->setPageTitle(I18N::translate('Certificates for %s', $city));
163
-        }
164
-        
165
-        $data = new ViewBag();
166
-        $data->set('title', $controller->getPageTitle());
167
-        $data->set('url_module', $this->module->getName());
168
-        $data->set('url_action', 'Certificate@listAll');
169
-        $data->set('url_ged', $WT_TREE->getNameUrl());
170
-        
171
-        $data->set('cities', $this->provider->getCitiesList());
172
-        $data->set('selected_city', $city);
173
-        
174
-        $data->set('has_list', false);        
175
-        if(!empty($city)) {            
176
-            $table_id = 'table-certiflist-' . Uuid::uuid4();
145
+	/**
146
+	 * Certificate@listAll
147
+	 */
148
+	public function listAll() {
149
+		global $WT_TREE;
150
+        
151
+		$controller = new PageController();
152
+		$controller
153
+			->setPageTitle(I18N::translate('Certificates'))
154
+			->restrictAccess(
155
+				$this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($WT_TREE)
156
+			);
157
+        
158
+		$city = Filter::get('city');
159
+        
160
+		if(!empty($city) && strlen($city) > 22){
161
+			$city = Functions::decryptFromSafeBase64($city);
162
+			$controller->setPageTitle(I18N::translate('Certificates for %s', $city));
163
+		}
164
+        
165
+		$data = new ViewBag();
166
+		$data->set('title', $controller->getPageTitle());
167
+		$data->set('url_module', $this->module->getName());
168
+		$data->set('url_action', 'Certificate@listAll');
169
+		$data->set('url_ged', $WT_TREE->getNameUrl());
170
+        
171
+		$data->set('cities', $this->provider->getCitiesList());
172
+		$data->set('selected_city', $city);
173
+        
174
+		$data->set('has_list', false);        
175
+		if(!empty($city)) {            
176
+			$table_id = 'table-certiflist-' . Uuid::uuid4();
177 177
             
178
-            $certif_list = $this->provider->getCertificatesList($city);            
179
-            if(!empty($certif_list)) {                
180
-                $data->set('has_list', true);
181
-                $data->set('table_id', $table_id);
182
-                $data->set('certificate_list', $certif_list);
178
+			$certif_list = $this->provider->getCertificatesList($city);            
179
+			if(!empty($certif_list)) {                
180
+				$data->set('has_list', true);
181
+				$data->set('table_id', $table_id);
182
+				$data->set('certificate_list', $certif_list);
183 183
                 
184
-                $controller
185
-                    ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)
186
-                    ->addInlineJavascript('
184
+				$controller
185
+					->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)
186
+					->addInlineJavascript('
187 187
                         /* Initialise datatables */
188 188
         				jQuery.fn.dataTableExt.oSort["unicode-asc"  ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
189 189
         				jQuery.fn.dataTableExt.oSort["unicode-desc" ]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
@@ -210,29 +210,29 @@  discard block
 block discarded – undo
210 210
         				jQuery(".certificate-list").css("visibility", "visible");
211 211
         				jQuery(".loading-image").css("display", "none");
212 212
                     ');
213
-            }
214
-        }
213
+			}
214
+		}
215 215
         
216
-        ViewFactory::make('CertificatesList', $this, $controller, $data)->render();
216
+		ViewFactory::make('CertificatesList', $this, $controller, $data)->render();
217 217
         
218
-    }
218
+	}
219 219
     
220
-    /**
221
-     * Certificate@autocomplete
222
-     */
223
-    public function autocomplete() {
224
-        global $WT_TREE;
220
+	/**
221
+	 * Certificate@autocomplete
222
+	 */
223
+	public function autocomplete() {
224
+		global $WT_TREE;
225 225
         
226
-        $controller = new JsonController();
226
+		$controller = new JsonController();
227 227
         
228
-        $city = Filter::get('city');
229
-        $contains = Filter::get('term');        
228
+		$city = Filter::get('city');
229
+		$contains = Filter::get('term');        
230 230
 
231
-        $controller
232
-            ->restrictAccess(Auth::isEditor($WT_TREE) && !empty($city) && !empty($contains))
233
-            ->pageHeader();
231
+		$controller
232
+			->restrictAccess(Auth::isEditor($WT_TREE) && !empty($city) && !empty($contains))
233
+			->pageHeader();
234 234
         
235
-        $listCert = $this->provider->getCertificatesListBeginWith($city, $contains); 
236
-        echo \Zend_Json::encode($listCert);
237
-    }
235
+		$listCert = $this->provider->getCertificatesListBeginWith($city, $contains); 
236
+		echo \Zend_Json::encode($listCert);
237
+	}
238 238
 }
239 239
\ No newline at end of file
Please login to merge, or discard this 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, $WT_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=' . $WT_TREE->getNameUrl() .
91
-                    '&city=' . Functions::encryptToSafeBase64($certificate->getCity())
88
+                'module.php?mod='.Constants::MODULE_MAJ_CERTIF_NAME. 
89
+                    '&mod_action=Certificate@listAll'.
90
+                    '&ged='.$WT_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
             }
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
     public function image() {      
123 123
         global $WT_TREE;
124 124
         
125
-        $cid   = Filter::get('cid');
125
+        $cid = Filter::get('cid');
126 126
         $certificate = null;
127
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
127
+        if (!empty($cid)) $certificate = Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
128 128
         
129 129
         $imageBuilder = new ImageBuilder($certificate);
130 130
         
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         
158 158
         $city = Filter::get('city');
159 159
         
160
-        if(!empty($city) && strlen($city) > 22){
160
+        if (!empty($city) && strlen($city) > 22) {
161 161
             $city = Functions::decryptFromSafeBase64($city);
162 162
             $controller->setPageTitle(I18N::translate('Certificates for %s', $city));
163 163
         }
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
         $data->set('selected_city', $city);
173 173
         
174 174
         $data->set('has_list', false);        
175
-        if(!empty($city)) {            
176
-            $table_id = 'table-certiflist-' . Uuid::uuid4();
175
+        if (!empty($city)) {            
176
+            $table_id = 'table-certiflist-'.Uuid::uuid4();
177 177
             
178 178
             $certif_list = $this->provider->getCertificatesList($city);            
179
-            if(!empty($certif_list)) {                
179
+            if (!empty($certif_list)) {                
180 180
                 $data->set('has_list', true);
181 181
                 $data->set('table_id', $table_id);
182 182
                 $data->set('certificate_list', $certif_list);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         				jQuery.fn.dataTableExt.oSort["num-html-desc"]=function(a,b) {a=parseFloat(a.replace(/<[^<]*>/, "")); b=parseFloat(b.replace(/<[^<]*>/, "")); return (a>b) ? -1 : (a<b ? 1 : 0);};
192 192
                         
193 193
                         jQuery("#'.$table_id.'").dataTable( {
194
-        					dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
194
+        					dom: \'<"H"<"filtersH_' . $table_id.'">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_'.$table_id.'">>\',
195 195
     					    '.I18N::datatablesI18N().',
196 196
     					    jQueryUI: true,
197 197
         					autoWidth: false,
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,9 @@
 block discarded – undo
124 124
         
125 125
         $cid   = Filter::get('cid');
126 126
         $certificate = null;
127
-        if(!empty($cid)) $certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
127
+        if(!empty($cid)) {
128
+        	$certificate =  Certificate::getInstance($cid, $WT_TREE, null, $this->provider);
129
+        }
128 130
         
129 131
         $imageBuilder = new ImageBuilder($certificate);
130 132
         
Please login to merge, or discard this patch.