added: notifications to users' emails

(core/notify.h core/notify.cpp)
       templatesnotify directory
       all notifications are managed by a second thread


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@512 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-09-30 22:31:20 +00:00
parent 9902ce2b78
commit 85b678a8fb
30 changed files with 769 additions and 37 deletions

89
templatesnotify/notify.cpp Executable file
View File

@@ -0,0 +1,89 @@
/*
* 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.
*
*/
#include "templatesnotify.h"
#include "../core/notify.h"
namespace TemplatesNotifyFunctions
{
void notify_item_added(Info & i)
{
i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_ADD) != 0;
}
void notify_item_edited(Info & i)
{
i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_EDIT) != 0;
}
void notify_item_deleted(Info & i)
{
i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_DELETE) != 0;
}
void notify_dir_added(Info & i)
{
i.result = (notify_msg->notify_code & CMSLU_NOTIFY_DIR_ADD) != 0;
}
void notify_to(Info & i)
{
i.out << notify_msg->email;
}
void notify_mount_is_thread(Info & i)
{
i.result = notify_msg->current_mount_type == Mount::thread;
}
void notify_mount_is_cms(Info & i)
{
i.result = notify_msg->current_mount_type == Mount::cms;
}
void notify_doc_base_url(Info & i)
{
i.out << notify_msg->doc_base_url;
}
void notify_item_dir(Info & i)
{
i.out << notify_msg->item_dir;
}
void notify_item_link(Info & i)
{
i.out << notify_msg->item_link;
}
} // namespace TemplatesNotifyFunctions