* Replaced occurrences of User.visisted with User.modified
* Set application's charset to UTF8 * Added Layout.getFile() method returning the layout's directory as helma.File * Simplified Layout.getSkinPath() method (still work in progress) * Replaced occurrences of Site.language with Site.locale * Modified some wording * Added slight b/w compatibility fix in Story.macro_filter() method * Added timex factor in Story.getDelta() method to prevent counting edits as site updates in-beteen 10 minutes * Moved site-related aspect hooks to Site prototype of compatibility module * Removed obsolete conversion code in compatibility module (has moved to updater app) * Re-included spacer_macro() method in compat. module * Temporarily overwrote HopObject.renderSkin() method to debug skin rendering process * Replaced individual legacy macros of Layout prototype by appropriate code in onUnhandledMacro() method (compat.) * Reflect legacy macros of Layout prototype in value() method of compat. module * Added and improved compatibility methods * Implemented support for renamed prototypes in updater app (still needs to be applied for database, too)
This commit is contained in:
parent
1df1c87525
commit
aa11e5db88
23 changed files with 578 additions and 650 deletions
|
@ -146,11 +146,11 @@ convert.xml = function(table) {
|
|||
var metadata = function(xml) {
|
||||
var clean = xml.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g, "");
|
||||
try {
|
||||
return Xml.readFromString(clean).toSource();
|
||||
return Xml.readFromString(clean);
|
||||
} catch (ex) {
|
||||
app.debug(xml);
|
||||
app.debug(ex);
|
||||
}
|
||||
return {}.toSource();
|
||||
return {};
|
||||
};
|
||||
|
||||
retrieve(sql("jsonize", table));
|
||||
|
@ -160,7 +160,7 @@ convert.xml = function(table) {
|
|||
}
|
||||
var data = metadata(this.xml);
|
||||
execute("update " + table + " set metadata = " +
|
||||
quote(data) + " where id = " + this.id);
|
||||
quote(data.toSource()) + " where id = " + this.id);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -193,11 +193,39 @@ convert.tags = function(table) {
|
|||
}
|
||||
|
||||
convert.skins = function() {
|
||||
var rename = function(prototype) {
|
||||
switch (prototype) {
|
||||
case "Day":
|
||||
return "Archive";
|
||||
case "LayoutImage":
|
||||
return "Image";
|
||||
case "LayoutImageMgr":
|
||||
return "Images";
|
||||
case "RootLayoutMgr":
|
||||
return "Layouts";
|
||||
case "StoryMgr":
|
||||
return "Stories";
|
||||
case "SysMgr":
|
||||
return "Admin";
|
||||
case "SysLog":
|
||||
return "LogEntry";
|
||||
case "Topic":
|
||||
return "Tag";
|
||||
case "TopicMgr":
|
||||
return "Tags";
|
||||
default:
|
||||
if (prototype.lastIndexOf("Mgr") > 0) {
|
||||
return prototype.substr(0, prototype.length - 3) + "s";
|
||||
}
|
||||
return prototype;
|
||||
}
|
||||
}
|
||||
|
||||
var dump = function(sql) {
|
||||
retrieve(sql);
|
||||
traverse(function() {
|
||||
var fpath = app.dir + "/../static/" + this.site_name +
|
||||
"/layouts/" + this.name + "/" + this["prototype"];
|
||||
"/layouts/" + this.name + "/" + rename(this["prototype"]);
|
||||
var file = new java.io.File(fpath);
|
||||
file.mkdirs();
|
||||
file = new java.io.File(file,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue