2009-06-05 22:29:06 +02:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-06-05 22:29:06 +02:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2010-02-28 22:33:06 +01:00
|
|
|
* Copyright (c) 2008-2010, Tomasz Sowa
|
2009-06-05 22:29:06 +02:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "templates.h"
|
2010-08-13 22:04:57 +02:00
|
|
|
#include "core/misc.h"
|
2009-06-05 22:29:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace TemplatesFunctions
|
|
|
|
{
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
void mount_type_is(Info & i)
|
2009-06-05 22:29:06 +02:00
|
|
|
{
|
2010-09-29 23:24:34 +02:00
|
|
|
int mount_type_id = system->mounts.FindMountType(i.par);
|
2009-06-05 22:29:06 +02:00
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
if( mount_type_id == -1 )
|
|
|
|
return;
|
2010-05-30 23:07:46 +02:00
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
i.res = (system->mounts.pmount->type == mount_type_id);
|
2009-06-07 04:40:27 +02:00
|
|
|
}
|
2009-06-05 22:29:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
void mount_page_arg_is(Info & i)
|
2009-10-01 00:31:20 +02:00
|
|
|
{
|
2010-09-29 23:24:34 +02:00
|
|
|
i.res = system->mounts.pmount->IsArg(system->mounts.MountParPage(), i.par);
|
2009-10-01 00:31:20 +02:00
|
|
|
}
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
void mount_thread_arg_is(Info & i)
|
2009-10-01 00:31:20 +02:00
|
|
|
{
|
2010-09-29 23:24:34 +02:00
|
|
|
i.res = system->mounts.pmount->IsArg(system->mounts.MountParThread(), i.par);
|
2009-10-01 00:31:20 +02:00
|
|
|
}
|
|
|
|
|
2010-09-29 23:24:34 +02:00
|
|
|
|
2010-08-13 22:04:57 +02:00
|
|
|
void mount_has_html_template(Info & i)
|
|
|
|
{
|
2010-09-13 01:33:27 +02:00
|
|
|
i.res = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()].defined;
|
2010-08-13 22:04:57 +02:00
|
|
|
}
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
|
2010-08-13 22:04:57 +02:00
|
|
|
void mount_first_html_template(Info & i)
|
|
|
|
{
|
2010-09-13 01:33:27 +02:00
|
|
|
Mount::ParamRow & par = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()];
|
2010-08-13 22:04:57 +02:00
|
|
|
|
|
|
|
if( par.defined && !par.arg.empty() )
|
|
|
|
HtmlEscape(i.out, par.arg[0]);
|
|
|
|
}
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
} // namespace TemplatesFunctions
|
|
|
|
|
|
|
|
|
|
|
|
|