added: plugin mechanism

files: core/plugin.h core/plugin.cpp core/pluginmsg.h
added: directory 'main' with main.cpp (moved from 'core' directory)
changed: the way of building
       nearly everything is in cmslu.so
       only main() is in cmslu and is dynamically linked with cmslu.so



git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@516 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-11-13 20:40:11 +00:00
parent 7db71d43e0
commit 378cfc0c3d
28 changed files with 554 additions and 355 deletions

View File

@@ -11,7 +11,7 @@
#include "../core/data.h"
#include "../core/request.h"
#include "../core/misc.h"
#include "../core/plugin.h"
namespace TemplatesFunctions
@@ -48,14 +48,6 @@ PatternCacher pattern_cacher;
// !! tymczasowa funkcja
void is_group_tv(Info & i)
{
long gid = data.groups.GetGroupId("tv");
if( request.session->puser && request.session->puser->IsMemberOf(gid) )
i.result = true;
}
@@ -384,13 +376,8 @@ void Templates::CreateFunctions()
functions.Insert("mount_is_cms", mount_is_cms);
// !! tymczasowa
functions.Insert("is_group_tv", is_group_tv);
#ifdef APPTEMPLATES
AppTemplateFunctions::CreateAppFunctions(functions);
#endif
plugin.Call(CMSLU_TEMPLATES_CREATEFUNCTIONS, &functions);
}
@@ -463,10 +450,6 @@ void Templates::Read()
CreateFunctions();
#ifdef APPTEMPLATES
AppTemplateFunctions::ReadAppPatterns();
#endif
}