Skip to content

Commit 14609fd

Browse files
committed
Remove 'focus_element' var.
Replaced with autofocus attributes in inputs.
1 parent 9d7512e commit 14609fd

33 files changed

+62
-107
lines changed

featherbb/Controller/Admin/Bans.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public function display($req, $res, $args)
5656

5757
View::setPageInfo(array(
5858
'admin_console' => true,
59-
'focus_element' => array('bans', 'new_ban_user'),
6059
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Bans')),
6160
)
6261
)->addTemplate('admin/bans/admin_bans.php')->display();
@@ -75,7 +74,6 @@ public function add($req, $res, $args)
7574

7675
View::setPageInfo(array(
7776
'admin_console' => true,
78-
'focus_element' => array('bans2', 'ban_user'),
7977
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Bans')),
8078
'ban' => $this->model->add_ban_info($args['id']),
8179
)
@@ -101,7 +99,6 @@ public function edit($req, $res, $args)
10199

102100
View::setPageInfo(array(
103101
'admin_console' => true,
104-
'focus_element' => array('bans2', 'ban_user'),
105102
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Bans')),
106103
'ban' => $this->model->edit_ban_info($args['id']),
107104
)

featherbb/Controller/Admin/Censoring.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function display($req, $res, $args)
4343

4444
return View::setPageInfo(array(
4545
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Censoring')),
46-
'focus_element' => array('censoring', 'new_search_for'),
4746
'active_page' => 'admin',
4847
'admin_console' => true,
4948
'word_data' => $this->model->get_words(),

featherbb/Controller/Admin/Groups.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public function addedit($req, $res, $args)
113113
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('User groups')),
114114
'active_page' => 'admin',
115115
'admin_console' => true,
116-
'focus_element' => array('groups2', 'req_title'),
117116
'group' => $group,
118117
'groups' => $groups,
119118
'id' => $args['id'],

featherbb/Controller/Admin/Users.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public function display($req, $res, $args)
7373
return View::setPageInfo(array(
7474
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Users'), __('Bans')),
7575
'active_page' => 'moderate',
76-
'focus_element' => array('bans2', 'ban_message'),
7776
'admin_console' => true,
7877
'user_ids' => $this->model->ban_users(),
7978
)
@@ -126,7 +125,6 @@ public function display($req, $res, $args)
126125
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Users')),
127126
'active_page' => 'admin',
128127
'admin_console' => true,
129-
'focus_element' => array('find_user', 'form[username]'),
130128
'group_list' => $this->model->get_group_list(),
131129
)
132130
)->addTemplate('admin/users/admin_users.php')->display();

featherbb/Controller/Auth.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ public function login($req, $res, $args)
6565
}
6666
} else {
6767
View::setPageInfo(array(
68-
'active_page' => 'login',
69-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Login')),
70-
'focus_element' => array('login', 'req_username'),
71-
)
72-
)->addTemplate('login/form.php')->display();
68+
'active_page' => 'login',
69+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Login')),
70+
)
71+
)->addTemplate('login/form.php')->display();
7372
}
7473
}
7574

@@ -181,8 +180,7 @@ public function forget($req, $res, $args)
181180
View::setPageInfo(array(
182181
// 'errors' => $this->model->password_forgotten(),
183182
'active_page' => 'login',
184-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Request pass')),
185-
'focus_element' => array('request_pass', 'req_email'),
183+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Request pass'))
186184
)
187185
)->addTemplate('login/password_forgotten.php')->display();
188186
}

featherbb/Controller/Post.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,6 @@ public function newpost($req, $res, $args)
163163
$url_topic = '';
164164
}
165165

166-
// Set focus element (new post or new reply to an existing post ?)
167-
$focus_element[] = 'post';
168-
if (!User::get()->is_guest) {
169-
$focus_element[] = ($args['fid']) ? 'req_subject' : 'req_message';
170-
} else {
171-
$focus_element[] = 'req_username';
172-
}
173-
174166
// Get the current state of checkboxes
175167
$checkboxes = $this->model->get_checkboxes($args['fid'], $is_admmod, $is_subscribed);
176168

@@ -183,7 +175,6 @@ public function newpost($req, $res, $args)
183175

184176
return View::setPageInfo(array(
185177
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), $action),
186-
'focus_element' => $focus_element,
187178
'active_page' => 'post',
188179
'post' => $post,
189180
'tid' => $args['tid'],
@@ -239,7 +230,7 @@ public function delete($req, $res, $args)
239230

240231
$cur_post['message'] = Container::get('parser')->parse_message($cur_post['message'], $cur_post['hide_smilies']);
241232

