* Fixed reference to parent site in Archive

* Fixed _children.filter in Archive
 * Added missing permission checks
 * Modified global defineConstants() method to return the getter function instead of automatically defining it with given argument
 * Added HopObject.macro_macro() method to display userland macro code
 * Removed colorpicker (will be replaced by third-party library)
 * Removed obsolete global constants and functions
 * Overhauled and tested global userland macros like story_macro(), image_macro() etc.
 * Implemented global list_macro() to replace any special listFoobar_macro() methods
 * Moved global autoLogin() method into User prototype
 * Overhauled global randomize_macro()
 * Renamed global evalURL() method to validateUrl() as well as evalEmail() to validateEmail()
 * Re-added accidentally removed subskins to Members.skin
 * Fixed some skin names which were changed recently
 * Remove delete_action() from Membership
 * Fixed foreign key of images collection in Membership
 * Removed global username_macro() and replaced it with appropriate membership macros
 * Moved contents of systemscripts.skin into javascript.skin in Root prototype
 * Removed main_css_action(), main_js_action() and sitecounter_macro() methods from Root
 * Added accessname to sites collection in Root
 * Upgraded jQuery to version 1.2.1
 * Replaced call for global history_macro() with corresponding list_macro() call
 * Renamed "public" collection of Stories prototype to "featured"
 * Moved a lot of styles from Root's style.skin to the one in Site
 * Added comments collection to Site
 * Moved embed.skin as subskin #embed into Site.skin
 * Fixed some minor issues in Story.js (removed check for creator before setting the story's mode)
 * Defined cookie names as constants of User which can be overriden via app.properties userCookie and hashCookie
 * Moved a lot of code into compatibility module
This commit is contained in:
Tobi Schäfer 2007-10-11 23:03:17 +00:00
parent ded7f5fcea
commit df9017ab77
38 changed files with 1154 additions and 1736 deletions

View file

@ -46,9 +46,9 @@ HopObject.prototype.onRequest = function() {
}
}
autoLogin();
User.autoLogin();
res.handlers.membership = User.getMembership();
if (User.getStatus() === User.BLOCKED) {
if (User.getCurrentStatus() === User.BLOCKED) {
session.logout();
res.message = new Error(gettext("Sorry, your account has been disabled. Please contact the maintainer of this site for further information."));
res.redirect(root.href());
@ -114,15 +114,6 @@ res.abort(); */
return;
};
HopObject.prototype.onUnhandledMacro = function(name) {
return;
switch (name) {
default:
return this[name];
}
};
HopObject.prototype.touch = function() {
return this.map({
modified: new Date,
@ -205,6 +196,24 @@ HopObject.prototype.upload_macro = function(param, name) {
return;
};
HopObject.prototype.macro_macro = function(param, handler) {
var ctor = this.constructor;
if ([Story, Image, File, Poll].indexOf(ctor) > -1) {
var quote = function(str) {
if (/\s/.test(str)) {
str = '"' + str + '"';
}
return str;
};
res.encode("<% ");
res.write(handler || ctor.name.toLowerCase());
res.write(String.SPACE);
res.write(quote(this.name) || this._id);
res.encode(" %>");
}
return;
};
HopObject.prototype.getFormValue = function(name) {
if (req.isPost()) {
return req.postParams[name];
@ -327,7 +336,7 @@ HopObject.getFromPath = function(name, collection) {
} else {
site = res.handlers.site;
}
if (site) {
if (site && site.getPermission("main")) {
return site[collection].get(name);
}
return null;