the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
notify.o: templatesnotify.h ../core/mount.h ../core/locale.h
|
||||
notify.o: ../confparser/confparser.h ../templates/misc.h
|
||||
notify.o: ../templates/localefilter.h ../../ezc/src/ezc.h ../core/notify.h
|
||||
notify.o: ../templatesnotify/templatesnotify.h
|
||||
templatesnotify.o: templatesnotify.h ../core/mount.h ../core/locale.h
|
||||
templatesnotify.o: ../confparser/confparser.h ../templates/misc.h
|
||||
templatesnotify.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
templatesnotify.o: ../core/misc.h ../core/item.h ../core/data.h
|
||||
templatesnotify.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
templatesnotify.o: ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
templatesnotify.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
templatesnotify.o: ../core/function.h ../core/lastcontainer.h
|
||||
templatesnotify.o: ../core/mounts.h ../core/mount.h ../core/error.h
|
||||
templatesnotify.o: ../core/rebus.h ../core/loadavg.h ../core/log.h
|
||||
notify.o: templatesnotify.h ../../ezc/src/ezc.h ../core/mount.h
|
||||
notify.o: ../core/locale.h ../core/confparser.h ../core/config.h
|
||||
notify.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
|
||||
notify.o: ../core/notify.h ../templatesnotify/templatesnotify.h
|
||||
notify.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
notify.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
notify.o: ../core/plugindata.h ../core/rebus.h ../core/thread.h
|
||||
notify.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
notify.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
notify.o: ../core/postmultiparser.h ../core/config.h ../core/ticket.h
|
||||
notify.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h ../core/db.h
|
||||
notify.o: ../core/group.h ../core/ugcontainer.h ../core/mounts.h
|
||||
notify.o: ../core/mount.h ../core/users.h ../core/lastcontainer.h
|
||||
notify.o: ../core/groups.h ../core/loadavg.h
|
||||
templatesnotify.o: templatesnotify.h ../../ezc/src/ezc.h ../core/mount.h
|
||||
templatesnotify.o: ../core/locale.h ../core/confparser.h ../core/config.h
|
||||
templatesnotify.o: ../templates/misc.h ../templates/localefilter.h
|
||||
templatesnotify.o: ../core/locale.h ../core/misc.h ../core/item.h
|
||||
templatesnotify.o: ../core/log.h
|
||||
|
||||
@@ -8,10 +8,9 @@
|
||||
*/
|
||||
|
||||
#include "templatesnotify.h"
|
||||
#include "../core/misc.h"
|
||||
#include "../core/locale.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/log.h"
|
||||
#include "core/misc.h"
|
||||
#include "core/locale.h"
|
||||
#include "core/log.h"
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +19,11 @@ namespace TemplatesNotifyFunctions
|
||||
{
|
||||
|
||||
Patterns patterns;
|
||||
Ezc::Functions functions;
|
||||
Ezc::Functions ezc_functions;
|
||||
Locale locale;
|
||||
LocaleFilter locale_filter;
|
||||
|
||||
Config * config;
|
||||
|
||||
|
||||
// you can use this pointer in template functions (will be always valid)
|
||||
@@ -35,24 +35,30 @@ NotifyMsg * notify_msg;
|
||||
|
||||
|
||||
|
||||
void TemplatesNotify::SetConfig(Config * pconfig)
|
||||
{
|
||||
TemplatesNotifyFunctions::config = pconfig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TemplatesNotify::CreateFunctions()
|
||||
{
|
||||
using namespace TemplatesNotifyFunctions;
|
||||
|
||||
functions.Clear();
|
||||
ezc_functions.Clear();
|
||||
|
||||
functions.Insert("notify_item_added", notify_item_added);
|
||||
functions.Insert("notify_item_edited", notify_item_edited);
|
||||
functions.Insert("notify_item_deleted", notify_item_deleted);
|
||||
functions.Insert("notify_dir_added", notify_dir_added);
|
||||
functions.Insert("notify_to", notify_to);
|
||||
functions.Insert("notify_mount_type_is_thread", notify_mount_type_is_thread);
|
||||
functions.Insert("notify_mount_type_is_cms", notify_mount_type_is_cms);
|
||||
functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
||||
functions.Insert("notify_item_dir", notify_item_dir);
|
||||
functions.Insert("notify_item_link", notify_item_link);
|
||||
ezc_functions.Insert("notify_item_added", notify_item_added);
|
||||
ezc_functions.Insert("notify_item_edited", notify_item_edited);
|
||||
ezc_functions.Insert("notify_item_deleted", notify_item_deleted);
|
||||
ezc_functions.Insert("notify_dir_added", notify_dir_added);
|
||||
ezc_functions.Insert("notify_to", notify_to);
|
||||
ezc_functions.Insert("notify_mount_type_is_thread", notify_mount_type_is_thread);
|
||||
ezc_functions.Insert("notify_mount_type_is_cms", notify_mount_type_is_cms);
|
||||
ezc_functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
||||
ezc_functions.Insert("notify_item_dir", notify_item_dir);
|
||||
ezc_functions.Insert("notify_item_link", notify_item_link);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +80,7 @@ void TemplatesNotify::Read()
|
||||
{
|
||||
using namespace TemplatesNotifyFunctions;
|
||||
|
||||
Locale::Lang lang = Locale::StrToLang(data.locale_str);
|
||||
Locale::Lang lang = Locale::StrToLang(config->locale_str);
|
||||
|
||||
if( lang != Locale::lang_unknown )
|
||||
locale.SetLang(lang);
|
||||
@@ -82,7 +88,7 @@ using namespace TemplatesNotifyFunctions;
|
||||
locale.SetLang(Locale::lang_en);
|
||||
|
||||
ClearPatterns();
|
||||
locale.Read(data.locale_dir, data.locale_dir_default);
|
||||
locale.Read(config->locale_dir, config->locale_dir_default);
|
||||
TemplatesFunctions::Read(patterns, pat_email_notify, locale, locale_filter, "notify_email.txt", true);
|
||||
|
||||
notify_msg = 0;
|
||||
@@ -105,7 +111,7 @@ using namespace TemplatesNotifyFunctions;
|
||||
return;
|
||||
}
|
||||
|
||||
Ezc::Generator generator(notify_str, patterns[lang][pat_email_notify], functions);
|
||||
Ezc::Generator generator(notify_str, patterns[lang][pat_email_notify], ezc_functions);
|
||||
generator.Generate();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
#include <iomanip>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include "../core/mount.h"
|
||||
#include "../core/locale.h"
|
||||
#include "../templates/misc.h"
|
||||
#include "ezc.h"
|
||||
#include "core/mount.h"
|
||||
#include "core/locale.h"
|
||||
#include "core/config.h"
|
||||
#include "templates/misc.h"
|
||||
|
||||
|
||||
|
||||
struct NotifyMsg
|
||||
@@ -46,6 +48,8 @@ namespace TemplatesNotifyFunctions
|
||||
extern Patterns patterns;
|
||||
extern NotifyMsg * notify_msg;
|
||||
|
||||
extern Config * config;
|
||||
|
||||
void notify_item_added(Info & i);
|
||||
void notify_item_edited(Info & i);
|
||||
void notify_item_deleted(Info & i);
|
||||
@@ -68,6 +72,8 @@ public:
|
||||
|
||||
TemplatesNotify();
|
||||
|
||||
void SetConfig(Config * pconfig);
|
||||
|
||||
void Read();
|
||||
void CreateFunctions();
|
||||
void Generate(Locale::Lang lang);
|
||||
|
||||
Reference in New Issue
Block a user