@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | * {@inhericDoc} |
25 | 25 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
26 | 26 | */ |
27 | - protected function renderContent() { |
|
27 | + protected function renderContent() { |
|
28 | 28 | |
29 | - ?> |
|
29 | + ?> |
|
30 | 30 | |
31 | 31 | <div id="maj-sosa-config-page"> |
32 | 32 | <h2><?php echo $this->data->get('title'); ?></h2> |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | </div> |
47 | 47 | <div class="value"> |
48 | 48 | <?php |
49 | - $users = $this->data->get('users_settings'); |
|
50 | - if(count($users) == 1) { |
|
51 | - $root_indi = $users[0]['rootid']; ?> |
|
49 | + $users = $this->data->get('users_settings'); |
|
50 | + if(count($users) == 1) { |
|
51 | + $root_indi = $users[0]['rootid']; ?> |
|
52 | 52 | <label> |
53 | 53 | <input id="maj_sosa_input_userid" type="hidden" name="userid" value="<?php echo $users[0]['user']->getUserId(); ?>" /> |
54 | 54 | <?php echo $users[0]['user']->getRealNameHtml() ?> |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | <?php } else if(count($users) > 1) { ?> |
57 | 57 | <select id='maj-sosa-config-select' name="userid"> |
58 | 58 | <?php |
59 | - $root_indi = $users[0]['rootid']; |
|
60 | - foreach ($this->data->get('users_settings') as $user) { ?> |
|
59 | + $root_indi = $users[0]['rootid']; |
|
60 | + foreach ($this->data->get('users_settings') as $user) { ?> |
|
61 | 61 | <option value="<?php echo $user['user']->getUserId(); ?>"><?php echo $user['user']->getRealNameHtml() ?></option> |
62 | 62 | <?php } ?> |
63 | 63 | </select> |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | </form> |
81 | 81 | |
82 | 82 | <?php |
83 | - } |
|
83 | + } |
|
84 | 84 | |
85 | 85 | } |
86 | 86 | |
87 | 87 | \ No newline at end of file |
@@ -18,50 +18,50 @@ |
||
18 | 18 | */ |
19 | 19 | class JsonController extends BaseController { |
20 | 20 | |
21 | - /** |
|
22 | - * {@inheritDoc} |
|
23 | - * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader() |
|
24 | - */ |
|
25 | - public function pageHeader() { |
|
26 | - header('Content-Type: application/json'); |
|
27 | - header('Cache-Control: no-cache, must-revalidate'); |
|
28 | - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|
29 | - // We've displayed the header - display the footer automatically |
|
30 | - register_shutdown_function(array($this, 'pageFooter')); |
|
21 | + /** |
|
22 | + * {@inheritDoc} |
|
23 | + * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader() |
|
24 | + */ |
|
25 | + public function pageHeader() { |
|
26 | + header('Content-Type: application/json'); |
|
27 | + header('Cache-Control: no-cache, must-revalidate'); |
|
28 | + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
|
29 | + // We've displayed the header - display the footer automatically |
|
30 | + register_shutdown_function(array($this, 'pageFooter')); |
|
31 | 31 | |
32 | - return $this; |
|
33 | - } |
|
32 | + return $this; |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * {@inheritDoc} |
|
37 | - * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter() |
|
38 | - */ |
|
39 | - public function pageFooter() { |
|
40 | - return $this; |
|
41 | - } |
|
35 | + /** |
|
36 | + * {@inheritDoc} |
|
37 | + * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter() |
|
38 | + */ |
|
39 | + public function pageFooter() { |
|
40 | + return $this; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * Restrict access. |
|
45 | - * |
|
46 | - * @param bool $condition |
|
47 | - * |
|
48 | - * @return $this |
|
49 | - */ |
|
50 | - public function restrictAccess($condition) { |
|
51 | - if ($condition !== true) { |
|
52 | - throw new MvcException(403); |
|
53 | - } |
|
43 | + /** |
|
44 | + * Restrict access. |
|
45 | + * |
|
46 | + * @param bool $condition |
|
47 | + * |
|
48 | + * @return $this |
|
49 | + */ |
|
50 | + public function restrictAccess($condition) { |
|
51 | + if ($condition !== true) { |
|
52 | + throw new MvcException(403); |
|
53 | + } |
|
54 | 54 | |
55 | - return $this; |
|
56 | - } |
|
55 | + return $this; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * Encode the data to JSON format. |
|
60 | - * |
|
61 | - * @param array $data Data to encode |
|
62 | - * @param number $options JSON options mask. See http://php.net/manual/fr/json.constants.php |
|
63 | - */ |
|
64 | - public function encode(array $data, $options = 0) { |
|
65 | - echo json_encode($data, $options); |
|
66 | - } |
|
58 | + /** |
|
59 | + * Encode the data to JSON format. |
|
60 | + * |
|
61 | + * @param array $data Data to encode |
|
62 | + * @param number $options JSON options mask. See http://php.net/manual/fr/json.constants.php |
|
63 | + */ |
|
64 | + public function encode(array $data, $options = 0) { |
|
65 | + echo json_encode($data, $options); |
|
66 | + } |
|
67 | 67 | } |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | */ |
23 | 23 | class Cache{ |
24 | 24 | |
25 | - /** |
|
26 | - * Underlying Cache object |
|
27 | - * @var CacheItemPoolInterface $cache |
|
28 | - */ |
|
25 | + /** |
|
26 | + * Underlying Cache object |
|
27 | + * @var CacheItemPoolInterface $cache |
|
28 | + */ |
|
29 | 29 | protected $cache=null; |
30 | 30 | |
31 | 31 | /** |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | protected static function getInstance() |
49 | 49 | { |
50 | - if (null === static::$instance) { |
|
51 | - static::$instance = new static(); |
|
52 | - } |
|
50 | + if (null === static::$instance) { |
|
51 | + static::$instance = new static(); |
|
52 | + } |
|
53 | 53 | |
54 | - return static::$instance; |
|
54 | + return static::$instance; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | * |
60 | 60 | */ |
61 | 61 | protected function init() { |
62 | - if(Apc::isAvailable()) { |
|
63 | - $driver = new Apc(); |
|
62 | + if(Apc::isAvailable()) { |
|
63 | + $driver = new Apc(); |
|
64 | 64 | } else { |
65 | 65 | if (!is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) { |
66 | 66 | // We may not have permission - especially during setup, before we instruct |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | @mkdir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache'); |
69 | 69 | } |
70 | 70 | if (is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) { |
71 | - $driver = new FileSystem(array('path' => WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')); |
|
71 | + $driver = new FileSystem(array('path' => WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')); |
|
72 | 72 | } else { |
73 | 73 | // No cache available, let's just use a basic one :-( |
74 | 74 | $driver = new Ephemeral(); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return string Cached key name |
96 | 96 | */ |
97 | 97 | protected function getKeyName($value, AbstractModule $mod = null){ |
98 | - $this->checkInit(); |
|
98 | + $this->checkInit(); |
|
99 | 99 | $mod_name = 'myartjaub'; |
100 | 100 | if($mod !== null) $mod_name = $mod->getName(); |
101 | 101 | return $mod_name.'_'.$value; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @return \Psr\Cache\CacheItemInterface |
110 | 110 | */ |
111 | 111 | public function getI($value, AbstractModule $mod = null){ |
112 | - $this->checkInit(); |
|
112 | + $this->checkInit(); |
|
113 | 113 | return $this->cache->getItem($this->getKeyName($value, $mod)); |
114 | 114 | } |
115 | 115 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @return \Psr\Cache\CacheItemInterface |
122 | 122 | */ |
123 | 123 | public static function get($value, AbstractModule $mod = null){ |
124 | - return self::getInstance()->getI($value, $mod); |
|
124 | + return self::getInstance()->getI($value, $mod); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | |
137 | 137 | $item = $value; |
138 | 138 | if(!($value instanceof CacheItemInterface)) { |
139 | - $item = new \Stash\Item(); |
|
140 | - $item->setKey($this->getKeyName($value, $mod)); |
|
139 | + $item = new \Stash\Item(); |
|
140 | + $item->setKey($this->getKeyName($value, $mod)); |
|
141 | 141 | } |
142 | 142 | $item->set($data); |
143 | 143 | $this->cache->save($item); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @param AbstractModule $mod Calling module |
152 | 152 | */ |
153 | 153 | public static function save($value, $data, AbstractModule $mod = null){ |
154 | - self::getInstance()->saveI($value, $data, $mod); |
|
154 | + self::getInstance()->saveI($value, $data, $mod); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | * @return bool Deletion successful? |
163 | 163 | */ |
164 | 164 | public function deleteI($value, AbstractModule $mod = null){ |
165 | - $this->checkInit(); |
|
166 | - return $this->cache->deleteItem($this->getKeyName($value, $mod)); |
|
165 | + $this->checkInit(); |
|
166 | + return $this->cache->deleteItem($this->getKeyName($value, $mod)); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | * @return bool Deletion successful? |
175 | 175 | */ |
176 | 176 | public static function delete($value, AbstractModule $mod = null){ |
177 | - return self::getInstance()->deleteI($value, $mod); |
|
177 | + return self::getInstance()->deleteI($value, $mod); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * |
183 | 183 | */ |
184 | 184 | public function cleanI(){ |
185 | - $this->checkInit(); |
|
185 | + $this->checkInit(); |
|
186 | 186 | $this->cache->clear(); |
187 | 187 | } |
188 | 188 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | * Static invocation of the *clean* method. |
191 | 191 | */ |
192 | 192 | public static function clean() { |
193 | - self::getInstance()->cleanI(); |
|
193 | + self::getInstance()->cleanI(); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | } |
197 | 197 | \ No newline at end of file |
@@ -17,27 +17,27 @@ |
||
17 | 17 | */ |
18 | 18 | class FunctionsPrintLists { |
19 | 19 | |
20 | - /** |
|
21 | - * Copy of core function, which is not public. |
|
22 | - * |
|
23 | - * @param Individual $individual |
|
24 | - * |
|
25 | - * @return string[] |
|
26 | - * @see \Fisharebest\Webtrees\Functions\FunctionsPrintLists |
|
27 | - */ |
|
28 | - public static function sortableNames(Individual $individual) { |
|
29 | - $names = $individual->getAllNames(); |
|
30 | - $primary = $individual->getPrimaryName(); |
|
20 | + /** |
|
21 | + * Copy of core function, which is not public. |
|
22 | + * |
|
23 | + * @param Individual $individual |
|
24 | + * |
|
25 | + * @return string[] |
|
26 | + * @see \Fisharebest\Webtrees\Functions\FunctionsPrintLists |
|
27 | + */ |
|
28 | + public static function sortableNames(Individual $individual) { |
|
29 | + $names = $individual->getAllNames(); |
|
30 | + $primary = $individual->getPrimaryName(); |
|
31 | 31 | |
32 | - list($surn, $givn) = explode(',', $names[$primary]['sort']); |
|
32 | + list($surn, $givn) = explode(',', $names[$primary]['sort']); |
|
33 | 33 | |
34 | - $givn = str_replace('@P.N.', 'AAAA', $givn); |
|
35 | - $surn = str_replace('@N.N.', 'AAAA', $surn); |
|
34 | + $givn = str_replace('@P.N.', 'AAAA', $givn); |
|
35 | + $surn = str_replace('@N.N.', 'AAAA', $surn); |
|
36 | 36 | |
37 | - return array( |
|
38 | - $surn . 'AAAA' . $givn, |
|
39 | - $givn . 'AAAA' . $surn, |
|
40 | - ); |
|
41 | - } |
|
37 | + return array( |
|
38 | + $surn . 'AAAA' . $givn, |
|
39 | + $givn . 'AAAA' . $surn, |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | \ No newline at end of file |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * {@inhericDoc} |
25 | 25 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
26 | 26 | */ |
27 | - protected function renderContent() { |
|
27 | + protected function renderContent() { |
|
28 | 28 | |
29 | - $cities = $this->data->get('cities'); |
|
30 | - $selected_city = $this->data->get('selected_city'); |
|
29 | + $cities = $this->data->get('cities'); |
|
30 | + $selected_city = $this->data->get('selected_city'); |
|
31 | 31 | |
32 | - ?> |
|
32 | + ?> |
|
33 | 33 | <div id="maj-cert-list-page" class="center"> |
34 | 34 | <h2><?= $this->data->get('title') ?></h2> |
35 | 35 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | </thead> |
59 | 59 | <tbody> |
60 | 60 | <?php foreach ($this->data->get('certificate_list') as $certificate) { |
61 | - /** @var \MyArtJaub\Webtrees\Module\Certificates\Model\Certificate $certificate */ |
|
62 | - ?> |
|
61 | + /** @var \MyArtJaub\Webtrees\Module\Certificates\Model\Certificate $certificate */ |
|
62 | + ?> |
|
63 | 63 | <tr> |
64 | 64 | <!-- Certificate date --> |
65 | 65 | <?php if($date = $certificate->getCertificateDate()) { ?> |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | <td><?= Filter::escapeHtml($certificate->getCertificateType() ?: '') ?></td> |
72 | 72 | <!-- Certificate Name --> |
73 | 73 | <?php |
74 | - $name = $certificate->getCertificateDetails() ?: ''; |
|
75 | - $sortname = ""; |
|
76 | - $ct_names=preg_match("/([A-Z]{2,})/", $name, $match); |
|
77 | - if($ct_names > 0) $sortname = $match[1].'_'; |
|
78 | - $sortname .= $name; |
|
79 | - ?> |
|
74 | + $name = $certificate->getCertificateDetails() ?: ''; |
|
75 | + $sortname = ""; |
|
76 | + $ct_names=preg_match("/([A-Z]{2,})/", $name, $match); |
|
77 | + if($ct_names > 0) $sortname = $match[1].'_'; |
|
78 | + $sortname .= $name; |
|
79 | + ?> |
|
80 | 80 | <td data-sort="<?= Filter::escapeHtml($sortname) ?>"> |
81 | 81 | <a href="<?= $certificate->getHtmlUrl() ?>"><?= Filter::escapeHtml($name) ?></a> |
82 | 82 | </td> |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | </div> |
90 | 90 | |
91 | 91 | <?php |
92 | - } |
|
92 | + } |
|
93 | 93 | |
94 | 94 | } |
95 | 95 | |
96 | 96 | \ No newline at end of file |
@@ -1,13 +1,13 @@ |
||
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 | use Fisharebest\Webtrees\GedcomRecord; |
@@ -1,13 +1,13 @@ |
||
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 | /** |
@@ -1,13 +1,13 @@ discard block |
||
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 |
||
15 | 15 | */ |
16 | 16 | interface PageHeaderExtenderInterface { |
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 |
@@ -1,13 +1,13 @@ discard block |
||
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 |
||
15 | 15 | */ |
16 | 16 | interface PageFooterExtenderInterface { |
17 | 17 | |
18 | - /** |
|
19 | - * Get HTML code for extending the footer of a page. |
|
20 | - * |
|
21 | - * @return string HTML code extension |
|
22 | - */ |
|
23 | - public function hPrintFooter(); |
|
18 | + /** |
|
19 | + * Get HTML code for extending the footer of a page. |
|
20 | + * |
|
21 | + * @return string HTML code extension |
|
22 | + */ |
|
23 | + public function hPrintFooter(); |
|
24 | 24 | |
25 | 25 | } |
26 | 26 |