diff --git a/Makefile b/Makefile index d74da9a..f0791c8 100755 --- a/Makefile +++ b/Makefile @@ -1,12 +1,17 @@ # Makefile for GNU make +ifndef CXX CXX = g++ -CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -CXXFLAGSMAIN = -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/ezc/src -L/usr/local/lib +endif + +ifndef CXXFLAGS +CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER +endif + export CXX export CXXFLAGS -export CXXFLAGSMAIN + all: winix @@ -21,7 +26,7 @@ winix: FORCE $(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o content/*.o templates/*.o templatesnotify/*.o confparser/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz @cd main ; $(MAKE) -e # use the full path with winix.so - $(CXX) -o winix $(CXXFLAGSMAIN) main/*.o /home/tomek/roboczy/winix/winix.so + $(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so clean: diff --git a/content/Makefile.dep b/content/Makefile.dep index 6cc68e8..db47dc6 100755 --- a/content/Makefile.dep +++ b/content/Makefile.dep @@ -28,7 +28,7 @@ content.o: ../core/db.h ../core/group.h ../core/dircontainer.h content.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h content.o: ../core/users.h ../core/groups.h ../core/functions.h content.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -content.o: ../core/locale.h ../core/loadavg.h ../core/misc.h ../core/plugin.h +content.o: ../core/loadavg.h ../core/misc.h ../core/plugin.h content.o: ../core/request.h ../core/data.h ../core/pluginmsg.h createthread.o: content.h ../core/item.h ../templates/templates.h createthread.o: ../templates/patterncacher.h ../templates/misc.h @@ -46,7 +46,7 @@ createthread.o: ../core/db.h ../core/group.h ../core/dircontainer.h createthread.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h createthread.o: ../core/dirs.h ../core/users.h ../core/groups.h createthread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -createthread.o: ../core/mount.h ../core/locale.h ../core/loadavg.h +createthread.o: ../core/mount.h ../core/loadavg.h createticket.o: content.h ../core/item.h ../templates/templates.h createticket.o: ../templates/patterncacher.h ../templates/misc.h createticket.o: ../templates/localefilter.h ../core/locale.h @@ -63,7 +63,7 @@ createticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h createticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h createticket.o: ../core/dirs.h ../core/users.h ../core/groups.h createticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -createticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h +createticket.o: ../core/mount.h ../core/loadavg.h default.o: content.h ../core/item.h ../templates/templates.h default.o: ../templates/patterncacher.h ../templates/misc.h default.o: ../templates/localefilter.h ../core/locale.h @@ -80,7 +80,7 @@ default.o: ../core/db.h ../core/group.h ../core/dircontainer.h default.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h default.o: ../core/users.h ../core/groups.h ../core/functions.h default.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -default.o: ../core/locale.h ../core/loadavg.h +default.o: ../core/loadavg.h editticket.o: content.h ../core/item.h ../templates/templates.h editticket.o: ../templates/patterncacher.h ../templates/misc.h editticket.o: ../templates/localefilter.h ../core/locale.h @@ -97,7 +97,7 @@ editticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h editticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h editticket.o: ../core/dirs.h ../core/users.h ../core/groups.h editticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -editticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h +editticket.o: ../core/mount.h ../core/loadavg.h emacs.o: content.h ../core/item.h ../templates/templates.h emacs.o: ../templates/patterncacher.h ../templates/misc.h emacs.o: ../templates/localefilter.h ../core/locale.h @@ -113,9 +113,9 @@ emacs.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h emacs.o: ../core/db.h ../core/group.h ../core/dircontainer.h emacs.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h emacs.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h -emacs.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h -emacs.o: ../core/notify.h ../templatesnotify/templatesnotify.h -emacs.o: ../core/mount.h ../templates/misc.h ../core/misc.h +emacs.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/notify.h +emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h +emacs.o: ../templates/misc.h ../core/misc.h last.o: content.h ../core/item.h ../templates/templates.h last.o: ../templates/patterncacher.h ../templates/misc.h last.o: ../templates/localefilter.h ../core/locale.h @@ -137,7 +137,7 @@ login.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h login.o: ../core/db.h ../core/group.h ../core/dircontainer.h login.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h login.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h -login.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h +login.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h logout.o: content.h ../core/item.h ../templates/templates.h logout.o: ../templates/patterncacher.h ../templates/misc.h logout.o: ../templates/localefilter.h ../core/locale.h @@ -153,7 +153,7 @@ logout.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h logout.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h logout.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h logout.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -logout.o: ../core/mount.h ../core/locale.h ../core/loadavg.h +logout.o: ../core/mount.h ../core/loadavg.h ls.o: content.h ../core/item.h ../templates/templates.h ls.o: ../templates/patterncacher.h ../templates/misc.h ls.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h @@ -197,8 +197,7 @@ misc_specialfile.o: ../core/ticket.h ../core/data.h ../core/dirs.h misc_specialfile.o: ../core/dircontainer.h ../core/users.h misc_specialfile.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h misc_specialfile.o: ../core/functions.h ../core/lastcontainer.h -misc_specialfile.o: ../core/mounts.h ../core/mount.h ../core/locale.h -misc_specialfile.o: ../core/loadavg.h +misc_specialfile.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h mkdir.o: content.h ../core/item.h ../templates/templates.h mkdir.o: ../templates/patterncacher.h ../templates/misc.h mkdir.o: ../templates/localefilter.h ../core/locale.h @@ -214,9 +213,9 @@ mkdir.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h mkdir.o: ../core/db.h ../core/group.h ../core/dircontainer.h mkdir.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h mkdir.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h -mkdir.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h -mkdir.o: ../core/notify.h ../templatesnotify/templatesnotify.h -mkdir.o: ../core/mount.h ../templates/misc.h +mkdir.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/notify.h +mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h +mkdir.o: ../templates/misc.h node.o: content.h ../core/item.h ../templates/templates.h node.o: ../templates/patterncacher.h ../templates/misc.h node.o: ../templates/localefilter.h ../core/locale.h @@ -244,7 +243,7 @@ priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h -priv.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h +priv.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h reload.o: content.h ../core/item.h ../templates/templates.h reload.o: ../templates/patterncacher.h ../templates/misc.h reload.o: ../templates/localefilter.h ../core/locale.h @@ -273,7 +272,7 @@ rm.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h ../core/db.h rm.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h rm.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h rm.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -rm.o: ../core/mount.h ../core/locale.h ../core/loadavg.h +rm.o: ../core/mount.h ../core/loadavg.h run.o: content.h ../core/item.h ../templates/templates.h run.o: ../templates/patterncacher.h ../templates/misc.h run.o: ../templates/localefilter.h ../core/locale.h @@ -301,7 +300,7 @@ thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h thread.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h thread.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h thread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -thread.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/mount.h +thread.o: ../core/mount.h ../core/loadavg.h ../core/mount.h ticket.o: content.h ../core/item.h ../templates/templates.h ticket.o: ../templates/patterncacher.h ../templates/misc.h ticket.o: ../templates/localefilter.h ../core/locale.h @@ -317,7 +316,7 @@ ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h ticket.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h ticket.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h ticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -ticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/mount.h +ticket.o: ../core/mount.h ../core/loadavg.h ../core/mount.h upload.o: content.h ../core/item.h ../templates/templates.h upload.o: ../templates/patterncacher.h ../templates/misc.h upload.o: ../templates/localefilter.h ../core/locale.h @@ -333,7 +332,7 @@ upload.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h upload.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h upload.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h upload.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -upload.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/misc.h +upload.o: ../core/mount.h ../core/loadavg.h ../core/misc.h who.o: content.h ../core/item.h ../templates/templates.h who.o: ../templates/patterncacher.h ../templates/misc.h who.o: ../templates/localefilter.h ../core/locale.h diff --git a/content/misc_item.cpp b/content/misc_item.cpp index 1b47fd9..3b2fb14 100755 --- a/content/misc_item.cpp +++ b/content/misc_item.cpp @@ -59,7 +59,7 @@ return with_url; void Content::ReadItemContentWithType(Item & item) { item.content_type = Item::ct_formatted_text; // default is formatted text - request.PostVar("content", request.item.content); + request.PostVar("itemcontent", request.item.content); request.PostVar("contenttype", temp); // ct_text and ct_formatted_text can use everyone diff --git a/core/Makefile.dep b/core/Makefile.dep index ba69364..ca47d24 100755 --- a/core/Makefile.dep +++ b/core/Makefile.dep @@ -5,14 +5,13 @@ compress.o: compress.h log.h config.o: config.h ../confparser/confparser.h log.h data.h dirs.h item.h config.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h config.o: functions.h function.h lastcontainer.h mounts.h mount.h error.h -config.o: rebus.h locale.h loadavg.h plugin.h request.h requesttypes.h -config.o: session.h done.h thread.h compress.h acceptencodingparser.h +config.o: rebus.h loadavg.h plugin.h request.h requesttypes.h session.h +config.o: done.h thread.h compress.h acceptencodingparser.h config.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h config.o: pluginmsg.h misc.h data.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h data.o: log.h groups.h group.h functions.h function.h lastcontainer.h -data.o: mounts.h mount.h error.h rebus.h locale.h ../confparser/confparser.h -data.o: loadavg.h +data.o: mounts.h mount.h error.h rebus.h loadavg.h db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h db.o: ugcontainer.h ticket.h misc.h db_itemcolumns.o: db.h item.h user.h group.h thread.h error.h log.h @@ -20,8 +19,7 @@ db_itemcolumns.o: dircontainer.h ugcontainer.h ticket.h dircontainer.o: dircontainer.h item.h log.h dirs.o: dirs.h item.h dircontainer.h error.h log.h db.h user.h group.h dirs.o: thread.h ugcontainer.h ticket.h data.h users.h groups.h functions.h -dirs.o: function.h lastcontainer.h mounts.h mount.h rebus.h locale.h -dirs.o: ../confparser/confparser.h loadavg.h +dirs.o: function.h lastcontainer.h mounts.h mount.h rebus.h loadavg.h done.o: done.h error.o: error.h log.h function.o: function.h item.h @@ -29,10 +27,9 @@ functioncodeparser.o: functioncodeparser.h item.h function.h log.h functionparser.o: functionparser.h requesttypes.h log.h item.h error.h data.h functionparser.o: dirs.h dircontainer.h users.h user.h ugcontainer.h groups.h functionparser.o: group.h functions.h function.h lastcontainer.h mounts.h -functionparser.o: mount.h rebus.h locale.h ../confparser/confparser.h -functionparser.o: loadavg.h db.h thread.h ticket.h request.h session.h done.h -functionparser.o: compress.h acceptencodingparser.h acceptbaseparser.h -functionparser.o: htmlfilter.h postmultiparser.h +functionparser.o: mount.h rebus.h loadavg.h db.h thread.h ticket.h request.h +functionparser.o: session.h done.h compress.h acceptencodingparser.h +functionparser.o: acceptbaseparser.h htmlfilter.h postmultiparser.h functions.o: functions.h function.h item.h groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h groups.o: error.h dircontainer.h ticket.h @@ -44,39 +41,36 @@ locale.o: locale.h ../confparser/confparser.h log.h log.o: log.h misc.o: misc.h item.h log.h data.h dirs.h dircontainer.h users.h user.h misc.o: ugcontainer.h groups.h group.h functions.h function.h lastcontainer.h -misc.o: mounts.h mount.h error.h rebus.h locale.h ../confparser/confparser.h -misc.o: loadavg.h +misc.o: mounts.h mount.h error.h rebus.h loadavg.h mount.o: mount.h mountparser.o: mountparser.h mount.h item.h error.h log.h data.h dirs.h mountparser.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h mountparser.o: functions.h function.h lastcontainer.h mounts.h rebus.h -mountparser.o: locale.h ../confparser/confparser.h loadavg.h misc.h +mountparser.o: loadavg.h misc.h mounts.o: mounts.h mount.h error.h log.h data.h dirs.h item.h dircontainer.h mounts.o: users.h user.h ugcontainer.h groups.h group.h functions.h -mounts.o: function.h lastcontainer.h rebus.h locale.h -mounts.o: ../confparser/confparser.h loadavg.h request.h requesttypes.h -mounts.o: session.h done.h thread.h compress.h acceptencodingparser.h -mounts.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h -mounts.o: mountparser.h db.h +mounts.o: function.h lastcontainer.h rebus.h loadavg.h request.h +mounts.o: requesttypes.h session.h done.h thread.h compress.h +mounts.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h +mounts.o: postmultiparser.h ticket.h mountparser.h db.h notify.o: log.h notify.h ../templatesnotify/templatesnotify.h ../core/mount.h notify.o: ../core/locale.h ../confparser/confparser.h ../templates/misc.h notify.o: ../templates/localefilter.h data.h dirs.h item.h dircontainer.h notify.o: users.h user.h ugcontainer.h groups.h group.h functions.h notify.o: function.h lastcontainer.h mounts.h mount.h error.h rebus.h -notify.o: locale.h loadavg.h misc.h request.h requesttypes.h session.h done.h -notify.o: thread.h compress.h acceptencodingparser.h acceptbaseparser.h -notify.o: htmlfilter.h postmultiparser.h ticket.h +notify.o: loadavg.h misc.h request.h requesttypes.h session.h done.h thread.h +notify.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h +notify.o: postmultiparser.h ticket.h plugin.o: plugin.h request.h requesttypes.h session.h done.h item.h error.h plugin.o: log.h user.h rebus.h function.h thread.h compress.h plugin.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h plugin.o: postmultiparser.h ticket.h data.h dirs.h dircontainer.h users.h plugin.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h mounts.h -plugin.o: mount.h locale.h ../confparser/confparser.h loadavg.h pluginmsg.h +plugin.o: mount.h loadavg.h pluginmsg.h postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h data.h postmultiparser.o: dirs.h item.h dircontainer.h users.h user.h ugcontainer.h postmultiparser.o: groups.h group.h functions.h function.h lastcontainer.h -postmultiparser.o: mounts.h mount.h rebus.h locale.h -postmultiparser.o: ../confparser/confparser.h loadavg.h +postmultiparser.o: mounts.h mount.h rebus.h loadavg.h rebus.o: log.h rebus.h misc.h item.h request.o: request.h requesttypes.h session.h done.h item.h error.h log.h request.o: user.h rebus.h function.h thread.h compress.h @@ -84,43 +78,39 @@ request.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h request.o: postmultiparser.h ticket.h getparser.h httpsimpleparser.h request.o: postparser.h cookieparser.h data.h dirs.h dircontainer.h users.h request.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h -request.o: mounts.h mount.h locale.h ../confparser/confparser.h loadavg.h -request.o: plugin.h pluginmsg.h misc.h db.h +request.o: mounts.h mount.h loadavg.h plugin.h pluginmsg.h misc.h db.h requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h requestcontroller.o: ../templates/templates.h ../templates/patterncacher.h requestcontroller.o: misc.h item.h ../templates/ckeditorgetparser.h requestcontroller.o: ../core/httpsimpleparser.h ../core/log.h +requestcontroller.o: ../core/locale.h ../confparser/confparser.h requestcontroller.o: ../core/thread.h ../core/ticket.h ../core/done.h requestcontroller.o: sessionmanager.h sessioncontainer.h session.h done.h requestcontroller.o: error.h log.h user.h rebus.h functionparser.h requestcontroller.o: requesttypes.h data.h dirs.h dircontainer.h users.h requestcontroller.o: ugcontainer.h groups.h group.h functions.h function.h -requestcontroller.o: lastcontainer.h mounts.h mount.h locale.h -requestcontroller.o: ../confparser/confparser.h loadavg.h request.h thread.h -requestcontroller.o: compress.h acceptencodingparser.h acceptbaseparser.h -requestcontroller.o: htmlfilter.h postmultiparser.h ticket.h postparser.h -requestcontroller.o: httpsimpleparser.h cookieparser.h notify.h -requestcontroller.o: ../templatesnotify/templatesnotify.h ../core/mount.h -requestcontroller.o: ../core/locale.h ../templates/misc.h +requestcontroller.o: lastcontainer.h mounts.h mount.h loadavg.h request.h +requestcontroller.o: thread.h compress.h acceptencodingparser.h +requestcontroller.o: acceptbaseparser.h htmlfilter.h postmultiparser.h +requestcontroller.o: ticket.h postparser.h httpsimpleparser.h cookieparser.h +requestcontroller.o: notify.h ../templatesnotify/templatesnotify.h +requestcontroller.o: ../core/mount.h ../templates/misc.h requestcontroller.o: ../templates/localefilter.h session.o: session.h done.h item.h error.h log.h user.h rebus.h sessioncontainer.o: sessioncontainer.h session.h done.h item.h error.h log.h sessioncontainer.o: user.h rebus.h data.h dirs.h dircontainer.h users.h sessioncontainer.o: ugcontainer.h groups.h group.h functions.h function.h -sessioncontainer.o: lastcontainer.h mounts.h mount.h locale.h -sessioncontainer.o: ../confparser/confparser.h loadavg.h +sessioncontainer.o: lastcontainer.h mounts.h mount.h loadavg.h sessionmanager.o: sessionmanager.h sessioncontainer.h session.h done.h item.h sessionmanager.o: error.h log.h user.h rebus.h request.h requesttypes.h sessionmanager.o: function.h thread.h compress.h acceptencodingparser.h sessionmanager.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h sessionmanager.o: data.h dirs.h dircontainer.h users.h ugcontainer.h groups.h sessionmanager.o: group.h functions.h lastcontainer.h mounts.h mount.h -sessionmanager.o: locale.h ../confparser/confparser.h loadavg.h -sessionmanager.o: sessionparser.h +sessionmanager.o: loadavg.h sessionparser.h sessionparser.o: sessionparser.h session.h done.h item.h error.h log.h user.h sessionparser.o: rebus.h sessioncontainer.h data.h dirs.h dircontainer.h sessionparser.o: users.h ugcontainer.h groups.h group.h functions.h -sessionparser.o: function.h lastcontainer.h mounts.h mount.h locale.h -sessionparser.o: ../confparser/confparser.h loadavg.h +sessionparser.o: function.h lastcontainer.h mounts.h mount.h loadavg.h users.o: users.h user.h ugcontainer.h log.h db.h item.h group.h thread.h users.o: error.h dircontainer.h ticket.h diff --git a/core/config.cpp b/core/config.cpp index 41c2aea..83b43e4 100755 --- a/core/config.cpp +++ b/core/config.cpp @@ -91,6 +91,7 @@ bool Config::ReadConfig(bool errors_to_stdout_) + void Config::AssignValues() { data.log_file = Text("log_file"); @@ -151,36 +152,34 @@ void Config::AssignValues() data.locale_dir = Text("locale_dir"); data.locale_dir_default = Text("locale_dir_default"); - Locale::Lang lang = Locale::StrToLang(data.locale_str); + data.title_separator = Text("title_separator", " / "); - if( lang != Locale::lang_unknown ) - data.locale.SetLang(lang); } -const std::string & Config::Text(const char * name) +std::string Config::Text(const char * name) { return Text(std::string(name), default_str); } -const std::string & Config::Text(const char * name, const char * def) +std::string Config::Text(const char * name, const char * def) { return Text(std::string(name), std::string(def)); } -const std::string & Config::Text(const std::string & name, const std::string & def) +std::string Config::Text(const std::string & name, const std::string & def) { ConfParser::Table::iterator i = conf_parser.table.find(name); if( i == conf_parser.table.end() ) return def; - -return i->second; + +return i->second; } diff --git a/core/config.h b/core/config.h index 5a9f8d4..f8e730f 100755 --- a/core/config.h +++ b/core/config.h @@ -32,10 +32,9 @@ private: void ShowError(); void AssignValues(); - - const std::string & Text(const char *); - const std::string & Text(const char * name, const char * def); - const std::string & Text(const std::string & name, const std::string & def); + std::string Text(const char * name); + std::string Text(const char * name, const char * def); + std::string Text(const std::string & name, const std::string & def); int Int(const char *); int Int(const char * name, int def); diff --git a/core/data.h b/core/data.h index 7998586..22dbefc 100755 --- a/core/data.h +++ b/core/data.h @@ -22,7 +22,6 @@ #include "lastcontainer.h" #include "mounts.h" #include "rebus.h" -#include "locale.h" #include "loadavg.h" @@ -143,8 +142,9 @@ public: // base_url_static_auth_prefix + base_server std::string base_url_static_auth; + // separator used in html tag + std::string title_separator; - Locale locale; // end config members diff --git a/core/misc.cpp b/core/misc.cpp index d701efe..b631ca8 100755 --- a/core/misc.cpp +++ b/core/misc.cpp @@ -264,6 +264,29 @@ return out.str(); } +const char * DateToStr(int year, int month, int day) +{ +static const char * month_letter[] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" }; +static char buffer[100]; + + --month; + + if( month < 0 ) + month = 0; + + if( month > 11 ) + month = 11; + + if( year == 0 ) + sprintf(buffer, "%s %02d", month_letter[month], day); + else + sprintf(buffer, "%02d %s %02d", year, month_letter[month], day); + + // warning: not thread safe (we do not use threads) + return buffer; +} + + const char * DateToStr(int year, int month, int day, int hour, int min, int sec) { static const char * month_letter[] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" }; diff --git a/core/misc.h b/core/misc.h index c3ea832..7c6db3c 100755 --- a/core/misc.h +++ b/core/misc.h @@ -37,6 +37,7 @@ void HtmlEscapeFormTxt(std::ostringstream & out, const std::string & in); std::string HtmlEscape(const std::string & in); std::string HtmlEscapeFormTxt(const std::string & in); +const char * DateToStr(int year, int month, int day); const char * DateToStr(int year, int month, int day, int hour, int min, int sec); const char * DateToStr(tm * ptm); const char * DateToStr(time_t t); diff --git a/core/notify.cpp b/core/notify.cpp index a357baa..3ccb09f 100755 --- a/core/notify.cpp +++ b/core/notify.cpp @@ -2,7 +2,7 @@ * This file is a part of CMSLU -- Content Management System like Unix * and is not publicly distributed * - * Copyright (c) 2008-2009, Tomasz Sowa + * Copyright (c) 2008-2010, Tomasz Sowa * All rights reserved. * */ @@ -138,7 +138,10 @@ Notify::~Notify() void Notify::ReadTemplates() { - Lock(); + // we are in the first thread here + // the second thread can use our templates and we must Lock() + // (the second thread is using Lock() too) + Lock(); templates_notify.Read(); Unlock(); } @@ -241,7 +244,11 @@ Users::Iterator i; if( sending ) { n.email = i->email; - n.lang = data.locale.GetLang(); // !! bedzie osobno dla kazdego uzytkownika + n.lang = Locale::StrToLang(data.locale_str);// !! bedzie osobno dla kazdego uzytkownika + + if( n.lang == Locale::lang_unknown ) + n.lang = Locale::lang_en; + notify_pool.insert(notify_pool.end(), n); } } diff --git a/core/requestcontroller.cpp b/core/requestcontroller.cpp index c132a69..365a2e9 100755 --- a/core/requestcontroller.cpp +++ b/core/requestcontroller.cpp @@ -108,7 +108,6 @@ bool RequestController::Init() data.groups.ReadGroups(); data.functions.ReadFunctions(); data.mounts.ReadMounts(); - data.locale.Read(data.locale_dir, data.locale_dir_default); // call it before content.Init() data.rebus.Init(); // diff --git a/html/fun_cat.html b/html/fun_cat.html index 781373b..e2d71c4 100755 --- a/html/fun_cat.html +++ b/html/fun_cat.html @@ -1,35 +1,25 @@ -<div> - [is mount_page_is "subject"] - - [is mount_page_is "info"] - <h1 class="withinfo"> - [else] - <h1> - [end] - - [item_subject] - </h1> - - [end] - - [is mount_page_is "info"] - [item_info] - [end] - - [if-one item_static_auth_is_image] - <img src="[item_link_static_auth]" alt="[item_subject]"> +[is mount_page_is "subject"] + +[is mount_page_is "info"]<h1 class="withinfo">[else]<h1>[end][item_subject]</h1>[end] + +[is mount_page_is "info"] + [item_info] +[end] + +[if-one item_static_auth_is_image] + <img src="[item_link_static_auth]" alt="[item_subject]"> + [item_print_content] +[else] + [if-one item_static_auth_is_other] + {download}: <a href="[item_link_static_auth]" title="[item_subject]">[item_subject]</a> [item_print_content] [else] - [if-one item_static_auth_is_other] - {download}: <a href="[item_link_static_auth]" title="[item_subject]">[item_subject]</a> + [if-one item_static_auth_is_none] [item_print_content] - [else] - [if-one item_static_auth_is_none] - [item_print_content] - [end] [end] [end] -</div> +[end] + diff --git a/html/fun_ckeditor.html b/html/fun_ckeditor.html index 77dcebb..2502716 100755 --- a/html/fun_ckeditor.html +++ b/html/fun_ckeditor.html @@ -29,14 +29,14 @@ [if-one mount_type_is_thread]<p class="withnext">{form_emacs_content_thread}</p>[end] [if-one mount_type_is_ticket]<p class="withnext">{form_emacs_content_ticket}</p>[end] - <textarea class="multitext" rows="[if-one mount_type_is_cms]30[else]10[end]" cols="60" name="content">[item_content]</textarea> + <textarea class="multitext" rows="[if-one mount_type_is_cms]30[else]10[end]" cols="60" name="itemcontent">[item_content]</textarea> <input type="hidden" name="contenttype" value="2"> [is winix_function_param_is "full"] - <script type="text/javascript">CKEDITOR.replace('content', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_full.js' \});</script> + <script type="text/javascript">CKEDITOR.replace('itemcontent', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_full.js' \});</script> [else] - <script type="text/javascript">CKEDITOR.replace('content', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_winix.js' \});</script> + <script type="text/javascript">CKEDITOR.replace('itemcontent', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_winix.js' \});</script> [end] [if-no user_logged] diff --git a/html/fun_emacs_post.html b/html/fun_emacs_post.html index 14a6b9b..92e144e 100755 --- a/html/fun_emacs_post.html +++ b/html/fun_emacs_post.html @@ -7,7 +7,7 @@ [if-one mount_type_is_ticket]<p class="withnext">{form_emacs_content_ticket}</p>[end] [end] -<textarea class="multitext" rows="[is winix_function_is "upload"]7[else][if-one mount_type_is_cms]30[else]10[end][end]" cols="60" name="content">[item_content]</textarea> +<textarea class="multitext" rows="[is winix_function_is "upload"]7[else][if-one mount_type_is_cms]30[else]10[end][end]" cols="60" name="itemcontent">[item_content]</textarea> <p class="withnext">{form_emacs_content_type}</p> diff --git a/html/fun_thread.html b/html/fun_thread.html index 5e9bed5..f2e930b 100755 --- a/html/fun_thread.html +++ b/html/fun_thread.html @@ -15,7 +15,7 @@ <tr> <td><a href="[doc_base_url][dir][thread_tab_url]">[thread_tab_subject]</a></td> <td class="smallfont">[thread_tab_author]</td><td class="smallfont">[thread_tab_answers]</td> - <td class="smallfont">[thread_tab_last_item_date_modification] ([thread_tab_last_item_user])</td> + <td class="smallfont">[thread_tab_last_item_date_modification_nice] ([thread_tab_last_item_user])</td> </tr> [end] </table> diff --git a/html/index.html b/html/index.html index 3fa56e8..3b0bb36 100755 --- a/html/index.html +++ b/html/index.html @@ -1,84 +1,4 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> - -<html lang="{language}"> -<head> - <title>[doc_title] - - - - - - [is winix_function_is "ckeditor"][end] - -[is-no winix_function_param_is "fullscreen"] - -
- - - - - [is-no winix_function_is "ckeditor"] -
-
- -
- [content] -
- [else] -
- [content] -
- [end] [# is-no winix_function_is "ckeditor"] - - - - -
- - -[else] - - -
- [content] -
- - -[end] [# is-no winix_function_param_is "fullscreen"] - - +[include "index_root.html"] diff --git a/html/index_contentmenu.html b/html/index_contentmenu.html new file mode 100755 index 0000000..987c2b3 --- /dev/null +++ b/html/index_contentmenu.html @@ -0,0 +1,12 @@ +
+ +

Menu

+ + + +
+ diff --git a/html/index_footer.html b/html/index_footer.html new file mode 100755 index 0000000..f607500 --- /dev/null +++ b/html/index_footer.html @@ -0,0 +1,4 @@ + + + diff --git a/html/index_head.html b/html/index_head.html new file mode 100755 index 0000000..6ec1f37 --- /dev/null +++ b/html/index_head.html @@ -0,0 +1,9 @@ + +[doc_title] + + + + + +[is winix_function_is "ckeditor"][end] + diff --git a/html/index_header.html b/html/index_header.html new file mode 100755 index 0000000..79a476b --- /dev/null +++ b/html/index_header.html @@ -0,0 +1,32 @@ +
+ +[if-one user_logged] + {logged_as}: [user_name]
+ {logout}
+[else] +
+
+ {form_login_legend}: + + + +

+
+
+[end] + + + +[if-one dir_tab] + +[end] + +
diff --git a/html/index_root.html b/html/index_root.html new file mode 100755 index 0000000..20a3e40 --- /dev/null +++ b/html/index_root.html @@ -0,0 +1,44 @@ + + + + +[include "index_head.html"] + + +[is-no winix_function_param_is "fullscreen"] + + +
+ + [include "index_header.html"] + + + [is-no winix_function_is "ckeditor"] + [include "index_contentmenu.html"] + +
+ [content] +
+ [else] +
+ [content] +
+ [end] [# is-no winix_function_is "ckeditor"] + + + [include "index_footer.html"] + +
+ + +[else] + + +
+ [content] +
+ + +[end] [# is-no winix_function_param_is "fullscreen"] + + diff --git a/html/item_info.html b/html/item_info.html index bc8b53a..7d7d4a2 100755 --- a/html/item_info.html +++ b/html/item_info.html @@ -1 +1 @@ -

{added_by}: [item_user], [item_date_creation][if-no item_dates_equal], {last_modified}: [item_date_modification][end]

+

{added_by}: [item_user], [item_date_creation_nice][if-no item_dates_equal], {last_modified}: [item_date_modification_nice][end]

diff --git a/html/item_tab_info.html b/html/item_tab_info.html index 3201b72..71a5856 100755 --- a/html/item_tab_info.html +++ b/html/item_tab_info.html @@ -1 +1 @@ -

{added_by}: [item_tab_user], [item_tab_date_creation][if-no item_tab_dates_equal], {last_modified}: [item_tab_date_modification][end]

+

{added_by}: [item_tab_user], [item_tab_date_creation_nice][if-no item_tab_dates_equal], {last_modified}: [item_tab_date_modification_nice][end]

diff --git a/main/Makefile b/main/Makefile index d05ff4e..e5cd145 100755 --- a/main/Makefile +++ b/main/Makefile @@ -7,7 +7,7 @@ all: $(o) .SUFFIXES: .cpp .o .cpp.o: - $(CXX) -c $(CXXFLAGSMAIN) $< + $(CXX) -c $(CXXFLAGS) $< diff --git a/main/Makefile.dep b/main/Makefile.dep index 4262846..97f4087 100755 --- a/main/Makefile.dep +++ b/main/Makefile.dep @@ -12,11 +12,11 @@ main.o: ../core/rebus.h ../core/functionparser.h ../core/requesttypes.h main.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h main.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h main.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h -main.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h -main.o: ../core/request.h ../core/thread.h ../core/compress.h -main.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -main.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -main.o: ../core/db.h ../core/config.h ../core/notify.h +main.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/request.h +main.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +main.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +main.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h +main.o: ../core/config.h ../core/notify.h main.o: ../templatesnotify/templatesnotify.h ../core/mount.h main.o: ../templates/misc.h ../core/plugin.h ../core/request.h ../core/data.h main.o: ../core/pluginmsg.h diff --git a/static/layout1/winix.css b/static/layout1/winix.css index e902691..ecd72bf 100755 --- a/static/layout1/winix.css +++ b/static/layout1/winix.css @@ -1,79 +1,126 @@ -* { -margin: 0; -border: 0; -padding: 0; +/* ---------------------- clearing -------------------------- */ + +html, body { +color: black; +background: white; } +html, body, div, span, +applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dd, dl, dt, li, ol, ul, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + line-height: 1.4em; + font-family: inherit; + text-align: left; + vertical-align: baseline; +} + +a img, :link img, :visited img { + border: 0; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +ol, ul { + list-style: none; +} + +q:before, q:after, +blockquote:before, blockquote:after { + content: ""; +} + + + +/* ---------------------- index template -------------------------- */ + + html, body { background: #DEDEDE; color: #626262; font-size: 14px; -font-family: Verdana, Tahoma, Arial CE; +line-height: 1.3em; +font-family: Verdana, Tahoma, Arial CE, Sans-Serif; } -body.white { -background: white; -height: 100%; -} -#container { +#winix_container { width: 909px; margin: 10px auto 33px auto; -background: white url('/images/a2.gif') repeat-y right top; +background: white url('/winix/a2.gif') repeat-y right top; } -#containerfull { + +#winix_containerfull { background: white; padding: 2em; overflow: hidden; } -#contentleft { + +#winix_contentleft { margin: 20px 30px 0 50px; width: 150px; float: left; } -* html #contentleft { + +* html #winix_contentleft { margin-left: 25px; } -#contentleft h2 { + +#winix_contentleft h2 { margin-top: 0; } -#contentleft h2.next { + +#winix_contentleft h2.next { margin-top: 1.2em; } - -.menu { +.winix_menu { list-style-type: none; margin: 0; } -.menu li { +.winix_menu li { width: 150px; -padding: 0 10px 2px 0; +padding: 0 12px 2px 0; +line-height: 1.5; } -.menu li a { + +.winix_menu li a { text-decoration: none; color: #666666; } -.menu li a:hover, .menu li a:focus { + +.winix_menu li a:hover, .winix_menu li a:focus { text-decoration: none; background: black; color: white; } - - -#contentright { +#winix_contentright { min-height: 400px; width: 600px; float: left; @@ -82,123 +129,127 @@ padding-right: 30px; } -* html #contentright { +* html #winix_contentright { height: 400px; } -#contentfull { +#winix_contentfull { min-height: 400px; width: 840px; margin: 20px 0 40px 0; padding: 30px; } -* html #contentfull { + +* html #winix_contentfull { height: 400px; } -#header { +#winix_header { height: 130px; -background: url('/images/a1.gif') no-repeat right top; +background: url('/winix/a1.gif') no-repeat right top; overflow: hidden; } -#header #logo { -display: block; -float: left; -width: 320px; -padding: 85px 0 0 0; -height: 0; -overflow: hidden; -background: url('/images/slimaczek.gif') no-repeat left top; -margin: 18px 0 0 28px; -} - -* html #header #logo { -margin-left: 14px; -} - - -#header #logo:focus { -border-bottom: 2px solid black; -} - -#loguj { -width: 280px; +#winix_login { +width: 240px; float: right; margin-top: 20px; } - -#loguj legend { + + +#winix_login legend { width: 0; height: 0; overflow: hidden; display: none; } -#loguj .edit { + +#winix_login .edit { border: #848484 1px solid; -width: 100px; -font-size: 0.9em; -} - -#loguj .submit { -background: white; -font-size: 0.9em; -} - -#loguj p { +width: 80px; font-size: 0.8em; +line-height: 1; +} + + +#winix_login .submit { +background: white; +font-size: 0.8em; +border: 0; +} + + +#winix_login p { +font-size: 0.7em; margin: 0.6em 0 0.6em 0; } -#loguj .remember { + +#winix_login .remember { margin: 0 0.5em 0 0; +vertical-align: middle; } -#zalogowany { + +#winix_logged { width: 280px; float: right; margin-top: 20px; font-size: 0.8em; text-align: right; -padding-right: 2em; +padding-right: 30px; } - -#current_dir { +#winix_header #winix_logo { +display: block; float: left; -list-style-type: none; -margin: 73px 0 0 0; +margin: 20px 0 5px 20px; } -#current_dir li { +* html #winix_header #winix_logo { +margin-left: 10px; +} + +#winix_current_dir { +list-style-type: none; +margin: 20px 0 0 10px; +overflow: hidden; +float: left; +} + + +#winix_current_dir li { display: block; float: left; } -#current_dir a{ + +#winix_current_dir a { text-decoration: none; color: #666666; -font-size: 0.8em; +font-size: 1em; } -#current_dir a:focus, #current_dir a:hover { + +#winix_current_dir a:focus, #winix_current_dir a:hover { color: white; background: black; } -#footer { + +#winix_footer { clear: both; height: 40px; -background: url('/images/b.gif') no-repeat left bottom; +background: url('/winix/b.gif') no-repeat left bottom; } -#menu2 { +#winix_menu_bottom { font-size: 0.8em; list-style-type: none; margin: 0 auto 0 auto; @@ -207,52 +258,37 @@ text-align: center; } -#menu2 li { +#winix_menu_bottom li { display: inline; margin-right: 15px; padding-right: 15px; border-right: 1px solid #626262; } -#menu2 li.last { + +#winix_menu_bottom li.last { margin-right: 0; padding-right: 0; border-right: none; } -#menu2 li a { + +#winix_menu_bottom li a { text-decoration: none; color: #666666; } -#menu2 li a:hover, #menu2 li a:focus { + +#winix_menu_bottom li a:hover, #winix_menu_bottom li a:focus { text-decoration: none; color: white; background: black; } -p.iteminfo { -font-size: 0.7em; -color: #AAAAAA; -margin: 0.4em 0 1.8em 0; -} -p.itemtabinfo { -font-size: 0.7em; -color: #AAAAAA; -margin: 0 0 1em 0; -padding: 0.5em 0 0 0; -} +/* ---------------------- content -------------------------- */ -p.itemtabinfo2 { -font-size: 0.7em; -color: #AAAAAA; -margin: 0 0 1em 0; -padding: 1.5em 0 0 0; -} - -/* ---------------------------------------------------------- */ h1 { font-size: 1.8em; @@ -261,6 +297,7 @@ color: #FF8700; font-weight: normal; } + h1.withinfo { margin: 0 0 0 0; } @@ -269,7 +306,8 @@ margin: 0 0 0 0; h1.next { margin-top: 1.2em; } - + + h2 { font-size: 1.2em; margin: 1.2em 0 0.8em 0; @@ -277,6 +315,7 @@ color: #FF8700; font-weight: normal; } + h2.withinfo { margin: 1.2em 0 0.2em 0; } @@ -287,6 +326,7 @@ color: #065A8B; text-decoration: none; } + a:hover, a:focus { background: #065A8B; color: white; @@ -299,15 +339,41 @@ margin: 1em 0 1em 0; line-height: 1.5em; } + p.withnext { margin: 1em 0 0 0; } + +p.iteminfo { +font-size: 0.7em; +color: #AAAAAA; +margin: 0.4em 0 1.8em 0; +} + + +p.itemtabinfo { +font-size: 0.7em; +color: #AAAAAA; +margin: 0 0 1em 0; +padding: 0.5em 0 0 0; +} + + +p.itemtabinfo2 { +font-size: 0.7em; +color: #AAAAAA; +margin: 0 0 1em 0; +padding: 1.5em 0 0 0; +} + + .error { color: red; font-weight: bold; } + cite { font-style: normal; } @@ -318,6 +384,7 @@ line-height: 1.49em; list-style-type: none; } + ul.a li { margin: 0.7em 0 0.7em 2em; list-style-type: disc; @@ -328,33 +395,23 @@ ol { margin-left: 2.5em; } -ol.transmitowane { - -} dt { margin: 1em 0 0 0; font-weight: bold; } + dd { margin: 0 0 1em 0; } -#additem { - -} form legend { display: none; } -#additem legend { -margin: 0.5em 0 0.5em 0; -} - - #additem .edit { margin: 0.3em 0 0.3em 0; padding: 0.2em; @@ -363,12 +420,14 @@ display: block; width: 530px; } + #additem select { border: 1px solid #dedede; width: 100px; margin: 0.3em 0 0.3em 0; } + #additem select.contenttype { border: 1px solid #dedede; width: 150px; @@ -384,7 +443,6 @@ width: 100px; } - #additem .multitext { margin: 0.5em 0 0.5em 0; border: 1px solid #dedede; @@ -407,6 +465,7 @@ margin: 0.5em 0 1em 0; border-collapse: collapse; } + table tr th { border: 1px solid #CCCCCC; padding: 0.3em 1em 0.3em 1em; @@ -424,69 +483,17 @@ text-align: left; } -table.server tr td, table.server tr th { -font-size: 0.8em; -} - -table.server tr th.name { -text-align: left; -} - - -table.nick { -background: #A4ACAC; -color: white; -border: 0; -} - -table.nick tr th, table.nick tr td { -border: 0; -font-size: 1em; -} - - table.who { font-size: 0.8em; } -.k0 { -color: black; -} -.k1 { -color: red; -} -.k2 { -color: green; -} -.k3 { -color: yellow; -} -.k4 { -color: blue; -} -.k5 { -color: #00A6EB; -} -.k6 { -color: purple; -} -.k7 { -color: white; -} -.k8 { -color: black; -} -.k9 { -color: red; -} - - table.withoutborder td { border: 0; padding: 0 1em 0 0; } + div.itemoptions { clear: both; border-top: 1px solid #D1D1E1; @@ -494,6 +501,7 @@ padding: 1em; margin: 5em 0 1em 0; } + div.itemoptions h2 { margin-top: 0; font-size: 1.1em; @@ -506,44 +514,33 @@ margin: 1em 0 2em 0; display: block; } + /* ie6 has some problems */ * html ul.itemmenu { overflow: visible; height: 1em; } + ul.itemmenu li { display: block; margin-right: 2em; font-size: 0.8em; +line-height: 1.8em; } -table.tvprogram { -font-size: 0.8em; -border: 1px solid #D1D1E1; -} - -table.tvprogram td { -border: 1px solid #D1D1E1; -} - -td.tvdzien { -white-space: nowrap; -} - -tr.tvprogramrowcol { -background: #F3F3FF; -} em { font-style: normal; font-weight: bold; } + div.threadbox { padding: 0.2em 1em 1em 1em; } + div.threadboxcolor { background: #F4F4F4; border-radius: 8px; @@ -556,32 +553,39 @@ table.forum { border: 1px solid #D1D1E1; } + table.forum th { border: 1px solid #D1D1E1; } + table.forum td { border: 1px solid #D1D1E1; } + .smallfont { font-size: 0.7em; } + table.ticket { margin: 1em 0 1em 0; } + table.ticket th { text-align: left; font-weight: normal; padding: 0 1em 0 0; } + table.ticket th, table.ticket td { border: 0; } + table.ticket input { margin: 0.3em 0 0.3em 0; padding: 0.2em; @@ -590,15 +594,13 @@ display: block; width: 100px; } + div.ticketinfo { background: #FFFED5; padding: 2em; border: 1px dotted #AFAFAF; } -div.ticketinfo table { - -} div.ticketinfo table th { text-align: left; @@ -606,10 +608,12 @@ border: 0; padding: 0 1em 0 0; } + div.ticketinfo table td { border: 0; } + div.ticketinfo p.edit { font-size: 0.8em; text-align: right; @@ -617,30 +621,6 @@ float: right; } -form#login legend { -display: none; -} - - -form#login input { -margin: 0.3em 0 0.3em 0; -padding: 0.2em; -border: 1px solid #dedede; -display: block; -width: 200px; -} - -form#login input.remember { -width: 1.5em; -display: inline; -} - -form#login input.submit { -width: 100px; -margin: 1.5em 0 1em 0; -} - - ul.ls_browse li { display: block; float: left; @@ -649,3 +629,7 @@ list-style-type: none; } +strong { +font-weight: bold; +} + diff --git a/templates/Makefile.dep b/templates/Makefile.dep index f7d09c3..9298494 100755 --- a/templates/Makefile.dep +++ b/templates/Makefile.dep @@ -11,8 +11,7 @@ dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -dir.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/db.h -dir.o: ../core/misc.h +dir.o: ../core/mount.h ../core/loadavg.h ../core/db.h ../core/misc.h doc.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h doc.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h doc.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h ../core/dirs.h @@ -20,11 +19,11 @@ doc.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h doc.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h doc.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h doc.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h -doc.o: ../core/locale.h ../core/loadavg.h ../core/request.h -doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h -doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h -doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +doc.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h +doc.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h +doc.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +doc.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +doc.o: ../core/misc.h done.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h done.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h done.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.h @@ -41,12 +40,11 @@ item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h item.o: ../core/group.h ../core/functions.h ../core/function.h item.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -item.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/loadavg.h -item.o: ../core/request.h ../core/requesttypes.h ../core/session.h -item.o: ../core/done.h ../core/thread.h ../core/compress.h -item.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -item.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -item.o: ../core/misc.h +item.o: ../core/error.h ../core/rebus.h ../core/loadavg.h ../core/request.h +item.o: ../core/requesttypes.h ../core/session.h ../core/done.h +item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h last.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h last.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h last.o: ../core/httpsimpleparser.h ../core/log.h ../core/lastcontainer.h @@ -54,9 +52,9 @@ last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h last.o: ../core/groups.h ../core/group.h ../core/functions.h last.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h -last.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h -last.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h +last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/loadavg.h +last.o: ../core/request.h ../core/requesttypes.h ../core/session.h +last.o: ../core/done.h ../core/thread.h ../core/compress.h last.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h last.o: ../core/misc.h @@ -74,9 +72,9 @@ misc.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h misc.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h misc.o: ../core/groups.h ../core/group.h ../core/functions.h misc.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -misc.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h -misc.o: ../core/loadavg.h ../core/misc.h misc.h localefilter.h -misc.o: ../core/locale.h ../confparser/confparser.h +misc.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/loadavg.h +misc.o: ../core/misc.h misc.h localefilter.h ../core/locale.h +misc.o: ../confparser/confparser.h mount.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h mount.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h mount.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -84,14 +82,14 @@ mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h mount.o: ../core/group.h ../core/functions.h ../core/function.h mount.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -mount.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/loadavg.h +mount.o: ../core/error.h ../core/rebus.h ../core/loadavg.h patterncacher.o: patterncacher.h ../core/item.h ../core/data.h ../core/dirs.h patterncacher.o: ../core/item.h ../core/dircontainer.h ../core/users.h patterncacher.o: ../core/user.h ../core/ugcontainer.h ../core/log.h patterncacher.o: ../core/groups.h ../core/group.h ../core/functions.h patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h -patterncacher.o: ../core/locale.h ../core/loadavg.h ../core/log.h +patterncacher.o: ../core/loadavg.h ../core/log.h priv.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h priv.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h priv.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -99,12 +97,11 @@ priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h priv.o: ../core/group.h ../core/functions.h ../core/function.h priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -priv.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/loadavg.h -priv.o: ../core/request.h ../core/requesttypes.h ../core/session.h -priv.o: ../core/done.h ../core/thread.h ../core/compress.h -priv.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -priv.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -priv.o: ../core/misc.h +priv.o: ../core/error.h ../core/rebus.h ../core/loadavg.h ../core/request.h +priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h +priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h rebus.o: ../core/request.h ../core/requesttypes.h ../core/session.h rebus.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h rebus.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h @@ -114,9 +111,9 @@ rebus.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h rebus.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -rebus.o: ../core/mount.h ../core/locale.h ../core/loadavg.h templates.h -rebus.o: patterncacher.h ../core/item.h misc.h localefilter.h -rebus.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +rebus.o: ../core/mount.h ../core/loadavg.h templates.h patterncacher.h +rebus.o: ../core/item.h misc.h localefilter.h ../core/locale.h +rebus.o: ../confparser/confparser.h ckeditorgetparser.h rebus.o: ../core/httpsimpleparser.h ../core/log.h sys.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h sys.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h @@ -125,11 +122,11 @@ sys.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h sys.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h sys.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h sys.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h -sys.o: ../core/locale.h ../core/loadavg.h ../core/request.h -sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h -sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h -sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +sys.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h +sys.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h +sys.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +sys.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +sys.o: ../core/misc.h templates.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h templates.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h templates.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -138,12 +135,12 @@ templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h templates.o: ../core/log.h ../core/groups.h ../core/group.h templates.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h templates.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h -templates.o: ../core/locale.h ../core/loadavg.h ../core/request.h -templates.o: ../core/requesttypes.h ../core/session.h ../core/done.h -templates.o: ../core/thread.h ../core/compress.h -templates.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -templates.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -templates.o: ../core/misc.h ../core/plugin.h ../core/request.h ../core/data.h +templates.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h +templates.o: ../core/session.h ../core/done.h ../core/thread.h +templates.o: ../core/compress.h ../core/acceptencodingparser.h +templates.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +templates.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +templates.o: ../core/plugin.h ../core/request.h ../core/data.h templates.o: ../core/pluginmsg.h thread.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h thread.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h @@ -152,12 +149,12 @@ thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h thread.o: ../core/groups.h ../core/group.h ../core/functions.h thread.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h -thread.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h -thread.o: ../core/session.h ../core/done.h ../core/thread.h -thread.o: ../core/compress.h ../core/acceptencodingparser.h -thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/loadavg.h +thread.o: ../core/request.h ../core/requesttypes.h ../core/session.h +thread.o: ../core/done.h ../core/thread.h ../core/compress.h +thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +thread.o: ../core/misc.h ticket.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h ticket.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h ticket.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -165,12 +162,12 @@ ticket.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ticket.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h ticket.o: ../core/groups.h ../core/group.h ../core/functions.h ticket.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h -ticket.o: ../core/loadavg.h ../core/request.h ../core/requesttypes.h -ticket.o: ../core/session.h ../core/done.h ../core/thread.h -ticket.o: ../core/compress.h ../core/acceptencodingparser.h -ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/loadavg.h +ticket.o: ../core/request.h ../core/requesttypes.h ../core/session.h +ticket.o: ../core/done.h ../core/thread.h ../core/compress.h +ticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +ticket.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +ticket.o: ../core/misc.h uptime.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h uptime.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h uptime.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -178,8 +175,7 @@ uptime.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h uptime.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h uptime.o: ../core/groups.h ../core/group.h ../core/functions.h uptime.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -uptime.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h -uptime.o: ../core/loadavg.h +uptime.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/loadavg.h user.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h user.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h user.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -187,12 +183,11 @@ user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h user.o: ../core/group.h ../core/functions.h ../core/function.h user.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -user.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/loadavg.h -user.o: ../core/request.h ../core/requesttypes.h ../core/session.h -user.o: ../core/done.h ../core/thread.h ../core/compress.h -user.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -user.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -user.o: ../core/misc.h +user.o: ../core/error.h ../core/rebus.h ../core/loadavg.h ../core/request.h +user.o: ../core/requesttypes.h ../core/session.h ../core/done.h +user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h who.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h who.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h who.o: ../core/httpsimpleparser.h ../core/log.h ../core/sessioncontainer.h @@ -205,11 +200,10 @@ who.o: ../core/functionparser.h ../core/requesttypes.h ../core/data.h who.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h who.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h who.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h -who.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h -who.o: ../core/request.h ../core/thread.h ../core/compress.h -who.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -who.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h -who.o: ../core/misc.h +who.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/request.h +who.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h winix.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h winix.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h winix.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h @@ -217,8 +211,8 @@ winix.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h winix.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h winix.o: ../core/group.h ../core/functions.h ../core/function.h winix.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -winix.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/loadavg.h -winix.o: ../core/request.h ../core/requesttypes.h ../core/session.h -winix.o: ../core/done.h ../core/thread.h ../core/compress.h -winix.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -winix.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +winix.o: ../core/error.h ../core/rebus.h ../core/loadavg.h ../core/request.h +winix.o: ../core/requesttypes.h ../core/session.h ../core/done.h +winix.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +winix.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +winix.o: ../core/postmultiparser.h ../core/ticket.h diff --git a/templates/dir.cpp b/templates/dir.cpp index 29bc5d5..6860e5c 100755 --- a/templates/dir.cpp +++ b/templates/dir.cpp @@ -228,10 +228,10 @@ void dir_last_subject(Info & i) void dir_last_info(Info & i) { - if( static_cast(data.locale.GetLang()) >= patterns.size() ) + if( static_cast(locale.GetLang()) >= patterns.size() ) return; - Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_dir_last_info], functions); + Ezc::Generator gen(i.out, patterns[locale.GetLang()][pat_dir_last_info], functions); gen.Generate(); } diff --git a/templates/doc.cpp b/templates/doc.cpp index cf3c786..ae53115 100755 --- a/templates/doc.cpp +++ b/templates/doc.cpp @@ -24,18 +24,20 @@ namespace TemplatesFunctions void doc_title(Info & i) { - size_t a = 0; - + size_t a; + // from 1 means skipping the root directory for(a = 1 ; asubject); + + if( a < request.dir_table.size()-1 ) + i.out << data.title_separator; } if( request.is_item ) { - i.out << " / "; + i.out << data.title_separator; HtmlEscape(i.out, request.item.subject); } } diff --git a/templates/item.cpp b/templates/item.cpp index d76b6a9..2dc81b3 100755 --- a/templates/item.cpp +++ b/templates/item.cpp @@ -8,6 +8,7 @@ */ #include "templates.h" +#include "misc.h" #include "../core/data.h" #include "../core/request.h" #include "../core/misc.h" @@ -150,8 +151,8 @@ void item_url(Info & i) void item_url_is(Info & i) { - if( !request.is_item || !i.is ) - return; // default false + if( !request.is_item || !i.is ) + return; // default false i.result = request.item.url == *i.is; } @@ -211,10 +212,10 @@ void item_can_remove(Info & i) void item_info(Info & i) { - if( static_cast(data.locale.GetLang()) >= patterns.size() ) + if( static_cast(locale.GetLang()) >= patterns.size() ) return; - Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_item_info], functions); + Ezc::Generator gen(i.out, patterns[locale.GetLang()][pat_item_info], functions); gen.Generate(); } @@ -253,6 +254,20 @@ void item_date_modification(Info & i) } +void item_date_creation_nice(Info & i) +{ + tm * ptm = &request.item.date_creation; + TemplatesMisc::print_date_nice(i, ptm); +} + + +void item_date_modification_nice(Info & i) +{ + tm * ptm = &request.item.date_modification; + TemplatesMisc::print_date_nice(i, ptm); +} + + void item_dates_equal(Info & i) { tm * ptm1 = &request.item.date_creation; @@ -483,10 +498,10 @@ void item_tab_can_read(Info & i) void item_tab_info(Info & i) { - if( static_cast(data.locale.GetLang()) >= patterns.size() ) + if( static_cast(locale.GetLang()) >= patterns.size() ) return; - Ezc::Generator gen(i.out, patterns[data.locale.GetLang()][pat_item_tab_info], functions); + Ezc::Generator gen(i.out, patterns[locale.GetLang()][pat_item_tab_info], functions); gen.Generate(); } @@ -534,6 +549,26 @@ void item_tab_date_modification(Info & i) } +void item_tab_date_creation_nice(Info & i) +{ + if( item_index < request.item_table.size() ) + { + tm * ptm = &request.item_table[item_index].date_creation; + TemplatesMisc::print_date_nice(i, ptm); + } +} + + +void item_tab_date_modification_nice(Info & i) +{ + if( item_index < request.item_table.size() ) + { + tm * ptm = &request.item_table[item_index].date_modification; + TemplatesMisc::print_date_nice(i, ptm); + } +} + + void item_tab_dates_equal(Info & i) { if( item_index < request.item_table.size() ) diff --git a/templates/misc.cpp b/templates/misc.cpp index a517009..23e63d6 100755 --- a/templates/misc.cpp +++ b/templates/misc.cpp @@ -16,14 +16,34 @@ namespace TemplatesMisc { + +void print_date_nice(Ezc::Info & i, tm * ptm) +{ + time_t t = mktime(ptm); + time_t now = time(0); + time_t one_day = 60 * 60 * 24; + + if( t + one_day > now ) + i.out << DateToStr(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec); + else + i.out << DateToStr(ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday); +} + + + + + + // those functions from here are used in the second thread too -void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const std::string & dir, const char * file, bool delete_white) + + +void Read(Patterns & patterns, size_t pat, Locale & locale, LocaleFilter & locale_filter, const char * file, bool delete_white) { size_t i; size_t len = patterns.size(); - Locale::Lang old_lang = data.locale.GetLang(); + Locale::Lang old_lang = locale.GetLang(); for(i=0 ; i(i); - data.locale.SetLang(new_lang); + locale.SetLang(new_lang); - locale_filter.Filter(patterns[i][pat], data.locale); - - log << "Read pattern: " << dir << "/" << file << " for lang: " << data.locale.LangToStr(new_lang) << logend; + locale_filter.Filter(patterns[i][pat], locale); } } - data.locale.SetLang(old_lang); -} + locale.SetLang(old_lang); + + + + + -void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const char * file, bool delete_white) -{ - std::string temp = data.templates_dir; - temp += '/'; - temp += file; - if( IsFile(temp) ) - { - Read(patterns, pat, locale_filter, data.templates_dir, file, delete_white); - } - else - { - Read(patterns, pat, locale_filter, data.templates_dir_default, file, delete_white); - } } diff --git a/templates/misc.h b/templates/misc.h index a62264e..5d1442d 100755 --- a/templates/misc.h +++ b/templates/misc.h @@ -21,15 +21,17 @@ namespace TemplatesMisc { - +// table: [language][file] typedef std::vector > Patterns; +void print_date_nice(Ezc::Info & i, tm * ptm); + + // those functions from here are used in the second thread too -void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const std::string & dir, const char * file, bool delete_white = false); -void Read(Patterns & patterns, size_t pat, LocaleFilter & locale_filter, const char * file, bool delete_white = false); +void Read(Patterns & patterns, size_t pat, Locale & locale, LocaleFilter & locale_filter, const char * file, bool delete_white = false); void ClearPatterns(Patterns & patterns, size_t len); diff --git a/templates/templates.cpp b/templates/templates.cpp index b0b6d36..2c15bd3 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -21,6 +21,7 @@ namespace TemplatesFunctions TemplatesMisc::Patterns patterns; Ezc::Functions functions; PatternCacher pattern_cacher; +Locale locale; LocaleFilter locale_filter; CKEditorGetParser ckeditor_getparser; @@ -74,8 +75,8 @@ Ezc::Pattern * p = 0; { if( pat_name_tab[i].fun_code == request.pfunction->code ) { - // !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika - p = &patterns[data.locale.GetLang()][pat_name_tab[i].pat]; + // !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika + p = &patterns[locale.GetLang()][pat_name_tab[i].pat]; break; } } @@ -89,7 +90,7 @@ void content(Info & i) { Ezc::Pattern * p = 0; - if( static_cast(data.locale.GetLang()) >= patterns.size() ) + if( static_cast(locale.GetLang()) >= patterns.size() ) { log << log1 << "Templates: there is no such a language in patterns" << logend; return; @@ -112,20 +113,20 @@ Ezc::Pattern * p = 0; case Error::cant_change_user: case Error::cant_change_group: case Error::cant_change_privileges: - // !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika - p = &patterns[data.locale.GetLang()][pat_err_per_denied]; + // !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika + p = &patterns[locale.GetLang()][pat_err_per_denied]; break; case Error::no_item: case Error::no_function: case Error::unknown_param: - // !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika - p = &patterns[data.locale.GetLang()][pat_err_404]; + // !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika + p = &patterns[locale.GetLang()][pat_err_404]; break; default: - // !! data.locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika - p = &patterns[data.locale.GetLang()][pat_err_others]; + // !! locale.GetLang() bedzie brane indywidualnie dla kazdego uzytkownika + p = &patterns[locale.GetLang()][pat_err_others]; break; } @@ -207,6 +208,8 @@ void Templates::CreateFunctions() functions.Insert("item_user", item_user); functions.Insert("item_date_creation", item_date_creation); functions.Insert("item_date_modification", item_date_modification); + functions.Insert("item_date_creation_nice", item_date_creation_nice); + functions.Insert("item_date_modification_nice",item_date_modification_nice); functions.Insert("item_dates_equal", item_dates_equal); functions.Insert("item_run", item_run); functions.Insert("item_guest_name", item_guest_name); @@ -238,6 +241,8 @@ void Templates::CreateFunctions() functions.Insert("item_tab_user", item_tab_user); functions.Insert("item_tab_date_creation", item_tab_date_creation); functions.Insert("item_tab_date_modification", item_tab_date_modification); + functions.Insert("item_tab_date_creation_nice", item_tab_date_creation_nice); + functions.Insert("item_tab_date_modification_nice", item_tab_date_modification_nice); functions.Insert("item_tab_dates_equal", item_tab_dates_equal); functions.Insert("item_tab_run", item_tab_run); @@ -359,6 +364,7 @@ void Templates::CreateFunctions() functions.Insert("thread_tab_author", thread_tab_author); functions.Insert("thread_tab_answers", thread_tab_answers); functions.Insert("thread_tab_last_item_date_modification", thread_tab_last_item_date_modification); + functions.Insert("thread_tab_last_item_date_modification_nice", thread_tab_last_item_date_modification_nice); functions.Insert("thread_tab_last_item_user", thread_tab_last_item_user); functions.Insert("thread_can_create", thread_can_create); @@ -467,45 +473,59 @@ void Templates::CreateFunctions() +void Templates::ReadFile(TemplatesFunctions::Pat pat, const char * file) +{ +using namespace TemplatesFunctions; + + TemplatesMisc::Read(patterns, static_cast(pat), locale, locale_filter, file); +} void Templates::ReadTemplates() { using namespace TemplatesFunctions; -using namespace TemplatesMisc; + + Locale::Lang lang = Locale::StrToLang(data.locale_str); + + if( lang != Locale::lang_unknown ) + locale.SetLang(lang); + else + locale.SetLang(Locale::lang_en); + + locale.Read(data.locale_dir, data.locale_dir_default); ClearPatterns(); - Read(patterns, pat_index, locale_filter, "index.html"); - Read(patterns, pat_err_404, locale_filter, "err_404.html"); - Read(patterns, pat_err_per_denied, locale_filter, "err_per_denied.html"); - Read(patterns, pat_fun_cat, locale_filter, "fun_cat.html"); - Read(patterns, pat_fun_ls, locale_filter, "fun_ls.html"); - Read(patterns, pat_fun_rm, locale_filter, "fun_rm.html"); - Read(patterns, pat_fun_emacs, locale_filter, "fun_emacs.html"); - Read(patterns, pat_fun_mkdir, locale_filter, "fun_mkdir.html"); - Read(patterns, pat_fun_default, locale_filter, "fun_default.html"); - Read(patterns, pat_fun_priv, locale_filter, "fun_priv.html"); - Read(patterns, pat_err_others, locale_filter, "err_others.html"); - Read(patterns, pat_fun_who, locale_filter, "fun_who.html"); - Read(patterns, pat_fun_run, locale_filter, "fun_run.html"); - Read(patterns, pat_fun_last, locale_filter, "fun_last.html"); - Read(patterns, pat_item_info, locale_filter, "item_info.html"); - Read(patterns, pat_item_tab_info, locale_filter, "item_tab_info.html"); - Read(patterns, pat_fun_thread, locale_filter, "fun_thread.html"); - Read(patterns, pat_fun_createthread,locale_filter, "fun_createthread.html"); - Read(patterns, pat_dir_last_info, locale_filter, "dir_last_info.html"); - Read(patterns, pat_fun_reload, locale_filter, "fun_reload.html"); - Read(patterns, pat_fun_upload, locale_filter, "fun_upload.html"); - Read(patterns, pat_fun_ticket, locale_filter, "fun_ticket.html"); - Read(patterns, pat_fun_createticket,locale_filter, "fun_createticket.html"); - Read(patterns, pat_fun_uptime, locale_filter, "fun_uptime.html"); - Read(patterns, pat_fun_login, locale_filter, "fun_login.html"); - /*Read(patterns, pat_fun_mv, locale_filter, "fun_mv.html"); - Read(patterns, pat_fun_uname, locale_filter, "fun_uname.html"); - Read(patterns, pat_fun_chmod, locale_filter, "fun_chmod.html"); - Read(patterns, pat_fun_chown, locale_filter, "fun_chown.html"); */ - Read(patterns, pat_fun_ckeditor, locale_filter, "fun_ckeditor.html"); + ReadFile(pat_index, "index.html"); + ReadFile(pat_err_404, "err_404.html"); + ReadFile(pat_err_per_denied, "err_per_denied.html"); + ReadFile(pat_fun_cat, "fun_cat.html"); + ReadFile(pat_fun_ls, "fun_ls.html"); + ReadFile(pat_fun_rm, "fun_rm.html"); + ReadFile(pat_fun_emacs, "fun_emacs.html"); + ReadFile(pat_fun_mkdir, "fun_mkdir.html"); + ReadFile(pat_fun_default, "fun_default.html"); + ReadFile(pat_fun_priv, "fun_priv.html"); + ReadFile(pat_err_others, "err_others.html"); + ReadFile(pat_fun_who, "fun_who.html"); + ReadFile(pat_fun_run, "fun_run.html"); + ReadFile(pat_fun_last, "fun_last.html"); + ReadFile(pat_item_info, "item_info.html"); + ReadFile(pat_item_tab_info, "item_tab_info.html"); + ReadFile(pat_fun_thread, "fun_thread.html"); + ReadFile(pat_fun_createthread, "fun_createthread.html"); + ReadFile(pat_dir_last_info, "dir_last_info.html"); + ReadFile(pat_fun_reload, "fun_reload.html"); + ReadFile(pat_fun_upload, "fun_upload.html"); + ReadFile(pat_fun_ticket, "fun_ticket.html"); + ReadFile(pat_fun_createticket, "fun_createticket.html"); + ReadFile(pat_fun_uptime, "fun_uptime.html"); + ReadFile(pat_fun_login, "fun_login.html"); + /*ReadFile(pat_fun_mv, "fun_mv.html"); + ReadFile(pat_fun_uname, "fun_uname.html"); + ReadFile(pat_fun_chmod, "fun_chmod.html"); + ReadFile(pat_fun_chown, "fun_chown.html"); */ + ReadFile(pat_fun_ckeditor, "fun_ckeditor.html"); } @@ -524,10 +544,10 @@ void Templates::Generate() using namespace TemplatesFunctions; // !! locale beda w zaleznosci od uzytkownika - if( static_cast(data.locale.GetLang()) >= patterns.size() ) + if( static_cast(locale.GetLang()) >= patterns.size() ) return; - Ezc::Generator generator(request.page, patterns[data.locale.GetLang()][pat_index], functions); + Ezc::Generator generator(request.page, patterns[locale.GetLang()][pat_index], functions); generator.Generate(); } diff --git a/templates/templates.h b/templates/templates.h index 96e48d1..aed597a 100755 --- a/templates/templates.h +++ b/templates/templates.h @@ -16,7 +16,7 @@ #include "patterncacher.h" #include "misc.h" #include "ckeditorgetparser.h" - +#include "../core/locale.h" namespace TemplatesFunctions @@ -68,6 +68,7 @@ namespace TemplatesFunctions extern TemplatesMisc::Patterns patterns; extern PatternCacher pattern_cacher; + extern Locale locale; extern Ezc::Functions functions; extern CKEditorGetParser ckeditor_getparser; @@ -122,6 +123,8 @@ namespace TemplatesFunctions void item_user(Info & i); void item_date_creation(Info & i); void item_date_modification(Info & i); + void item_date_creation_nice(Info & i); + void item_date_modification_nice(Info & i); void item_dates_equal(Info & i); void item_run(Info & i); void item_guest_name(Info & i); @@ -153,6 +156,8 @@ namespace TemplatesFunctions void item_tab_user(Info & i); void item_tab_date_creation(Info & i); void item_tab_date_modification(Info & i); + void item_tab_date_creation_nice(Info & i); + void item_tab_date_modification_nice(Info & i); void item_tab_dates_equal(Info & i); void item_tab_run(Info & i); @@ -267,6 +272,7 @@ namespace TemplatesFunctions void thread_tab_author(Info & i); void thread_tab_answers(Info & i); void thread_tab_last_item_date_modification(Info & i); + void thread_tab_last_item_date_modification_nice(Info & i); void thread_tab_last_item_user(Info & i); void thread_can_create(Info & i); @@ -386,6 +392,8 @@ public: private: + void ReadFile(TemplatesFunctions::Pat pat, const char * file); + std::string temp; }; diff --git a/templates/thread.cpp b/templates/thread.cpp index a755795..b9aa9e9 100755 --- a/templates/thread.cpp +++ b/templates/thread.cpp @@ -8,6 +8,7 @@ */ #include "templates.h" +#include "misc.h" #include "../core/data.h" #include "../core/request.h" #include "../core/misc.h" @@ -135,6 +136,14 @@ void thread_tab_last_item_date_modification(Info & i) } +void thread_tab_last_item_date_modification_nice(Info & i) +{ + if( thread_tab_index < request.thread_tab.size() ) + if( request.thread_tab[thread_tab_index].last_item.id != -1 ) + TemplatesMisc::print_date_nice(i, &request.thread_tab[thread_tab_index].last_item.date_modification); +} + + void thread_tab_last_item_user(Info & i) { if( thread_tab_index < request.thread_tab.size() ) diff --git a/templates/winix.cpp b/templates/winix.cpp index ccd2623..d24ac80 100755 --- a/templates/winix.cpp +++ b/templates/winix.cpp @@ -97,7 +97,7 @@ void winix_req_per_sec_now(Info & i) { char buf[20]; - sprintf(buf, "%.1f", (double)data.load_avg.ReqPerSecNow()); + sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSecNow()); i.out << buf; } @@ -106,15 +106,16 @@ void winix_req_per_sec_1(Info & i) { char buf[20]; - sprintf(buf, "%.1f", (double)data.load_avg.ReqPerSec1()); + sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec1()); i.out << buf; } + void winix_req_per_sec_5(Info & i) { char buf[20]; - sprintf(buf, "%.1f", (double)data.load_avg.ReqPerSec5()); + sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec5()); i.out << buf; } @@ -123,7 +124,7 @@ void winix_req_per_sec_15(Info & i) { char buf[20]; - sprintf(buf, "%.1f", (double)data.load_avg.ReqPerSec15()); + sprintf(buf, "%.2f", (double)data.load_avg.ReqPerSec15()); i.out << buf; } diff --git a/templatesnotify/Makefile.dep b/templatesnotify/Makefile.dep index 5e590f6..aa9c355 100755 --- a/templatesnotify/Makefile.dep +++ b/templatesnotify/Makefile.dep @@ -12,5 +12,5 @@ templatesnotify.o: ../core/users.h ../core/user.h ../core/ugcontainer.h templatesnotify.o: ../core/log.h ../core/groups.h ../core/group.h templatesnotify.o: ../core/functions.h ../core/function.h templatesnotify.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -templatesnotify.o: ../core/error.h ../core/rebus.h ../core/locale.h -templatesnotify.o: ../core/loadavg.h ../core/log.h +templatesnotify.o: ../core/error.h ../core/rebus.h ../core/loadavg.h +templatesnotify.o: ../core/log.h diff --git a/templatesnotify/templatesnotify.cpp b/templatesnotify/templatesnotify.cpp index 41278b6..76ca1f1 100755 --- a/templatesnotify/templatesnotify.cpp +++ b/templatesnotify/templatesnotify.cpp @@ -21,6 +21,7 @@ namespace TemplatesNotifyFunctions TemplatesMisc::Patterns patterns; Ezc::Functions functions; +Locale locale; LocaleFilter locale_filter; @@ -74,10 +75,16 @@ void TemplatesNotify::Read() using namespace TemplatesNotifyFunctions; using namespace TemplatesMisc; + Locale::Lang lang = Locale::StrToLang(data.locale_str); + + if( lang != Locale::lang_unknown ) + locale.SetLang(lang); + else + locale.SetLang(Locale::lang_en); + ClearPatterns(); - - TemplatesMisc::Read(patterns, pat_email_notify, locale_filter, "notify_email.txt", true); - + locale.Read(data.locale_dir, data.locale_dir_default); + TemplatesMisc::Read(patterns, pat_email_notify, locale, locale_filter, "notify_email.txt", true); notify_msg = 0; }