From 5ce1ee4a2415ea2df76f81b509ac05c416f6d7e0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 11 Feb 2016 11:21:03 -0800 Subject: [PATCH] Fixes #1337 - newforumposts_menu configuration rewrite. --- e107_admin/admin.php | 4 +- e107_plugins/forum/e_menu.php | 53 +++++++++ e107_plugins/forum/newforumposts_menu.php | 7 +- .../forum/newforumposts_menu_config.php | 105 ------------------ 4 files changed, 58 insertions(+), 111 deletions(-) create mode 100644 e107_plugins/forum/e_menu.php delete mode 100755 e107_plugins/forum/newforumposts_menu_config.php diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 111a23e14..a29d4710f 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -205,7 +205,9 @@ class admin_start e_HANDLER."np_class.php", e_CORE."shortcodes/single/user_extended.sc", e_ADMIN."download.php", - e_PLUGIN."banner/config.php" + e_PLUGIN."banner/config.php", + e_PLUGIN."forum/newforumposts_menu_config.php", + ); $found = array(); diff --git a/e107_plugins/forum/e_menu.php b/e107_plugins/forum/e_menu.php new file mode 100644 index 000000000..015392d0a --- /dev/null +++ b/e107_plugins/forum/e_menu.php @@ -0,0 +1,53 @@ + LAN_FORUM_MENU_004, 'type'=>'text', 'multilan'=>true, 'writeParms'=>array('size'=>'xxlarge')); + $fields['display'] = array('title'=> LAN_FORUM_MENU_005, 'type'=>'text', 'writeParms'=>array('size'=>'mini','pattern'=>'[0-9]*')); + $fields['maxage'] = array('title'=> LAN_FORUM_MENU_0012, 'type'=>'text', 'help'=>LAN_FORUM_MENU_0013, 'writeParms'=>array('size'=>'mini','pattern'=>'[0-9]*')); + $fields['characters'] = array('title'=> LAN_FORUM_MENU_006, 'type'=>'text', 'writeParms'=>array('size'=>'mini','pattern'=>'[0-9]*')); + $fields['postfix'] = array('title'=> LAN_FORUM_MENU_007, 'type'=>'text', 'writeParms'=>array('size'=>'mini')); + $fields['title'] = array('title'=> LAN_FORUM_MENU_008, 'type'=>'boolean'); + + return $fields; + + } + +} + +// optional - for when using custom methods above. +/* +class forum_menu_form extends e_form +{ + + +} +*/ + +?> \ No newline at end of file diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index 9ee24ecf8..43b244d5b 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -138,11 +138,8 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php) $text = LAN_FORUM_MENU_002; } - - e107::getRender()->tablerender($this->menuPref['caption'], $text, 'nfp_menu'); - - - + $caption = varset($this->menuPref['caption'][e_LANGUAGE], $this->menuPref['caption']); + e107::getRender()->tablerender($caption, $text, 'nfp_menu'); } diff --git a/e107_plugins/forum/newforumposts_menu_config.php b/e107_plugins/forum/newforumposts_menu_config.php deleted file mode 100755 index 7f4646799..000000000 --- a/e107_plugins/forum/newforumposts_menu_config.php +++ /dev/null @@ -1,105 +0,0 @@ -db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' "); - $ns->tablerender("", "
".LAN_FORUM_MENU_003."
"); -} - -$menu_pref['newforumposts_maxage'] = varset($menu_pref['newforumposts_maxage'],0); - -$text = "
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
".LAN_FORUM_MENU_004.": - -
".LAN_FORUM_MENU_005.": - - -
".LAN_FORUM_MENU_0012.": - -
- ".LAN_FORUM_MENU_0013." -
".LAN_FORUM_MENU_006.": - -
".LAN_FORUM_MENU_007.": - - -
".LAN_FORUM_MENU_008.": - -
- -
-
-
"; -$ns->tablerender(LAN_FORUM_MENU_0010, $mes->render(). $text); -require_once(e_ADMIN."footer.php"); \ No newline at end of file