-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
-"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
-<erl>\r
- out(A) ->\r
- {header, {content_type,\r
- case string:str((A#arg.headers)#headers.user_agent, "MSIE") of\r
- 0 -> "text/html"; %"application/xhtml+xml"; % TODO : jquery.lightbox does not support application/xhtml+xml\r
- _ -> "text/html"\r
- end\r
- }}.\r
-</erl>\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
+<!DOCTYPE html>\r
+<html>\r
<head>\r
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
<title>euphorik.ch</title>\r
<p>\r
<select id="menuCss">\r
<erl>\r
- % parse les styles disponible\r
+ % Parse the available styles.\r
out(A) ->\r
Styles_dir = A#arg.docroot ++ "/styles",\r
{ok, Liste_dir} = file:list_dir(Styles_dir),\r
String.prototype.rtrim = function() {
return this.replace(/\s+$/, "");
};
-
-/**
- * (Not use for the moment)
- * See : http://www.coolpage.com/developer/javascript/Correct%20OOP%20for%20Javascript.html
- *
- * Example :
- *
- * function Mammal(name) {
- * this.name = name;
- * }
- *
- * Cat.Inherits(Mammal);
- * function Cat(name) {
- * this.Super(Mammal, name);
- * }
- */
-/*Object.prototype.Super = function(parent) {
- if(arguments.length > 1) {
- parent.apply( this, Array.prototype.slice.call( arguments, 1 ) );
- } else {
- parent.call( this );
- }
-}
-Function.prototype.Inherits = function(parent) {
- this.prototype = new parent();
- this.prototype.constructor = this;
-}*/
create() ->\r
mnesia:stop(),\r
mnesia:delete_schema([node()]),\r
- mnesia:create_schema([node()]), % nécessaire pour les tables sur disc\r
+ mnesia:create_schema([node()]), % Needed for tables on disk.\r
mnesia:start(),\r
create_tables(),\r
reset().\r
mnesia:clear_table(minichat),\r
mnesia:clear_table(troll),\r
mnesia:clear_table(ip_table),\r
- % Create the root user.\r
+ % Create the root user and write the current database version.\r
mnesia:transaction(fun() ->\r
mnesia:write(#proprietes{nom = version, valeur = ?DB_VERSION}),\r
User = #user{id = 0, profile = #profile{pseudo = "Sys"}, login = "Sys", date_creation = erlang:timestamp(), date_derniere_connexion = erlang:timestamp(), ek_master = true},\r
#uri{host = Host, path = Path}.
build() ->
- % Create the directory "var/database" if it doesn't exist.
- {ok, Files_in_root} = file:list_dir("."),
- Var_exists = lists:any(fun(Name) -> Name =:= "var" end, Files_in_root),
- if not Var_exists ->
- file:make_dir("var");
- true -> ok
- end,
- {ok, Files_in_var} = file:list_dir("var"),
- Database_exists = lists:any(fun(Name) -> Name =:= "database" end, Files_in_var),
- if not Database_exists ->
- file:make_dir("var/database");
- true -> ok
- end,
% Build all the Erlang modules.
cmd("make", [], "modules").
main([Node_name]) when Node_name =:= "yaws"; Node_name =:= "yaws_dev" ->
Node = list_to_atom(Node_name ++ atom_to_list(hote())),
net_kernel:start([flynux, shortnames]),
- io:format("rechargement des modules..~n"),
+ io:format("reloading modules...~n"),
rpc:call(Node, euphorik_daemon, reload_euphorik, []),
if Node_name =:= "yaws_dev" -> copy_database(Node);
true -> true
end,
- io:format("mise à jour de la BD..~n"),
+ io:format("updating database...~n"),
rpc:call(Node, euphorik_bd_admin, update, []);
main(_) ->
io:format("Usage: update_server.erl <node-name>"),
halt(1).
+create_database_directory() ->
+ % Create the directory "var/database" if it doesn't exist.
+ {ok, Files_in_root} = file:list_dir("."),
+ Var_exists = lists:any(fun(Name) -> Name =:= "var" end, Files_in_root),
+ if not Var_exists ->
+ file:make_dir("var");
+ true -> ok
+ end,
+ {ok, Files_in_var} = file:list_dir("var"),
+ Database_exists = lists:any(fun(Name) -> Name =:= "database" end, Files_in_var),
+ if not Database_exists ->
+ file:make_dir("var/database");
+ true -> ok
+ end.
+
% Copy the datbase from the production to pre production.
copy_database(Node) ->
io:format("Copying production database to pre-production node~n"),