242-
View::setPageInfo(array(
233+
return View::setPageInfo(array(
243234
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Delete post')),
244235
'active_page' => 'delete',
245236
'cur_post' => $cur_post,
@@ -306,9 +297,8 @@ public function editpost($req, $res, $args)
306297
$preview_message = '';
307298
}
308299

309-
View::setPageInfo(array(
300+
return View::setPageInfo(array(
310301
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Edit post')),
311-
'focus_element' => array('edit', 'req_message'),
312302
'cur_post' => $cur_post,
313303
'errors' => $errors,
314304
'preview_message' => $preview_message,
@@ -335,13 +325,13 @@ public function report($req, $res, $args)
335325
$cur_post['subject'] = Utils::censor($cur_post['subject']);
336326
}
337327

338-
View::setPageInfo(array(
339-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Report post')),
340-
'active_page' => 'report',
341-
'focus_element' => array('report', 'req_reason'),
342-
'id' => $args['id'],
343-
'cur_post' => $cur_post
344-
))->addTemplate('misc/report.php')->display();
328+
return View::setPageInfo(array(
329+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Report post')),
330+
'active_page' => 'report',
331+
'id' => $args['id'],
332+
'cur_post' => $cur_post
333+
)
334+
)->addTemplate('misc/report.php')->display();
345335
}
346336

347337
public function gethost($req, $res, $args)

featherbb/Controller/Profile.php

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -256,28 +256,24 @@ public function action($req, $res, $args)
256256
return $this->model->change_pass($args['id']);
257257
}
258258

259-
View::setPageInfo(array(
260-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Change pass')),
261-
'active_page' => 'profile',
262-
'id' => $args['id'],
263-
'focus_element' => array('change_pass', ((!User::get()->is_admmod) ? 'req_old_password' : 'req_new_password1')),
264-
));
265-
266-
View::addTemplate('profile/change_pass.php')->display();
259+
return View::setPageInfo(array(
260+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Change pass')),
261+
'active_page' => 'profile',
262+
'id' => $args['id']
263+
)
264+
)->addTemplate('profile/change_pass.php')->display();
267265

268266
} elseif ($args['action'] == 'change_email') {
269267
if (Request::isPost()) {
270268
return $this->model->change_email($args['id']);
271269
}
272270

273-
View::setPageInfo(array(
274-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Change email')),
275-
'active_page' => 'profile',
276-
'focus_element' => array('change_email', 'req_new_email'),
277-
'id' => $args['id'],
278-
));
279-
280-
View::addTemplate('profile/change_mail.php')->display();
271+
return View::setPageInfo(array(
272+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Change email')),
273+
'active_page' => 'profile',
274+
'id' => $args['id'],
275+
)
276+
)->addTemplate('profile/change_mail.php')->display();
281277

282278
} elseif ($args['action'] == 'upload_avatar' || $args['action'] == 'upload_avatar2') {
283279
if (ForumSettings::get('o_avatars') == '0') {
@@ -292,14 +288,12 @@ public function action($req, $res, $args)
292288
return $this->model->upload_avatar($args['id'], $_FILES);
293289
}
294290

295-
View::setPageInfo(array(
296-
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Upload avatar')),
297-
'active_page' => 'profile',
298-
'focus_element' => array('upload_avatar', 'req_file'),
299-
'id' => $args['id'],
300-
));
301-
302-
View::addTemplate('profile/upload_avatar.php')->display();
291+
return View::setPageInfo(array(
292+
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Profile'), __('Upload avatar')),
293+
'active_page' => 'profile',
294+
'id' => $args['id'],
295+
)
296+
)->addTemplate('profile/upload_avatar.php')->display();
303297

304298
} elseif ($args['action'] == 'delete_avatar') {
305299
if (User::get()->id != $args['id'] && !User::get()->is_admmod) {
@@ -346,7 +340,6 @@ public function email($req, $res, $args)
346340
View::setPageInfo(array(
347341
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Send email to').' '.Utils::escape($mail['recipient'])),
348342
'active_page' => 'email',
349-
'focus_element' => array('email', 'req_subject'),
350343
'id' => $args['id'],
351344
'mail' => $mail
352345
))->addTemplate('misc/email.php')->display();

featherbb/Controller/Register.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function display($req, $res, $args)
5757

5858
View::setPageInfo(array(
5959
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Register')),
60-
'focus_element' => array('register', 'req_user'),
6160
'active_page' => 'register',
6261
'is_indexed' => true,
6362
'errors' => $user['errors'],

featherbb/Controller/Search.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public function display($req, $res, $args)
7474
View::setPageInfo(array(
7575
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Search')),
7676
'active_page' => 'search',
77-
'focus_element' => array('search', 'keywords'),
7877
'is_indexed' => true,
7978
'forums' => $this->model->get_list_forums(),
8079
))->addTemplate('search/form.php')->display();

featherbb/Controller/Topic.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ public function moderate($req, $res, $args)
241241
else if (Input::post('split_posts')) {
242242
View::setPageInfo(array(
243243
'title' => array(Utils::escape(ForumSettings::get('o_board_title')), __('Moderate')),
244-
'focus_element' => array('subject','new_subject'),
245244
'page' => $p,
246245
'active_page' => 'moderate',
247246
'id' => $args['id'],

0 commit comments

Comments
 (0)