root/branches/release-36/default_templates/signin.mtml @ 2052

Revision 2052, 2.5 kB (checked in by fumiakiy, 19 months ago)

Integrated Widget Manager to the core. BugId:68750

Now a widgetset is another type of template. The widgets contained in a widgetset is stored in a meta field.

  • Property svn:keywords set to Id Date Author Revision
Line 
1<script type="text/javascript" src="<$mt:Link template="<__trans phrase="JavaScript">"$>"></script>
2<div class="widget-sign-in widget">
3    <h3 class="widget-header"><__trans phrase="Sign In"></h3>
4    <div class="widget-content">
5<script type="text/javascript">
6/* <![CDATA[ */
7var name, id, url, blog_ids;
8if (typeof(commenter_name) != 'undefined')
9    name = commenter_name
10if (typeof(commenter_id) != 'undefined')
11    id = commenter_id;
12if (typeof(commenter_url) != 'undefined')
13    url = commenter_url;
14if (typeof(commenter_blog_ids) != 'undefined')
15    blog_ids = commenter_blog_ids;
16
17if (!name && !id) {
18    if ('<$mt:CGIHost exclude_port="1"$>' != '<$mt:BlogHost exclude_port="1"$>') {
19        document.write('<scr' + 'ipt src="<$mt:CGIPath$><$mt:CommentScript$>?__mode=cmtr_name_js">');
20        document.write("</scr" + "ipt>");
21    } else {
22        name = getCookie('commenter_name');
23        ids = getCookie('commenter_id').split(':');
24        id = ids[0];
25        blog_ids = ids[1];
26        url = getCookie('commenter_url');
27    }
28}
29showMessage(name, id, url);
30
31function showMessage(commenter_name, commenter_id, commenter_url) {
32    static = location.href;
33    if ( commenter_name &&
34         ( !commenter_id
35        || commenter_blog_ids.indexOf("'<$mt:BlogID$>'") > -1))
36    {
37        var url;
38        if (commenter_id) {
39            url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&commenter=' + commenter_id + '&blog_id=<$mt:BlogID$>';
40            url += '&static=' + static;
41        } else if (commenter_url) {
42            url = commenter_url;
43        } else {
44            url = null;
45        }
46        var content = '<__trans phrase="You are signed in as " escape="js">';
47        if (url) {
48            content += '<a href="' + url + '">' + commenter_name + '</a>';
49        } else {
50            content += commenter_name;
51        }
52        content += '.  (<a href="<$mt:RemoteSignOutLink no_static="1"$>&static=' + static + '"><__trans phrase="sign out" escape="js"></a>)';
53        document.write(content);
54    } else if (commenter_name) {
55        document.write('<__trans phrase="You do not have permission to sign in to this blog." escape="js"> (<a href="<$mt:RemoteSignOutLink no_static="1"$>&static=' + static + '"><__trans phrase="sign out" escape="js"></a>)');
56    } else {
57    <mt:IfRegistrationAllowed>
58        document.write('<a href="<$mt:CGIPath$><$mt:CommentScript$>?__mode=login&blog_id=<$mt:BlogID$>&static=' + static + '"><__trans phrase="Sign In" escape="js"></a>');
59    </mt:IfRegistrationAllowed>
60    }
61}
62/* ]]> */
63</script>
64    </div>
65</div>
Note: See TracBrowser for help on using the browser.