@@ -23,42 +23,42 @@ |
||
23 | 23 | * Class OccupationReportModule |
24 | 24 | */ |
25 | 25 | class OccupationReportModule extends AbstractModule implements ModuleReportInterface { |
26 | - /** {@inheritdoc} */ |
|
27 | - public function getTitle() { |
|
28 | - // This text also appears in the .XML file - update both together |
|
29 | - return /* I18N: Name of a report */ I18N::translate('Occupations'); |
|
30 | - } |
|
26 | + /** {@inheritdoc} */ |
|
27 | + public function getTitle() { |
|
28 | + // This text also appears in the .XML file - update both together |
|
29 | + return /* I18N: Name of a report */ I18N::translate('Occupations'); |
|
30 | + } |
|
31 | 31 | |
32 | - /** {@inheritdoc} */ |
|
33 | - public function getDescription() { |
|
34 | - // This text also appears in the .XML file - update both together |
|
35 | - return /* I18N: Description of the “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); |
|
36 | - } |
|
32 | + /** {@inheritdoc} */ |
|
33 | + public function getDescription() { |
|
34 | + // This text also appears in the .XML file - update both together |
|
35 | + return /* I18N: Description of the “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * What is the default access level for this module? |
|
40 | - * |
|
41 | - * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | - * |
|
43 | - * @return int |
|
44 | - */ |
|
45 | - public function defaultAccessLevel() { |
|
46 | - return Auth::PRIV_USER; |
|
47 | - } |
|
38 | + /** |
|
39 | + * What is the default access level for this module? |
|
40 | + * |
|
41 | + * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | + * |
|
43 | + * @return int |
|
44 | + */ |
|
45 | + public function defaultAccessLevel() { |
|
46 | + return Auth::PRIV_USER; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Return a menu item for this report. |
|
51 | - * |
|
52 | - * @return Menu |
|
53 | - */ |
|
54 | - public function getReportMenu() { |
|
55 | - global $WT_TREE; |
|
49 | + /** |
|
50 | + * Return a menu item for this report. |
|
51 | + * |
|
52 | + * @return Menu |
|
53 | + */ |
|
54 | + public function getReportMenu() { |
|
55 | + global $WT_TREE; |
|
56 | 56 | |
57 | - return new Menu( |
|
58 | - $this->getTitle(), |
|
59 | - 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', |
|
60 | - 'menu-report-' . $this->getName(), |
|
61 | - array('rel' => 'nofollow') |
|
62 | - ); |
|
63 | - } |
|
57 | + return new Menu( |
|
58 | + $this->getTitle(), |
|
59 | + 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', |
|
60 | + 'menu-report-' . $this->getName(), |
|
61 | + array('rel' => 'nofollow') |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
@@ -22,15 +22,18 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class OccupationReportModule |
24 | 24 | */ |
25 | -class OccupationReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class OccupationReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritdoc} */ |
27 | - public function getTitle() { |
|
28 | + public function getTitle() |
|
29 | + { |
|
28 | 30 | // This text also appears in the .XML file - update both together |
29 | 31 | return /* I18N: Name of a report */ I18N::translate('Occupations'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | // This text also appears in the .XML file - update both together |
35 | 38 | return /* I18N: Description of the “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); |
36 | 39 | } |
@@ -42,7 +45,8 @@ discard block |
||
42 | 45 | * |
43 | 46 | * @return int |
44 | 47 | */ |
45 | - public function defaultAccessLevel() { |
|
48 | + public function defaultAccessLevel() |
|
49 | + { |
|
46 | 50 | return Auth::PRIV_USER; |
47 | 51 | } |
48 | 52 | |
@@ -51,7 +55,8 @@ discard block |
||
51 | 55 | * |
52 | 56 | * @return Menu |
53 | 57 | */ |
54 | - public function getReportMenu() { |
|
58 | + public function getReportMenu() |
|
59 | + { |
|
55 | 60 | global $WT_TREE; |
56 | 61 | |
57 | 62 | return new Menu( |
@@ -24,30 +24,30 @@ discard block |
||
24 | 24 | * Class LoginBlockModule |
25 | 25 | */ |
26 | 26 | class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { |
27 | - /** {@inheritdoc} */ |
|
28 | - public function getTitle() { |
|
29 | - return /* I18N: Name of a module */ I18N::translate('Sign in'); |
|
30 | - } |
|
27 | + /** {@inheritdoc} */ |
|
28 | + public function getTitle() { |
|
29 | + return /* I18N: Name of a module */ I18N::translate('Sign in'); |
|
30 | + } |
|
31 | 31 | |
32 | - /** {@inheritdoc} */ |
|
33 | - public function getDescription() { |
|
34 | - return /* I18N: Description of the “Sign in” module */ I18N::translate('An alternative way to sign in and sign out.'); |
|
35 | - } |
|
32 | + /** {@inheritdoc} */ |
|
33 | + public function getDescription() { |
|
34 | + return /* I18N: Description of the “Sign in” module */ I18N::translate('An alternative way to sign in and sign out.'); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * Generate the HTML content of this block. |
|
39 | - * |
|
40 | - * @param int $block_id |
|
41 | - * @param bool $template |
|
42 | - * @param string[] $cfg |
|
43 | - * |
|
44 | - * @return string |
|
45 | - */ |
|
46 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
47 | - global $controller; |
|
48 | - $id = $this->getName() . $block_id; |
|
49 | - $class = $this->getName() . '_block'; |
|
50 | - $controller->addInlineJavascript(' |
|
37 | + /** |
|
38 | + * Generate the HTML content of this block. |
|
39 | + * |
|
40 | + * @param int $block_id |
|
41 | + * @param bool $template |
|
42 | + * @param string[] $cfg |
|
43 | + * |
|
44 | + * @return string |
|
45 | + */ |
|
46 | + public function getBlock($block_id, $template = true, $cfg = array()) { |
|
47 | + global $controller; |
|
48 | + $id = $this->getName() . $block_id; |
|
49 | + $class = $this->getName() . '_block'; |
|
50 | + $controller->addInlineJavascript(' |
|
51 | 51 | jQuery("#new_passwd").hide(); |
52 | 52 | jQuery("#passwd_click").click(function() { |
53 | 53 | jQuery("#new_passwd").slideToggle(200); |
@@ -58,26 +58,26 @@ discard block |
||
58 | 58 | }); |
59 | 59 | '); |
60 | 60 | |
61 | - if (Auth::check()) { |
|
62 | - $title = I18N::translate('Sign out'); |
|
63 | - $content = '<div class="center"><form method="post" action="logout.php" name="logoutform" onsubmit="return true;">'; |
|
64 | - $content .= '<br>' . I18N::translate('You are signed in as %s.', '<a href="edituser.php" class="name2">' . Auth::user()->getRealNameHtml() . '</a>') . '<br><br>'; |
|
65 | - $content .= '<input type="submit" value="' . /* I18N: A button label. */ I18N::translate('sign out') . '">'; |
|
61 | + if (Auth::check()) { |
|
62 | + $title = I18N::translate('Sign out'); |
|
63 | + $content = '<div class="center"><form method="post" action="logout.php" name="logoutform" onsubmit="return true;">'; |
|
64 | + $content .= '<br>' . I18N::translate('You are signed in as %s.', '<a href="edituser.php" class="name2">' . Auth::user()->getRealNameHtml() . '</a>') . '<br><br>'; |
|
65 | + $content .= '<input type="submit" value="' . /* I18N: A button label. */ I18N::translate('sign out') . '">'; |
|
66 | 66 | |
67 | - $content .= '<br><br></form></div>'; |
|
68 | - } else { |
|
69 | - $title = I18N::translate('Sign in'); |
|
70 | - $content = '<div id="login-box"> |
|
67 | + $content .= '<br><br></form></div>'; |
|
68 | + } else { |
|
69 | + $title = I18N::translate('Sign in'); |
|
70 | + $content = '<div id="login-box"> |
|
71 | 71 | <form id="login-form" name="login-form" method="post" action="' . WT_LOGIN_URL . '"> |
72 | 72 | <input type="hidden" name="action" value="login">'; |
73 | - $content .= '<div> |
|
73 | + $content .= '<div> |
|
74 | 74 | <label for="username">' . I18N::translate('Username') . |
75 | - '<input type="text" id="username" name="username" class="formField"> |
|
75 | + '<input type="text" id="username" name="username" class="formField"> |
|
76 | 76 | </label> |
77 | 77 | </div> |
78 | 78 | <div> |
79 | 79 | <label for="password">' . I18N::translate('Password') . |
80 | - '<input type="password" id="password" name="password" class="formField"> |
|
80 | + '<input type="password" id="password" name="password" class="formField"> |
|
81 | 81 | </label> |
82 | 82 | </div> |
83 | 83 | <div> |
@@ -86,55 +86,55 @@ discard block |
||
86 | 86 | <div> |
87 | 87 | <a href="#" id="passwd_click">' . I18N::translate('Forgot password?') . '</a> |
88 | 88 | </div>'; |
89 | - if (Site::getPreference('USE_REGISTRATION_MODULE')) { |
|
90 | - $content .= '<div id="register-link"><a href="' . WT_LOGIN_URL . '?action=register">' . I18N::translate('Request a new user account') . '</a></div>'; |
|
91 | - } |
|
92 | - $content .= '</form>'; // close "login-form" |
|
89 | + if (Site::getPreference('USE_REGISTRATION_MODULE')) { |
|
90 | + $content .= '<div id="register-link"><a href="' . WT_LOGIN_URL . '?action=register">' . I18N::translate('Request a new user account') . '</a></div>'; |
|
91 | + } |
|
92 | + $content .= '</form>'; // close "login-form" |
|
93 | 93 | |
94 | - // hidden New Password block |
|
95 | - $content .= '<div id="new_passwd"> |
|
94 | + // hidden New Password block |
|
95 | + $content .= '<div id="new_passwd"> |
|
96 | 96 | <form id="new_passwd_form" name="new_passwd_form" action="' . WT_LOGIN_URL . '" method="post"> |
97 | 97 | <input type="hidden" name="time" value=""> |
98 | 98 | <input type="hidden" name="action" value="requestpw"> |
99 | 99 | <h4>' . I18N::translate('Request a new password') . '</h4> |
100 | 100 | <div> |
101 | 101 | <label for="new_passwd_username">' . I18N::translate('Username or email address') . |
102 | - '<input type="text" id="new_passwd_username" name="new_passwd_username" value=""> |
|
102 | + '<input type="text" id="new_passwd_username" name="new_passwd_username" value=""> |
|
103 | 103 | </label> |
104 | 104 | </div> |
105 | 105 | <div><input type="submit" value="' . I18N::translate('continue') . '"></div> |
106 | 106 | </form> |
107 | 107 | </div>'; //"new_passwd" |
108 | - $content .= '</div>'; //"login-box" |
|
109 | - } |
|
108 | + $content .= '</div>'; //"login-box" |
|
109 | + } |
|
110 | 110 | |
111 | - if ($template) { |
|
112 | - return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
113 | - } else { |
|
114 | - return $content; |
|
115 | - } |
|
116 | - } |
|
111 | + if ($template) { |
|
112 | + return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
113 | + } else { |
|
114 | + return $content; |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - /** {@inheritdoc} */ |
|
119 | - public function loadAjax() { |
|
120 | - return false; |
|
121 | - } |
|
118 | + /** {@inheritdoc} */ |
|
119 | + public function loadAjax() { |
|
120 | + return false; |
|
121 | + } |
|
122 | 122 | |
123 | - /** {@inheritdoc} */ |
|
124 | - public function isUserBlock() { |
|
125 | - return true; |
|
126 | - } |
|
123 | + /** {@inheritdoc} */ |
|
124 | + public function isUserBlock() { |
|
125 | + return true; |
|
126 | + } |
|
127 | 127 | |
128 | - /** {@inheritdoc} */ |
|
129 | - public function isGedcomBlock() { |
|
130 | - return true; |
|
131 | - } |
|
128 | + /** {@inheritdoc} */ |
|
129 | + public function isGedcomBlock() { |
|
130 | + return true; |
|
131 | + } |
|
132 | 132 | |
133 | - /** |
|
134 | - * An HTML form to edit block settings |
|
135 | - * |
|
136 | - * @param int $block_id |
|
137 | - */ |
|
138 | - public function configureBlock($block_id) { |
|
139 | - } |
|
133 | + /** |
|
134 | + * An HTML form to edit block settings |
|
135 | + * |
|
136 | + * @param int $block_id |
|
137 | + */ |
|
138 | + public function configureBlock($block_id) { |
|
139 | + } |
|
140 | 140 | } |
@@ -23,14 +23,17 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * Class LoginBlockModule |
25 | 25 | */ |
26 | -class LoginBlockModule extends AbstractModule implements ModuleBlockInterface { |
|
26 | +class LoginBlockModule extends AbstractModule implements ModuleBlockInterface |
|
27 | +{ |
|
27 | 28 | /** {@inheritdoc} */ |
28 | - public function getTitle() { |
|
29 | + public function getTitle() |
|
30 | + { |
|
29 | 31 | return /* I18N: Name of a module */ I18N::translate('Sign in'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | return /* I18N: Description of the “Sign in” module */ I18N::translate('An alternative way to sign in and sign out.'); |
35 | 38 | } |
36 | 39 | |
@@ -43,7 +46,8 @@ discard block |
||
43 | 46 | * |
44 | 47 | * @return string |
45 | 48 | */ |
46 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
49 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
50 | + { |
|
47 | 51 | global $controller; |
48 | 52 | $id = $this->getName() . $block_id; |
49 | 53 | $class = $this->getName() . '_block'; |
@@ -116,17 +120,20 @@ discard block |
||
116 | 120 | } |
117 | 121 | |
118 | 122 | /** {@inheritdoc} */ |
119 | - public function loadAjax() { |
|
123 | + public function loadAjax() |
|
124 | + { |
|
120 | 125 | return false; |
121 | 126 | } |
122 | 127 | |
123 | 128 | /** {@inheritdoc} */ |
124 | - public function isUserBlock() { |
|
129 | + public function isUserBlock() |
|
130 | + { |
|
125 | 131 | return true; |
126 | 132 | } |
127 | 133 | |
128 | 134 | /** {@inheritdoc} */ |
129 | - public function isGedcomBlock() { |
|
135 | + public function isGedcomBlock() |
|
136 | + { |
|
130 | 137 | return true; |
131 | 138 | } |
132 | 139 | |
@@ -135,6 +142,7 @@ discard block |
||
135 | 142 | * |
136 | 143 | * @param int $block_id |
137 | 144 | */ |
138 | - public function configureBlock($block_id) { |
|
145 | + public function configureBlock($block_id) |
|
146 | + { |
|
139 | 147 | } |
140 | 148 | } |
@@ -21,17 +21,17 @@ |
||
21 | 21 | * Interface ModuleMenuInterface - Classes and libraries for module system |
22 | 22 | */ |
23 | 23 | interface ModuleMenuInterface { |
24 | - /** |
|
25 | - * The user can re-order menus. Until they do, they are shown in this order. |
|
26 | - * |
|
27 | - * @return int |
|
28 | - */ |
|
29 | - public function defaultMenuOrder(); |
|
24 | + /** |
|
25 | + * The user can re-order menus. Until they do, they are shown in this order. |
|
26 | + * |
|
27 | + * @return int |
|
28 | + */ |
|
29 | + public function defaultMenuOrder(); |
|
30 | 30 | |
31 | - /** |
|
32 | - * A menu, to be added to the main application menu. |
|
33 | - * |
|
34 | - * @return Menu|null |
|
35 | - */ |
|
36 | - public function getMenu(); |
|
31 | + /** |
|
32 | + * A menu, to be added to the main application menu. |
|
33 | + * |
|
34 | + * @return Menu|null |
|
35 | + */ |
|
36 | + public function getMenu(); |
|
37 | 37 | } |
@@ -20,7 +20,8 @@ |
||
20 | 20 | /** |
21 | 21 | * Interface ModuleMenuInterface - Classes and libraries for module system |
22 | 22 | */ |
23 | -interface ModuleMenuInterface { |
|
23 | +interface ModuleMenuInterface |
|
24 | +{ |
|
24 | 25 | /** |
25 | 26 | * The user can re-order menus. Until they do, they are shown in this order. |
26 | 27 | * |
@@ -25,70 +25,70 @@ |
||
25 | 25 | * Class WelcomeBlockModule |
26 | 26 | */ |
27 | 27 | class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface { |
28 | - /** {@inheritdoc} */ |
|
29 | - public function getTitle() { |
|
30 | - return /* I18N: Name of a module */ I18N::translate('Home page'); |
|
31 | - } |
|
28 | + /** {@inheritdoc} */ |
|
29 | + public function getTitle() { |
|
30 | + return /* I18N: Name of a module */ I18N::translate('Home page'); |
|
31 | + } |
|
32 | 32 | |
33 | - /** {@inheritdoc} */ |
|
34 | - public function getDescription() { |
|
35 | - return /* I18N: Description of the “Home page” module */ I18N::translate('A greeting message for site visitors.'); |
|
36 | - } |
|
33 | + /** {@inheritdoc} */ |
|
34 | + public function getDescription() { |
|
35 | + return /* I18N: Description of the “Home page” module */ I18N::translate('A greeting message for site visitors.'); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * Generate the HTML content of this block. |
|
40 | - * |
|
41 | - * @param int $block_id |
|
42 | - * @param bool $template |
|
43 | - * @param string[] $cfg |
|
44 | - * |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
48 | - global $controller, $WT_TREE; |
|
38 | + /** |
|
39 | + * Generate the HTML content of this block. |
|
40 | + * |
|
41 | + * @param int $block_id |
|
42 | + * @param bool $template |
|
43 | + * @param string[] $cfg |
|
44 | + * |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + public function getBlock($block_id, $template = true, $cfg = array()) { |
|
48 | + global $controller, $WT_TREE; |
|
49 | 49 | |
50 | - $indi_xref = $controller->getSignificantIndividual()->getXref(); |
|
51 | - $id = $this->getName() . $block_id; |
|
52 | - $class = $this->getName() . '_block'; |
|
53 | - $title = $WT_TREE->getTitleHtml(); |
|
54 | - $content = '<table><tr>'; |
|
55 | - if (Module::isActiveChart($WT_TREE, 'pedigree_chart')) { |
|
56 | - $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-pedigree"></i><br>' . I18N::translate('Default chart') . '</a></td>'; |
|
57 | - } |
|
58 | - $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-indis"></i><br>' . I18N::translate('Default individual') . '</a></td>'; |
|
59 | - if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) { |
|
60 | - $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . I18N::translate('Request a new user account') . '</a></td>'; |
|
61 | - } |
|
62 | - $content .= "</tr>"; |
|
63 | - $content .= "</table>"; |
|
50 | + $indi_xref = $controller->getSignificantIndividual()->getXref(); |
|
51 | + $id = $this->getName() . $block_id; |
|
52 | + $class = $this->getName() . '_block'; |
|
53 | + $title = $WT_TREE->getTitleHtml(); |
|
54 | + $content = '<table><tr>'; |
|
55 | + if (Module::isActiveChart($WT_TREE, 'pedigree_chart')) { |
|
56 | + $content .= '<td><a href="pedigree.php?rootid=' . $indi_xref . '&ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-pedigree"></i><br>' . I18N::translate('Default chart') . '</a></td>'; |
|
57 | + } |
|
58 | + $content .= '<td><a href="individual.php?pid=' . $indi_xref . '&ged=' . $WT_TREE->getNameUrl() . '"><i class="icon-indis"></i><br>' . I18N::translate('Default individual') . '</a></td>'; |
|
59 | + if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) { |
|
60 | + $content .= '<td><a href="' . WT_LOGIN_URL . '?action=register"><i class="icon-user_add"></i><br>' . I18N::translate('Request a new user account') . '</a></td>'; |
|
61 | + } |
|
62 | + $content .= "</tr>"; |
|
63 | + $content .= "</table>"; |
|
64 | 64 | |
65 | - if ($template) { |
|
66 | - return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
67 | - } else { |
|
68 | - return $content; |
|
69 | - } |
|
70 | - } |
|
65 | + if ($template) { |
|
66 | + return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
67 | + } else { |
|
68 | + return $content; |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - /** {@inheritdoc} */ |
|
73 | - public function loadAjax() { |
|
74 | - return false; |
|
75 | - } |
|
72 | + /** {@inheritdoc} */ |
|
73 | + public function loadAjax() { |
|
74 | + return false; |
|
75 | + } |
|
76 | 76 | |
77 | - /** {@inheritdoc} */ |
|
78 | - public function isUserBlock() { |
|
79 | - return false; |
|
80 | - } |
|
77 | + /** {@inheritdoc} */ |
|
78 | + public function isUserBlock() { |
|
79 | + return false; |
|
80 | + } |
|
81 | 81 | |
82 | - /** {@inheritdoc} */ |
|
83 | - public function isGedcomBlock() { |
|
84 | - return true; |
|
85 | - } |
|
82 | + /** {@inheritdoc} */ |
|
83 | + public function isGedcomBlock() { |
|
84 | + return true; |
|
85 | + } |
|
86 | 86 | |
87 | - /** |
|
88 | - * An HTML form to edit block settings |
|
89 | - * |
|
90 | - * @param int $block_id |
|
91 | - */ |
|
92 | - public function configureBlock($block_id) { |
|
93 | - } |
|
87 | + /** |
|
88 | + * An HTML form to edit block settings |
|
89 | + * |
|
90 | + * @param int $block_id |
|
91 | + */ |
|
92 | + public function configureBlock($block_id) { |
|
93 | + } |
|
94 | 94 | } |
@@ -24,14 +24,17 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Class WelcomeBlockModule |
26 | 26 | */ |
27 | -class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface { |
|
27 | +class WelcomeBlockModule extends AbstractModule implements ModuleBlockInterface |
|
28 | +{ |
|
28 | 29 | /** {@inheritdoc} */ |
29 | - public function getTitle() { |
|
30 | + public function getTitle() |
|
31 | + { |
|
30 | 32 | return /* I18N: Name of a module */ I18N::translate('Home page'); |
31 | 33 | } |
32 | 34 | |
33 | 35 | /** {@inheritdoc} */ |
34 | - public function getDescription() { |
|
36 | + public function getDescription() |
|
37 | + { |
|
35 | 38 | return /* I18N: Description of the “Home page” module */ I18N::translate('A greeting message for site visitors.'); |
36 | 39 | } |
37 | 40 | |
@@ -44,7 +47,8 @@ discard block |
||
44 | 47 | * |
45 | 48 | * @return string |
46 | 49 | */ |
47 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
50 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
51 | + { |
|
48 | 52 | global $controller, $WT_TREE; |
49 | 53 | |
50 | 54 | $indi_xref = $controller->getSignificantIndividual()->getXref(); |
@@ -70,17 +74,20 @@ discard block |
||
70 | 74 | } |
71 | 75 | |
72 | 76 | /** {@inheritdoc} */ |
73 | - public function loadAjax() { |
|
77 | + public function loadAjax() |
|
78 | + { |
|
74 | 79 | return false; |
75 | 80 | } |
76 | 81 | |
77 | 82 | /** {@inheritdoc} */ |
78 | - public function isUserBlock() { |
|
83 | + public function isUserBlock() |
|
84 | + { |
|
79 | 85 | return false; |
80 | 86 | } |
81 | 87 | |
82 | 88 | /** {@inheritdoc} */ |
83 | - public function isGedcomBlock() { |
|
89 | + public function isGedcomBlock() |
|
90 | + { |
|
84 | 91 | return true; |
85 | 92 | } |
86 | 93 | |
@@ -89,6 +96,7 @@ discard block |
||
89 | 96 | * |
90 | 97 | * @param int $block_id |
91 | 98 | */ |
92 | - public function configureBlock($block_id) { |
|
99 | + public function configureBlock($block_id) |
|
100 | + { |
|
93 | 101 | } |
94 | 102 | } |
@@ -23,42 +23,42 @@ |
||
23 | 23 | * Class IndividualReportModule |
24 | 24 | */ |
25 | 25 | class IndividualReportModule extends AbstractModule implements ModuleReportInterface { |
26 | - /** {@inheritdoc} */ |
|
27 | - public function getTitle() { |
|
28 | - // This text also appears in the .XML file - update both together |
|
29 | - return /* I18N: Name of a module/report */ I18N::translate('Individual'); |
|
30 | - } |
|
26 | + /** {@inheritdoc} */ |
|
27 | + public function getTitle() { |
|
28 | + // This text also appears in the .XML file - update both together |
|
29 | + return /* I18N: Name of a module/report */ I18N::translate('Individual'); |
|
30 | + } |
|
31 | 31 | |
32 | - /** {@inheritdoc} */ |
|
33 | - public function getDescription() { |
|
34 | - // This text also appears in the .XML file - update both together |
|
35 | - return /* I18N: Description of the “Individual” module */ I18N::translate('A report of an individual’s details.'); |
|
36 | - } |
|
32 | + /** {@inheritdoc} */ |
|
33 | + public function getDescription() { |
|
34 | + // This text also appears in the .XML file - update both together |
|
35 | + return /* I18N: Description of the “Individual” module */ I18N::translate('A report of an individual’s details.'); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * What is the default access level for this module? |
|
40 | - * |
|
41 | - * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | - * |
|
43 | - * @return int |
|
44 | - */ |
|
45 | - public function defaultAccessLevel() { |
|
46 | - return Auth::PRIV_PRIVATE; |
|
47 | - } |
|
38 | + /** |
|
39 | + * What is the default access level for this module? |
|
40 | + * |
|
41 | + * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | + * |
|
43 | + * @return int |
|
44 | + */ |
|
45 | + public function defaultAccessLevel() { |
|
46 | + return Auth::PRIV_PRIVATE; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Return a menu item for this report. |
|
51 | - * |
|
52 | - * @return Menu |
|
53 | - */ |
|
54 | - public function getReportMenu() { |
|
55 | - global $controller, $WT_TREE; |
|
49 | + /** |
|
50 | + * Return a menu item for this report. |
|
51 | + * |
|
52 | + * @return Menu |
|
53 | + */ |
|
54 | + public function getReportMenu() { |
|
55 | + global $controller, $WT_TREE; |
|
56 | 56 | |
57 | - return new Menu( |
|
58 | - $this->getTitle(), |
|
59 | - 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), |
|
60 | - 'menu-report-' . $this->getName(), |
|
61 | - array('rel' => 'nofollow') |
|
62 | - ); |
|
63 | - } |
|
57 | + return new Menu( |
|
58 | + $this->getTitle(), |
|
59 | + 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&pid=' . $controller->getSignificantIndividual()->getXref(), |
|
60 | + 'menu-report-' . $this->getName(), |
|
61 | + array('rel' => 'nofollow') |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
@@ -22,15 +22,18 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class IndividualReportModule |
24 | 24 | */ |
25 | -class IndividualReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class IndividualReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritdoc} */ |
27 | - public function getTitle() { |
|
28 | + public function getTitle() |
|
29 | + { |
|
28 | 30 | // This text also appears in the .XML file - update both together |
29 | 31 | return /* I18N: Name of a module/report */ I18N::translate('Individual'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | // This text also appears in the .XML file - update both together |
35 | 38 | return /* I18N: Description of the “Individual” module */ I18N::translate('A report of an individual’s details.'); |
36 | 39 | } |
@@ -42,7 +45,8 @@ discard block |
||
42 | 45 | * |
43 | 46 | * @return int |
44 | 47 | */ |
45 | - public function defaultAccessLevel() { |
|
48 | + public function defaultAccessLevel() |
|
49 | + { |
|
46 | 50 | return Auth::PRIV_PRIVATE; |
47 | 51 | } |
48 | 52 | |
@@ -51,7 +55,8 @@ discard block |
||
51 | 55 | * |
52 | 56 | * @return Menu |
53 | 57 | */ |
54 | - public function getReportMenu() { |
|
58 | + public function getReportMenu() |
|
59 | + { |
|
55 | 60 | global $controller, $WT_TREE; |
56 | 61 | |
57 | 62 | return new Menu( |
@@ -24,55 +24,55 @@ |
||
24 | 24 | * Class DescendancyChartModule |
25 | 25 | */ |
26 | 26 | class DescendancyChartModule extends AbstractModule implements ModuleChartInterface { |
27 | - /** |
|
28 | - * How should this module be labelled on tabs, menus, etc.? |
|
29 | - * |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function getTitle() { |
|
33 | - return /* I18N: Name of a module/chart */ I18N::translate('Descendants'); |
|
34 | - } |
|
27 | + /** |
|
28 | + * How should this module be labelled on tabs, menus, etc.? |
|
29 | + * |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function getTitle() { |
|
33 | + return /* I18N: Name of a module/chart */ I18N::translate('Descendants'); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * A sentence describing what this module does. |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function getDescription() { |
|
42 | - return /* I18N: Description of the “DescendancyChart” module */ I18N::translate('A chart of an individual’s descendants.'); |
|
43 | - } |
|
36 | + /** |
|
37 | + * A sentence describing what this module does. |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function getDescription() { |
|
42 | + return /* I18N: Description of the “DescendancyChart” module */ I18N::translate('A chart of an individual’s descendants.'); |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * What is the default access level for this module? |
|
47 | - * |
|
48 | - * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
49 | - * |
|
50 | - * @return int |
|
51 | - */ |
|
52 | - public function defaultAccessLevel() { |
|
53 | - return Auth::PRIV_PRIVATE; |
|
54 | - } |
|
45 | + /** |
|
46 | + * What is the default access level for this module? |
|
47 | + * |
|
48 | + * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
49 | + * |
|
50 | + * @return int |
|
51 | + */ |
|
52 | + public function defaultAccessLevel() { |
|
53 | + return Auth::PRIV_PRIVATE; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * Return a menu item for this chart. |
|
58 | - * |
|
59 | - * @return Menu|null |
|
60 | - */ |
|
61 | - public function getChartMenu(Individual $individual) { |
|
62 | - return new Menu( |
|
63 | - $this->getTitle(), |
|
64 | - 'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), |
|
65 | - 'menu-chart-descendants', |
|
66 | - array('rel' => 'nofollow') |
|
67 | - ); |
|
68 | - } |
|
56 | + /** |
|
57 | + * Return a menu item for this chart. |
|
58 | + * |
|
59 | + * @return Menu|null |
|
60 | + */ |
|
61 | + public function getChartMenu(Individual $individual) { |
|
62 | + return new Menu( |
|
63 | + $this->getTitle(), |
|
64 | + 'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), |
|
65 | + 'menu-chart-descendants', |
|
66 | + array('rel' => 'nofollow') |
|
67 | + ); |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * Return a menu item for this chart - for use in individual boxes. |
|
72 | - * |
|
73 | - * @return Menu|null |
|
74 | - */ |
|
75 | - public function getBoxChartMenu(Individual $individual) { |
|
76 | - return $this->getChartMenu($individual); |
|
77 | - } |
|
70 | + /** |
|
71 | + * Return a menu item for this chart - for use in individual boxes. |
|
72 | + * |
|
73 | + * @return Menu|null |
|
74 | + */ |
|
75 | + public function getBoxChartMenu(Individual $individual) { |
|
76 | + return $this->getChartMenu($individual); |
|
77 | + } |
|
78 | 78 | } |
@@ -23,13 +23,15 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * Class DescendancyChartModule |
25 | 25 | */ |
26 | -class DescendancyChartModule extends AbstractModule implements ModuleChartInterface { |
|
26 | +class DescendancyChartModule extends AbstractModule implements ModuleChartInterface |
|
27 | +{ |
|
27 | 28 | /** |
28 | 29 | * How should this module be labelled on tabs, menus, etc.? |
29 | 30 | * |
30 | 31 | * @return string |
31 | 32 | */ |
32 | - public function getTitle() { |
|
33 | + public function getTitle() |
|
34 | + { |
|
33 | 35 | return /* I18N: Name of a module/chart */ I18N::translate('Descendants'); |
34 | 36 | } |
35 | 37 | |
@@ -38,7 +40,8 @@ discard block |
||
38 | 40 | * |
39 | 41 | * @return string |
40 | 42 | */ |
41 | - public function getDescription() { |
|
43 | + public function getDescription() |
|
44 | + { |
|
42 | 45 | return /* I18N: Description of the “DescendancyChart” module */ I18N::translate('A chart of an individual’s descendants.'); |
43 | 46 | } |
44 | 47 | |
@@ -49,7 +52,8 @@ discard block |
||
49 | 52 | * |
50 | 53 | * @return int |
51 | 54 | */ |
52 | - public function defaultAccessLevel() { |
|
55 | + public function defaultAccessLevel() |
|
56 | + { |
|
53 | 57 | return Auth::PRIV_PRIVATE; |
54 | 58 | } |
55 | 59 | |
@@ -58,7 +62,8 @@ discard block |
||
58 | 62 | * |
59 | 63 | * @return Menu|null |
60 | 64 | */ |
61 | - public function getChartMenu(Individual $individual) { |
|
65 | + public function getChartMenu(Individual $individual) |
|
66 | + { |
|
62 | 67 | return new Menu( |
63 | 68 | $this->getTitle(), |
64 | 69 | 'descendancy.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), |
@@ -72,7 +77,8 @@ discard block |
||
72 | 77 | * |
73 | 78 | * @return Menu|null |
74 | 79 | */ |
75 | - public function getBoxChartMenu(Individual $individual) { |
|
80 | + public function getBoxChartMenu(Individual $individual) |
|
81 | + { |
|
76 | 82 | return $this->getChartMenu($individual); |
77 | 83 | } |
78 | 84 | } |
@@ -23,42 +23,42 @@ |
||
23 | 23 | * Class FamilyGroupReportModule |
24 | 24 | */ |
25 | 25 | class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface { |
26 | - /** {@inheritdoc} */ |
|
27 | - public function getTitle() { |
|
28 | - // This text also appears in the .XML file - update both together |
|
29 | - return /* I18N: Name of a module/report */ I18N::translate('Family'); |
|
30 | - } |
|
26 | + /** {@inheritdoc} */ |
|
27 | + public function getTitle() { |
|
28 | + // This text also appears in the .XML file - update both together |
|
29 | + return /* I18N: Name of a module/report */ I18N::translate('Family'); |
|
30 | + } |
|
31 | 31 | |
32 | - /** {@inheritdoc} */ |
|
33 | - public function getDescription() { |
|
34 | - // This text also appears in the .XML file - update both together |
|
35 | - return /* I18N: Description of the “Family” module */ I18N::translate('A report of family members and their details.'); |
|
36 | - } |
|
32 | + /** {@inheritdoc} */ |
|
33 | + public function getDescription() { |
|
34 | + // This text also appears in the .XML file - update both together |
|
35 | + return /* I18N: Description of the “Family” module */ I18N::translate('A report of family members and their details.'); |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * What is the default access level for this module? |
|
40 | - * |
|
41 | - * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | - * |
|
43 | - * @return int |
|
44 | - */ |
|
45 | - public function defaultAccessLevel() { |
|
46 | - return Auth::PRIV_PRIVATE; |
|
47 | - } |
|
38 | + /** |
|
39 | + * What is the default access level for this module? |
|
40 | + * |
|
41 | + * Some modules are aimed at admins or managers, and are not generally shown to users. |
|
42 | + * |
|
43 | + * @return int |
|
44 | + */ |
|
45 | + public function defaultAccessLevel() { |
|
46 | + return Auth::PRIV_PRIVATE; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * Return a menu item for this report. |
|
51 | - * |
|
52 | - * @return Menu |
|
53 | - */ |
|
54 | - public function getReportMenu() { |
|
55 | - global $controller, $WT_TREE; |
|
49 | + /** |
|
50 | + * Return a menu item for this report. |
|
51 | + * |
|
52 | + * @return Menu |
|
53 | + */ |
|
54 | + public function getReportMenu() { |
|
55 | + global $controller, $WT_TREE; |
|
56 | 56 | |
57 | - return new Menu( |
|
58 | - $this->getTitle(), |
|
59 | - 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&famid=' . $controller->getSignificantFamily()->getXref(), |
|
60 | - 'menu-report-' . $this->getName(), |
|
61 | - array('rel' => 'nofollow') |
|
62 | - ); |
|
63 | - } |
|
57 | + return new Menu( |
|
58 | + $this->getTitle(), |
|
59 | + 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml&famid=' . $controller->getSignificantFamily()->getXref(), |
|
60 | + 'menu-report-' . $this->getName(), |
|
61 | + array('rel' => 'nofollow') |
|
62 | + ); |
|
63 | + } |
|
64 | 64 | } |
@@ -22,15 +22,18 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * Class FamilyGroupReportModule |
24 | 24 | */ |
25 | -class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface { |
|
25 | +class FamilyGroupReportModule extends AbstractModule implements ModuleReportInterface |
|
26 | +{ |
|
26 | 27 | /** {@inheritdoc} */ |
27 | - public function getTitle() { |
|
28 | + public function getTitle() |
|
29 | + { |
|
28 | 30 | // This text also appears in the .XML file - update both together |
29 | 31 | return /* I18N: Name of a module/report */ I18N::translate('Family'); |
30 | 32 | } |
31 | 33 | |
32 | 34 | /** {@inheritdoc} */ |
33 | - public function getDescription() { |
|
35 | + public function getDescription() |
|
36 | + { |
|
34 | 37 | // This text also appears in the .XML file - update both together |
35 | 38 | return /* I18N: Description of the “Family” module */ I18N::translate('A report of family members and their details.'); |
36 | 39 | } |
@@ -42,7 +45,8 @@ discard block |
||
42 | 45 | * |
43 | 46 | * @return int |
44 | 47 | */ |
45 | - public function defaultAccessLevel() { |
|
48 | + public function defaultAccessLevel() |
|
49 | + { |
|
46 | 50 | return Auth::PRIV_PRIVATE; |
47 | 51 | } |
48 | 52 | |
@@ -51,7 +55,8 @@ discard block |
||
51 | 55 | * |
52 | 56 | * @return Menu |
53 | 57 | */ |
54 | - public function getReportMenu() { |
|
58 | + public function getReportMenu() |
|
59 | + { |
|
55 | 60 | global $controller, $WT_TREE; |
56 | 61 | |
57 | 62 | return new Menu( |
@@ -19,10 +19,10 @@ |
||
19 | 19 | * Interface ModuleConfigInterface - Classes and libraries for module system |
20 | 20 | */ |
21 | 21 | interface ModuleConfigInterface { |
22 | - /** |
|
23 | - * The URL to a page where the user can modify the configuration of this module. |
|
24 | - * |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public function getConfigLink(); |
|
22 | + /** |
|
23 | + * The URL to a page where the user can modify the configuration of this module. |
|
24 | + * |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public function getConfigLink(); |
|
28 | 28 | } |
@@ -18,7 +18,8 @@ |
||
18 | 18 | /** |
19 | 19 | * Interface ModuleConfigInterface - Classes and libraries for module system |
20 | 20 | */ |
21 | -interface ModuleConfigInterface { |
|
21 | +interface ModuleConfigInterface |
|
22 | +{ |
|
22 | 23 | /** |
23 | 24 | * The URL to a page where the user can modify the configuration of this module. |
24 | 25 | * |
@@ -26,161 +26,161 @@ |
||
26 | 26 | * Class UpcomingAnniversariesModule |
27 | 27 | */ |
28 | 28 | class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface { |
29 | - /** |
|
30 | - * How should this module be labelled on tabs, menus, etc.? |
|
31 | - * |
|
32 | - * @return string |
|
33 | - */ |
|
34 | - public function getTitle() { |
|
35 | - return /* I18N: Name of a module */ I18N::translate('Upcoming events'); |
|
36 | - } |
|
37 | - |
|
38 | - /** |
|
39 | - * A sentence describing what this module does. |
|
40 | - * |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function getDescription() { |
|
44 | - return /* I18N: Description of the “Upcoming events” module */ I18N::translate('A list of the anniversaries that will occur in the near future.'); |
|
45 | - } |
|
46 | - |
|
47 | - /** |
|
48 | - * Generate the HTML content of this block. |
|
49 | - * |
|
50 | - * @param int $block_id |
|
51 | - * @param bool $template |
|
52 | - * @param string[] $cfg |
|
53 | - * |
|
54 | - * @return string |
|
55 | - */ |
|
56 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
57 | - global $ctype, $WT_TREE; |
|
58 | - |
|
59 | - $days = $this->getBlockSetting($block_id, 'days', '7'); |
|
60 | - $filter = $this->getBlockSetting($block_id, 'filter', '1'); |
|
61 | - $onlyBDM = $this->getBlockSetting($block_id, 'onlyBDM', '0'); |
|
62 | - $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); |
|
63 | - $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); |
|
64 | - $block = $this->getBlockSetting($block_id, 'block', '1'); |
|
65 | - |
|
66 | - foreach (array('days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { |
|
67 | - if (array_key_exists($name, $cfg)) { |
|
68 | - $$name = $cfg[$name]; |
|
69 | - } |
|
70 | - } |
|
71 | - |
|
72 | - $startjd = WT_CLIENT_JD + 1; |
|
73 | - $endjd = WT_CLIENT_JD + $days; |
|
74 | - |
|
75 | - $id = $this->getName() . $block_id; |
|
76 | - $class = $this->getName() . '_block'; |
|
77 | - if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) { |
|
78 | - $title = '<a class="icon-admin" title="' . I18N::translate('Preferences') . '" href="block_edit.php?block_id=' . $block_id . '&ged=' . $WT_TREE->getNameHtml() . '&ctype=' . $ctype . '"></a>'; |
|
79 | - } else { |
|
80 | - $title = ''; |
|
81 | - } |
|
82 | - $title .= $this->getTitle(); |
|
83 | - |
|
84 | - $content = ''; |
|
85 | - switch ($infoStyle) { |
|
86 | - case 'list': |
|
87 | - // Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page. |
|
88 | - $content .= FunctionsPrintLists::eventsList($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
89 | - break; |
|
90 | - case 'table': |
|
91 | - // Style 2: New format, tables, big text, etc. Not too good on right side of page |
|
92 | - ob_start(); |
|
93 | - $content .= FunctionsPrintLists::eventsTable($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
94 | - $content .= ob_get_clean(); |
|
95 | - break; |
|
96 | - } |
|
97 | - |
|
98 | - if ($template) { |
|
99 | - if ($block) { |
|
100 | - $class .= ' small_inner_block'; |
|
101 | - } |
|
102 | - |
|
103 | - return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
104 | - } else { |
|
105 | - return $content; |
|
106 | - } |
|
107 | - } |
|
108 | - |
|
109 | - /** {@inheritdoc} */ |
|
110 | - public function loadAjax() { |
|
111 | - return true; |
|
112 | - } |
|
113 | - |
|
114 | - /** {@inheritdoc} */ |
|
115 | - public function isUserBlock() { |
|
116 | - return true; |
|
117 | - } |
|
118 | - |
|
119 | - /** {@inheritdoc} */ |
|
120 | - public function isGedcomBlock() { |
|
121 | - return true; |
|
122 | - } |
|
123 | - |
|
124 | - /** |
|
125 | - * An HTML form to edit block settings |
|
126 | - * |
|
127 | - * @param int $block_id |
|
128 | - */ |
|
129 | - public function configureBlock($block_id) { |
|
130 | - if (Filter::postBool('save') && Filter::checkCsrf()) { |
|
131 | - $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7)); |
|
132 | - $this->setBlockSetting($block_id, 'filter', Filter::postBool('filter')); |
|
133 | - $this->setBlockSetting($block_id, 'onlyBDM', Filter::postBool('onlyBDM')); |
|
134 | - $this->setBlockSetting($block_id, 'infoStyle', Filter::post('infoStyle', 'list|table', 'table')); |
|
135 | - $this->setBlockSetting($block_id, 'sortStyle', Filter::post('sortStyle', 'alpha|anniv', 'alpha')); |
|
136 | - $this->setBlockSetting($block_id, 'block', Filter::postBool('block')); |
|
137 | - } |
|
138 | - |
|
139 | - $days = $this->getBlockSetting($block_id, 'days', '7'); |
|
140 | - $filter = $this->getBlockSetting($block_id, 'filter', '1'); |
|
141 | - $onlyBDM = $this->getBlockSetting($block_id, 'onlyBDM', '0'); |
|
142 | - $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); |
|
143 | - $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); |
|
144 | - $block = $this->getBlockSetting($block_id, 'block', '1'); |
|
145 | - |
|
146 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
147 | - echo I18N::translate('Number of days to show'); |
|
148 | - echo '</td><td class="optionbox">'; |
|
149 | - echo '<input type="text" name="days" size="2" value="', $days, '">'; |
|
150 | - echo ' <em>', I18N::plural('maximum %s day', 'maximum %s days', 30, I18N::number(30)), '</em>'; |
|
151 | - echo '</td></tr>'; |
|
152 | - |
|
153 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
154 | - echo I18N::translate('Show only events of living individuals'); |
|
155 | - echo '</td><td class="optionbox">'; |
|
156 | - echo FunctionsEdit::editFieldYesNo('filter', $filter); |
|
157 | - echo '</td></tr>'; |
|
158 | - |
|
159 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
160 | - echo I18N::translate('Show only births, deaths, and marriages'); |
|
161 | - echo '</td><td class="optionbox">'; |
|
162 | - echo FunctionsEdit::editFieldYesNo('onlyBDM', $onlyBDM); |
|
163 | - echo '</td></tr>'; |
|
164 | - |
|
165 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
166 | - echo I18N::translate('Presentation style'); |
|
167 | - echo '</td><td class="optionbox">'; |
|
168 | - echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); |
|
169 | - echo '</td></tr>'; |
|
170 | - |
|
171 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
172 | - echo I18N::translate('Sort order'); |
|
173 | - echo '</td><td class="optionbox">'; |
|
174 | - echo FunctionsEdit::selectEditControl('sortStyle', array( |
|
175 | - /* I18N: An option in a list-box */ 'alpha' => I18N::translate('sort by name'), |
|
176 | - /* I18N: An option in a list-box */ 'anniv' => I18N::translate('sort by date'), |
|
177 | - ), null, $sortStyle, ''); |
|
178 | - echo '</td></tr>'; |
|
179 | - |
|
180 | - echo '<tr><td class="descriptionbox wrap width33">'; |
|
181 | - echo /* I18N: label for a yes/no option */ I18N::translate('Add a scrollbar when block contents grow'); |
|
182 | - echo '</td><td class="optionbox">'; |
|
183 | - echo FunctionsEdit::editFieldYesNo('block', $block); |
|
184 | - echo '</td></tr>'; |
|
185 | - } |
|
29 | + /** |
|
30 | + * How should this module be labelled on tabs, menus, etc.? |
|
31 | + * |
|
32 | + * @return string |
|
33 | + */ |
|
34 | + public function getTitle() { |
|
35 | + return /* I18N: Name of a module */ I18N::translate('Upcoming events'); |
|
36 | + } |
|
37 | + |
|
38 | + /** |
|
39 | + * A sentence describing what this module does. |
|
40 | + * |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function getDescription() { |
|
44 | + return /* I18N: Description of the “Upcoming events” module */ I18N::translate('A list of the anniversaries that will occur in the near future.'); |
|
45 | + } |
|
46 | + |
|
47 | + /** |
|
48 | + * Generate the HTML content of this block. |
|
49 | + * |
|
50 | + * @param int $block_id |
|
51 | + * @param bool $template |
|
52 | + * @param string[] $cfg |
|
53 | + * |
|
54 | + * @return string |
|
55 | + */ |
|
56 | + public function getBlock($block_id, $template = true, $cfg = array()) { |
|
57 | + global $ctype, $WT_TREE; |
|
58 | + |
|
59 | + $days = $this->getBlockSetting($block_id, 'days', '7'); |
|
60 | + $filter = $this->getBlockSetting($block_id, 'filter', '1'); |
|
61 | + $onlyBDM = $this->getBlockSetting($block_id, 'onlyBDM', '0'); |
|
62 | + $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); |
|
63 | + $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); |
|
64 | + $block = $this->getBlockSetting($block_id, 'block', '1'); |
|
65 | + |
|
66 | + foreach (array('days', 'filter', 'onlyBDM', 'infoStyle', 'sortStyle', 'block') as $name) { |
|
67 | + if (array_key_exists($name, $cfg)) { |
|
68 | + $$name = $cfg[$name]; |
|
69 | + } |
|
70 | + } |
|
71 | + |
|
72 | + $startjd = WT_CLIENT_JD + 1; |
|
73 | + $endjd = WT_CLIENT_JD + $days; |
|
74 | + |
|
75 | + $id = $this->getName() . $block_id; |
|
76 | + $class = $this->getName() . '_block'; |
|
77 | + if ($ctype === 'gedcom' && Auth::isManager($WT_TREE) || $ctype === 'user' && Auth::check()) { |
|
78 | + $title = '<a class="icon-admin" title="' . I18N::translate('Preferences') . '" href="block_edit.php?block_id=' . $block_id . '&ged=' . $WT_TREE->getNameHtml() . '&ctype=' . $ctype . '"></a>'; |
|
79 | + } else { |
|
80 | + $title = ''; |
|
81 | + } |
|
82 | + $title .= $this->getTitle(); |
|
83 | + |
|
84 | + $content = ''; |
|
85 | + switch ($infoStyle) { |
|
86 | + case 'list': |
|
87 | + // Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page. |
|
88 | + $content .= FunctionsPrintLists::eventsList($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
89 | + break; |
|
90 | + case 'table': |
|
91 | + // Style 2: New format, tables, big text, etc. Not too good on right side of page |
|
92 | + ob_start(); |
|
93 | + $content .= FunctionsPrintLists::eventsTable($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
94 | + $content .= ob_get_clean(); |
|
95 | + break; |
|
96 | + } |
|
97 | + |
|
98 | + if ($template) { |
|
99 | + if ($block) { |
|
100 | + $class .= ' small_inner_block'; |
|
101 | + } |
|
102 | + |
|
103 | + return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
104 | + } else { |
|
105 | + return $content; |
|
106 | + } |
|
107 | + } |
|
108 | + |
|
109 | + /** {@inheritdoc} */ |
|
110 | + public function loadAjax() { |
|
111 | + return true; |
|
112 | + } |
|
113 | + |
|
114 | + /** {@inheritdoc} */ |
|
115 | + public function isUserBlock() { |
|
116 | + return true; |
|
117 | + } |
|
118 | + |
|
119 | + /** {@inheritdoc} */ |
|
120 | + public function isGedcomBlock() { |
|
121 | + return true; |
|
122 | + } |
|
123 | + |
|
124 | + /** |
|
125 | + * An HTML form to edit block settings |
|
126 | + * |
|
127 | + * @param int $block_id |
|
128 | + */ |
|
129 | + public function configureBlock($block_id) { |
|
130 | + if (Filter::postBool('save') && Filter::checkCsrf()) { |
|
131 | + $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7)); |
|
132 | + $this->setBlockSetting($block_id, 'filter', Filter::postBool('filter')); |
|
133 | + $this->setBlockSetting($block_id, 'onlyBDM', Filter::postBool('onlyBDM')); |
|
134 | + $this->setBlockSetting($block_id, 'infoStyle', Filter::post('infoStyle', 'list|table', 'table')); |
|
135 | + $this->setBlockSetting($block_id, 'sortStyle', Filter::post('sortStyle', 'alpha|anniv', 'alpha')); |
|
136 | + $this->setBlockSetting($block_id, 'block', Filter::postBool('block')); |
|
137 | + } |
|
138 | + |
|
139 | + $days = $this->getBlockSetting($block_id, 'days', '7'); |
|
140 | + $filter = $this->getBlockSetting($block_id, 'filter', '1'); |
|
141 | + $onlyBDM = $this->getBlockSetting($block_id, 'onlyBDM', '0'); |
|
142 | + $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', 'table'); |
|
143 | + $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', 'alpha'); |
|
144 | + $block = $this->getBlockSetting($block_id, 'block', '1'); |
|
145 | + |
|
146 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
147 | + echo I18N::translate('Number of days to show'); |
|
148 | + echo '</td><td class="optionbox">'; |
|
149 | + echo '<input type="text" name="days" size="2" value="', $days, '">'; |
|
150 | + echo ' <em>', I18N::plural('maximum %s day', 'maximum %s days', 30, I18N::number(30)), '</em>'; |
|
151 | + echo '</td></tr>'; |
|
152 | + |
|
153 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
154 | + echo I18N::translate('Show only events of living individuals'); |
|
155 | + echo '</td><td class="optionbox">'; |
|
156 | + echo FunctionsEdit::editFieldYesNo('filter', $filter); |
|
157 | + echo '</td></tr>'; |
|
158 | + |
|
159 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
160 | + echo I18N::translate('Show only births, deaths, and marriages'); |
|
161 | + echo '</td><td class="optionbox">'; |
|
162 | + echo FunctionsEdit::editFieldYesNo('onlyBDM', $onlyBDM); |
|
163 | + echo '</td></tr>'; |
|
164 | + |
|
165 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
166 | + echo I18N::translate('Presentation style'); |
|
167 | + echo '</td><td class="optionbox">'; |
|
168 | + echo FunctionsEdit::selectEditControl('infoStyle', array('list' => I18N::translate('list'), 'table' => I18N::translate('table')), null, $infoStyle, ''); |
|
169 | + echo '</td></tr>'; |
|
170 | + |
|
171 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
172 | + echo I18N::translate('Sort order'); |
|
173 | + echo '</td><td class="optionbox">'; |
|
174 | + echo FunctionsEdit::selectEditControl('sortStyle', array( |
|
175 | + /* I18N: An option in a list-box */ 'alpha' => I18N::translate('sort by name'), |
|
176 | + /* I18N: An option in a list-box */ 'anniv' => I18N::translate('sort by date'), |
|
177 | + ), null, $sortStyle, ''); |
|
178 | + echo '</td></tr>'; |
|
179 | + |
|
180 | + echo '<tr><td class="descriptionbox wrap width33">'; |
|
181 | + echo /* I18N: label for a yes/no option */ I18N::translate('Add a scrollbar when block contents grow'); |
|
182 | + echo '</td><td class="optionbox">'; |
|
183 | + echo FunctionsEdit::editFieldYesNo('block', $block); |
|
184 | + echo '</td></tr>'; |
|
185 | + } |
|
186 | 186 | } |
@@ -83,16 +83,16 @@ |
||
83 | 83 | |
84 | 84 | $content = ''; |
85 | 85 | switch ($infoStyle) { |
86 | - case 'list': |
|
87 | - // Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page. |
|
88 | - $content .= FunctionsPrintLists::eventsList($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
89 | - break; |
|
90 | - case 'table': |
|
91 | - // Style 2: New format, tables, big text, etc. Not too good on right side of page |
|
92 | - ob_start(); |
|
93 | - $content .= FunctionsPrintLists::eventsTable($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
94 | - $content .= ob_get_clean(); |
|
95 | - break; |
|
86 | + case 'list': |
|
87 | + // Output style 1: Old format, no visible tables, much smaller text. Better suited to right side of page. |
|
88 | + $content .= FunctionsPrintLists::eventsList($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
89 | + break; |
|
90 | + case 'table': |
|
91 | + // Style 2: New format, tables, big text, etc. Not too good on right side of page |
|
92 | + ob_start(); |
|
93 | + $content .= FunctionsPrintLists::eventsTable($startjd, $endjd, $onlyBDM ? 'BIRT MARR DEAT' : '', $filter, $sortStyle); |
|
94 | + $content .= ob_get_clean(); |
|
95 | + break; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | if ($template) { |
@@ -25,13 +25,15 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * Class UpcomingAnniversariesModule |
27 | 27 | */ |
28 | -class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface { |
|
28 | +class UpcomingAnniversariesModule extends AbstractModule implements ModuleBlockInterface |
|
29 | +{ |
|
29 | 30 | /** |
30 | 31 | * How should this module be labelled on tabs, menus, etc.? |
31 | 32 | * |
32 | 33 | * @return string |
33 | 34 | */ |
34 | - public function getTitle() { |
|
35 | + public function getTitle() |
|
36 | + { |
|
35 | 37 | return /* I18N: Name of a module */ I18N::translate('Upcoming events'); |
36 | 38 | } |
37 | 39 | |
@@ -40,7 +42,8 @@ discard block |
||
40 | 42 | * |
41 | 43 | * @return string |
42 | 44 | */ |
43 | - public function getDescription() { |
|
45 | + public function getDescription() |
|
46 | + { |
|
44 | 47 | return /* I18N: Description of the “Upcoming events” module */ I18N::translate('A list of the anniversaries that will occur in the near future.'); |
45 | 48 | } |
46 | 49 | |
@@ -53,7 +56,8 @@ discard block |
||
53 | 56 | * |
54 | 57 | * @return string |
55 | 58 | */ |
56 | - public function getBlock($block_id, $template = true, $cfg = array()) { |
|
59 | + public function getBlock($block_id, $template = true, $cfg = array()) |
|
60 | + { |
|
57 | 61 | global $ctype, $WT_TREE; |
58 | 62 | |
59 | 63 | $days = $this->getBlockSetting($block_id, 'days', '7'); |
@@ -107,17 +111,20 @@ discard block |
||
107 | 111 | } |
108 | 112 | |
109 | 113 | /** {@inheritdoc} */ |
110 | - public function loadAjax() { |
|
114 | + public function loadAjax() |
|
115 | + { |
|
111 | 116 | return true; |
112 | 117 | } |
113 | 118 | |
114 | 119 | /** {@inheritdoc} */ |
115 | - public function isUserBlock() { |
|
120 | + public function isUserBlock() |
|
121 | + { |
|
116 | 122 | return true; |
117 | 123 | } |
118 | 124 | |
119 | 125 | /** {@inheritdoc} */ |
120 | - public function isGedcomBlock() { |
|
126 | + public function isGedcomBlock() |
|
127 | + { |
|
121 | 128 | return true; |
122 | 129 | } |
123 | 130 | |
@@ -126,7 +133,8 @@ discard block |
||
126 | 133 | * |
127 | 134 | * @param int $block_id |
128 | 135 | */ |
129 | - public function configureBlock($block_id) { |
|
136 | + public function configureBlock($block_id) |
|
137 | + { |
|
130 | 138 | if (Filter::postBool('save') && Filter::checkCsrf()) { |
131 | 139 | $this->setBlockSetting($block_id, 'days', Filter::postInteger('days', 1, 30, 7)); |
132 | 140 | $this->setBlockSetting($block_id, 'filter', Filter::postBool('filter')); |