Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Duplicate] Replace hard coded HTML in ACP groups
#1
admin/modules/user/groups.php - line 1517
Replace:  
$form_container->output_cell("<input type=\"text\" name=\"disporder[{$usergroup['gid']}]\" value=\"{$usergroup['disporder']}\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center")); 

with:


$form_container->output_cell($form->generate_text_box("disporder[{$usergroup['gid']}]", "{$usergroup['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

Could also be replaced with $form->generate_numeric_field like elsewhere in the ACP.

Also

admin/modules/forum/management.php - Line 2720 
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));


admin/modules/forum/management.php - Line 2761
$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));
What goes around comes around
Reply
#2
Feel free to create a PR.
[Image: logo.svg.svg]
Reply
#3
https://github.com/mybb/mybb/issues/3739
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#4
(06-27-2019, 06:49 PM)Eldenroot Wrote: https://github.com/mybb/mybb/issues/3739

Thanks.
What goes around comes around
Reply
#5
Please just check if everything is fine
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#6
Hi Eldenroot.

For the first one in admin/modules/user/groups.php

$form_container->output_cell("<input type=\"text\" name=\"disporder[{$usergroup['gid']}]\" value=\"{$usergroup['disporder']}\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));

The replacement should be:

$form_container->output_cell($form->generate_numeric_field("disporder[{$usergroup['gid']}]", "{$usergroup['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

I tested this and it works fine.

For the other 2 in admin/modules/forum/management.php
Line: 2720

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%; font-weight: bold;\" />", array("class" => "align_center"));

The replacement should be:


$form_container->output_cell($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('class' => 'align_center', 'style' => 'width:80%; font-weight:bold')), array("class" => "align_center"));

Line 2761:

$form_container->output_cell("<input type=\"text\" name=\"disporder[".$forum['fid']."]\" value=\"".$forum['disporder']."\" class=\"text_input align_center\" style=\"width: 80%;\" />", array("class" => "align_center"));

The replacement should be:

$form_container->output_cell($form->generate_numeric_field("disporder[{$forum['fid']}]", "{$forum['disporder']}", array('class' => 'align_center', 'style' => 'width:80%')), array("class" => "align_center"));

These last 2 throw an error pointing to the build_admincp_forums_list function in admin/modules/forum/management.php, which maybe explains why they were hardcoded in the first place. So maybe the team can look into these last 2.
What goes around comes around
Reply
#7
OK, updated, thx
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#8
(06-28-2019, 10:23 AM)Ashley1 Wrote: Hi Eldenroot.
These last 2 throw an error pointing to the build_admincp_forums_list function in admin/modules/forum/management.php, which maybe explains why they were hardcoded in the first place. So maybe the team can look into these last 2.

Updated with another PR, you may want to check it.

BTW, why is this thread labeled with [Duplicate] and located in the Rejected forum.. ?

Sorry, forgot to include the URL, https://github.com/mybb/mybb/pull/3780 .
Worth a try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)