changed: mount points

mount type and mount fs are of type 'int' now
they can be added by plugins


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@652 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-09-12 23:33:27 +00:00
parent f48f08a98b
commit 23aedd68b0
36 changed files with 979 additions and 730 deletions

View File

@@ -10,8 +10,9 @@ notify.o: ../core/error.h ../core/log.h ../core/user.h ../core/plugindata.h
notify.o: ../core/rebus.h ../core/config.h ../core/system.h ../core/dirs.h
notify.o: ../core/dircontainer.h ../core/db.h ../core/group.h
notify.o: ../core/thread.h ../core/ugcontainer.h ../core/ticket.h
notify.o: ../core/mounts.h ../core/mount.h ../core/users.h
notify.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
notify.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
notify.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
notify.o: ../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: ../core/htmlfilter.h ../templates/misc.h

View File

@@ -11,11 +11,11 @@
#include "../core/notify.h"
namespace TemplatesNotifyFunctions
{
void notify_item_added(Info & i)
{
i.res = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_ADD) != 0;
@@ -52,17 +52,19 @@ void notify_to(Info & i)
void notify_mount_type_is_thread(Info & i)
{
i.res = notify_msg->current_mount_type == Mount::thread;
i.res = notify_msg->current_mount_type == mount_type_thread;
}
void notify_mount_type_is_ticket(Info & i)
{
i.res = notify_msg->current_mount_type == Mount::ticket;
i.res = notify_msg->current_mount_type == mount_type_ticket;
}
void notify_mount_type_is_cms(Info & i)
{
i.res = notify_msg->current_mount_type == Mount::cms;
i.res = notify_msg->current_mount_type == mount_type_cms;
}

View File

@@ -15,9 +15,16 @@
namespace TemplatesNotifyFunctions
{
// id of mount points types
int mount_type_cms;
int mount_type_thread;
int mount_type_ticket;
Patterns patterns;
Ezc::Functions ezc_functions;
Locale locale;
@@ -40,13 +47,21 @@ void TemplatesNotify::SetConfig(Config * pconfig)
TemplatesNotifyFunctions::config = pconfig;
}
void TemplatesNotify::SetMountTypes(int mcms, int mthread, int mticket)
{
using namespace TemplatesNotifyFunctions;
mount_type_cms = mcms;
mount_type_thread = mthread;
mount_type_ticket = mticket;
}
void TemplatesNotify::CreateFunctions()
{
using namespace TemplatesNotifyFunctions;
ezc_functions.Clear();
ezc_functions.Insert("notify_item_added", notify_item_added);

View File

@@ -25,7 +25,7 @@ struct NotifyMsg
{
std::string email;
int notify_code;
Mount::Type current_mount_type;
int current_mount_type;
Locale::Lang lang;
std::string doc_base_url;
std::string item_dir;
@@ -35,6 +35,11 @@ struct NotifyMsg
namespace TemplatesNotifyFunctions
{
extern int mount_type_cms;
extern int mount_type_thread;
extern int mount_type_ticket;
using Ezc::Info;
enum Pat {
@@ -74,6 +79,7 @@ public:
TemplatesNotify();
void SetConfig(Config * pconfig);
void SetMountTypes(int mcms, int mthread, int mticket);
void Read();
void CreateFunctions();