1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 17:44:37 +02:00

Make the comments-menu caption support multiple languages.

This commit is contained in:
Cameron
2016-12-18 14:59:02 -08:00
parent 5f91ebf20d
commit 3afb992fbd
4 changed files with 79 additions and 11 deletions

View File

@@ -73,5 +73,10 @@ $text .= $tp->parseTemplate($TEMPLATE['end'], true, $comment_menu_shortcodes);
$title = e107::getConfig('menu')->get('comment_caption');
if(!empty($title[e_LANGUAGE]))
{
$title = $title[e_LANGUAGE];
}
e107::getRender()->tablerender(defset($title, $title), $text, 'comment_menu');
?>

View File

@@ -41,8 +41,7 @@ class comment_menu_shortcodes extends e_shortcode
function sc_cm_datestamp()
{
$gen = new convert;
return $gen->convert_date($this->var['comment_datestamp'], "relative");
return e107::getParser()->toDate($this->var['comment_datestamp'], "relative");
}
function sc_cm_heading()

View File

@@ -28,34 +28,57 @@ $menu_config = e107::getConfig('menu');
if (isset($_POST['update_menu']))
{
$temp = $old = $menu_config->getPref();
if(!is_array($temp['comment_caption']))
{
$temp['comment_caption'] = array();
}
$tp = e107::getParser();
while (list($key, $value) = each($_POST))
{
if($key == "comment_caption")
{
$temp['comment_caption'][e_LANGUAGE] = $tp->toDB($value);
continue;
}
if ($value != LAN_UPDATE)
{
$temp[$tp->toDB($key)] = $tp->toDB($value);
}
}
if (!$_POST['comment_title'])
if (!$_POST['comment_title'])
{
$temp['comment_title'] = 0;
}
$menu_config->setPref($temp);
if ($admin_log->logArrayDiffs($old, $menu_config->getPref(), 'MISC_04'))
if($menu_config->save(false))
{
if($menu_config->save(false))
{
$mes->addSuccess();
}
$mes->addSuccess();
}
/*if ($admin_log->logArrayDiffs($old, $menu_config->getPref(), 'MISC_04'))
{
}
else
{
$mes->addInfo(LAN_NO_CHANGE);
}
}*/
}
$frm = e107::getForm();
$commentTmp = $menu_config->get('comment_caption');
$commentCaption = (!empty($commentTmp[e_LANGUAGE])) ? $commentTmp[e_LANGUAGE] : $commentTmp;
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."' id='plugin-menu-config-form'>
<table class='table adminform'>
@@ -65,7 +88,7 @@ $text = "
</colgroup>
<tr>
<td>".CM_L3.":</td>
<td><input class='tbox' type='text' name='comment_caption' size='20' value='".$menu_config->get('comment_caption')."' maxlength='100' /></td>
<td>".$frm->renderElement('comment_caption',$commentCaption, array('type'=>'text','multilan'=>true))."</td>
</tr>
<tr>