root/branches/release-36/php/lib/function.mtsignoutlink.php @ 2062

Revision 2062, 1.0 kB (checked in by bchoate, 19 months ago)

Updates to blog-side javascript regarding user state and permissions. BugId:79077,69644,67754,69814,79258,62643. Fixed declarations for conditional tags. BugId:79476. Display auth'd user nickname rather than name from comment object. BugId:79475

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_mtsignoutlink($args, &$ctx) {
9    // status: complete
10    // parameters: none
11    $entry = $ctx->stash('entry');
12    require_once "function.mtcgipath.php";
13    $path = smarty_function_mtcgipath($args, $ctx);
14    if (isset($args['no_static']) && ($args['no_static'] == 1)) {
15        $static_arg = '';
16    } else {
17        $url = $args['static'];
18        if (isset($url) && ($url != '1')) {
19            $static_arg = "&static=" . urlencode($url);
20        } else if (isset($url) && ($url == 1)) {
21            $static_arg = "&static=1";
22        } else {
23            $static_arg = "&static=0";
24        }
25    }
26
27    $path = $path . $ctx->mt->config('CommentScript') .
28        '?__mode=handle_sign_in' .
29        $static_arg .
30        '&logout=1';
31    if ($entry) {
32        $path .= '&entry_id=' . $entry['entry_id'];
33    }
34    return $path;
35}
Note: See TracBrowser for help on using the browser.