|
Revision 2613, 0.8 kB
(checked in by bsmith, 18 months ago)
|
|
bugzid:80096 - changing CommentReplyLink tag to CommentReplyToLink to avoid conflicts with Simply Threaded plugin
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | # Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd. |
|---|
| 3 | # This program is distributed under the terms of the |
|---|
| 4 | # GNU General Public License, version 2. |
|---|
| 5 | # |
|---|
| 6 | # $Id$ |
|---|
| 7 | |
|---|
| 8 | function smarty_function_mtcommentreplytolink($args, &$ctx) { |
|---|
| 9 | $comment = $ctx->stash('comment'); |
|---|
| 10 | if (!$comment) return ''; |
|---|
| 11 | |
|---|
| 12 | global $mt; |
|---|
| 13 | $label = $args['label']; |
|---|
| 14 | $label or $label = $args['text']; |
|---|
| 15 | $label or $label = $mt->translate("Reply"); |
|---|
| 16 | |
|---|
| 17 | $onclick = $args['onclick']; |
|---|
| 18 | $onclick or $onclick = "mtReplyCommentOnClick(%d, '%s')"; |
|---|
| 19 | |
|---|
| 20 | $comment_author = $comment['comment_author']; |
|---|
| 21 | require_once("MTUtil.php"); |
|---|
| 22 | $comment_author = encode_js($comment_author); |
|---|
| 23 | |
|---|
| 24 | $onclick = sprintf($onclick, $comment['comment_id'], $comment_author); |
|---|
| 25 | return sprintf("<a title=\"%s\" href=\"javascript:void(0);\" onclick=\"$onclick\">%s</a>", |
|---|
| 26 | $label, $label); |
|---|
| 27 | } |
|---|