@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * A GEDCOM note (NOTE) object. |
20 | 20 | */ |
21 | -class Note extends GedcomRecord { |
|
21 | +class Note extends GedcomRecord |
|
22 | +{ |
|
22 | 23 | const RECORD_TYPE = 'NOTE'; |
23 | 24 | const URL_PREFIX = 'note.php?nid='; |
24 | 25 | |
@@ -27,7 +28,8 @@ discard block |
||
27 | 28 | * |
28 | 29 | * @return string|null |
29 | 30 | */ |
30 | - public function getNote() { |
|
31 | + public function getNote() |
|
32 | + { |
|
31 | 33 | if (preg_match('/^0 @' . WT_REGEX_XREF . '@ NOTE ?(.*(?:\n1 CONT ?.*)*)/', $this->gedcom . $this->pending, $match)) { |
32 | 34 | return preg_replace("/\n1 CONT ?/", "\n", $match[1]); |
33 | 35 | } else { |
@@ -42,7 +44,8 @@ discard block |
||
42 | 44 | * |
43 | 45 | * @return bool |
44 | 46 | */ |
45 | - protected function canShowByType($access_level) { |
|
47 | + protected function canShowByType($access_level) |
|
48 | + { |
|
46 | 49 | // Hide notes if they are attached to private records |
47 | 50 | $linked_ids = Database::prepare( |
48 | 51 | "SELECT l_from FROM `##link` WHERE l_to=? AND l_file=?" |
@@ -67,7 +70,8 @@ discard block |
||
67 | 70 | * |
68 | 71 | * @return string |
69 | 72 | */ |
70 | - protected function createPrivateGedcomRecord($access_level) { |
|
73 | + protected function createPrivateGedcomRecord($access_level) |
|
74 | + { |
|
71 | 75 | return '0 @' . $this->xref . '@ NOTE ' . I18N::translate('Private'); |
72 | 76 | } |
73 | 77 | |
@@ -79,7 +83,8 @@ discard block |
||
79 | 83 | * |
80 | 84 | * @return null|string |
81 | 85 | */ |
82 | - protected static function fetchGedcomRecord($xref, $tree_id) { |
|
86 | + protected static function fetchGedcomRecord($xref, $tree_id) |
|
87 | + { |
|
83 | 88 | return Database::prepare( |
84 | 89 | "SELECT o_gedcom FROM `##other` WHERE o_id = :xref AND o_file = :tree_id AND o_type = 'NOTE'" |
85 | 90 | )->execute(array( |
@@ -92,7 +97,8 @@ discard block |
||
92 | 97 | * Create a name for this note - apply (and remove) markup, then take |
93 | 98 | * a maximum of 100 characters from the first line. |
94 | 99 | */ |
95 | - public function extractNames() { |
|
100 | + public function extractNames() |
|
101 | + { |
|
96 | 102 | $text = $this->getNote(); |
97 | 103 | |
98 | 104 | if ($text) { |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Measure page popularity. |
20 | 20 | */ |
21 | -class HitCounter { |
|
21 | +class HitCounter |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Count the number of times this page has been viewed. |
24 | 25 | * |
@@ -28,7 +29,8 @@ discard block |
||
28 | 29 | * |
29 | 30 | * @return int |
30 | 31 | */ |
31 | - public static function countHit(Tree $tree, $page, $parameter) { |
|
32 | + public static function countHit(Tree $tree, $page, $parameter) |
|
33 | + { |
|
32 | 34 | // Don't increment the counter while we stay on the same page. |
33 | 35 | if ( |
34 | 36 | Session::get('last_tree_id') === $tree->getTreeId() && |
@@ -79,7 +81,8 @@ discard block |
||
79 | 81 | * |
80 | 82 | * @return int |
81 | 83 | */ |
82 | - public static function getCount(Tree $tree, $page, $parameter) { |
|
84 | + public static function getCount(Tree $tree, $page, $parameter) |
|
85 | + { |
|
83 | 86 | return (int) Database::prepare( |
84 | 87 | "SELECT page_count FROM `##hit_counter`" . |
85 | 88 | " WHERE gedcom_id = :tree_id AND page_name = :page AND page_parameter = :parameter" |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Class Html - Add HTML markup to elements consistently. |
20 | 20 | */ |
21 | -class Html { |
|
21 | +class Html |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * Filenames are (almost?) always LTR, even on RTL systems. |
24 | 25 | * |
@@ -26,7 +27,8 @@ discard block |
||
26 | 27 | * |
27 | 28 | * @return string |
28 | 29 | */ |
29 | - public static function filename($filename) { |
|
30 | + public static function filename($filename) |
|
31 | + { |
|
30 | 32 | return '<samp class="filename" dir="ltr">' . Filter::escapeHtml($filename) . '</samp>'; |
31 | 33 | } |
32 | 34 | } |
@@ -22,13 +22,15 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * The clouds theme. |
24 | 24 | */ |
25 | -class CloudsTheme extends AbstractTheme implements ThemeInterface { |
|
25 | +class CloudsTheme extends AbstractTheme implements ThemeInterface |
|
26 | +{ |
|
26 | 27 | /** |
27 | 28 | * Where are our CSS, JS and other assets? |
28 | 29 | * |
29 | 30 | * @return string A relative path, such as "themes/foo/" |
30 | 31 | */ |
31 | - public function assetUrl() { |
|
32 | + public function assetUrl() |
|
33 | + { |
|
32 | 34 | return 'themes/clouds/css-1.7.8/'; |
33 | 35 | } |
34 | 36 | |
@@ -39,7 +41,8 @@ discard block |
||
39 | 41 | * |
40 | 42 | * @return string |
41 | 43 | */ |
42 | - protected function flashMessageContainer(\stdClass $message) { |
|
44 | + protected function flashMessageContainer(\stdClass $message) |
|
45 | + { |
|
43 | 46 | // This theme uses jQueryUI markup. |
44 | 47 | switch ($message->status) { |
45 | 48 | case 'danger': |
@@ -59,7 +62,8 @@ discard block |
||
59 | 62 | * |
60 | 63 | * @return string |
61 | 64 | */ |
62 | - public function formatBlock($id, $title, $class, $content) { |
|
65 | + public function formatBlock($id, $title, $class, $content) |
|
66 | + { |
|
63 | 67 | return |
64 | 68 | '<div id="' . $id . '" class="block" >' . |
65 | 69 | '<table class="blockheader"><tr><td class="blockh1"></td><td class="blockh2">' . |
@@ -74,7 +78,8 @@ discard block |
||
74 | 78 | * |
75 | 79 | * @return string |
76 | 80 | */ |
77 | - protected function formQuickSearchFields() { |
|
81 | + protected function formQuickSearchFields() |
|
82 | + { |
|
78 | 83 | return |
79 | 84 | '<input type="search" name="query" size="15" placeholder="' . I18N::translate('Search') . '">' . |
80 | 85 | '<input class="search-icon" type="image" src="' . $this->assetUrl() . 'images/go.png" alt="' . I18N::translate('Search') . '" title="' . I18N::translate('Search') . '">'; |
@@ -85,7 +90,8 @@ discard block |
||
85 | 90 | * |
86 | 91 | * @return string |
87 | 92 | */ |
88 | - public function hookFooterExtraJavascript() { |
|
93 | + public function hookFooterExtraJavascript() |
|
94 | + { |
|
89 | 95 | return |
90 | 96 | '<script src="' . WT_JQUERY_COLORBOX_URL . '"></script>' . |
91 | 97 | '<script src="' . WT_JQUERY_WHEELZOOM_URL . '"></script>' . |
@@ -109,7 +115,8 @@ discard block |
||
109 | 115 | * |
110 | 116 | * @return string|int|float |
111 | 117 | */ |
112 | - public function parameter($parameter_name) { |
|
118 | + public function parameter($parameter_name) |
|
119 | + { |
|
113 | 120 | $parameters = array( |
114 | 121 | 'chart-background-f' => 'e9daf1', |
115 | 122 | 'chart-background-m' => 'b1cff0', |
@@ -132,7 +139,8 @@ discard block |
||
132 | 139 | * |
133 | 140 | * @return string |
134 | 141 | */ |
135 | - protected function primaryMenuContent(array $menus) { |
|
142 | + protected function primaryMenuContent(array $menus) |
|
143 | + { |
|
136 | 144 | $html = ''; |
137 | 145 | |
138 | 146 | foreach ($menus as $menu) { |
@@ -155,7 +163,8 @@ discard block |
||
155 | 163 | * |
156 | 164 | * @return string[] |
157 | 165 | */ |
158 | - protected function stylesheets() { |
|
166 | + protected function stylesheets() |
|
167 | + { |
|
159 | 168 | return array( |
160 | 169 | 'themes/clouds/jquery-ui-1.11.2/jquery-ui.css', |
161 | 170 | $this->assetUrl() . 'style.css', |
@@ -167,7 +176,8 @@ discard block |
||
167 | 176 | * |
168 | 177 | * @return string |
169 | 178 | */ |
170 | - public function themeId() { |
|
179 | + public function themeId() |
|
180 | + { |
|
171 | 181 | return 'clouds'; |
172 | 182 | } |
173 | 183 | |
@@ -176,7 +186,8 @@ discard block |
||
176 | 186 | * |
177 | 187 | * @return string |
178 | 188 | */ |
179 | - public function themeName() { |
|
189 | + public function themeName() |
|
190 | + { |
|
180 | 191 | return /* I18N: Name of a theme. */ I18N::translate('clouds'); |
181 | 192 | } |
182 | 193 | } |
@@ -25,7 +25,8 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * The colors theme. |
27 | 27 | */ |
28 | -class ColorsTheme extends CloudsTheme implements ThemeInterface { |
|
28 | +class ColorsTheme extends CloudsTheme implements ThemeInterface |
|
29 | +{ |
|
29 | 30 | /** @var string[] A list of color palettes */ |
30 | 31 | protected $palettes; |
31 | 32 | |
@@ -37,7 +38,8 @@ discard block |
||
37 | 38 | * |
38 | 39 | * @return string A relative path, such as "themes/foo/" |
39 | 40 | */ |
40 | - public function assetUrl() { |
|
41 | + public function assetUrl() |
|
42 | + { |
|
41 | 43 | return 'themes/colors/css-1.7.8/'; |
42 | 44 | } |
43 | 45 | |
@@ -46,7 +48,8 @@ discard block |
||
46 | 48 | * |
47 | 49 | * @return string |
48 | 50 | */ |
49 | - protected function formatSecondaryMenu() { |
|
51 | + protected function formatSecondaryMenu() |
|
52 | + { |
|
50 | 53 | return |
51 | 54 | '<ul class="secondary-menu">' . |
52 | 55 | implode('', $this->secondaryMenu()) . |
@@ -61,7 +64,8 @@ discard block |
||
61 | 64 | * |
62 | 65 | * @return string |
63 | 66 | */ |
64 | - protected function headerContent() { |
|
67 | + protected function headerContent() |
|
68 | + { |
|
65 | 69 | return |
66 | 70 | //$this->accessibilityLinks() . |
67 | 71 | $this->formatTreeTitle() . |
@@ -71,7 +75,8 @@ discard block |
||
71 | 75 | /** |
72 | 76 | * Create resources for the colors theme. |
73 | 77 | */ |
74 | - public function hookAfterInit() { |
|
78 | + public function hookAfterInit() |
|
79 | + { |
|
75 | 80 | $this->palettes = array( |
76 | 81 | 'aquamarine' => /* I18N: The name of a colour-scheme */ I18N::translate('Aqua Marine'), |
77 | 82 | 'ash' => /* I18N: The name of a colour-scheme */ I18N::translate('Ash'), |
@@ -125,7 +130,8 @@ discard block |
||
125 | 130 | * |
126 | 131 | * @return Menu[] |
127 | 132 | */ |
128 | - protected function secondaryMenu() { |
|
133 | + protected function secondaryMenu() |
|
134 | + { |
|
129 | 135 | return array_filter(array( |
130 | 136 | $this->menuPendingChanges(), |
131 | 137 | $this->menuMyPages(), |
@@ -143,7 +149,8 @@ discard block |
||
143 | 149 | * |
144 | 150 | * @return Menu |
145 | 151 | */ |
146 | - protected function menuPalette() { |
|
152 | + protected function menuPalette() |
|
153 | + { |
|
147 | 154 | if ($this->tree && Site::getPreference('ALLOW_USER_THEMES') && $this->tree->getPreference('ALLOW_THEME_DROPDOWN')) { |
148 | 155 | $menu = new Menu(/* I18N: A colour scheme */ |
149 | 156 | I18N::translate('Palette'), '#', 'menu-color'); |
@@ -170,7 +177,8 @@ discard block |
||
170 | 177 | * |
171 | 178 | * @return string[] |
172 | 179 | */ |
173 | - protected function stylesheets() { |
|
180 | + protected function stylesheets() |
|
181 | + { |
|
174 | 182 | return array( |
175 | 183 | 'themes/colors/jquery-ui-1.11.2/jquery-ui.css', |
176 | 184 | $this->assetUrl() . 'style.css', |
@@ -183,7 +191,8 @@ discard block |
||
183 | 191 | * |
184 | 192 | * @return string |
185 | 193 | */ |
186 | - public function themeId() { |
|
194 | + public function themeId() |
|
195 | + { |
|
187 | 196 | return 'colors'; |
188 | 197 | } |
189 | 198 | |
@@ -192,7 +201,8 @@ discard block |
||
192 | 201 | * |
193 | 202 | * @return string |
194 | 203 | */ |
195 | - public function themeName() { |
|
204 | + public function themeName() |
|
205 | + { |
|
196 | 206 | return /* I18N: Name of a theme. */ I18N::translate('colors'); |
197 | 207 | } |
198 | 208 | } |
@@ -20,13 +20,15 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * The xenea theme. |
22 | 22 | */ |
23 | -class XeneaTheme extends AbstractTheme implements ThemeInterface { |
|
23 | +class XeneaTheme extends AbstractTheme implements ThemeInterface |
|
24 | +{ |
|
24 | 25 | /** |
25 | 26 | * Where are our CSS, JS and other assets? |
26 | 27 | * |
27 | 28 | * @return string A relative path, such as "themes/foo/" |
28 | 29 | */ |
29 | - public function assetUrl() { |
|
30 | + public function assetUrl() |
|
31 | + { |
|
30 | 32 | return 'themes/xenea/css-1.7.8/'; |
31 | 33 | } |
32 | 34 | |
@@ -37,7 +39,8 @@ discard block |
||
37 | 39 | * |
38 | 40 | * @return string |
39 | 41 | */ |
40 | - protected function flashMessageContainer(\stdClass $message) { |
|
42 | + protected function flashMessageContainer(\stdClass $message) |
|
43 | + { |
|
41 | 44 | // This theme uses jQueryUI markup. |
42 | 45 | switch ($message->status) { |
43 | 46 | case 'danger': |
@@ -52,7 +55,8 @@ discard block |
||
52 | 55 | * |
53 | 56 | * @return string |
54 | 57 | */ |
55 | - protected function formQuickSearchFields() { |
|
58 | + protected function formQuickSearchFields() |
|
59 | + { |
|
56 | 60 | return |
57 | 61 | '<input type="search" name="query" size="12" placeholder="' . I18N::translate('Search') . '">' . |
58 | 62 | '<input type="submit" name="search" value=">">'; |
@@ -63,7 +67,8 @@ discard block |
||
63 | 67 | * |
64 | 68 | * @return string |
65 | 69 | */ |
66 | - protected function headerContent() { |
|
70 | + protected function headerContent() |
|
71 | + { |
|
67 | 72 | return |
68 | 73 | //$this->accessibilityLinks() . |
69 | 74 | '<div class="header-upper">' . |
@@ -80,7 +85,8 @@ discard block |
||
80 | 85 | * |
81 | 86 | * @return string |
82 | 87 | */ |
83 | - public function hookFooterExtraJavascript() { |
|
88 | + public function hookFooterExtraJavascript() |
|
89 | + { |
|
84 | 90 | return |
85 | 91 | '<script src="' . WT_JQUERY_COLORBOX_URL . '"></script>' . |
86 | 92 | '<script src="' . WT_JQUERY_WHEELZOOM_URL . '"></script>' . |
@@ -104,7 +110,8 @@ discard block |
||
104 | 110 | * |
105 | 111 | * @return string|int|float |
106 | 112 | */ |
107 | - public function parameter($parameter_name) { |
|
113 | + public function parameter($parameter_name) |
|
114 | + { |
|
108 | 115 | $parameters = array( |
109 | 116 | 'chart-background-f' => 'e9daf1', |
110 | 117 | 'chart-background-m' => 'b1cff0', |
@@ -124,7 +131,8 @@ discard block |
||
124 | 131 | * |
125 | 132 | * @return string[] |
126 | 133 | */ |
127 | - protected function stylesheets() { |
|
134 | + protected function stylesheets() |
|
135 | + { |
|
128 | 136 | return array( |
129 | 137 | 'themes/xenea/jquery-ui-1.11.2/jquery-ui.css', |
130 | 138 | $this->assetUrl() . 'style.css', |
@@ -136,7 +144,8 @@ discard block |
||
136 | 144 | * |
137 | 145 | * @return string |
138 | 146 | */ |
139 | - public function themeId() { |
|
147 | + public function themeId() |
|
148 | + { |
|
140 | 149 | return 'xenea'; |
141 | 150 | } |
142 | 151 | |
@@ -145,7 +154,8 @@ discard block |
||
145 | 154 | * |
146 | 155 | * @return string |
147 | 156 | */ |
148 | - public function themeName() { |
|
157 | + public function themeName() |
|
158 | + { |
|
149 | 159 | return /* I18N: Name of a theme. */ I18N::translate('xenea'); |
150 | 160 | } |
151 | 161 | } |
@@ -21,13 +21,15 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * The F.A.B. theme. |
23 | 23 | */ |
24 | -class FabTheme extends AbstractTheme implements ThemeInterface { |
|
24 | +class FabTheme extends AbstractTheme implements ThemeInterface |
|
25 | +{ |
|
25 | 26 | /** |
26 | 27 | * Where are our CSS, JS and other assets? |
27 | 28 | * |
28 | 29 | * @return string A relative path, such as "themes/foo/" |
29 | 30 | */ |
30 | - public function assetUrl() { |
|
31 | + public function assetUrl() |
|
32 | + { |
|
31 | 33 | return 'themes/fab/css-1.7.8/'; |
32 | 34 | } |
33 | 35 | |
@@ -38,7 +40,8 @@ discard block |
||
38 | 40 | * |
39 | 41 | * @return string |
40 | 42 | */ |
41 | - protected function flashMessageContainer(\stdClass $message) { |
|
43 | + protected function flashMessageContainer(\stdClass $message) |
|
44 | + { |
|
42 | 45 | // This theme uses jQueryUI markup. |
43 | 46 | switch ($message->status) { |
44 | 47 | case 'danger': |
@@ -53,7 +56,8 @@ discard block |
||
53 | 56 | * |
54 | 57 | * @return string |
55 | 58 | */ |
56 | - protected function formatSecondaryMenu() { |
|
59 | + protected function formatSecondaryMenu() |
|
60 | + { |
|
57 | 61 | return |
58 | 62 | '<ul class="secondary-menu">' . |
59 | 63 | implode('', $this->secondaryMenu()) . |
@@ -68,7 +72,8 @@ discard block |
||
68 | 72 | * |
69 | 73 | * @return string |
70 | 74 | */ |
71 | - protected function headerContent() { |
|
75 | + protected function headerContent() |
|
76 | + { |
|
72 | 77 | return |
73 | 78 | //$this->accessibilityLinks() . |
74 | 79 | $this->formatTreeTitle() . |
@@ -82,7 +87,8 @@ discard block |
||
82 | 87 | * |
83 | 88 | * @return string |
84 | 89 | */ |
85 | - protected function formatSecondaryMenuItem(Menu $menu) { |
|
90 | + protected function formatSecondaryMenuItem(Menu $menu) |
|
91 | + { |
|
86 | 92 | return $menu->getMenuAsList(); |
87 | 93 | } |
88 | 94 | |
@@ -91,7 +97,8 @@ discard block |
||
91 | 97 | * |
92 | 98 | * @return string |
93 | 99 | */ |
94 | - protected function formQuickSearchFields() { |
|
100 | + protected function formQuickSearchFields() |
|
101 | + { |
|
95 | 102 | return |
96 | 103 | '<input type="search" name="query" size="20" placeholder="' . I18N::translate('Search') . '">'; |
97 | 104 | } |
@@ -101,7 +108,8 @@ discard block |
||
101 | 108 | * |
102 | 109 | * @return string |
103 | 110 | */ |
104 | - public function hookFooterExtraJavascript() { |
|
111 | + public function hookFooterExtraJavascript() |
|
112 | + { |
|
105 | 113 | return |
106 | 114 | '<script src="' . WT_JQUERY_COLORBOX_URL . '"></script>' . |
107 | 115 | '<script src="' . WT_JQUERY_WHEELZOOM_URL . '"></script>' . |
@@ -125,7 +133,8 @@ discard block |
||
125 | 133 | * |
126 | 134 | * @return string|int|float |
127 | 135 | */ |
128 | - public function parameter($parameter_name) { |
|
136 | + public function parameter($parameter_name) |
|
137 | + { |
|
129 | 138 | $parameters = array( |
130 | 139 | 'chart-background-f' => 'e9daf1', |
131 | 140 | 'chart-background-m' => 'b1cff0', |
@@ -147,7 +156,8 @@ discard block |
||
147 | 156 | * |
148 | 157 | * @return string[] |
149 | 158 | */ |
150 | - protected function stylesheets() { |
|
159 | + protected function stylesheets() |
|
160 | + { |
|
151 | 161 | return array( |
152 | 162 | 'themes/fab/jquery-ui-1.11.2/jquery-ui.css', |
153 | 163 | $this->assetUrl() . 'style.css', |
@@ -159,7 +169,8 @@ discard block |
||
159 | 169 | * |
160 | 170 | * @return string |
161 | 171 | */ |
162 | - public function themeId() { |
|
172 | + public function themeId() |
|
173 | + { |
|
163 | 174 | return 'fab'; |
164 | 175 | } |
165 | 176 | |
@@ -168,7 +179,8 @@ discard block |
||
168 | 179 | * |
169 | 180 | * @return string |
170 | 181 | */ |
171 | - public function themeName() { |
|
182 | + public function themeName() |
|
183 | + { |
|
172 | 184 | return /* I18N: Name of a theme. */ I18N::translate('F.A.B.'); |
173 | 185 | } |
174 | 186 | } |
@@ -52,7 +52,8 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * Common functions for all themes. |
54 | 54 | */ |
55 | -abstract class AbstractTheme { |
|
55 | +abstract class AbstractTheme |
|
56 | +{ |
|
56 | 57 | /** @var Tree The current tree */ |
57 | 58 | protected $tree; |
58 | 59 | |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | * Custom themes should place their initialization code in the function hookAfterInit(), not in |
67 | 68 | * the constructor, as all themes get constructed - whether they are used or not. |
68 | 69 | */ |
69 | - final public function __construct() { |
|
70 | + final public function __construct() |
|
71 | + { |
|
70 | 72 | } |
71 | 73 | |
72 | 74 | /** |
@@ -77,7 +79,8 @@ discard block |
||
77 | 79 | * |
78 | 80 | * @return string |
79 | 81 | */ |
80 | - protected function accessibilityLinks() { |
|
82 | + protected function accessibilityLinks() |
|
83 | + { |
|
81 | 84 | return |
82 | 85 | '<div class="accessibility-links">' . |
83 | 86 | '<a class="sr-only sr-only-focusable btn btn-info btn-sm" href="#content">' . |
@@ -91,7 +94,8 @@ discard block |
||
91 | 94 | * |
92 | 95 | * @return string |
93 | 96 | */ |
94 | - protected function analytics() { |
|
97 | + protected function analytics() |
|
98 | + { |
|
95 | 99 | if ($this->themeId() === '_administration' || !empty($_SERVER['HTTP_DNT'])) { |
96 | 100 | return ''; |
97 | 101 | } else { |
@@ -123,7 +127,8 @@ discard block |
||
123 | 127 | * |
124 | 128 | * @return string |
125 | 129 | */ |
126 | - protected function analyticsBingWebmaster($verification_id) { |
|
130 | + protected function analyticsBingWebmaster($verification_id) |
|
131 | + { |
|
127 | 132 | // Only need to add this to the home page. |
128 | 133 | if (WT_SCRIPT_NAME === 'index.php' && $verification_id) { |
129 | 134 | return '<meta name="msvalidate.01" content="' . $verification_id . '">'; |
@@ -139,7 +144,8 @@ discard block |
||
139 | 144 | * |
140 | 145 | * @return string |
141 | 146 | */ |
142 | - protected function analyticsGoogleWebmaster($verification_id) { |
|
147 | + protected function analyticsGoogleWebmaster($verification_id) |
|
148 | + { |
|
143 | 149 | // Only need to add this to the home page. |
144 | 150 | if (WT_SCRIPT_NAME === 'index.php' && $verification_id) { |
145 | 151 | return '<meta name="google-site-verification" content="' . $verification_id . '">'; |
@@ -157,7 +163,8 @@ discard block |
||
157 | 163 | * |
158 | 164 | * @return string |
159 | 165 | */ |
160 | - protected function analyticsGoogleTracker($analytics_id) { |
|
166 | + protected function analyticsGoogleTracker($analytics_id) |
|
167 | + { |
|
161 | 168 | if ($analytics_id) { |
162 | 169 | // Add extra dimensions (i.e. filtering categories) |
163 | 170 | $dimensions = (object) array( |
@@ -185,7 +192,8 @@ discard block |
||
185 | 192 | * |
186 | 193 | * @return string |
187 | 194 | */ |
188 | - protected function analyticsPiwikTracker($url, $site_id) { |
|
195 | + protected function analyticsPiwikTracker($url, $site_id) |
|
196 | + { |
|
189 | 197 | $url = preg_replace(array('/^https?:\/\//', '/\/$/'), '', $url); |
190 | 198 | |
191 | 199 | if ($url && $site_id) { |
@@ -213,7 +221,8 @@ discard block |
||
213 | 221 | * |
214 | 222 | * @return string |
215 | 223 | */ |
216 | - protected function analyticsStatcounterTracker($project_id, $security_id) { |
|
224 | + protected function analyticsStatcounterTracker($project_id, $security_id) |
|
225 | + { |
|
217 | 226 | if ($project_id && $security_id) { |
218 | 227 | return |
219 | 228 | '<script>' . |
@@ -231,7 +240,8 @@ discard block |
||
231 | 240 | * |
232 | 241 | * @return string |
233 | 242 | */ |
234 | - public function bodyHeader() { |
|
243 | + public function bodyHeader() |
|
244 | + { |
|
235 | 245 | return |
236 | 246 | '<body class="container">' . |
237 | 247 | '<header>' . |
@@ -247,7 +257,8 @@ discard block |
||
247 | 257 | * |
248 | 258 | * @return string |
249 | 259 | */ |
250 | - public function bodyHeaderPopupWindow() { |
|
260 | + public function bodyHeaderPopupWindow() |
|
261 | + { |
|
251 | 262 | return |
252 | 263 | '<body class="container container-popup">' . |
253 | 264 | '<main id="content">' . |
@@ -261,7 +272,8 @@ discard block |
||
261 | 272 | * |
262 | 273 | * @return string |
263 | 274 | */ |
264 | - public function contactLink(User $user) { |
|
275 | + public function contactLink(User $user) |
|
276 | + { |
|
265 | 277 | $method = $user->getPreference('contactmethod'); |
266 | 278 | |
267 | 279 | switch ($method) { |
@@ -281,7 +293,8 @@ discard block |
||
281 | 293 | * |
282 | 294 | * @return string |
283 | 295 | */ |
284 | - protected function contactLinkEverything(User $user) { |
|
296 | + protected function contactLinkEverything(User $user) |
|
297 | + { |
|
285 | 298 | return I18N::translate('For technical support or genealogy questions contact %s.', $this->contactLink($user)); |
286 | 299 | } |
287 | 300 | |
@@ -292,7 +305,8 @@ discard block |
||
292 | 305 | * |
293 | 306 | * @return string |
294 | 307 | */ |
295 | - protected function contactLinkGenealogy(User $user) { |
|
308 | + protected function contactLinkGenealogy(User $user) |
|
309 | + { |
|
296 | 310 | return I18N::translate('For help with genealogy questions contact %s.', $this->contactLink($user)); |
297 | 311 | } |
298 | 312 | |
@@ -303,7 +317,8 @@ discard block |
||
303 | 317 | * |
304 | 318 | * @return string |
305 | 319 | */ |
306 | - protected function contactLinkTechnical(User $user) { |
|
320 | + protected function contactLinkTechnical(User $user) |
|
321 | + { |
|
307 | 322 | return I18N::translate('For technical support and information contact %s.', $this->contactLink($user)); |
308 | 323 | } |
309 | 324 | |
@@ -312,7 +327,8 @@ discard block |
||
312 | 327 | * |
313 | 328 | * @return string |
314 | 329 | */ |
315 | - protected function contactLinks() { |
|
330 | + protected function contactLinks() |
|
331 | + { |
|
316 | 332 | $contact_user = User::find($this->tree->getPreference('CONTACT_USER_ID')); |
317 | 333 | $webmaster_user = User::find($this->tree->getPreference('WEBMASTER_USER_ID')); |
318 | 334 | |
@@ -334,7 +350,8 @@ discard block |
||
334 | 350 | * |
335 | 351 | * @return string |
336 | 352 | */ |
337 | - public function cookieWarning() { |
|
353 | + public function cookieWarning() |
|
354 | + { |
|
338 | 355 | if ( |
339 | 356 | empty($_SERVER['HTTP_DNT']) && |
340 | 357 | empty($_COOKIE['cookie']) && |
@@ -356,7 +373,8 @@ discard block |
||
356 | 373 | * |
357 | 374 | * @return string |
358 | 375 | */ |
359 | - public function doctype() { |
|
376 | + public function doctype() |
|
377 | + { |
|
360 | 378 | return '<!DOCTYPE html>'; |
361 | 379 | } |
362 | 380 | |
@@ -365,7 +383,8 @@ discard block |
||
365 | 383 | * |
366 | 384 | * @return string |
367 | 385 | */ |
368 | - protected function favicon() { |
|
386 | + protected function favicon() |
|
387 | + { |
|
369 | 388 | return |
370 | 389 | '<link rel="icon" href="' . $this->assetUrl() . 'favicon.png" type="image/png">' . |
371 | 390 | '<link rel="icon" type="image/png" href="' . $this->assetUrl() . 'favicon192.png" sizes="192x192">' . |
@@ -379,7 +398,8 @@ discard block |
||
379 | 398 | * |
380 | 399 | * @return string |
381 | 400 | */ |
382 | - protected function flashMessageContainer(\stdClass $message) { |
|
401 | + protected function flashMessageContainer(\stdClass $message) |
|
402 | + { |
|
383 | 403 | return $this->htmlAlert($message->text, $message->status, true); |
384 | 404 | } |
385 | 405 | |
@@ -392,7 +412,8 @@ discard block |
||
392 | 412 | * |
393 | 413 | * @return string |
394 | 414 | */ |
395 | - protected function flashMessagesContainer(array $messages) { |
|
415 | + protected function flashMessagesContainer(array $messages) |
|
416 | + { |
|
396 | 417 | $html = ''; |
397 | 418 | foreach ($messages as $message) { |
398 | 419 | $html .= $this->flashMessageContainer($message); |
@@ -410,7 +431,8 @@ discard block |
||
410 | 431 | * |
411 | 432 | * @return string |
412 | 433 | */ |
413 | - public function footerContainer() { |
|
434 | + public function footerContainer() |
|
435 | + { |
|
414 | 436 | return '</main><footer>' . $this->footerContent() . '</footer>'; |
415 | 437 | } |
416 | 438 | |
@@ -420,7 +442,8 @@ discard block |
||
420 | 442 | * |
421 | 443 | * @return string |
422 | 444 | */ |
423 | - public function footerContainerPopupWindow() { |
|
445 | + public function footerContainerPopupWindow() |
|
446 | + { |
|
424 | 447 | return '</main>'; |
425 | 448 | } |
426 | 449 | |
@@ -429,7 +452,8 @@ discard block |
||
429 | 452 | * |
430 | 453 | * @return string |
431 | 454 | */ |
432 | - protected function footerContent() { |
|
455 | + protected function footerContent() |
|
456 | + { |
|
433 | 457 | return |
434 | 458 | $this->formatContactLinks() . |
435 | 459 | $this->logoPoweredBy() . |
@@ -447,7 +471,8 @@ discard block |
||
447 | 471 | * |
448 | 472 | * @return string |
449 | 473 | */ |
450 | - public function formatBlock($id, $title, $class, $content) { |
|
474 | + public function formatBlock($id, $title, $class, $content) |
|
475 | + { |
|
451 | 476 | return |
452 | 477 | '<div id="' . $id . '" class="block" >' . |
453 | 478 | '<div class="blockheader">' . $title . '</div>' . |
@@ -460,7 +485,8 @@ discard block |
||
460 | 485 | * |
461 | 486 | * @return string |
462 | 487 | */ |
463 | - protected function formatContactLinks() { |
|
488 | + protected function formatContactLinks() |
|
489 | + { |
|
464 | 490 | if ($this->tree) { |
465 | 491 | return '<div class="contact-links">' . $this->contactLinks() . '</div>'; |
466 | 492 | } else { |
@@ -475,7 +501,8 @@ discard block |
||
475 | 501 | * |
476 | 502 | * @return string |
477 | 503 | */ |
478 | - protected function formatPageViews($count) { |
|
504 | + protected function formatPageViews($count) |
|
505 | + { |
|
479 | 506 | if ($count > 0) { |
480 | 507 | return |
481 | 508 | '<div class="page-views">' . |
@@ -492,7 +519,8 @@ discard block |
||
492 | 519 | * |
493 | 520 | * @return string |
494 | 521 | */ |
495 | - protected function formatPendingChangesLink() { |
|
522 | + protected function formatPendingChangesLink() |
|
523 | + { |
|
496 | 524 | if ($this->pendingChangesExist()) { |
497 | 525 | return '<div class="pending-changes-link">' . $this->pendingChangesLink() . '</div>'; |
498 | 526 | } else { |
@@ -505,7 +533,8 @@ discard block |
||
505 | 533 | * |
506 | 534 | * @return string |
507 | 535 | */ |
508 | - protected function formQuickSearch() { |
|
536 | + protected function formQuickSearch() |
|
537 | + { |
|
509 | 538 | if ($this->tree) { |
510 | 539 | return |
511 | 540 | '<form action="search.php" class="header-search" role="search">' . |
@@ -523,7 +552,8 @@ discard block |
||
523 | 552 | * |
524 | 553 | * @return string |
525 | 554 | */ |
526 | - protected function formQuickSearchFields() { |
|
555 | + protected function formQuickSearchFields() |
|
556 | + { |
|
527 | 557 | return |
528 | 558 | '<input type="search" name="query" size="15" placeholder="' . I18N::translate('Search') . '">' . |
529 | 559 | '<input type="image" src="' . $this->assetUrl() . 'images/go.png" alt="' . I18N::translate('Search') . '">'; |
@@ -534,7 +564,8 @@ discard block |
||
534 | 564 | * |
535 | 565 | * @return string |
536 | 566 | */ |
537 | - protected function formatTreeTitle() { |
|
567 | + protected function formatTreeTitle() |
|
568 | + { |
|
538 | 569 | if ($this->tree) { |
539 | 570 | return '<h1 class="header-title">' . $this->tree->getTitleHtml() . '</h1>'; |
540 | 571 | } else { |
@@ -547,7 +578,8 @@ discard block |
||
547 | 578 | * |
548 | 579 | * @return string |
549 | 580 | */ |
550 | - protected function formatSecondaryMenu() { |
|
581 | + protected function formatSecondaryMenu() |
|
582 | + { |
|
551 | 583 | return |
552 | 584 | '<ul class="secondary-menu">' . |
553 | 585 | implode('', $this->secondaryMenu()) . |
@@ -561,7 +593,8 @@ discard block |
||
561 | 593 | * |
562 | 594 | * @return string |
563 | 595 | */ |
564 | - protected function formatSecondaryMenuItem(Menu $menu) { |
|
596 | + protected function formatSecondaryMenuItem(Menu $menu) |
|
597 | + { |
|
565 | 598 | return $menu->getMenuAsList(); |
566 | 599 | } |
567 | 600 | |
@@ -572,7 +605,8 @@ discard block |
||
572 | 605 | * |
573 | 606 | * @return string |
574 | 607 | */ |
575 | - public function head(PageController $controller) { |
|
608 | + public function head(PageController $controller) |
|
609 | + { |
|
576 | 610 | // Record this now. By the time we render the footer, $controller no longer exists. |
577 | 611 | $this->page_views = $this->pageViews($controller); |
578 | 612 | |
@@ -591,7 +625,8 @@ discard block |
||
591 | 625 | * |
592 | 626 | * @return string |
593 | 627 | */ |
594 | - protected function headContents(PageController $controller) { |
|
628 | + protected function headContents(PageController $controller) |
|
629 | + { |
|
595 | 630 | // The title often includes the names of records, which may include HTML markup. |
596 | 631 | $title = Filter::unescapeHtml($controller->getPageTitle()); |
597 | 632 | |
@@ -629,7 +664,8 @@ discard block |
||
629 | 664 | * |
630 | 665 | * @return string |
631 | 666 | */ |
632 | - protected function headerContent() { |
|
667 | + protected function headerContent() |
|
668 | + { |
|
633 | 669 | return |
634 | 670 | //$this->accessibilityLinks() . |
635 | 671 | $this->logoHeader() . |
@@ -643,7 +679,8 @@ discard block |
||
643 | 679 | * |
644 | 680 | * @return string |
645 | 681 | */ |
646 | - protected function headerSimple() { |
|
682 | + protected function headerSimple() |
|
683 | + { |
|
647 | 684 | return |
648 | 685 | $this->flashMessagesContainer(FlashMessages::getMessages()) . |
649 | 686 | '<div id="content">'; |
@@ -653,7 +690,8 @@ discard block |
||
653 | 690 | * Allow themes to do things after initialization (since they cannot use |
654 | 691 | * the constructor). |
655 | 692 | */ |
656 | - public function hookAfterInit() { |
|
693 | + public function hookAfterInit() |
|
694 | + { |
|
657 | 695 | } |
658 | 696 | |
659 | 697 | /** |
@@ -661,7 +699,8 @@ discard block |
||
661 | 699 | * |
662 | 700 | * @return string |
663 | 701 | */ |
664 | - public function hookFooterExtraJavascript() { |
|
702 | + public function hookFooterExtraJavascript() |
|
703 | + { |
|
665 | 704 | return ''; |
666 | 705 | } |
667 | 706 | |
@@ -671,7 +710,8 @@ discard block |
||
671 | 710 | * |
672 | 711 | * @return string |
673 | 712 | */ |
674 | - public function hookHeaderExtraContent() { |
|
713 | + public function hookHeaderExtraContent() |
|
714 | + { |
|
675 | 715 | return ''; |
676 | 716 | } |
677 | 717 | |
@@ -680,7 +720,8 @@ discard block |
||
680 | 720 | * |
681 | 721 | * @return string |
682 | 722 | */ |
683 | - public function html() { |
|
723 | + public function html() |
|
724 | + { |
|
684 | 725 | return '<html ' . I18N::htmlAttributes() . '>'; |
685 | 726 | } |
686 | 727 | |
@@ -693,7 +734,8 @@ discard block |
||
693 | 734 | * |
694 | 735 | * @return string |
695 | 736 | */ |
696 | - public function htmlAlert($html, $level, $dismissible) { |
|
737 | + public function htmlAlert($html, $level, $dismissible) |
|
738 | + { |
|
697 | 739 | if ($dismissible) { |
698 | 740 | return |
699 | 741 | '<div class="alert alert-' . $level . ' alert-dismissible" role="alert">' . |
@@ -717,7 +759,8 @@ discard block |
||
717 | 759 | * |
718 | 760 | * @return string |
719 | 761 | */ |
720 | - public function icon(Fact $fact) { |
|
762 | + public function icon(Fact $fact) |
|
763 | + { |
|
721 | 764 | $icon = 'images/facts/' . $fact->getTag() . '.png'; |
722 | 765 | $dir = substr($this->assetUrl(), strlen(WT_STATIC_URL)); |
723 | 766 | if (file_exists($dir . $icon)) { |
@@ -737,7 +780,8 @@ discard block |
||
737 | 780 | * |
738 | 781 | * @return string |
739 | 782 | */ |
740 | - public function individualBox(Individual $individual) { |
|
783 | + public function individualBox(Individual $individual) |
|
784 | + { |
|
741 | 785 | $personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U')); |
742 | 786 | if ($individual->canShow() && $individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) { |
743 | 787 | $thumbnail = $individual->displayImage(); |
@@ -778,7 +822,8 @@ discard block |
||
778 | 822 | * |
779 | 823 | * @return string |
780 | 824 | */ |
781 | - public function individualBoxEmpty() { |
|
825 | + public function individualBoxEmpty() |
|
826 | + { |
|
782 | 827 | return '<div class="person_box_template person_boxNN box-style1" style="width: ' . $this->parameter('chart-box-x') . 'px; min-height: ' . $this->parameter('chart-box-y') . 'px"></div>'; |
783 | 828 | } |
784 | 829 | |
@@ -789,7 +834,8 @@ discard block |
||
789 | 834 | * |
790 | 835 | * @return string |
791 | 836 | */ |
792 | - public function individualBoxLarge(Individual $individual) { |
|
837 | + public function individualBoxLarge(Individual $individual) |
|
838 | + { |
|
793 | 839 | $personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U')); |
794 | 840 | if ($individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) { |
795 | 841 | $thumbnail = $individual->displayImage(); |
@@ -832,7 +878,8 @@ discard block |
||
832 | 878 | * |
833 | 879 | * @return string |
834 | 880 | */ |
835 | - public function individualBoxSmall(Individual $individual) { |
|
881 | + public function individualBoxSmall(Individual $individual) |
|
882 | + { |
|
836 | 883 | $personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U')); |
837 | 884 | if ($individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) { |
838 | 885 | $thumbnail = $individual->displayImage(); |
@@ -858,7 +905,8 @@ discard block |
||
858 | 905 | * |
859 | 906 | * @return string |
860 | 907 | */ |
861 | - public function individualBoxSmallEmpty() { |
|
908 | + public function individualBoxSmallEmpty() |
|
909 | + { |
|
862 | 910 | return '<div class="person_box_template person_boxNN box-style1" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px"></div>'; |
863 | 911 | } |
864 | 912 | |
@@ -869,7 +917,8 @@ discard block |
||
869 | 917 | * |
870 | 918 | * @return string |
871 | 919 | */ |
872 | - protected function individualBoxFacts(Individual $individual) { |
|
920 | + protected function individualBoxFacts(Individual $individual) |
|
921 | + { |
|
873 | 922 | $html = ''; |
874 | 923 | |
875 | 924 | $opt_tags = preg_split('/\W/', $individual->getTree()->getPreference('CHART_BOX_TAGS'), 0, PREG_SPLIT_NO_EMPTY); |
@@ -922,7 +971,8 @@ discard block |
||
922 | 971 | * |
923 | 972 | * @return string |
924 | 973 | */ |
925 | - protected function individualBoxLdsSummary(Individual $individual) { |
|
974 | + protected function individualBoxLdsSummary(Individual $individual) |
|
975 | + { |
|
926 | 976 | if ($individual->getTree()->getPreference('SHOW_LDS_AT_GLANCE')) { |
927 | 977 | $BAPL = $individual->getFacts('BAPL') ? 'B' : '_'; |
928 | 978 | $ENDL = $individual->getFacts('ENDL') ? 'E' : '_'; |
@@ -948,7 +998,8 @@ discard block |
||
948 | 998 | * |
949 | 999 | * @return Menu[] |
950 | 1000 | */ |
951 | - public function individualBoxMenu(Individual $individual) { |
|
1001 | + public function individualBoxMenu(Individual $individual) |
|
1002 | + { |
|
952 | 1003 | $menus = array_merge( |
953 | 1004 | $this->individualBoxMenuCharts($individual), |
954 | 1005 | $this->individualBoxMenuFamilyLinks($individual) |
@@ -964,7 +1015,8 @@ discard block |
||
964 | 1015 | * |
965 | 1016 | * @return Menu[] |
966 | 1017 | */ |
967 | - protected function individualBoxMenuCharts(Individual $individual) { |
|
1018 | + protected function individualBoxMenuCharts(Individual $individual) |
|
1019 | + { |
|
968 | 1020 | $menus = array(); |
969 | 1021 | foreach (Module::getActiveCharts($this->tree) as $chart) { |
970 | 1022 | $menu = $chart->getBoxChartMenu($individual); |
@@ -987,7 +1039,8 @@ discard block |
||
987 | 1039 | * |
988 | 1040 | * @return Menu[] |
989 | 1041 | */ |
990 | - protected function individualBoxMenuFamilyLinks(Individual $individual) { |
|
1042 | + protected function individualBoxMenuFamilyLinks(Individual $individual) |
|
1043 | + { |
|
991 | 1044 | $menus = array(); |
992 | 1045 | |
993 | 1046 | foreach ($individual->getSpouseFamilies() as $family) { |
@@ -1013,7 +1066,8 @@ discard block |
||
1013 | 1066 | * |
1014 | 1067 | * @return string |
1015 | 1068 | */ |
1016 | - protected function individualBoxSexSymbol(Individual $individual) { |
|
1069 | + protected function individualBoxSexSymbol(Individual $individual) |
|
1070 | + { |
|
1017 | 1071 | if ($individual->getTree()->getPreference('PEDIGREE_SHOW_GENDER')) { |
1018 | 1072 | return $individual->sexImage('large'); |
1019 | 1073 | } else { |
@@ -1027,7 +1081,8 @@ discard block |
||
1027 | 1081 | * |
1028 | 1082 | * @param Tree|null $tree The current tree (if there is one). |
1029 | 1083 | */ |
1030 | - final public function init(Tree $tree = null) { |
|
1084 | + final public function init(Tree $tree = null) |
|
1085 | + { |
|
1031 | 1086 | $this->tree = $tree; |
1032 | 1087 | $this->tree_url = $tree ? 'ged=' . $tree->getNameUrl() : ''; |
1033 | 1088 | |
@@ -1039,7 +1094,8 @@ discard block |
||
1039 | 1094 | * |
1040 | 1095 | * @return string |
1041 | 1096 | */ |
1042 | - protected function logoHeader() { |
|
1097 | + protected function logoHeader() |
|
1098 | + { |
|
1043 | 1099 | return '<div class="header-logo"></div>'; |
1044 | 1100 | } |
1045 | 1101 | |
@@ -1048,7 +1104,8 @@ discard block |
||
1048 | 1104 | * |
1049 | 1105 | * @return string |
1050 | 1106 | */ |
1051 | - protected function logoPoweredBy() { |
|
1107 | + protected function logoPoweredBy() |
|
1108 | + { |
|
1052 | 1109 | return '<a href="' . WT_WEBTREES_URL . '" class="powered-by-webtrees" title="' . WT_WEBTREES_URL . '"></a>'; |
1053 | 1110 | } |
1054 | 1111 | |
@@ -1057,7 +1114,8 @@ discard block |
||
1057 | 1114 | * |
1058 | 1115 | * @return Menu |
1059 | 1116 | */ |
1060 | - protected function menuCalendar() { |
|
1117 | + protected function menuCalendar() |
|
1118 | + { |
|
1061 | 1119 | return new Menu(I18N::translate('Calendar'), '#', 'menu-calendar', array('rel' => 'nofollow'), array( |
1062 | 1120 | // Day view |
1063 | 1121 | new Menu(I18N::translate('Day'), 'calendar.php?' . $this->tree_url . '&view=day', 'menu-calendar-day', array('rel' => 'nofollow')), |
@@ -1073,7 +1131,8 @@ discard block |
||
1073 | 1131 | * |
1074 | 1132 | * @return Menu|null |
1075 | 1133 | */ |
1076 | - protected function menuChangeBlocks() { |
|
1134 | + protected function menuChangeBlocks() |
|
1135 | + { |
|
1077 | 1136 | if (WT_SCRIPT_NAME === 'index.php' && Auth::check() && Filter::get('ctype', 'gedcom|user', 'user') === 'user') { |
1078 | 1137 | return new Menu(I18N::translate('Customize this page'), 'index_edit.php?user_id=' . Auth::id(), 'menu-change-blocks'); |
1079 | 1138 | } elseif (WT_SCRIPT_NAME === 'index.php' && Auth::isManager($this->tree)) { |
@@ -1090,7 +1149,8 @@ discard block |
||
1090 | 1149 | * |
1091 | 1150 | * @return Menu|null |
1092 | 1151 | */ |
1093 | - protected function menuChart(Individual $individual) { |
|
1152 | + protected function menuChart(Individual $individual) |
|
1153 | + { |
|
1094 | 1154 | $submenus = array(); |
1095 | 1155 | foreach (Module::getActiveCharts($this->tree) as $chart) { |
1096 | 1156 | $menu = $chart->getChartMenu($individual); |
@@ -1119,7 +1179,8 @@ discard block |
||
1119 | 1179 | * |
1120 | 1180 | * @deprecated |
1121 | 1181 | */ |
1122 | - protected function menuChartAncestors(Individual $individual) { |
|
1182 | + protected function menuChartAncestors(Individual $individual) |
|
1183 | + { |
|
1123 | 1184 | $chart = new AncestorsChartModule(WT_ROOT . WT_MODULES_DIR . 'ancestors_chart'); |
1124 | 1185 | |
1125 | 1186 | return $chart->getChartMenu($individual); |
@@ -1134,7 +1195,8 @@ discard block |
||
1134 | 1195 | * |
1135 | 1196 | * @deprecated |
1136 | 1197 | */ |
1137 | - protected function menuChartCompact(Individual $individual) { |
|
1198 | + protected function menuChartCompact(Individual $individual) |
|
1199 | + { |
|
1138 | 1200 | $chart = new CompactTreeChartModule(WT_ROOT . WT_MODULES_DIR . 'compact_tree_chart'); |
1139 | 1201 | |
1140 | 1202 | return $chart->getChartMenu($individual); |
@@ -1149,7 +1211,8 @@ discard block |
||
1149 | 1211 | * |
1150 | 1212 | * @deprecated |
1151 | 1213 | */ |
1152 | - protected function menuChartDescendants(Individual $individual) { |
|
1214 | + protected function menuChartDescendants(Individual $individual) |
|
1215 | + { |
|
1153 | 1216 | $chart = new DescendancyChartModule(WT_ROOT . WT_MODULES_DIR . 'descendancy_chart'); |
1154 | 1217 | |
1155 | 1218 | return $chart->getChartMenu($individual); |
@@ -1164,7 +1227,8 @@ discard block |
||
1164 | 1227 | * |
1165 | 1228 | * @deprecated |
1166 | 1229 | */ |
1167 | - protected function menuChartFamilyBook(Individual $individual) { |
|
1230 | + protected function menuChartFamilyBook(Individual $individual) |
|
1231 | + { |
|
1168 | 1232 | $chart = new FamilyBookChartModule(WT_ROOT . WT_MODULES_DIR . 'family_book_chart'); |
1169 | 1233 | |
1170 | 1234 | return $chart->getChartMenu($individual); |
@@ -1181,7 +1245,8 @@ discard block |
||
1181 | 1245 | * |
1182 | 1246 | * @deprecated |
1183 | 1247 | */ |
1184 | - protected function menuChartFanChart(Individual $individual) { |
|
1248 | + protected function menuChartFanChart(Individual $individual) |
|
1249 | + { |
|
1185 | 1250 | $chart = new FanChartModule(WT_ROOT . WT_MODULES_DIR . 'fan_chart'); |
1186 | 1251 | |
1187 | 1252 | return $chart->getChartMenu($individual); |
@@ -1196,7 +1261,8 @@ discard block |
||
1196 | 1261 | * |
1197 | 1262 | * @deprecated |
1198 | 1263 | */ |
1199 | - protected function menuChartInteractiveTree(Individual $individual) { |
|
1264 | + protected function menuChartInteractiveTree(Individual $individual) |
|
1265 | + { |
|
1200 | 1266 | $chart = new InteractiveTreeModule(WT_ROOT . WT_MODULES_DIR . 'tree'); |
1201 | 1267 | |
1202 | 1268 | return $chart->getChartMenu($individual); |
@@ -1211,7 +1277,8 @@ discard block |
||
1211 | 1277 | * |
1212 | 1278 | * @deprecated |
1213 | 1279 | */ |
1214 | - protected function menuChartHourglass(Individual $individual) { |
|
1280 | + protected function menuChartHourglass(Individual $individual) |
|
1281 | + { |
|
1215 | 1282 | $chart = new HourglassChartModule(WT_ROOT . WT_MODULES_DIR . 'hourglass_chart'); |
1216 | 1283 | |
1217 | 1284 | return $chart->getChartMenu($individual); |
@@ -1226,7 +1293,8 @@ discard block |
||
1226 | 1293 | * |
1227 | 1294 | * @deprecated |
1228 | 1295 | */ |
1229 | - protected function menuChartLifespan(Individual $individual) { |
|
1296 | + protected function menuChartLifespan(Individual $individual) |
|
1297 | + { |
|
1230 | 1298 | $chart = new LifespansChartModule(WT_ROOT . WT_MODULES_DIR . 'lifespans_chart'); |
1231 | 1299 | |
1232 | 1300 | return $chart->getChartMenu($individual); |
@@ -1241,7 +1309,8 @@ discard block |
||
1241 | 1309 | * |
1242 | 1310 | * @deprecated |
1243 | 1311 | */ |
1244 | - protected function menuChartPedigree(Individual $individual) { |
|
1312 | + protected function menuChartPedigree(Individual $individual) |
|
1313 | + { |
|
1245 | 1314 | $chart = new PedigreeChartModule(WT_ROOT . WT_MODULES_DIR . 'pedigree_chart'); |
1246 | 1315 | |
1247 | 1316 | return $chart->getChartMenu($individual); |
@@ -1256,7 +1325,8 @@ discard block |
||
1256 | 1325 | * |
1257 | 1326 | * @deprecated |
1258 | 1327 | */ |
1259 | - protected function menuChartPedigreeMap(Individual $individual) { |
|
1328 | + protected function menuChartPedigreeMap(Individual $individual) |
|
1329 | + { |
|
1260 | 1330 | $chart = new GoogleMapsModule(WT_ROOT . WT_MODULES_DIR . 'googlemap'); |
1261 | 1331 | |
1262 | 1332 | return $chart->getChartMenu($individual); |
@@ -1271,7 +1341,8 @@ discard block |
||
1271 | 1341 | * |
1272 | 1342 | * @deprecated |
1273 | 1343 | */ |
1274 | - protected function menuChartRelationship(Individual $individual) { |
|
1344 | + protected function menuChartRelationship(Individual $individual) |
|
1345 | + { |
|
1275 | 1346 | $chart = new RelationshipsChartModule(WT_ROOT . WT_MODULES_DIR . 'relationships_chart'); |
1276 | 1347 | |
1277 | 1348 | return $chart->getChartMenu($individual); |
@@ -1284,7 +1355,8 @@ discard block |
||
1284 | 1355 | * |
1285 | 1356 | * @deprecated |
1286 | 1357 | */ |
1287 | - protected function menuChartStatistics() { |
|
1358 | + protected function menuChartStatistics() |
|
1359 | + { |
|
1288 | 1360 | $chart = new StatisticsChartModule(WT_ROOT . WT_MODULES_DIR . 'statistics_chart'); |
1289 | 1361 | |
1290 | 1362 | return $chart->getChartMenu(null); |
@@ -1299,7 +1371,8 @@ discard block |
||
1299 | 1371 | * |
1300 | 1372 | * @deprecated |
1301 | 1373 | */ |
1302 | - protected function menuChartTimeline(Individual $individual) { |
|
1374 | + protected function menuChartTimeline(Individual $individual) |
|
1375 | + { |
|
1303 | 1376 | $chart = new TimelineChartModule(WT_ROOT . WT_MODULES_DIR . 'timeline_chart'); |
1304 | 1377 | |
1305 | 1378 | return $chart->getChartMenu($individual); |
@@ -1310,7 +1383,8 @@ discard block |
||
1310 | 1383 | * |
1311 | 1384 | * @return Menu|null |
1312 | 1385 | */ |
1313 | - protected function menuControlPanel() { |
|
1386 | + protected function menuControlPanel() |
|
1387 | + { |
|
1314 | 1388 | if (Auth::isManager($this->tree)) { |
1315 | 1389 | return new Menu(I18N::translate('Control panel'), 'admin.php', 'menu-admin'); |
1316 | 1390 | } else { |
@@ -1323,7 +1397,8 @@ discard block |
||
1323 | 1397 | * |
1324 | 1398 | * @return Menu|null |
1325 | 1399 | */ |
1326 | - protected function menuFavorites() { |
|
1400 | + protected function menuFavorites() |
|
1401 | + { |
|
1327 | 1402 | global $controller; |
1328 | 1403 | |
1329 | 1404 | $show_user_favorites = $this->tree && Module::getModuleByName('user_favorites') && Auth::check(); |
@@ -1381,7 +1456,8 @@ discard block |
||
1381 | 1456 | * |
1382 | 1457 | * @return Menu |
1383 | 1458 | */ |
1384 | - protected function menuHomePage() { |
|
1459 | + protected function menuHomePage() |
|
1460 | + { |
|
1385 | 1461 | if (count(Tree::getAll()) === 1 || Site::getPreference('ALLOW_CHANGE_GEDCOM') === '0') { |
1386 | 1462 | return new Menu(I18N::translate('Family tree'), 'index.php?ctype=gedcom&' . $this->tree_url, 'menu-tree'); |
1387 | 1463 | } else { |
@@ -1404,7 +1480,8 @@ discard block |
||
1404 | 1480 | * |
1405 | 1481 | * @return Menu|null |
1406 | 1482 | */ |
1407 | - protected function menuLanguages() { |
|
1483 | + protected function menuLanguages() |
|
1484 | + { |
|
1408 | 1485 | $menu = new Menu(I18N::translate('Language'), '#', 'menu-language'); |
1409 | 1486 | |
1410 | 1487 | foreach (I18N::activeLocales() as $locale) { |
@@ -1430,7 +1507,8 @@ discard block |
||
1430 | 1507 | * |
1431 | 1508 | * @return Menu |
1432 | 1509 | */ |
1433 | - protected function menuLists($surname) { |
|
1510 | + protected function menuLists($surname) |
|
1511 | + { |
|
1434 | 1512 | // Do not show empty lists |
1435 | 1513 | $row = Database::prepare( |
1436 | 1514 | "SELECT" . |
@@ -1478,7 +1556,8 @@ discard block |
||
1478 | 1556 | * |
1479 | 1557 | * @return Menu |
1480 | 1558 | */ |
1481 | - protected function menuListsBranches($surname) { |
|
1559 | + protected function menuListsBranches($surname) |
|
1560 | + { |
|
1482 | 1561 | return new Menu(I18N::translate('Branches'), 'branches.php?ged=' . $this->tree->getNameUrl() . '&surname=' . rawurlencode($surname), 'menu-branches', array('rel' => 'nofollow')); |
1483 | 1562 | } |
1484 | 1563 | |
@@ -1489,7 +1568,8 @@ discard block |
||
1489 | 1568 | * |
1490 | 1569 | * @return Menu |
1491 | 1570 | */ |
1492 | - protected function menuListsFamilies($surname) { |
|
1571 | + protected function menuListsFamilies($surname) |
|
1572 | + { |
|
1493 | 1573 | return new Menu(I18N::translate('Families'), 'famlist.php?ged=' . $this->tree->getNameUrl() . '&surname=' . rawurlencode($surname), 'menu-list-fam', array('rel' => 'nofollow')); |
1494 | 1574 | } |
1495 | 1575 | |
@@ -1500,7 +1580,8 @@ discard block |
||
1500 | 1580 | * |
1501 | 1581 | * @return Menu |
1502 | 1582 | */ |
1503 | - protected function menuListsIndividuals($surname) { |
|
1583 | + protected function menuListsIndividuals($surname) |
|
1584 | + { |
|
1504 | 1585 | return new Menu(I18N::translate('Individuals'), 'indilist.php?ged=' . $this->tree->getNameUrl() . '&surname=' . rawurlencode($surname), 'menu-list-indi'); |
1505 | 1586 | } |
1506 | 1587 | |
@@ -1509,7 +1590,8 @@ discard block |
||
1509 | 1590 | * |
1510 | 1591 | * @return Menu |
1511 | 1592 | */ |
1512 | - protected function menuListsMedia() { |
|
1593 | + protected function menuListsMedia() |
|
1594 | + { |
|
1513 | 1595 | return new Menu(I18N::translate('Media objects'), 'medialist.php?' . $this->tree_url, 'menu-list-obje', array('rel' => 'nofollow')); |
1514 | 1596 | } |
1515 | 1597 | |
@@ -1518,7 +1600,8 @@ discard block |
||
1518 | 1600 | * |
1519 | 1601 | * @return Menu |
1520 | 1602 | */ |
1521 | - protected function menuListsNotes() { |
|
1603 | + protected function menuListsNotes() |
|
1604 | + { |
|
1522 | 1605 | return new Menu(I18N::translate('Shared notes'), 'notelist.php?' . $this->tree_url, 'menu-list-note', array('rel' => 'nofollow')); |
1523 | 1606 | } |
1524 | 1607 | |
@@ -1527,7 +1610,8 @@ discard block |
||
1527 | 1610 | * |
1528 | 1611 | * @return Menu |
1529 | 1612 | */ |
1530 | - protected function menuListsPlaces() { |
|
1613 | + protected function menuListsPlaces() |
|
1614 | + { |
|
1531 | 1615 | return new Menu(I18N::translate('Place hierarchy'), 'placelist.php?ged=' . $this->tree->getNameUrl(), 'menu-list-plac', array('rel' => 'nofollow')); |
1532 | 1616 | } |
1533 | 1617 | |
@@ -1536,7 +1620,8 @@ discard block |
||
1536 | 1620 | * |
1537 | 1621 | * @return Menu |
1538 | 1622 | */ |
1539 | - protected function menuListsRepositories() { |
|
1623 | + protected function menuListsRepositories() |
|
1624 | + { |
|
1540 | 1625 | return new Menu(I18N::translate('Repositories'), 'repolist.php?' . $this->tree_url, 'menu-list-repo', array('rel' => 'nofollow')); |
1541 | 1626 | } |
1542 | 1627 | |
@@ -1545,7 +1630,8 @@ discard block |
||
1545 | 1630 | * |
1546 | 1631 | * @return Menu |
1547 | 1632 | */ |
1548 | - protected function menuListsSources() { |
|
1633 | + protected function menuListsSources() |
|
1634 | + { |
|
1549 | 1635 | return new Menu(I18N::translate('Sources'), 'sourcelist.php?' . $this->tree_url, 'menu-list-sour', array('rel' => 'nofollow')); |
1550 | 1636 | } |
1551 | 1637 | |
@@ -1554,7 +1640,8 @@ discard block |
||
1554 | 1640 | * |
1555 | 1641 | * @return Menu|null |
1556 | 1642 | */ |
1557 | - protected function menuLogin() { |
|
1643 | + protected function menuLogin() |
|
1644 | + { |
|
1558 | 1645 | if (Auth::check() || WT_SCRIPT_NAME === 'login.php') { |
1559 | 1646 | return null; |
1560 | 1647 | } else { |
@@ -1567,7 +1654,8 @@ discard block |
||
1567 | 1654 | * |
1568 | 1655 | * @return Menu|null |
1569 | 1656 | */ |
1570 | - protected function menuLogout() { |
|
1657 | + protected function menuLogout() |
|
1658 | + { |
|
1571 | 1659 | if (Auth::check()) { |
1572 | 1660 | return new Menu(I18N::translate('Sign out'), 'logout.php', 'menu-logout'); |
1573 | 1661 | } else { |
@@ -1580,7 +1668,8 @@ discard block |
||
1580 | 1668 | * |
1581 | 1669 | * @return Menu[] |
1582 | 1670 | */ |
1583 | - protected function menuModules() { |
|
1671 | + protected function menuModules() |
|
1672 | + { |
|
1584 | 1673 | $menus = array(); |
1585 | 1674 | foreach (Module::getActiveMenus($this->tree) as $module) { |
1586 | 1675 | $menus[] = $module->getMenu(); |
@@ -1594,7 +1683,8 @@ discard block |
||
1594 | 1683 | * |
1595 | 1684 | * @return Menu|null |
1596 | 1685 | */ |
1597 | - protected function menuMyAccount() { |
|
1686 | + protected function menuMyAccount() |
|
1687 | + { |
|
1598 | 1688 | if (Auth::check()) { |
1599 | 1689 | return new Menu(I18N::translate('My account'), 'edituser.php'); |
1600 | 1690 | } else { |
@@ -1607,7 +1697,8 @@ discard block |
||
1607 | 1697 | * |
1608 | 1698 | * @return Menu|null |
1609 | 1699 | */ |
1610 | - protected function menuMyIndividualRecord() { |
|
1700 | + protected function menuMyIndividualRecord() |
|
1701 | + { |
|
1611 | 1702 | $gedcomid = $this->tree->getUserPreference(Auth::user(), 'gedcomid'); |
1612 | 1703 | |
1613 | 1704 | if ($gedcomid) { |
@@ -1622,7 +1713,8 @@ discard block |
||
1622 | 1713 | * |
1623 | 1714 | * @return Menu |
1624 | 1715 | */ |
1625 | - protected function menuMyPage() { |
|
1716 | + protected function menuMyPage() |
|
1717 | + { |
|
1626 | 1718 | return new Menu(I18N::translate('My page'), 'index.php?ctype=user&' . $this->tree_url, 'menu-mypage'); |
1627 | 1719 | } |
1628 | 1720 | |
@@ -1631,7 +1723,8 @@ discard block |
||
1631 | 1723 | * |
1632 | 1724 | * @return Menu|null |
1633 | 1725 | */ |
1634 | - protected function menuMyPages() { |
|
1726 | + protected function menuMyPages() |
|
1727 | + { |
|
1635 | 1728 | if (Auth::id()) { |
1636 | 1729 | return new Menu(I18N::translate('My pages'), '#', 'menu-mymenu', array(), array_filter(array( |
1637 | 1730 | $this->menuMyPage(), |
@@ -1651,7 +1744,8 @@ discard block |
||
1651 | 1744 | * |
1652 | 1745 | * @return Menu|null |
1653 | 1746 | */ |
1654 | - protected function menuMyPedigree() { |
|
1747 | + protected function menuMyPedigree() |
|
1748 | + { |
|
1655 | 1749 | $gedcomid = $this->tree->getUserPreference(Auth::user(), 'gedcomid'); |
1656 | 1750 | |
1657 | 1751 | if ($gedcomid && Module::isActiveChart($this->tree, 'pedigree_chart')) { |
@@ -1673,7 +1767,8 @@ discard block |
||
1673 | 1767 | * |
1674 | 1768 | * @return Menu|null |
1675 | 1769 | */ |
1676 | - protected function menuPendingChanges() { |
|
1770 | + protected function menuPendingChanges() |
|
1771 | + { |
|
1677 | 1772 | if ($this->pendingChangesExist()) { |
1678 | 1773 | $menu = new Menu(I18N::translate('Pending changes'), '#', 'menu-pending', array('onclick' => 'window.open("edit_changes.php", "_blank", chan_window_specs); return false;')); |
1679 | 1774 | |
@@ -1688,7 +1783,8 @@ discard block |
||
1688 | 1783 | * |
1689 | 1784 | * @return Menu|null |
1690 | 1785 | */ |
1691 | - protected function menuReports() { |
|
1786 | + protected function menuReports() |
|
1787 | + { |
|
1692 | 1788 | $submenus = array(); |
1693 | 1789 | foreach (Module::getActiveReports($this->tree) as $report) { |
1694 | 1790 | $submenus[] = $report->getReportMenu(); |
@@ -1706,7 +1802,8 @@ discard block |
||
1706 | 1802 | * |
1707 | 1803 | * @return Menu |
1708 | 1804 | */ |
1709 | - protected function menuSearch() { |
|
1805 | + protected function menuSearch() |
|
1806 | + { |
|
1710 | 1807 | return new Menu(I18N::translate('Search'), '#', 'menu-search', array('rel' => 'nofollow'), array_filter(array( |
1711 | 1808 | $this->menuSearchGeneral(), |
1712 | 1809 | $this->menuSearchPhonetic(), |
@@ -1720,7 +1817,8 @@ discard block |
||
1720 | 1817 | * |
1721 | 1818 | * @return Menu |
1722 | 1819 | */ |
1723 | - protected function menuSearchGeneral() { |
|
1820 | + protected function menuSearchGeneral() |
|
1821 | + { |
|
1724 | 1822 | return new Menu(I18N::translate('General search'), 'search.php?' . $this->tree_url, 'menu-search-general', array('rel' => 'nofollow')); |
1725 | 1823 | } |
1726 | 1824 | |
@@ -1729,7 +1827,8 @@ discard block |
||
1729 | 1827 | * |
1730 | 1828 | * @return Menu |
1731 | 1829 | */ |
1732 | - protected function menuSearchPhonetic() { |
|
1830 | + protected function menuSearchPhonetic() |
|
1831 | + { |
|
1733 | 1832 | return new Menu(/* I18N: search using “sounds like”, rather than exact spelling */ I18N::translate('Phonetic search'), 'search.php?' . $this->tree_url . '&action=soundex', 'menu-search-soundex', array('rel' => 'nofollow')); |
1734 | 1833 | } |
1735 | 1834 | |
@@ -1738,7 +1837,8 @@ discard block |
||
1738 | 1837 | * |
1739 | 1838 | * @return Menu |
1740 | 1839 | */ |
1741 | - protected function menuSearchAdvanced() { |
|
1840 | + protected function menuSearchAdvanced() |
|
1841 | + { |
|
1742 | 1842 | return new Menu(I18N::translate('Advanced search'), 'search_advanced.php?' . $this->tree_url, 'menu-search-advanced', array('rel' => 'nofollow')); |
1743 | 1843 | } |
1744 | 1844 | |
@@ -1747,7 +1847,8 @@ discard block |
||
1747 | 1847 | * |
1748 | 1848 | * @return Menu |
1749 | 1849 | */ |
1750 | - protected function menuSearchAndReplace() { |
|
1850 | + protected function menuSearchAndReplace() |
|
1851 | + { |
|
1751 | 1852 | if (Auth::isEditor($this->tree)) { |
1752 | 1853 | return new Menu(I18N::translate('Search and replace'), 'search.php?' . $this->tree_url . '&action=replace', 'menu-search-replace'); |
1753 | 1854 | } else { |
@@ -1760,7 +1861,8 @@ discard block |
||
1760 | 1861 | * |
1761 | 1862 | * @return Menu|null |
1762 | 1863 | */ |
1763 | - public function menuThemes() { |
|
1864 | + public function menuThemes() |
|
1865 | + { |
|
1764 | 1866 | if ($this->tree && Site::getPreference('ALLOW_USER_THEMES') && $this->tree->getPreference('ALLOW_THEME_DROPDOWN')) { |
1765 | 1867 | $submenus = array(); |
1766 | 1868 | foreach (Theme::installedThemes() as $theme) { |
@@ -1788,7 +1890,8 @@ discard block |
||
1788 | 1890 | * |
1789 | 1891 | * @return string |
1790 | 1892 | */ |
1791 | - protected function metaCharset() { |
|
1893 | + protected function metaCharset() |
|
1894 | + { |
|
1792 | 1895 | return '<meta charset="UTF-8">'; |
1793 | 1896 | } |
1794 | 1897 | |
@@ -1799,7 +1902,8 @@ discard block |
||
1799 | 1902 | * |
1800 | 1903 | * @return string |
1801 | 1904 | */ |
1802 | - protected function metaDescription($description) { |
|
1905 | + protected function metaDescription($description) |
|
1906 | + { |
|
1803 | 1907 | if ($description) { |
1804 | 1908 | return '<meta name="description" content="' . $description . '">'; |
1805 | 1909 | } else { |
@@ -1814,7 +1918,8 @@ discard block |
||
1814 | 1918 | * |
1815 | 1919 | * @return string |
1816 | 1920 | */ |
1817 | - protected function metaGenerator($generator) { |
|
1921 | + protected function metaGenerator($generator) |
|
1922 | + { |
|
1818 | 1923 | if ($generator) { |
1819 | 1924 | return '<meta name="generator" content="' . $generator . '">'; |
1820 | 1925 | } else { |
@@ -1829,7 +1934,8 @@ discard block |
||
1829 | 1934 | * |
1830 | 1935 | * @return string |
1831 | 1936 | */ |
1832 | - protected function metaRobots($robots) { |
|
1937 | + protected function metaRobots($robots) |
|
1938 | + { |
|
1833 | 1939 | if ($robots) { |
1834 | 1940 | return '<meta name="robots" content="' . $robots . '">'; |
1835 | 1941 | } else { |
@@ -1842,7 +1948,8 @@ discard block |
||
1842 | 1948 | * |
1843 | 1949 | * @return string |
1844 | 1950 | */ |
1845 | - protected function metaUaCompatible() { |
|
1951 | + protected function metaUaCompatible() |
|
1952 | + { |
|
1846 | 1953 | return '<meta http-equiv="X-UA-Compatible" content="IE=edge">'; |
1847 | 1954 | } |
1848 | 1955 | |
@@ -1851,7 +1958,8 @@ discard block |
||
1851 | 1958 | * |
1852 | 1959 | * @return string |
1853 | 1960 | */ |
1854 | - protected function metaViewport() { |
|
1961 | + protected function metaViewport() |
|
1962 | + { |
|
1855 | 1963 | return '<meta name="viewport" content="width=device-width, initial-scale=1">'; |
1856 | 1964 | } |
1857 | 1965 | |
@@ -1862,7 +1970,8 @@ discard block |
||
1862 | 1970 | * |
1863 | 1971 | * @return int Number of views, or zero for pages that aren't logged. |
1864 | 1972 | */ |
1865 | - protected function pageViews(PageController $controller) { |
|
1973 | + protected function pageViews(PageController $controller) |
|
1974 | + { |
|
1866 | 1975 | if ($this->tree && $this->tree->getPreference('SHOW_COUNTER')) { |
1867 | 1976 | if (isset($controller->record) && $controller->record instanceof GedcomRecord) { |
1868 | 1977 | return HitCounter::countHit($this->tree, WT_SCRIPT_NAME, $controller->record->getXref()); |
@@ -1887,7 +1996,8 @@ discard block |
||
1887 | 1996 | * |
1888 | 1997 | * @return string|int|float |
1889 | 1998 | */ |
1890 | - public function parameter($parameter_name) { |
|
1999 | + public function parameter($parameter_name) |
|
2000 | + { |
|
1891 | 2001 | $parameters = array( |
1892 | 2002 | 'chart-background-f' => 'dddddd', |
1893 | 2003 | 'chart-background-m' => 'cccccc', |
@@ -1936,7 +2046,8 @@ discard block |
||
1936 | 2046 | * |
1937 | 2047 | * @return bool |
1938 | 2048 | */ |
1939 | - protected function pendingChangesExist() { |
|
2049 | + protected function pendingChangesExist() |
|
2050 | + { |
|
1940 | 2051 | return $this->tree && $this->tree->hasPendingEdit() && Auth::isModerator($this->tree); |
1941 | 2052 | } |
1942 | 2053 | |
@@ -1945,7 +2056,8 @@ discard block |
||
1945 | 2056 | * |
1946 | 2057 | * @return string |
1947 | 2058 | */ |
1948 | - protected function pendingChangesLink() { |
|
2059 | + protected function pendingChangesLink() |
|
2060 | + { |
|
1949 | 2061 | return |
1950 | 2062 | '<a href="#" onclick="window.open(\'edit_changes.php\', \'_blank\', chan_window_specs); return false;">' . |
1951 | 2063 | $this->pendingChangesLinkText() . |
@@ -1957,7 +2069,8 @@ discard block |
||
1957 | 2069 | * |
1958 | 2070 | * @return string |
1959 | 2071 | */ |
1960 | - protected function pendingChangesLinkText() { |
|
2072 | + protected function pendingChangesLinkText() |
|
2073 | + { |
|
1961 | 2074 | return I18N::translate('There are pending changes for you to moderate.'); |
1962 | 2075 | } |
1963 | 2076 | |
@@ -1966,7 +2079,8 @@ discard block |
||
1966 | 2079 | * |
1967 | 2080 | * @return Menu[] |
1968 | 2081 | */ |
1969 | - protected function primaryMenu() { |
|
2082 | + protected function primaryMenu() |
|
2083 | + { |
|
1970 | 2084 | global $controller; |
1971 | 2085 | |
1972 | 2086 | if ($this->tree) { |
@@ -1993,7 +2107,8 @@ discard block |
||
1993 | 2107 | * |
1994 | 2108 | * @return string |
1995 | 2109 | */ |
1996 | - protected function primaryMenuContainer(array $menus) { |
|
2110 | + protected function primaryMenuContainer(array $menus) |
|
2111 | + { |
|
1997 | 2112 | return '<nav><ul class="primary-menu">' . $this->primaryMenuContent($menus) . '</ul></nav>'; |
1998 | 2113 | } |
1999 | 2114 | |
@@ -2004,7 +2119,8 @@ discard block |
||
2004 | 2119 | * |
2005 | 2120 | * @return string |
2006 | 2121 | */ |
2007 | - protected function primaryMenuContent(array $menus) { |
|
2122 | + protected function primaryMenuContent(array $menus) |
|
2123 | + { |
|
2008 | 2124 | return implode('', array_map(function (Menu $menu) { |
2009 | 2125 | return $menu->getMenuAsList(); |
2010 | 2126 | }, $menus)); |
@@ -2015,7 +2131,8 @@ discard block |
||
2015 | 2131 | * |
2016 | 2132 | * @return Menu[] |
2017 | 2133 | */ |
2018 | - protected function secondaryMenu() { |
|
2134 | + protected function secondaryMenu() |
|
2135 | + { |
|
2019 | 2136 | return array_filter(array( |
2020 | 2137 | $this->menuPendingChanges(), |
2021 | 2138 | $this->menuMyPages(), |
@@ -2034,7 +2151,8 @@ discard block |
||
2034 | 2151 | * |
2035 | 2152 | * @return string |
2036 | 2153 | */ |
2037 | - protected function secondaryMenuContainer(array $menus) { |
|
2154 | + protected function secondaryMenuContainer(array $menus) |
|
2155 | + { |
|
2038 | 2156 | return '<ul class="nav nav-pills secondary-menu">' . $this->secondaryMenuContent($menus) . '</ul>'; |
2039 | 2157 | } |
2040 | 2158 | |
@@ -2045,7 +2163,8 @@ discard block |
||
2045 | 2163 | * |
2046 | 2164 | * @return string |
2047 | 2165 | */ |
2048 | - protected function secondaryMenuContent(array $menus) { |
|
2166 | + protected function secondaryMenuContent(array $menus) |
|
2167 | + { |
|
2049 | 2168 | return implode('', array_map(function (Menu $menu) { |
2050 | 2169 | return $menu->getMenuAsList(); |
2051 | 2170 | }, $menus)); |
@@ -2054,7 +2173,8 @@ discard block |
||
2054 | 2173 | /** |
2055 | 2174 | * Send any HTTP headers. |
2056 | 2175 | */ |
2057 | - public function sendHeaders() { |
|
2176 | + public function sendHeaders() |
|
2177 | + { |
|
2058 | 2178 | header('Content-Type: text/html; charset=UTF-8'); |
2059 | 2179 | } |
2060 | 2180 | |
@@ -2063,7 +2183,8 @@ discard block |
||
2063 | 2183 | * |
2064 | 2184 | * @return string[] |
2065 | 2185 | */ |
2066 | - protected function stylesheets() { |
|
2186 | + protected function stylesheets() |
|
2187 | + { |
|
2067 | 2188 | $stylesheets = array( |
2068 | 2189 | WT_BOOTSTRAP_CSS_URL, |
2069 | 2190 | WT_FONT_AWESOME_CSS_URL, |
@@ -2084,7 +2205,8 @@ discard block |
||
2084 | 2205 | * |
2085 | 2206 | * @return string |
2086 | 2207 | */ |
2087 | - protected function title($title) { |
|
2208 | + protected function title($title) |
|
2209 | + { |
|
2088 | 2210 | return '<title>' . Filter::escapeHtml($title) . '</title>'; |
2089 | 2211 | } |
2090 | 2212 | } |
@@ -21,13 +21,15 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * The webtrees (default) theme. |
23 | 23 | */ |
24 | -class WebtreesTheme extends AbstractTheme implements ThemeInterface { |
|
24 | +class WebtreesTheme extends AbstractTheme implements ThemeInterface |
|
25 | +{ |
|
25 | 26 | /** |
26 | 27 | * Where are our CSS, JS and other assets? |
27 | 28 | * |
28 | 29 | * @return string A relative path, such as "themes/foo/" |
29 | 30 | */ |
30 | - public function assetUrl() { |
|
31 | + public function assetUrl() |
|
32 | + { |
|
31 | 33 | return 'themes/webtrees/css-1.7.8/'; |
32 | 34 | } |
33 | 35 | |
@@ -38,7 +40,8 @@ discard block |
||
38 | 40 | * |
39 | 41 | * @return string |
40 | 42 | */ |
41 | - protected function flashMessageContainer(\stdClass $message) { |
|
43 | + protected function flashMessageContainer(\stdClass $message) |
|
44 | + { |
|
42 | 45 | // This theme uses jQueryUI markup. |
43 | 46 | switch ($message->status) { |
44 | 47 | case 'danger': |
@@ -53,7 +56,8 @@ discard block |
||
53 | 56 | * |
54 | 57 | * @return string |
55 | 58 | */ |
56 | - protected function formQuickSearchFields() { |
|
59 | + protected function formQuickSearchFields() |
|
60 | + { |
|
57 | 61 | return |
58 | 62 | '<input type="search" name="query" size="25" placeholder="' . I18N::translate('Search') . '">' . |
59 | 63 | '<input type="image" class="image" src="' . $this->assetUrl() . 'images/search.png" alt="' . I18N::translate('Search') . '" title="' . I18N::translate('Search') . '">'; |
@@ -64,7 +68,8 @@ discard block |
||
64 | 68 | * |
65 | 69 | * @return string |
66 | 70 | */ |
67 | - public function hookFooterExtraJavascript() { |
|
71 | + public function hookFooterExtraJavascript() |
|
72 | + { |
|
68 | 73 | return |
69 | 74 | '<script src="' . WT_JQUERY_COLORBOX_URL . '"></script>' . |
70 | 75 | '<script src="' . WT_JQUERY_WHEELZOOM_URL . '"></script>' . |
@@ -88,7 +93,8 @@ discard block |
||
88 | 93 | * |
89 | 94 | * @return string|int|float |
90 | 95 | */ |
91 | - public function parameter($parameter_name) { |
|
96 | + public function parameter($parameter_name) |
|
97 | + { |
|
92 | 98 | $parameters = array( |
93 | 99 | 'chart-background-f' => 'e9daf1', |
94 | 100 | 'chart-background-m' => 'b1cff0', |
@@ -108,7 +114,8 @@ discard block |
||
108 | 114 | * |
109 | 115 | * @return string[] |
110 | 116 | */ |
111 | - protected function stylesheets() { |
|
117 | + protected function stylesheets() |
|
118 | + { |
|
112 | 119 | return array( |
113 | 120 | 'themes/webtrees/jquery-ui-1.11.2/jquery-ui.css', |
114 | 121 | $this->assetUrl() . 'style.css', |
@@ -120,7 +127,8 @@ discard block |
||
120 | 127 | * |
121 | 128 | * @return string |
122 | 129 | */ |
123 | - public function themeId() { |
|
130 | + public function themeId() |
|
131 | + { |
|
124 | 132 | return 'webtrees'; |
125 | 133 | } |
126 | 134 | |
@@ -129,7 +137,8 @@ discard block |
||
129 | 137 | * |
130 | 138 | * @return string |
131 | 139 | */ |
132 | - public function themeName() { |
|
140 | + public function themeName() |
|
141 | + { |
|
133 | 142 | return I18N::translate('webtrees'); |
134 | 143 | } |
135 | 144 | } |