1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 11:36:08 +02:00

comment_menu - 0.8 aware

This commit is contained in:
secretr
2009-10-08 10:53:02 +00:00
parent 885a966161
commit f57a35bd04
4 changed files with 101 additions and 90 deletions

View File

@@ -9,9 +9,9 @@
* Plugin Administration - Comment menu
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/comment_menu/config.php,v $
* $Revision: 1.2 $
* $Date: 2008-12-21 12:53:48 $
* $Author: e107steved $
* $Revision: 1.3 $
* $Date: 2009-10-08 10:53:02 $
* $Author: secretr $
*
*/
$eplug_admin = TRUE;
@@ -26,68 +26,75 @@ if (!getperms("1"))
}
require_once(e_ADMIN."auth.php");
$menu_config = e107::getConfig('menu');
if (isset($_POST['update_menu']))
{
$temp = array();
$temp = $old = $menu_config->getPref();
$tp = e107::getParser();
while (list($key, $value) = each($_POST))
{
if ($value != CM_L9)
{
$temp[$key] = $value;
$temp[$tp->toDB($key)] = $tp->toDB($value);
}
}
if (!$_POST['comment_title'])
{
$temp['comment_title'] = 0;
}
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_04'))
{
$tmp = addslashes(serialize($menu_pref));
$sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='menu_pref' ");
}
$ns->tablerender("", "<div style=\"text-align:center\"><b>".CM_L10."</b></div>");
}
$menu_config->setPref($temp);
if ($admin_log->logArrayDiffs($old, $menu_config->getPref(), 'MISC_04'))
{
if($menu_config->save(false))
{
e107::getMessage()->add(CM_L10, E_MESSAGE_SUCCESS);
}
}
else
{
e107::getMessage()->add(LAN_NO_CHANGE);
}
}
// TODO - 0.8 aware markup, e_form usage
$text = "<div style='text-align:center'>
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" id=\"plugin-menu-config-form\">
<table style=\"width:85%\" class=\"fborder\" >
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L3.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_pref['comment_caption']."\" maxlength=\"100\" />
<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_config->get('comment_caption')."\" maxlength=\"100\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L4.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_pref['comment_display']."\" maxlength=\"2\" />
<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_config->get('comment_display')."\" maxlength=\"2\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L5.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_pref['comment_characters']."\" maxlength=\"4\" />
<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_config->get('comment_characters')."\" maxlength=\"4\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L6.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_pref['comment_postfix']."\" maxlength=\"200\" />
<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_config->get('comment_postfix')."\" maxlength=\"200\" />
</td>
</tr>
<tr>
<td style=\"width:40%\" class='forumheader3'>".CM_L7.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input type=\"checkbox\" name=\"comment_title\" value=\"1\"";
if ($menu_pref['comment_title']) {
$text .= " checked ";
}
$text .= " />
<input type=\"checkbox\" name=\"comment_title\" value=\"1\"".($menu_config->get('comment_title') ? ' checked="checked"' : '')." />
</td>
</tr>
@@ -97,6 +104,7 @@ $text .= " />
</table>
</form>
</div>";
$ns->tablerender(CM_L8, $text);
e107::getRender()->tablerender(CM_L8, e107::getMessage()->render().$text);
require_once(e_ADMIN."footer.php");
?>