initial check-in

This commit is contained in:
Robert Gaggl 2002-03-27 11:27:04 +00:00
parent d3b1047e16
commit 3a6e80c7fb
5 changed files with 218 additions and 0 deletions

View file

@ -0,0 +1,21 @@
alter table WEBLOG add column LASTOFFLINE datetime null after LASTUPDATE;
alter table WEBLOG add column LASTBLOCKWARN datetime null after LASTOFFLINE;
alter table WEBLOG add column LASTDELWARN datetime null after LASTBLOCKWARN;
alter table WEBLOG add column ISTRUSTED tinyint(1) null after ISBLOCKED;
alter table USER add column ISTRUSTED tinyint(1) null after ISBLOCKED;
alter table USER add column ISSYSADMIN tinyint(1) null after ISTRUSTED;
create table SYSLOG
(
ID mediumint(9) not null,
TYPE tinytext null,
OBJECT tinytext null,
LOGMESSAGE mediumtext null,
SYSADMIN_ID mediumint(9) null,
CREATETIME datetime null,
primary key (ID)
)
# set LASTOFFLINE-Timestamp of weblogs
update WEBLOG set LASTOFFLINE = LASTUPDATE where ISONLINE = 0 AND LASTUPDATE is not null AND LASTOFFLINE is null;
update WEBLOG set LASTOFFLINE = CREATETIME where ISONLINE = 0 AND LASTOFFLINE is null;

View file

@ -0,0 +1,13 @@
<form method="post" action="<% response.action %>#<% this.alias %>">
<input type="hidden" name="item" value="<% this.alias %>">
<input type="hidden" name="page" value="<% request.page %>">
<tr>
<td colspan=4 class="highlight" valign="top"><p><b>Warning!</b> You're about to delete the above weblog. Please mind that this is an irreversible process, and any asset of this weblog will be deleted. Just to remind you: <% this.alias %> currently contains <b><% this.sysmgr_count what="stories" %> stories</b> with <b><% this.sysmgr_count what="comments" %> comments</b>, <b><% this.sysmgr_count what="images" %> images</b> and <b><% this.sysmgr_count what="goodies" %> goodies</b>. Also all the subscriptions to this weblog will be removed.</p>
<p><b>Are you sure you want to delete this weblog?</b></p>
<p><% this.input type="button" name="remove" value="yes" %>&nbsp;&nbsp;<% this.input type="button" name="cancel" value="&nbsp;no&nbsp;" %></p></td>
</tr>
<tr>
<td colspan=4 height=5 nowrap></form></td>
</tr>

View file

@ -0,0 +1,29 @@
<form method="post" action="<% response.action %>#<% this.alias %>">
<input type="hidden" name="item" value="<% request.item %>">
<input type="hidden" name="page" value="<% request.page %>">
<tr>
<td valign="top" class="small" nowrap><% this.sysmgr_count what="stories" suffix="&nbsp;stories<br>" %>
<% this.sysmgr_count what="comments" suffix="&nbsp;comments<br>" %>
<% this.sysmgr_count what="images" suffix="&nbsp;images<br>" %>
<% this.sysmgr_count what="goodies" suffix="&nbsp;goodies<br>" %></td>
<td width=10 nowrap><% image name="/pixel" width=10 %></td>
<td colspan=2 nowrap><table border=0 class="highlight">
<tr>
<td nowrap>trusted:</td>
<td nowrap><% this.sysmgr_trusted as="editor" %></td>
</tr>
<tr>
<td nowrap>blocked:</td>
<td nowrap><% this.sysmgr_blocked as="editor" %></td>
</tr>
<tr>
<td nowrap></td>
<td nowrap><% this.input type="button" name="save" value="save" %>&nbsp;<% this.input type="button" name="cancel" value="cancel" %></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan=4 height=5 nowrap></form></td>
</tr>

View file

