/*
- * $Id$
- * Copyright 2005 - 2009 The Citadel Team
+ * Copyright 2005 - 2010 The Citadel Team
* Licensed under the GPL V3
*
* JavaScript function library for WebCit.
- *
*/
}
}
-function fixMissingCSSTable(elems) {
- if (elems[0] == null || elems[1] == null) {
- return;
- }
- if (elems[0].getStyle("display") != "table-cell") {
- var parentNode = elems[0].parentNode;
- var table = document.createElement("table");
- table.style.width = "100%";
- var tbody = document.createElement("tbody");
- table.appendChild(tbody);
- var tr = document.createElement("tr");
- tbody.appendChild(tr);
- parentNode.appendChild(table);
- for(var i=0; i<elems.length; i++) {
- parentNode.removeChild(elems[i]);
- var td = document.createElement("td");
- td.appendChild(elems[i]);
- tr.appendChild(td);
- }
- }
-}
-
-
function RefreshSMTPqueueDisplay() {
new Ajax.Updater('smtpqueue_inner_div',
'display_smtpqueue_inner_div', { method: 'get',
}
);
}
+
+
+function ConfirmLogoff() {
+ new Ajax.Updater(
+ 'md-content',
+ 'do_template?template=confirmlogoff',
+ {
+ method: 'get',
+ onSuccess: function(cl_success) {
+ toggleModal(1);
+ }
+ }
+ );
+}
+
+
+/*
+ * Wrapper script to require logging in before completing an action
+ */
+function GetLoggedInFirst(destination_url) {
+
+ /* If logged in already, go directly to the destination. */
+ /* FIXME implement this */
+
+ /* If not logged in, go modal and ask the user to log in first. */
+ p = 'do_template?template=get_logged_in?destination_url=' + destination_url;
+ new Ajax.Updater(
+ 'md-content',
+ p,
+ {
+ method: 'get',
+ onSuccess: function(cl_success) {
+ toggleModal(1);
+ }
+ }
+ );
+}