From c7563958ee85259216f14f1595ed81fc35bcad31 Mon Sep 17 00:00:00 2001 From: Tijn Kuyper Date: Fri, 30 Nov 2012 18:04:59 +0100 Subject: [PATCH] Start on GUI of forum admin, also #6 LAN improvements. Work in progress. --- e107_languages/English/admin/lan_admin.php | 2 +- e107_plugins/forum/forum_admin_class.php | 347 +++++++++--------- .../languages/English/lan_forum_admin.php | 16 +- 3 files changed, 187 insertions(+), 178 deletions(-) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 8d5103b22..6a20db310 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -236,7 +236,7 @@ define("LAN_UPDATED_FAILED","Update Unsuccessful"); define("LAN_NO_CHANGE","Nothing updated as no changes were made."); define("LAN_TRY_AGAIN","Please try again."); define("LAN_NEVER", "Never"); - +define("LAN_PRUNE", "Prune"); define("LAN_RESET","Reset"); define("LAN_CLEAR","Clear"); // define("LAN_OK","OK"); // defined in e107_languages/English/English.php diff --git a/e107_plugins/forum/forum_admin_class.php b/e107_plugins/forum/forum_admin_class.php index 793f4dd06..69119d3b2 100755 --- a/e107_plugins/forum/forum_admin_class.php +++ b/e107_plugins/forum/forum_admin_class.php @@ -33,7 +33,7 @@ class forumAdmin $var['order']['link'] = e_SELF.'?order'; $var['opt']['text'] = FORLAN_79; $var['opt']['link'] = e_SELF.'?opt'; - $var['prune']['text'] = FORLAN_59; + $var['prune']['text'] = LAN_PRUNE; $var['prune']['link'] = e_SELF.'?prune'; $var['rules']['text'] = FORLAN_123; $var['rules']['link'] = e_SELF.'?rules'; @@ -193,11 +193,12 @@ class forumAdmin $txt = "
".FORLAN_180."

- + ".$frm->admin_button('confirm', LAN_UI_DELETE_LABEL, 'submit')." +
"; - $ns->tablerender(FORLAN_181, $txt); + $ns->tablerender(LAN_UI_DELETE_LABEL, $txt); } function show_subs($id) @@ -207,11 +208,11 @@ class forumAdmin
- - - - - + + + + + "; if($sql->db_Select('forum', 'forum_id, forum_name, forum_description, forum_order', "forum_sub = {$id} ORDER by forum_order ASC")) @@ -221,11 +222,11 @@ class forumAdmin { $txt .= " - - - - - + + + + @@ -233,7 +234,7 @@ class forumAdmin } $txt .= " - + @@ -243,36 +244,37 @@ class forumAdmin } else { - $txt .= ""; + $txt .= ""; } $txt .= " - - - - - + + + + + - - - - - + + + + + - +
".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37."".FORLAN_20."".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37."".FORLAN_20."
{$sub['forum_id']} + {$sub['forum_id']} ".ADMIN_DELETE_ICON."
".$frm->admin_button('update_subs', LAN_UPDATE, 'update')."
 
".FORLAN_146."
".FORLAN_146."
".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37." ".FORLAN_151."".FORLAN_31."".FORLAN_32."".FORLAN_37." 
    