@ -0,0 +1,20 @@
<tr>
<td colspan=4 height=1 background="<% imageurl name="/dot" %>" nowrap><a name="<% this.alias %>"></a><% image name="/pixel" height="1" %></td>
</tr>
<tr>
<td colspan=4 nowrap><% this.sysmgr_statusflags %></td>
</tr>
<tr>
<td width=390 valign="top" nowrap><b><% this.title linkto="main" suffix="<br>" %></b>
<% this.tagline suffix="<br>" %>
<a href="<% this.url %>"><% this.url %></a></td>
<td width=10 nowrap><% image name="/pixel" width=10 %></td>
<td width=200 valign="top" class="small" nowrap>creator:&nbsp;<% this.sysmgr_creator %><br>
created:&nbsp;<% this.createtime format="dd.MM.yyyy HH:mm" %><br>
last update:&nbsp;<% this.lastupdate format="dd.MM.yyyy HH:mm" %></td>
<td width=80 class="small" valign="top" align=right nowrap><% this.sysmgr_editlink prefix="...&nbsp;" %><br>
<% this.sysmgr_deletelink prefix="...&nbsp;" %></td>
</tr>
<tr>
<td colspan=4 height=5 nowrap><% image name=pixel height=5 %></td>
</tr>

135
code/Site/sysmgr_macros.js Normal file
View file

@ -0,0 +1,135 @@
/**
* macro counts
*/
function sysmgr_count_macro(param) {
if (!param || !param.what)
return;
// this macro is allowed just for sysadmins
if (!user.isSysAdmin())
return;
res.write(param.prefix);
if (param.what == "stories")
res.write(this.allstories.size());
else if (param.what == "comments")
res.write(this.allcontent.size() - this.allstories.size());
else if (param.what == "images")
res.write(this.images.size());
else if (param.what == "goodies")
res.write(this.goodies.size());
res.write(param.suffix);
}
/**
* function renders the statusflags for this weblog
*/
function sysmgr_statusflags_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin())
return;
res.write(param.prefix);
if (this.isTrusted())
res.write("<span class=\"flagltgreen\" nowrap>TRUSTED</span>");
if (!parseInt(this.online))
res.write("<span class=\"flagred\" nowrap>PRIVATE</span>");
else
res.write("<span class=\"flagdkgreen\" nowrap>PUBLIC</span>");
if (this.isBlocked())
res.write("<span class=\"flagblack\" nowrap>BLOCKED</span>");
res.write(param.suffix);
}
/**
* function renders an edit-link
*/
function sysmgr_editlink_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin() || req.data.item == this.alias)
return;
res.write(param.prefix);
var linkParam = new Object();
linkParam.linkto = "weblogs";
linkParam.urlparam = "?item=" + this.alias;
linkParam.urlparam += "&action=edit";
if (req.data.page)
linkParam.urlparam += "&page=" + req.data.page;
linkParam.urlparam += "#" + this.alias;
root.manage.openLink(linkParam);
res.write(param.text ? param.text : "edit");
this.closeLink();
res.write(param.suffix);
}
/**
* function renders a delete-link
*/
function sysmgr_deletelink_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin() || req.data.item == this.alias)
return;
res.write(param.prefix);
var linkParam = new Object();
linkParam.linkto = "weblogs";
linkParam.urlparam = "?item=" + this.alias;
linkParam.urlparam += "&action=remove";
if (req.data.page)
linkParam.urlparam += "&page=" + req.data.page;
linkParam.urlparam += "#" + this.alias;
root.manage.openLink(linkParam);
res.write(param.text ? param.text : "delete");
this.closeLink();
res.write(param.suffix);
}
/**
* macro renders the name of the creator of this
* weblog as link
*/
function sysmgr_creator_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin())
return;
res.write(param.prefix);
res.write(this.creator.name);
res.write(param.suffix);
}
/**
* macro renders the trust-state of this weblog
*/
function sysmgr_trusted_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin())
return;
res.write(param.prefix);
if (param.as == "editor") {
var options = new Array("no","yes");
var selectedIndex = parseInt(this.trusted,10);
res.write(simpleDropDownBox("trusted",options,selectedIndex));
} else
res.write(this.isTrusted() ? "yes" : "no");
res.write(param.suffix);
}
/**
* macro renders the block-state of this weblog
*/
function sysmgr_blocked_macro(param) {
// this macro is allowed just for sysadmins
if (!user.isSysAdmin())
return;
res.write(param.prefix);
if (param.as == "editor") {
var options = new Array("no","yes");
var selectedIndex = parseInt(this.blocked,10);
res.write(simpleDropDownBox("blocked",options,selectedIndex));
} else
res.write(this.isBlocked() ? "yes" : "no");
res.write(param.suffix);
}