root/branches/release-38/php/lib/function.mtcommentreplylink.php @ 2256

Revision 2256, 0.8 kB (checked in by bchoate, 19 months ago)

Fixed function name in dynamic handler. BugId:79668

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
8function smarty_function_mtcommentreplylink($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}
Note: See TracBrowser for help on using the browser.