@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | * {@inhericDoc} |
25 | 25 | * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent() |
26 | 26 | */ |
27 | - protected function renderContent() { |
|
28 | - /** @var \Fisharebest\Webtrees\Individual $indi */ |
|
29 | - $indi = $this->data->get('indi'); |
|
27 | + protected function renderContent() { |
|
28 | + /** @var \Fisharebest\Webtrees\Individual $indi */ |
|
29 | + $indi = $this->data->get('indi'); |
|
30 | 30 | |
31 | - /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
32 | - $tree = $this->data->get('tree'); |
|
31 | + /** @var \Fisharebest\Webtrees\Tree $tree */ |
|
32 | + $tree = $this->data->get('tree'); |
|
33 | 33 | |
34 | - //Welcome section - gedcom title, date, statistics - based on gedcom_block |
|
35 | - $content = |
|
36 | - '<table> |
|
34 | + //Welcome section - gedcom title, date, statistics - based on gedcom_block |
|
35 | + $content = |
|
36 | + '<table> |
|
37 | 37 | <tr> |
38 | 38 | <td> |
39 | 39 | <a href="pedigree.php?rootid=' . $indi->getXref() . '&ged=' . $tree->getNameUrl() . '"> |
@@ -46,33 +46,33 @@ discard block |
||
46 | 46 | </a> |
47 | 47 | </td>'; |
48 | 48 | |
49 | - if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) { |
|
50 | - $content .= ' |
|
49 | + if (Site::getPreference('USE_REGISTRATION_MODULE') && !Auth::check()) { |
|
50 | + $content .= ' |
|
51 | 51 | <td> |
52 | 52 | <a href="' . WT_LOGIN_URL . '?action=register"> |
53 | 53 | <i class="icon-user_add"></i><br>'.I18N::translate('Request a new user account').' |
54 | 54 | </a> |
55 | 55 | </td>'; |
56 | - } |
|
57 | - $content .= ' |
|
56 | + } |
|
57 | + $content .= ' |
|
58 | 58 | </tr> |
59 | 59 | </table>'; |
60 | 60 | |
61 | - // Piwik Statistics |
|
62 | - if ($this->data->get('piwik_enabled', false)){ |
|
63 | - $content .= ' |
|
61 | + // Piwik Statistics |
|
62 | + if ($this->data->get('piwik_enabled', false)){ |
|
63 | + $content .= ' |
|
64 | 64 | <div class="center"> |
65 | 65 | <div id="piwik_stats"> |
66 | 66 | <i class="icon-loading-small"></i> ' . I18N::translate('Retrieving Piwik statistics...') . ' |
67 | 67 | </div> |
68 | 68 | </div>'; |
69 | - } |
|
69 | + } |
|
70 | 70 | |
71 | - $content .= '<hr />'; |
|
71 | + $content .= '<hr />'; |
|
72 | 72 | |
73 | - // Login section - based on login_block |
|
74 | - if (Auth::check()) { |
|
75 | - $content .= ' |
|
73 | + // Login section - based on login_block |
|
74 | + if (Auth::check()) { |
|
75 | + $content .= ' |
|
76 | 76 | <div class="center"> |
77 | 77 | <form method="post" action="logout.php" name="logoutform" onsubmit="return true;"> |
78 | 78 | <br> |
@@ -82,14 +82,14 @@ discard block |
||
82 | 82 | <br><br> |
83 | 83 | </form> |
84 | 84 | </div>'; |
85 | - } else { |
|
86 | - $content .= ' |
|
85 | + } else { |
|
86 | + $content .= ' |
|
87 | 87 | <div id="maj-login-box"> |
88 | 88 | <form id="maj-login-form" name="maj-login-form" method="post" action="'.WT_LOGIN_URL.'"> |
89 | 89 | <input type="hidden" name="action" value="login"> |
90 | 90 | <div> |
91 | 91 | <label for="maj-username">'. I18N::translate('Username'). |
92 | - '<input type="text" id="maj-username" name="username" class="formField"> |
|
92 | + '<input type="text" id="maj-username" name="username" class="formField"> |
|
93 | 93 | </label> |
94 | 94 | </div> |
95 | 95 | <div> |
@@ -103,17 +103,17 @@ discard block |
||
103 | 103 | <div> |
104 | 104 | <a href="#" id="maj-passwd_click">'. I18N::translate('Request a new password').'</a> |
105 | 105 | </div>'; |
106 | - if (Site::getPreference('USE_REGISTRATION_MODULE')) { |
|
107 | - $content.= ' |
|
106 | + if (Site::getPreference('USE_REGISTRATION_MODULE')) { |
|
107 | + $content.= ' |
|
108 | 108 | <div> |
109 | 109 | <a href="'.WT_LOGIN_URL.'?action=register">'. I18N::translate('Request a new user account').'</a> |
110 | 110 | </div>'; |
111 | - } |
|
112 | - $content.= ' |
|
111 | + } |
|
112 | + $content.= ' |
|
113 | 113 | </form>'; // close "login-form" |
114 | 114 | |
115 | - // hidden New Password block |
|
116 | - $content.= ' |
|
115 | + // hidden New Password block |
|
116 | + $content.= ' |
|
117 | 117 | <div id="maj-new_passwd"> |
118 | 118 | <form id="maj-new_passwd_form" name="new_passwd_form" action="'.WT_LOGIN_URL.'" method="post"> |
119 | 119 | <input type="hidden" name="time" value=""> |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | </form> |
131 | 131 | </div> |
132 | 132 | </div>';//"login-box" |
133 | - } |
|
133 | + } |
|
134 | 134 | |
135 | - return $content; |
|
136 | - } |
|
135 | + return $content; |
|
136 | + } |
|
137 | 137 | |
138 | 138 | |
139 | 139 | } |
@@ -29,30 +29,30 @@ discard block |
||
29 | 29 | class WelcomeBlockController extends MvcController |
30 | 30 | { |
31 | 31 | |
32 | - /** |
|
33 | - * Pages |
|
34 | - */ |
|
32 | + /** |
|
33 | + * Pages |
|
34 | + */ |
|
35 | 35 | |
36 | - /** |
|
37 | - * WelcomeBlock@index |
|
38 | - * |
|
39 | - * @param PageController $parent_controller |
|
40 | - * @param Tree $tree |
|
41 | - * @param string $block_id |
|
42 | - * @param string $template |
|
43 | - * @return $string |
|
44 | - */ |
|
45 | - public function index(PageController $parent_controller, Tree $tree, $block_id, $template) { |
|
46 | - $view_bag = new ViewBag(); |
|
36 | + /** |
|
37 | + * WelcomeBlock@index |
|
38 | + * |
|
39 | + * @param PageController $parent_controller |
|
40 | + * @param Tree $tree |
|
41 | + * @param string $block_id |
|
42 | + * @param string $template |
|
43 | + * @return $string |
|
44 | + */ |
|
45 | + public function index(PageController $parent_controller, Tree $tree, $block_id, $template) { |
|
46 | + $view_bag = new ViewBag(); |
|
47 | 47 | |
48 | - if($parent_controller && $tree) { |
|
48 | + if($parent_controller && $tree) { |
|
49 | 49 | |
50 | - $view_bag->set('tree', $tree); |
|
51 | - $view_bag->set('indi', $parent_controller->getSignificantIndividual()); |
|
50 | + $view_bag->set('tree', $tree); |
|
51 | + $view_bag->set('indi', $parent_controller->getSignificantIndividual()); |
|
52 | 52 | |
53 | - $id = $this->module->getName().$block_id; |
|
54 | - $class = $this->module->getName().'_block'; |
|
55 | - $parent_controller->addInlineJavascript(' |
|
53 | + $id = $this->module->getName().$block_id; |
|
54 | + $class = $this->module->getName().'_block'; |
|
55 | + $parent_controller->addInlineJavascript(' |
|
56 | 56 | jQuery("#maj-new_passwd").hide(); |
57 | 57 | jQuery("#maj-passwd_click").click(function() |
58 | 58 | { |
@@ -63,65 +63,65 @@ discard block |
||
63 | 63 | }); |
64 | 64 | '); |
65 | 65 | |
66 | - if (Auth::isAdmin()) { |
|
67 | - $title='<a class="icon-admin" title="'.I18N::translate('Preferences').'" href="block_edit.php?block_id='.$block_id.'&ged=' . $tree->getNameHtml() . '&ctype=gedcom"></a>'; |
|
68 | - } else { |
|
69 | - $title=''; |
|
70 | - } |
|
71 | - $title .='<span dir="auto">'.$tree->getTitleHtml().'</span>'; |
|
66 | + if (Auth::isAdmin()) { |
|
67 | + $title='<a class="icon-admin" title="'.I18N::translate('Preferences').'" href="block_edit.php?block_id='.$block_id.'&ged=' . $tree->getNameHtml() . '&ctype=gedcom"></a>'; |
|
68 | + } else { |
|
69 | + $title=''; |
|
70 | + } |
|
71 | + $title .='<span dir="auto">'.$tree->getTitleHtml().'</span>'; |
|
72 | 72 | |
73 | - $piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false); |
|
74 | - $view_bag->set('piwik_enabled', $piwik_enabled); |
|
75 | - if($piwik_enabled) { |
|
76 | - $parent_controller->addInlineJavascript( |
|
77 | - '$("#piwik_stats") |
|
73 | + $piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false); |
|
74 | + $view_bag->set('piwik_enabled', $piwik_enabled); |
|
75 | + if($piwik_enabled) { |
|
76 | + $parent_controller->addInlineJavascript( |
|
77 | + '$("#piwik_stats") |
|
78 | 78 | .load("module.php?mod='.$this->module->getName().'&mod_action=Piwik&block_id='.$block_id.'");' |
79 | - ); |
|
80 | - } |
|
79 | + ); |
|
80 | + } |
|
81 | 81 | |
82 | - $content = ViewFactory::make('WelcomeBlock', $this, new BaseController(), $view_bag)->getHtmlPartial(); |
|
82 | + $content = ViewFactory::make('WelcomeBlock', $this, new BaseController(), $view_bag)->getHtmlPartial(); |
|
83 | 83 | |
84 | - if ($template) { |
|
85 | - return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
86 | - } else { |
|
87 | - return $content; |
|
88 | - } |
|
89 | - } |
|
90 | - } |
|
84 | + if ($template) { |
|
85 | + return Theme::theme()->formatBlock($id, $title, $class, $content); |
|
86 | + } else { |
|
87 | + return $content; |
|
88 | + } |
|
89 | + } |
|
90 | + } |
|
91 | 91 | |
92 | 92 | |
93 | 93 | |
94 | - /** |
|
95 | - * WelcomeBlock@config |
|
96 | - * |
|
97 | - * @param string $block_id |
|
98 | - */ |
|
99 | - public function config($block_id = null) { |
|
94 | + /** |
|
95 | + * WelcomeBlock@config |
|
96 | + * |
|
97 | + * @param string $block_id |
|
98 | + */ |
|
99 | + public function config($block_id = null) { |
|
100 | 100 | |
101 | - if(empty($block_id)) throw new MvcException(404); |
|
101 | + if(empty($block_id)) throw new MvcException(404); |
|
102 | 102 | |
103 | - if (Filter::postBool('save') && Filter::checkCsrf()) { |
|
104 | - $this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled')); |
|
105 | - $this->module->setBlockSetting($block_id, 'piwik_url', trim(Filter::postUrl('piwik_url'))); |
|
106 | - $this->module->setBlockSetting($block_id, 'piwik_siteid', trim(Filter::post('piwik_siteid'))); |
|
107 | - $this->module->setBlockSetting($block_id, 'piwik_token', trim(Filter::post('piwik_token'))); |
|
108 | - Cache::delete('piwikCountYear', $this->module); |
|
109 | - throw new MvcException(200); // Use this instead of exit |
|
110 | - } |
|
103 | + if (Filter::postBool('save') && Filter::checkCsrf()) { |
|
104 | + $this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled')); |
|
105 | + $this->module->setBlockSetting($block_id, 'piwik_url', trim(Filter::postUrl('piwik_url'))); |
|
106 | + $this->module->setBlockSetting($block_id, 'piwik_siteid', trim(Filter::post('piwik_siteid'))); |
|
107 | + $this->module->setBlockSetting($block_id, 'piwik_token', trim(Filter::post('piwik_token'))); |
|
108 | + Cache::delete('piwikCountYear', $this->module); |
|
109 | + throw new MvcException(200); // Use this instead of exit |
|
110 | + } |
|
111 | 111 | |
112 | - $view_bag = new ViewBag(); |
|
112 | + $view_bag = new ViewBag(); |
|
113 | 113 | |
114 | - // Is Piwik Statistic Enabled ? |
|
115 | - $view_bag->set('piwik_enabled', $this->module->getBlockSetting($block_id, 'piwik_enabled', '0')); |
|
116 | - //Piwik Root Url |
|
117 | - $view_bag->set('piwik_url', $this->module->getBlockSetting($block_id, 'piwik_url', '')); |
|
118 | - // Piwik token |
|
119 | - $view_bag->set('piwik_token', $this->module->getBlockSetting($block_id, 'piwik_token', '')); |
|
120 | - // Piwik side id |
|
121 | - $view_bag->set('piwik_siteid', $this->module->getBlockSetting($block_id, 'piwik_siteid', '')); |
|
114 | + // Is Piwik Statistic Enabled ? |
|
115 | + $view_bag->set('piwik_enabled', $this->module->getBlockSetting($block_id, 'piwik_enabled', '0')); |
|
116 | + //Piwik Root Url |
|
117 | + $view_bag->set('piwik_url', $this->module->getBlockSetting($block_id, 'piwik_url', '')); |
|
118 | + // Piwik token |
|
119 | + $view_bag->set('piwik_token', $this->module->getBlockSetting($block_id, 'piwik_token', '')); |
|
120 | + // Piwik side id |
|
121 | + $view_bag->set('piwik_siteid', $this->module->getBlockSetting($block_id, 'piwik_siteid', '')); |
|
122 | 122 | |
123 | - return ViewFactory::make('WelcomeBlockConfig', $this, new BaseController(), $view_bag)->getHtmlPartial(); |
|
124 | - } |
|
123 | + return ViewFactory::make('WelcomeBlockConfig', $this, new BaseController(), $view_bag)->getHtmlPartial(); |
|
124 | + } |
|
125 | 125 | |
126 | 126 | |
127 | 127 |