root/branches/release-29/plugins/MultiBlog/tmpl/blog_config.tmpl @ 1309

Revision 1309, 5.2 kB (checked in by ddavis, 23 months ago)

standarize js comment tag escape. BugzID:58265

Line 
1<script type="text/javascript">
2/* <![CDATA[ */
3var multiBlogRebuilds = new Array();
4<TMPL_LOOP NAME=REBUILDS_LOOP>
5multiBlogRebuilds[multiBlogRebuilds.length] = new Array ("<TMPL_VAR NAME=ACTION_NAME ESCAPE=HTML>", "<TMPL_VAR NAME=ACTION_VALUE>", "<TMPL_VAR NAME=BLOG_NAME ESCAPE=HTML>", "<TMPL_VAR NAME=BLOG_ID>", "<TMPL_VAR NAME=TRIGGER_NAME>", "<TMPL_VAR NAME=TRIGGER_VALUE>");
6</TMPL_LOOP>
7
8function rebuildMultiBlogTriggerTable() {
9    DOM.addClassName(getByID('multiblog_blog_list_zero_state'), 'hidden');
10    DOM.removeClassName(getByID('multiblog_blog_list'), 'hidden');
11    getByID('multiblog_blog_list').innerHTML = "";
12    getByID('rebuild_triggers').value = "";
13    if (multiBlogRebuilds.length > 0) {
14        var values = new Array();
15        var str = "";
16        for (var i = 0; i < multiBlogRebuilds.length; i++) {
17            str += "<tr class=\"" + ((i + 1) % 2 == 0 ? "even" : "odd") + "\">";
18            str += "<td> <MT_TRANS phrase="When"> <strong>"
19                + (multiBlogRebuilds[i][3] == "_all"
20                    ? "<em><MT_TRANS phrase="Any Weblog"></em>"
21                    : multiBlogRebuilds[i][2])
22                + "</strong></td><td>"
23                + multiBlogRebuilds[i][4]
24                + "</td>";
25            str += "<td>" + multiBlogRebuilds[i][0] + "</td>";
26            str += "<td><a href='javascript:void(0)' onclick='removeMultiBlogTrigger(" + i + ")'><img src='<TMPL_VAR NAME=STATIC_URI>images/nav_icons/mini/delete.gif' width='9' height='11' alt='<MT_TRANS phrase="Remove">' /></a></td>";
27            str += "</tr>\n";
28            values[i] = multiBlogRebuilds[i][1];
29            values[i] += ":";
30            values[i] += multiBlogRebuilds[i][3];
31            values[i] += ":";
32            values[i] += multiBlogRebuilds[i][5];
33        }
34        str = "<table cellspacing='0'><tr><thead><th><MT_TRANS phrase="Weblog" escape="js"></th><th><MT_TRANS phrase="Trigger" escape="js"></th><th><MT_TRANS phrase="Action" escape="js"></th><th></th></thead></tr>\n" + str + "</table>";
35        getByID('multiblog_blog_list').innerHTML = str;
36        getByID('rebuild_triggers').value = values.join('|');
37    }
38}
39
40function removeMultiBlogTrigger(index) {
41    multiBlogRebuilds.splice(index, 1);
42    rebuildMultiBlogTriggerTable();
43}
44
45function addMultiBlogTrigger(actionName, actionValue, blogName, blogId, triggerName, triggerValue) {
46    multiBlogRebuilds[multiBlogRebuilds.length] = [actionName, actionValue, blogName, blogId, triggerName, triggerValue];
47    rebuildMultiBlogTriggerTable();
48}
49/* ]]> */
50</script>
51
52<fieldset>
53
54    <mtapp:setting
55        id="blog_content_accessible"
56        label="<__trans phrase="Content Privacy">"
57        hint="<__trans phrase="Specify whether other blogs in the installation may publish content from this blog. This setting takes precedence over the default system aggregation policy found in the system-level MultiBlog configuration.">">
58        <select name="blog_content_accessible" id="blog_content_accessible">
59            <option value="0"><MT_TRANS phrase="Use system default"></option>
60            <option value="2" <TMPL_IF NAME=BLOG_CONTENT_ACCESSIBLE_2>selected="selected"</TMPL_IF>><MT_TRANS phrase="Allow"></option>
61            <option value="1"  <TMPL_IF NAME=BLOG_CONTENT_ACCESSIBLE_1>selected="selected"</TMPL_IF>><MT_TRANS phrase="Disallow"></option>
62        </select>
63    </mtapp:setting>
64</fieldset>
65
66<fieldset>
67    <mtapp:setting
68        id="default_mtmultiblog_action"
69        label="<__trans phrase="MTMultiBlog tag default arguments">"
70        hint="<__trans phrase="Enables use of the MTMultiBlog tag without include_blogs/exclude_blogs attributes. Comma-separated BlogIDs or 'all' (include_blogs only) are acceptable values.">">
71    <select name="default_mtmultiblog_action" id="default_mtmultiblog_action">
72        <option value="1" <TMPL_IF NAME=DEFAULT_MTMULTIBLOG_ACTION_1>selected="selected"</TMPL_IF>><MT_TRANS phrase="Include blogs"></option>
73        <option value="0"  <TMPL_IF NAME=DEFAULT_MTMULTIBLOG_ACTION_0>selected="selected"</TMPL_IF>><MT_TRANS phrase="Exclude blogs"></option>
74    </select>
75    <input name="default_mtmulitblog_blogs" type="text" value="<TMPL_VAR NAME=DEFAULT_MTMULITBLOG_BLOGS>" />
76    </mtapp:setting>
77</fieldset>
78
79<fieldset>
80
81<mtapp:setting
82    id="rebuild_triggers"
83    label="<__trans phrase="Rebuild Triggers">"
84    label_class="top-label"
85    hint=""
86    show_hint="0">
87    <p><a href="javascript:void(0)" onclick="return openDialog(this.form, 'multiblog_add_trigger', 'blog_id=<mt:var name="blog_id">')" class="icon-left icon-create"><__trans phrase="Create Rebuild Trigger"></a></p>
88
89    <TMPL_UNLESS NAME=REBUILDS_LOOP>
90    <em id="multiblog_blog_list_zero_state"><MT_TRANS phrase="You have not defined any rebuild triggers."></em>
91    </TMPL_UNLESS>
92    <div id="multiblog_blog_list" class="listing hide_actions<mt:unless name="rebuilds_loop"> hidden</mt:unless>">
93    </div>
94
95    <input type="hidden" name="rebuild_triggers" id="rebuild_triggers" value="<TMPL_VAR NAME=REBUILD_TRIGGERS>" />
96    <input type="hidden" name="old_rebuild_triggers" id="old_rebuild_triggers" value="<TMPL_VAR NAME=REBUILD_TRIGGERS>" />
97</mtapp:setting>
98
99</fieldset>
100
101<TMPL_IF NAME=REBUILDS_LOOP>
102<script type="text/javascript">
103<!--
104rebuildMultiBlogTriggerTable();
105// -->
106</script>
107</TMPL_IF>
Note: See TracBrowser for help on using the browser.