2009-10-01 00:31:20 +02:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef headerfilecmslutemplatestemplatesnotify
|
|
|
|
#define headerfilecmslutemplatestemplatesnotify
|
|
|
|
|
|
|
|
#include <iomanip>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include "../core/mount.h"
|
2010-01-28 16:39:01 +01:00
|
|
|
#include "../core/locale.h"
|
|
|
|
#include "../templates/misc.h"
|
2009-11-13 21:40:11 +01:00
|
|
|
#include "ezc.h"
|
2009-10-01 00:31:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
struct NotifyMsg
|
|
|
|
{
|
|
|
|
std::string email;
|
|
|
|
int notify_code;
|
|
|
|
Mount::Type current_mount_type;
|
2010-01-28 16:39:01 +01:00
|
|
|
Locale::Lang lang;
|
2009-10-01 00:31:20 +02:00
|
|
|
std::string doc_base_url;
|
|
|
|
std::string item_dir;
|
|
|
|
std::string item_link;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
namespace TemplatesNotifyFunctions
|
|
|
|
{
|
|
|
|
using Ezc::Info;
|
|
|
|
|
2010-01-28 16:39:01 +01:00
|
|
|
enum Pat {
|
|
|
|
pat_email_notify = 0, // first should be zero
|
|
|
|
|
|
|
|
pat_last // should be last
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<std::vector<Ezc::Pattern> > Patterns;
|
|
|
|
|
|
|
|
extern TemplatesMisc::Patterns patterns;
|
2009-10-01 00:31:20 +02:00
|
|
|
extern NotifyMsg * notify_msg;
|
|
|
|
|
|
|
|
void notify_item_added(Info & i);
|
|
|
|
void notify_item_edited(Info & i);
|
|
|
|
void notify_item_deleted(Info & i);
|
|
|
|
void notify_dir_added(Info & i);
|
|
|
|
void notify_to(Info & i);
|
2010-01-25 05:52:17 +01:00
|
|
|
void notify_mount_type_is_thread(Info & i);
|
|
|
|
void notify_mount_type_is_cms(Info & i);
|
2009-10-01 00:31:20 +02:00
|
|
|
void notify_doc_base_url(Info & i);
|
|
|
|
void notify_item_dir(Info & i);
|
|
|
|
void notify_item_link(Info & i);
|
|
|
|
|
|
|
|
} // namespace TemplatesNotifyFunctions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TemplatesNotify
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2010-01-28 16:39:01 +01:00
|
|
|
TemplatesNotify();
|
|
|
|
|
|
|
|
void Read();
|
|
|
|
void CreateFunctions();
|
|
|
|
void Generate(Locale::Lang lang);
|
2009-10-01 00:31:20 +02:00
|
|
|
|
|
|
|
std::ostringstream notify_str;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2010-01-28 16:39:01 +01:00
|
|
|
void Read(TemplatesNotifyFunctions::Pat pat, const std::string & dir, const char * file);
|
|
|
|
void Read(TemplatesNotifyFunctions::Pat pat, const char * file);
|
|
|
|
void ClearPatterns();
|
2009-10-01 00:31:20 +02:00
|
|
|
|
2010-01-28 16:39:01 +01:00
|
|
|
std::string temp;
|
2009-10-01 00:31:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|