mirror of
https://github.com/e107inc/e107.git
synced 2025-10-12 05:24:38 +02:00
Issue #1944 (Partial fix) Comments use unique IDs.
This commit is contained in:
@@ -1078,6 +1078,7 @@ class comment
|
||||
$tp = e107::getParser();
|
||||
$ns = e107::getRender();
|
||||
$pref = e107::getPref();
|
||||
$frm = e107::getForm();
|
||||
|
||||
if ($this->getCommentPermissions() === FALSE) return;
|
||||
|
||||
@@ -1166,15 +1167,17 @@ class comment
|
||||
{
|
||||
$comment = "<br /><div style='text-align:center'><b>".COMLAN_328."</b></div>";
|
||||
}
|
||||
|
||||
|
||||
$containerTarget = "comments-container-".$frm->name2id($table);
|
||||
|
||||
if($text)
|
||||
{
|
||||
//XXX Do NOT add to template - too important to allow for modification.
|
||||
$text = "<ul class='media-list' id='comments-container'>\n".$text."\n</ul>";
|
||||
$text = "<ul class='media-list comments-container' id='".$containerTarget."'>\n".$text."\n</ul>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = "<ul class='media-list' id='comments-container'><li><!-- --></li></ul>";
|
||||
$text = "<ul class='media-list comments-container' id='".$containerTarget."'><li><!-- --></li></ul>";
|
||||
}
|
||||
|
||||
|
||||
@@ -1322,6 +1325,9 @@ class comment
|
||||
//return "table=".$table." id=".$id." from=".$from;
|
||||
//$from = $from + $this->commentsPerPage;
|
||||
|
||||
$target = "comments-container-".e107::getForm()->name2id($table);
|
||||
|
||||
$navid = 'comments-nav-'.e107::getForm()->name2id($table);
|
||||
|
||||
// from calculations are done by eNav() js.
|
||||
if($this->totalComments > $this->commentsPerPage)
|
||||
@@ -1329,8 +1335,8 @@ class comment
|
||||
$prev = e_HTTP . 'comment.php?mode=list&type=' . $table . '&id=' . $id . '&from=0';
|
||||
$next = e_HTTP . 'comment.php?mode=list&type=' . $table . '&id=' . $id . '&from=0';
|
||||
|
||||
return "<a class='e-ajax btn btn-default btn-secondary btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='down' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='{$prev}'>" . LAN_PREVIOUS . "</a>
|
||||
<a class='e-ajax btn btn-default btn-secondary btn-mini btn-sm' href='#' data-nav-total='{$this->totalComments}' data-nav-dir='up' data-nav-inc='{$this->commentsPerPage}' data-target='comments-container' data-src='{$next}'>" . LAN_NEXT . "</a>";
|
||||
return "<a class='e-ajax btn btn-default btn-secondary btn-mini btn-sm {$navid}' href='#' data-nav-id='{$navid}' data-nav-total='{$this->totalComments}' data-nav-dir='down' data-nav-inc='{$this->commentsPerPage}' data-target='{$target}' data-src='{$prev}'>" . LAN_PREVIOUS . "</a>
|
||||
<a class='e-ajax btn btn-default btn-secondary btn-mini btn-sm {$navid}' href='#' data-nav-id='{$navid}' data-nav-total='{$this->totalComments}' data-nav-dir='up' data-nav-inc='{$this->commentsPerPage}' data-target='{$target}' data-src='{$next}'>" . LAN_NEXT . "</a>";
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user