".$frm->admin_button('create_sub', FORLAN_148, 'submit')."
"; - $ns->tablerender(FORLAN_149, $txt); + $ns->tablerender(FORLAN_149, $txt); // LAN } function show_existing_forums($sub_action, $id, $mode = false) { global $e107, $for; + $frm = e107::getForm(); $subList = $for->forumGetSubs(); @@ -285,15 +287,15 @@ class forumAdmin $text = "
"; } $text .= " - +
- - + + "; if (!$parent_amount = $e107->sql->db_Select('forum', '*', "forum_parent='0' ORDER BY forum_order ASC")) { - $text .= ""; + $text .= ""; } else { @@ -305,11 +307,11 @@ class forumAdmin { $text .= " - "; - $text .= ""; + $text .= ""; } else { @@ -347,8 +349,8 @@ class forumAdmin { $text .= " - \n\n\n\n - \n\n\n
".FORLAN_28."".FORLAN_80."".FORLAN_28."".FORLAN_80."
".FORLAN_29."
".FORLAN_29."
".$parent['forum_name']." + ".$parent['forum_name']."
".FORLAN_140.": ".$e107->user_class->uc_get_classname($parent['forum_class'])."  ".FORLAN_141.": ".$e107->user_class->uc_get_classname($parent['forum_postclass'])."
"; + $text .= ""; if ($mode) { @@ -334,7 +336,7 @@ class forumAdmin $forumCount = $e107->sql->db_Select('forum', '*', "forum_parent='".$parent['forum_id']."' AND forum_sub = 0 ORDER BY forum_order ASC"); if (!$forumCount) { - $text .= "".FORLAN_29."".FORLAN_29."
".IMAGE_new."".$e107->tp->toHTML($forum['forum_name']).""; -// ".IMAGE_new."".$e107->tp->toHTML($forum['forum_name']).""; + ".IMAGE_new."".$e107->tp->toHTML($forum['forum_name']).""; +// ".IMAGE_new."".$e107->tp->toHTML($forum['forum_name']).""; $text .= "
".$e107->tp->toHTML($forum['forum_description'])."  @@ -356,7 +358,7 @@ class forumAdmin
"; + "; if ($mode) { @@ -392,7 +394,7 @@ class forumAdmin } else { - $text .= "
\n\n
\n
"; + $text .= "\n\n".$frm->admin_button('update_order', LAN_UPDATE, 'update')."\n\n\n\n"; $e107->ns->tablerender(FORLAN_37, $text); } @@ -401,6 +403,7 @@ class forumAdmin function create_parents($sub_action, $id) { global $e107; + $frm = e107::getForm(); $id = (int)$id; if ($sub_action == 'edit' && !$_POST['update_parent']) @@ -421,40 +424,40 @@ class forumAdmin $text = "
- +
- - + - - + + - - + + - - + + - @@ -469,6 +472,7 @@ class forumAdmin function create_forums($sub_action, $id) { global $e107; + $frm = e107::getForm(); $id = (int)$id; if ($sub_action == 'edit' && !$_POST['update_forum']) @@ -491,10 +495,10 @@ class forumAdmin $text = "
\n -
".FORLAN_31.": + ".FORLAN_31.":
".FORLAN_23.":
(".FORLAN_24.")
".$e107->user_class->uc_dropdown('forum_class', $row['forum_class'], 'nobody,public,member,admin,classes')."".FORLAN_23.":
(".FORLAN_24.")
".$e107->user_class->uc_dropdown('forum_class', $row['forum_class'], 'nobody,public,member,admin,classes')."
".FORLAN_142.":
(".FORLAN_143.")
".$e107->user_class->uc_dropdown("forum_postclass", $row['forum_postclass'], 'nobody,public,member,admin,classes')."".FORLAN_142.":
(".FORLAN_143.")
".$e107->user_class->uc_dropdown("forum_postclass", $row['forum_postclass'], 'nobody,public,member,admin,classes')."
".FORLAN_184.":
(".FORLAN_185.")
".$e107->user_class->uc_dropdown('forum_threadclass', $row['forum_threadclass'], 'nobody,public,member,admin,classes')."".FORLAN_184.":
(".FORLAN_185.")
".$e107->user_class->uc_dropdown('forum_threadclass', $row['forum_threadclass'], 'nobody,public,member,admin,classes')."
"; + "; if ($sub_action == 'edit') { - $text .= ""; + $text .= $frm->admin_button('update_parent', LAN_UPDATE, 'update'); } else { - $text .= ""; + $text .= $frm->admin_button('submit_parent', LAN_CREATE, 'submit'); } $text .= "
+
- - + - - - - + - - + - - + + - - + + - - + + - @@ -566,20 +570,22 @@ class forumAdmin function show_message($message) { global $e107; - $e107->ns->tablerender('', "
".$message."
"); + $e107->ns->tablerender('', "
".$message."
"); //FIX: v2 style = render? } function show_tools() { global $sql, $ns, $tp; + $frm = e107::getForm(); + $txt = " -
".FORLAN_22.":"; + ".FORLAN_22.":"; $e107->sql->db_Select('forum', '*', 'forum_parent=0'); $text .= "
".FORLAN_31.": + ".FORLAN_31.":
".FORLAN_179."
+
".FORLAN_32.": + ".FORLAN_32.":
".FORLAN_33.":
(".FORLAN_34.")
"; + ".FORLAN_33.":
(".FORLAN_34.")
"; $text .= $e107->user_class->uc_dropdown('forum_moderators', $fInfo['forum_moderators'], 'admin,classes'); $text .= "
".FORLAN_23.":
(".FORLAN_24.")
".$e107->user_class->uc_dropdown('forum_class', $fInfo['forum_class'], 'nobody,public,member,admin,classes')."".FORLAN_23.":
(".FORLAN_24.")
".$e107->user_class->uc_dropdown('forum_class', $fInfo['forum_class'], 'nobody,public,member,admin,classes')."
".FORLAN_142.":
(".FORLAN_143.")
".$e107->user_class->uc_dropdown('forum_postclass', $fInfo['forum_postclass'], 'nobody,public,member,admin,classes')."".FORLAN_142.":
(".FORLAN_143.")
".$e107->user_class->uc_dropdown('forum_postclass', $fInfo['forum_postclass'], 'nobody,public,member,admin,classes')."
".FORLAN_184.":
(".FORLAN_185.")
".$e107->user_class->uc_dropdown('forum_threadclass', $fInfo['forum_threadclass'], 'nobody,public,member,admin,classes')."".FORLAN_184.":
(".FORLAN_185.")
".$e107->user_class->uc_dropdown('forum_threadclass', $fInfo['forum_threadclass'], 'nobody,public,member,admin,classes')."
"; + "; if ($sub_action == "edit") { - $text .= ""; + $text .= $frm->admin_button('update_forum', LAN_UPDATE, 'update'); } else { - $text .= ""; + $text .= $frm->admin_button('submit_forum', LAN_CREATE, 'submit'); } $text .= "
+
- + - - + - - + - - + - -
".FORLAN_156."".FORLAN_156."
+ "; if($sql->db_Select("forum", "*", "1 ORDER BY forum_order")) { @@ -594,34 +600,34 @@ class forumAdmin
".FORLAN_158."".FORLAN_158."
+ ".FORLAN_159."
     ".FORLAN_160."
".FORLAN_161."".FORLAN_161."
+ ".FORLAN_162."
     ".FORLAN_182."
".FORLAN_183."

".FORLAN_163."".FORLAN_163."
+ ".FORLAN_164."
- + + ".$frm->admin_button('tools', LAN_EXECUTE, 'submit')."
@@ -635,6 +641,7 @@ class forumAdmin global $fPref, $ns, $sql; $e107 = e107::getInstance(); $emessage = eMessage::getInstance(); + $frm = e107::getForm(); $poll_installed = plugInstalled('poll'); @@ -650,44 +657,44 @@ class forumAdmin $text = "
\n - +
- - + + - - + + - - + + - - + + - "; + "; if($poll_installed) { -// - $text .= "'; +// + $text .= "'; } else { - $text .= ""; + $text .= ""; } $text .= " - - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + -
".FORLAN_44."
".FORLAN_45."
".($fPref->get('enclose') ? "" : "")."".FORLAN_44."
".FORLAN_45."
".($fPref->get('enclose') ? "" : "")."
".FORLAN_65."
".FORLAN_46."
".FORLAN_65."
".FORLAN_46."
".FORLAN_47."
".FORLAN_48."
".($fPref->get('notify') ? "" : "")."".FORLAN_47."
".FORLAN_48."
".($fPref->get('notify') ? "" : "")."
".FORLAN_177."
".FORLAN_178."
".($fPref->get('notify_on') ? "" : "")."".FORLAN_177."
".FORLAN_178."
".($fPref->get('notify_on') ? "" : "")."
".FORLAN_49."
".FORLAN_50."
".FORLAN_49."
".FORLAN_50."
".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."".$e107->user_class->uc_dropdown('forum_poll', $fPref->get('poll'), 'admin,classes').'".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."".$e107->user_class->uc_dropdown('forum_poll', $fPref->get('poll'), 'admin,classes').'".FORLAN_66."".FORLAN_66."
".FORLAN_70."
".FORLAN_71." ".FORLAN_130." ". FORLAN_131.""; +
".FORLAN_70."
".FORLAN_71." ".FORLAN_130." ". FORLAN_131.""; if(!$pref['image_post']) { @@ -699,74 +706,74 @@ class forumAdmin } $text .= "
".($fPref->get('attach') ? "" : "")."".($fPref->get('attach') ? "" : "")."
".FORLAN_134."
".FORLAN_135."
".FORLAN_134."
".FORLAN_135."
".FORLAN_136."
".FORLAN_137."
".($fPref->get('linkimg') ? "" : "")."".FORLAN_136."
".FORLAN_137."
".($fPref->get('linkimg') ? "" : "")."
".FORLAN_51."
".FORLAN_52."
".($fPref->get('track') ? "" : "")."".FORLAN_51."
".FORLAN_52."
".($fPref->get('track') ? "" : "")."
".FORLAN_112."
".FORLAN_113."
".($fPref->get('redirect') ? "" : "")."".FORLAN_112."
".FORLAN_113."
".($fPref->get('redirect') ? "" : "")."
".FORLAN_116."
".FORLAN_122."
".($fPref->get('reported_post_email') ? "" : "")."".FORLAN_116."
".FORLAN_122."
".($fPref->get('reported_post_email') ? "" : "")."
".FORLAN_126."
".FORLAN_127."
".($fPref->get('forum_tooltip') ? "" : "")."".FORLAN_126."
".FORLAN_127."
".($fPref->get('forum_tooltip') ? "" : "")."
".FORLAN_128."
".FORLAN_129."
".FORLAN_128."
".FORLAN_129."
".FORLAN_53."
".FORLAN_54."
".FORLAN_53."
".FORLAN_54."
".FORLAN_55."
".FORLAN_56."
".FORLAN_55."
".FORLAN_56."
".FORLAN_57."
".FORLAN_58."
".FORLAN_57."
".FORLAN_58."
".FORLAN_186."
".FORLAN_187."
".FORLAN_186."
".FORLAN_187."
".FORLAN_132."
".FORLAN_133."
".($fPref->get('hilightsticky') ? "" : "")."".FORLAN_132."
".FORLAN_133."
".($fPref->get('hilightsticky') ? "" : "")."
- + + ".$frm->admin_button('updateoptions', LAN_UPDATE, 'update')."
@@ -785,48 +792,48 @@ class forumAdmin $user = $sql -> db_Fetch(); $con = new convert; $text = "
- -
+ + - - - - - - - - - -
".FORLAN_171.": + #".$row['gen_intdata']."
+ ".FORLAN_173.": + ".$row['gen_ip']."
+ ".FORLAN_174.": + ".$user['user_name']."
+ ".FORLAN_175.": + ".$con -> convert_date($row['gen_datestamp'], "long")."
+ ".FORLAN_176.": + ".$row['gen_chardata']."
+ ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." ".$rs->form_close()." @@ -839,16 +846,16 @@ class forumAdmin $text = "
"; if ($reported_total = $sql->db_Select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'")) { - $text .= " + $text .= "
- - + + "; while ($row = $sql->db_Fetch()) { $text .= " - - +
".FORLAN_170."".FORLAN_80."".FORLAN_170."".FORLAN_80."
".FORLAN_171." #".$row['gen_intdata']." + ".FORLAN_171." #".$row['gen_intdata']." ".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")." ".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)." ".$rs->form_close()." @@ -869,6 +876,7 @@ class forumAdmin function show_prune() { global $ns, $sql; + $frm = e107::getForm(); // $sql -> db_Select("forum", "forum_id, forum_name", "forum_parent!=0 ORDER BY forum_order ASC"); $qry = " @@ -882,28 +890,28 @@ class forumAdmin $sql -> db_Select_gen($qry); $forums = $sql -> db_getList(); - $text = "
+ $text = " \n - +
- + - - - -
".FORLAN_60."".FORLAN_60."
".FORLAN_87." + ".FORLAN_87."
".FORLAN_2."
+
".FORLAN_2."
".FORLAN_89."     ".FORLAN_90."
".FORLAN_138.":
"; +
".FORLAN_138.":
"; foreach($forums as $forum) { @@ -915,14 +923,13 @@ class forumAdmin $text .= "
- + + ".$frm->admin_button('do_prune', LAN_PRUNE, 'submit')."
- -
"; - $ns->tablerender(FORLAN_59, $text); + "; + $ns->tablerender(LAN_PRUNE, $text); } @@ -933,14 +940,15 @@ class forumAdmin $forumList = $for->forum_getforums('all'); $parentList = $for->forum_getparents('list'); $subList = $for->forumGetSubs('bysub'); + $frm = e107::getForm(); - $txt = "
"; + $txt = "
 
"; foreach($parentList as $p) { $txt .= " - + "; @@ -948,16 +956,16 @@ class forumAdmin { $txt .= " - - + + "; foreach($subList[$f['forum_id']] as $s) { $txt .= " - - + + "; } @@ -965,18 +973,19 @@ class forumAdmin } $txt .= " -
 
".$tp->toHTML($p['forum_name'])."".$tp->toHTML($p['forum_name'])."
{$f['forum_name']}".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."{$f['forum_name']}".$e107->user_class->uc_dropdown("mods[{$f['forum_id']}]", $f['forum_moderators'], 'admin,classes')."
    {$s['forum_name']}".$e107->user_class->uc_dropdown("mods[{$s['forum_id']}]", $s['forum_moderators'], 'admin,classes')."    {$s['forum_name']}".$e107->user_class->uc_dropdown("mods[{$s['forum_id']}]", $s['forum_moderators'], 'admin,classes')."
- + + ".$frm->admin_button('setMods', LAN_UPDATE, 'update')."
"; - $ns->tablerender(FORLAN_33, $txt); + $ns->tablerender(FORLAN_33, $txt); // FIX: LAN button update was WMGLAN_4." ".FORLAN_33) } function show_rules() { global $sql, $pref, $ns, $tp; + $frm = e107::getForm(); $sql->db_Select("wmessage"); list($null) = $sql->db_Fetch(); @@ -1006,12 +1015,12 @@ class forumAdmin $text = "
- +
"; $text .= " - - - - - - - - +
".WMGLAN_1.":
+
".WMGLAN_1.":
".WMGLAN_6.":"; if ($guest_rules['gen_intdata']) { @@ -1022,7 +1031,7 @@ class forumAdmin $text .= ""; } $text .= "
+
@@ -1032,7 +1041,7 @@ class forumAdmin
".WMGLAN_2.":
+
".WMGLAN_2.":
".WMGLAN_6.":"; if ($member_rules['gen_intdata']) { @@ -1043,17 +1052,17 @@ class forumAdmin $text .= ""; } $text .= "
+
- +
".display_help('helpb', 1, 'addtext2', 'help2')."
".WMGLAN_3.":
+
".WMGLAN_3.":
".WMGLAN_6.": "; if ($admin_rules['gen_intdata']) @@ -1066,7 +1075,7 @@ class forumAdmin } $text .= "
+
@@ -1076,9 +1085,9 @@ class forumAdmin
  - +   + ".$frm->admin_button('frsubmit', WMGLAN_4, 'submit')."
diff --git a/e107_plugins/forum/languages/English/lan_forum_admin.php b/e107_plugins/forum/languages/English/lan_forum_admin.php index 25bf4e94e..b500621d5 100644 --- a/e107_plugins/forum/languages/English/lan_forum_admin.php +++ b/e107_plugins/forum/languages/English/lan_forum_admin.php @@ -33,8 +33,8 @@ define("FORLAN_21", "tick to confirm"); define("FORLAN_22", "Parent"); define("FORLAN_23", "Viewable by"); define("FORLAN_24", "Indicates who can view the forum"); -define("FORLAN_25", "Update Parent"); -define("FORLAN_26", "Create Parent"); +//define("FORLAN_25", "Update Parent"); +//define("FORLAN_26", "Create Parent"); define("FORLAN_27", "You need to define at least one forum parent before creating a forum."); define("FORLAN_28", "Forums"); define("FORLAN_29", "No forums yet."); @@ -43,8 +43,8 @@ define("FORLAN_31", "Name"); define("FORLAN_32", "Description"); define("FORLAN_33", "Moderators"); define("FORLAN_34", "Choose userclass for moderators of this forum"); -define("FORLAN_35", "Update Forum"); -define("FORLAN_36", "Create Forum"); +//define("FORLAN_35", "Update Forum"); +//define("FORLAN_36", "Create Forum"); define("FORLAN_37", "Order"); define("FORLAN_38", "Closed"); define("FORLAN_39", "Members Only"); @@ -67,9 +67,9 @@ define("FORLAN_55", "Popular thread threshold"); define("FORLAN_56", "Number of posts made to a thread before it is marked as popular"); define("FORLAN_57", "Posts per page"); define("FORLAN_58", "Number of posts displayed per page"); -define("FORLAN_59", "Prune"); +//define("FORLAN_59", "Prune"); define("FORLAN_60", "This will delete all threads that have not received a reply in the number of days you enter.
Please be careful using this function!"); -define("FORLAN_61", "Update Options"); +//define("FORLAN_61", "Update Options"); define("FORLAN_62", "Forum Options"); define("FORLAN_63", "Ranks"); define("FORLAN_64", "Enter your levels here, if left blank generic stars will be used to denote level. Separate levels with comma. Maximum of 10 levels, lowest first."); @@ -78,7 +78,7 @@ define('FORLAN_66', 'Not installed'); define("FORLAN_70", "Enable file / image attachments"); define("FORLAN_71", "Allow users to upload file or image with their forum post,"); -define("FORLAN_72", "Update Order"); +//define("FORLAN_72", "Update Order"); define("FORLAN_73", "Order Updated"); define("FORLAN_75", "Parents"); @@ -202,7 +202,7 @@ define("FORLAN_178", "Tick this to allow make the email notification checkbox be define("FORLAN_179", "(Adding a * to the beginning of the forum name will make this forum a container for sub-forums only. The forum theme must support this option also.)"); define("FORLAN_180", "Confirm delete operation"); -define("FORLAN_181", "Confirm Delete"); +//define("FORLAN_181", "Confirm Delete"); define("FORLAN_182", "also recalculate replies for all threads in selected forum"); define("FORLAN_183", "(this function is not allowed when selecting 'all forums' due to the number of queries it will generate)");