diff --git a/core/item.cpp b/core/item.cpp index 1ac0b9b..f22851c 100755 --- a/core/item.cpp +++ b/core/item.cpp @@ -74,6 +74,7 @@ void Item::Clear() html_template.clear(); sort_index = 0; meta.Clear(); + ameta.Clear(); SetDateToNow(); } diff --git a/core/item.h b/core/item.h index 0dcca59..41c31e8 100755 --- a/core/item.h +++ b/core/item.h @@ -98,6 +98,7 @@ struct Item // meta information PT::Space meta; + PT::Space ameta; // methods diff --git a/core/version.h b/core/version.h index 65c847e..6af559d 100755 --- a/core/version.h +++ b/core/version.h @@ -13,7 +13,7 @@ #define WINIX_VER_MAJOR 0 #define WINIX_VER_MINOR 5 -#define WINIX_VER_REVISION 1 +#define WINIX_VER_REVISION 2 #endif diff --git a/db/db.cpp b/db/db.cpp index 2de6cc8..5397cb7 100755 --- a/db/db.cpp +++ b/db/db.cpp @@ -311,7 +311,7 @@ Error Db::AddItemIntoItem(Item & item) query.Clear(); query << R("insert into core.item (user_id, modification_user_id, group_id, privileges, " "date_creation, date_modification, type, parent_id, content_id, " - "link_to, link_redirect, subject, guest_name, template, sort_index, meta, url) values (") + "link_to, link_redirect, subject, guest_name, template, sort_index, meta, ameta, url) values (") << item.user_id << item.modification_user_id << item.group_id @@ -327,7 +327,8 @@ Error Db::AddItemIntoItem(Item & item) << item.guest_name << item.html_template << item.sort_index - << item.meta; + << item.meta + << item.ameta; url_without_id = AddItemCreateUrlSubject(item); @@ -469,7 +470,7 @@ Error Db::EditItemInItem(Item & item, bool with_url) query.Clear(); query << R("update core.item set (user_id, modification_user_id, group_id, privileges, " "date_creation, date_modification, type, link_to, link_redirect, parent_id, subject, " - "guest_name, template, sort_index, meta"); + "guest_name, template, sort_index, meta, ameta"); if( with_url ) query << R(", url"); @@ -489,7 +490,8 @@ Error Db::EditItemInItem(Item & item, bool with_url) << item.guest_name << item.html_template << item.sort_index - << item.meta; + << item.meta + << item.ameta; if( with_url ) { @@ -771,7 +773,7 @@ void Db::GetItemsQuerySelect(const DbItemQuery & iq, DbTextStream & query, bool if( iq.sel_file ) query << R(", file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size"); if( iq.sel_html_template ) query << R(", template"); if( iq.sel_sort_index ) query << R(", sort_index"); - if( iq.sel_meta ) query << R(", meta"); + if( iq.sel_meta ) query << R(", meta, ameta"); } query << R(" from core.item"); @@ -1343,6 +1345,19 @@ return DoCommand(query); } +Error Db::EditAdminMetaById(const PT::Space & ameta, long id) +{ + query.Clear(); + query << R("update core.item set (ameta) = (") + << ameta + << R(") where id=") + << id + << R(";"); + +return DoCommand(query); +} + + Error Db::EditSubjectById(Item & item, long id) diff --git a/db/db.h b/db/db.h index 7853843..e18a476 100755 --- a/db/db.h +++ b/db/db.h @@ -72,6 +72,7 @@ public: Error EditFileById(const Item & item, long id); // file_path, file_fs, file_type Error EditHasThumbById(bool has_thumb, long id); Error EditMetaById(const PT::Space & meta, long id); + Error EditAdminMetaById(const PT::Space & meta, long id); Error DelDirById(long id); Error DelFileById(long file_id); diff --git a/db/dbitemcolumns.cpp b/db/dbitemcolumns.cpp index dda1e81..66c05f0 100755 --- a/db/dbitemcolumns.cpp +++ b/db/dbitemcolumns.cpp @@ -46,6 +46,7 @@ void DbItemColumns::SetColumns(PGresult * r) modify_index = PQfnumber(r, "modify_index"); sort_index = PQfnumber(r, "sort_index"); meta = PQfnumber(r, "meta"); + ameta = PQfnumber(r, "ameta"); } @@ -82,7 +83,8 @@ void DbItemColumns::SetItem(PGresult * r, long row, Item & item) if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template); if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index); - if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta); + if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta); + if( ameta != -1 ) db_base.AssertValueSpace(r, row, ameta, item.ameta); } diff --git a/db/dbitemcolumns.h b/db/dbitemcolumns.h index ac3011c..24acb39 100755 --- a/db/dbitemcolumns.h +++ b/db/dbitemcolumns.h @@ -48,6 +48,7 @@ struct DbItemColumns int modify_index; int sort_index; int meta; + int ameta; DbItemColumns(DbBase & db_base_) : db_base(db_base_) { diff --git a/db/dbitemquery.h b/db/dbitemquery.h index 23edcae..b4b89e9 100755 --- a/db/dbitemquery.h +++ b/db/dbitemquery.h @@ -33,7 +33,7 @@ struct DbItemQuery bool sel_file; // file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size bool sel_html_template; // template bool sel_sort_index; // sort_index - bool sel_meta; // meta PT::Space + bool sel_meta; // meta and ameta (PT::Space) bool where_id; // bool where_parent_id; // diff --git a/functions/env.cpp b/functions/env.cpp index ebf5e09..767c34c 100755 --- a/functions/env.cpp +++ b/functions/env.cpp @@ -54,7 +54,7 @@ return (conf_parser.ParseString(env_str) == PT::SpaceParser::ok); } -bool Env::EditAdminEnv(long user_id, const std::wstring & env_str) +bool Env::EditAdminEnv(long user_id, const std::wstring & env_str, bool use_ses_log) { if( Parse(env_str) ) { @@ -69,21 +69,23 @@ bool Env::EditAdminEnv(long user_id, const std::wstring & env_str) } else { - log << log1 << "Evn: a problem with changing environment variables for user: " + log << log1 << "Evn: a database problem with changing environment variables for user: " << cur->session->puser->name << ", id: " << cur->session->puser->id << logend; } } else { log << log2 << "Env: Syntax error in line: " << conf_parser.line << logend; - slog << logerror << "Syntax error in line: " << conf_parser.line << logend; + + if( use_ses_log ) + slog << logerror << T("syntax_error_in_line") << ' ' << conf_parser.line << logend; } return false; } -bool Env::EditEnv(long user_id, const std::wstring & env_str) +bool Env::EditEnv(long user_id, const std::wstring & env_str, bool use_ses_log) { if( Parse(env_str) ) { @@ -98,20 +100,23 @@ bool Env::EditEnv(long user_id, const std::wstring & env_str) } else { - log << log1 << "Evn: a problem with changing admin environment variables for user: " + log << log1 << "Evn: a database problem with changing admin environment variables for user: " << cur->session->puser->name << ", id: " << cur->session->puser->id << logend; } } else { log << log2 << "Env: Syntax error in line: " << conf_parser.line << logend; - slog << logerror << "Syntax error in line: " << conf_parser.line << logend; + + if( use_ses_log ) + slog << logerror << T("syntax_error_in_line") << ' ' << conf_parser.line << logend; } return false; } + void Env::SaveEnv() { if( GetUser() ) @@ -123,11 +128,11 @@ void Env::SaveEnv() if( cur->request->IsParam(L"a") ) { if( cur->session->puser->super_user ) - status = EditAdminEnv(user_id, env_str); + status = EditAdminEnv(user_id, env_str, true); } else { - status = EditEnv(user_id, env_str); + status = EditEnv(user_id, env_str, true); } if( status ) diff --git a/functions/env.h b/functions/env.h index 7d33fda..f4636d6 100755 --- a/functions/env.h +++ b/functions/env.h @@ -24,8 +24,8 @@ public: Env(); - bool EditAdminEnv(long user_id, const std::wstring & env_str); - bool EditEnv(long user_id, const std::wstring & env_str); + bool EditAdminEnv(long user_id, const std::wstring & env_str, bool use_ses_log = false); + bool EditEnv(long user_id, const std::wstring & env_str, bool use_ses_log = false); bool HasAccess(); void MakePost(); diff --git a/functions/meta.cpp b/functions/meta.cpp index 4ac054a..8ebd424 100755 --- a/functions/meta.cpp +++ b/functions/meta.cpp @@ -17,30 +17,53 @@ namespace Fun Meta::Meta() { fun.url = L"meta"; + // !! CHECKME what about follow symlinks? } bool Meta::HasAccess() { - return system->HasReadAccess(*cur->request->last_item); + if( cur->request->IsParam(L"a") ) + return cur->session->puser && cur->session->puser->super_user; + else + return system->HasWriteAccess(*cur->request->last_item); } -bool Meta::AddMetaInfo(Item & item, const std::wstring & meta_str) +bool Meta::Parse(const std::wstring & meta_str) { space.Clear(); conf_parser.SetSpace(space); conf_parser.UTF8(config->utf8); conf_parser.SplitSingle(true); - if( conf_parser.ParseString(meta_str) == PT::SpaceParser::ok ) +return (conf_parser.ParseString(meta_str) == PT::SpaceParser::ok); +} + + + + +bool Meta::EditAdminMeta(long item_id, const std::wstring & meta_str, bool use_ses_log) +{ + if( Parse(meta_str) ) { - if( db->EditMetaById(space, item.id) == WINIX_ERR_OK ) + if( db->EditAdminMetaById(space, item_id) == WINIX_ERR_OK ) { - item.meta = space; return true; } + else + { + log << log1 << "Meta: a database problem with changing admin meta information for item id: " + << item_id << logend; + } + } + else + { + log << log2 << "Meta: Syntax error in line: " << conf_parser.line << logend; + + if( use_ses_log ) + slog << logerror << T("syntax_error_in_line") << ' ' << conf_parser.line << logend; } return false; @@ -48,21 +71,64 @@ return false; -void Meta::MakePost() +bool Meta::EditMeta(long item_id, const std::wstring & meta_str, bool use_ses_log) +{ + if( Parse(meta_str) ) + { + if( db->EditMetaById(space, item_id) == WINIX_ERR_OK ) + { + return true; + } + else + { + log << log1 << "Meta: a database problem with changing meta information for item id: " + << item_id << logend; + } + } + else + { + log << log2 << "Meta: Syntax error in line: " << conf_parser.line << logend; + + if( use_ses_log ) + slog << logerror << T("syntax_error_in_line") << ' ' << conf_parser.line << logend; + } + +return false; +} + + + +void Meta::ChangeAdminMeta() +{ + if( cur->session->puser && cur->session->puser->super_user ) + { + const std::wstring & meta_str = cur->request->PostVar(L"itemmeta"); + + if( EditAdminMeta(cur->request->last_item->id, meta_str, true) ) + system->RedirectToLastItem(); + } +} + + +void Meta::ChangeMeta() { if( system->HasWriteAccess(*cur->request->last_item) ) { const std::wstring & meta_str = cur->request->PostVar(L"itemmeta"); - if( AddMetaInfo(*cur->request->last_item, meta_str) ) + if( EditMeta(cur->request->last_item->id, meta_str, true) ) system->RedirectToLastItem(); - else - slog << logerror << "Syntax error in line: " << conf_parser.line << logend; } +} + + + +void Meta::MakePost() +{ + if( cur->request->IsParam(L"a") ) + ChangeAdminMeta(); else - { - cur->request->status = WINIX_ERR_PERMISSION_DENIED; - } + ChangeMeta(); } diff --git a/functions/meta.h b/functions/meta.h index 529088f..17bb08a 100755 --- a/functions/meta.h +++ b/functions/meta.h @@ -26,12 +26,19 @@ public: bool HasAccess(); void MakePost(); - bool AddMetaInfo(Item & item, const std::wstring & meta_str); + + bool EditAdminMeta(long item_id, const std::wstring & meta_str, bool use_ses_log = false); + bool EditMeta(long item_id, const std::wstring & meta_str, bool use_ses_log = false); private: PT::SpaceParser conf_parser; PT::Space space; + + bool Parse(const std::wstring & meta_str); + void ChangeAdminMeta(); + void ChangeMeta(); + }; diff --git a/html/fun_meta.html b/html/fun_meta.html index 5045a13..580ee4c 100755 --- a/html/fun_meta.html +++ b/html/fun_meta.html @@ -1,12 +1,40 @@
-

{meta_header}

+[if winix_function_param_is "a"] +

{meta_admin_header}

+ + [if item_is] +
+ + + + + [if winix_function_param_is "postredirect"] + + [end] + +
+ [else] +
+ + + + + [if winix_function_param_is "postredirect"] + + [end] + +
+ [end] + + +[else] + +

{meta_header}

+ + [if item_is] +
-[if item_is] - [if item_can_write] - -
- {form_meta_legend} @@ -14,28 +42,20 @@ [end] -
[else] -
[item_meta_str]
- [end] -[else] - [if dir_can_write] -
-
- {form_meta_legend} - - + - [if winix_function_param_is "postredirect"] - - [end] + + -
-
- [else] -
[dir_last_meta_str]
+ [if winix_function_param_is "postredirect"] + + [end] + + [end] + [end] diff --git a/locale/en b/locale/en index 4848eff..f690e72 100755 --- a/locale/en +++ b/locale/en @@ -10,6 +10,9 @@ logged_as_long = You are logged as display_guest_name = guest unknown = unknown +syntax_error_in_line = Syntax error in line: + + this_ip_is_banned_until = We are sorry but your IP address is banned until to: account_not_activated = This account is not activated yet. @@ -177,7 +180,7 @@ man_ezc_functions = EZC templates functions meta_header = Meta -form_meta_legend = Form for changing meta info +meta_admin_header = Admin meta mkdir_header = Make directory diff --git a/locale/pl b/locale/pl index 5aa48ef..45de9f7 100755 --- a/locale/pl +++ b/locale/pl @@ -11,6 +11,9 @@ logged_as_long = Aktualnie jesteś zalogowany jako display_guest_name = gość unknown = nie znany +syntax_error_in_line = Błąd składni w linii: + + this_ip_is_banned_until = Przepraszamy ale twój adres IP jest zablokowany aż do: @@ -175,7 +178,7 @@ ipban_ban_list_empty = W tej chwili nie ma żadnych zbanowanych adresów IP. meta_header = Meta -form_meta_legend = Formularz zmiany meta informacji +meta_admin_header = Admin meta man_header = Man diff --git a/plugins/thread/reply.cpp b/plugins/thread/reply.cpp index a9c11f0..965418b 100755 --- a/plugins/thread/reply.cpp +++ b/plugins/thread/reply.cpp @@ -53,6 +53,15 @@ bool Reply::HasAccess() if( !files_dir || !system->HasWriteAccess(*files_dir) ) return false; + + PT::Space * thread_space = cur->request->item.ameta.FindSpace(L"thread"); + + if( thread_space ) + { + if( thread_space->Bool(L"closed", false) ) + return false; + } + return true; } diff --git a/plugins/ticket/editticket.cpp b/plugins/ticket/editticket.cpp index 3fbc783..6c76192 100755 --- a/plugins/ticket/editticket.cpp +++ b/plugins/ticket/editticket.cpp @@ -50,6 +50,8 @@ bool EditTicket::HasAccess() if( cur->mount->type != ticket_info->mount_type_ticket ) return false; + // !! CHECKME what about closing threads? + return true; } @@ -187,19 +189,39 @@ void EditTicket::MakePost() } +void EditTicket::CloseTicket() +{ + PT::Space & ticket_space = cur->request->item.ameta.FindAddSpace(L"ticket"); + ticket_space.Add(L"closed", true); + + PT::Space & thread_space = cur->request->item.ameta.FindAddSpace(L"thread"); + thread_space.Add(L"closed", true); + + if( db->EditAdminMetaById(cur->request->item.ameta, cur->request->item.id) == WINIX_ERR_OK ) + log << log3 << "EditTicket: closing ticket" << logend; +} + void EditTicket::MakeGet() { - ticket_info->Clear(); - ticket_info->FindCurrentConf(); + if( cur->request->IsParam(L"close") ) + { + CloseTicket(); + system->RedirectToLastItem(); + } + else + { + ticket_info->Clear(); + ticket_info->FindCurrentConf(); - Ticket & ticket = PrepareTicket(); - PT::Space & meta = PrepareSpace(); - ticket_info->ticket = &ticket; - ticket_info->item = &cur->request->item; + Ticket & ticket = PrepareTicket(); + PT::Space & meta = PrepareSpace(); + ticket_info->ticket = &ticket; + ticket_info->item = &cur->request->item; - // copy meta info to display correctly new files - ticket_info->CopyTicketSpace(meta, cur->request->item); + // copy meta info to display correctly new files + ticket_info->CopyTicketSpace(meta, cur->request->item); + } } diff --git a/plugins/ticket/editticket.h b/plugins/ticket/editticket.h index c7e674b..52df157 100755 --- a/plugins/ticket/editticket.h +++ b/plugins/ticket/editticket.h @@ -46,6 +46,7 @@ private: PT::Space & PrepareSpace(); void ChangeTicket(Ticket & ticket, Item & item); void Submit(Ticket & ticket, Item & item); + void CloseTicket(); }; diff --git a/plugins/ticket/templates.cpp b/plugins/ticket/templates.cpp index d6db27d..da75cbe 100755 --- a/plugins/ticket/templates.cpp +++ b/plugins/ticket/templates.cpp @@ -274,6 +274,14 @@ void ticket_meta_value(Info & i) space(i, ticket_info.item->meta); } +void ticket_is_closed(Info & i) +{ + PT::Space * ticket_space = cur->request->item.ameta.FindSpace(L"ticket"); + + if( ticket_space ) + i.res = ticket_space->Bool(L"closed", false); +} + namespace ns_tickets_tab @@ -414,6 +422,21 @@ void tickets_tab(Info & i) } +void tickets_tab_is_closed(Info & i) +{ + tickets_tab_check_reqid(); + + if( tickets_value.is_item ) + { + PT::Space * ticket_space = tickets_value.item->ameta.FindSpace(L"ticket"); + + if( ticket_space ) + i.res = ticket_space->Bool(L"closed", false); + } +} + + + void tickets_tab_url(Info & i) { tickets_tab_check_reqid(); @@ -844,8 +867,10 @@ using namespace ns_ticket_tab; fun->Insert("ticket_can_edit", ticket_can_edit); fun->Insert("ticket_is_creating_new", ticket_is_creating_new); fun->Insert("ticket_meta_value", ticket_meta_value); + fun->Insert("ticket_is_closed", ticket_is_closed); fun->Insert("tickets_tab", tickets_tab); + fun->Insert("tickets_tab_is_closed", tickets_tab_is_closed); fun->Insert("tickets_tab_url", tickets_tab_url); fun->Insert("tickets_tab_subject_empty", tickets_tab_subject_empty); fun->Insert("tickets_tab_subject", tickets_tab_subject); diff --git a/templates/Makefile.dep b/templates/Makefile.dep index 7141e8c..da1dd07 100755 --- a/templates/Makefile.dep +++ b/templates/Makefile.dep @@ -132,7 +132,7 @@ dir.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h dir.o: ../functions/specialdefault.h ../functions/stat.h dir.o: ../functions/subject.h ../functions/template.h ../functions/tinymce.h dir.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h -dir.o: ../functions/who.h ../functions/vim.h +dir.o: ../functions/who.h ../functions/vim.h miscspace.h doc.o: templates.h ../../ezc/src/ezc.h ../../ezc/src/generator.h doc.o: ../../ezc/src/pattern.h ../../ezc/src/item.h ../../ezc/src/funinfo.h doc.o: ../../ezc/src/functions.h ../../ezc/src/stringconv.h diff --git a/templates/dir.cpp b/templates/dir.cpp index cd03250..a959768 100755 --- a/templates/dir.cpp +++ b/templates/dir.cpp @@ -10,6 +10,7 @@ #include "templates.h" #include "core/misc.h" #include "functions/functions.h" +#include "miscspace.h" namespace TemplatesFunctions @@ -432,14 +433,71 @@ void dir_last_has_html_template(Info & i) } + void dir_last_meta_str(Info & i) { cur->request->dir_tab.back()->meta.Serialize(i.out, true, false); } +void dir_last_meta(Info & i) +{ + space(i, cur->request->dir_tab.back()->meta); +} + + +void dir_last_meta_tab(Info & i) +{ + spaces_tab(i, cur->request->dir_tab.back()->meta); +} + + +void dir_last_meta_tab_value(Info & i) +{ + spaces_tab_value(i, cur->request->dir_tab.back()->meta); +} + + + +void dir_last_meta_tab_has_next(Info & i) +{ + spaces_tab_has_next(i, cur->request->dir_tab.back()->meta); +} + + + + +void dir_last_admin_meta_str(Info & i) +{ + cur->request->dir_tab.back()->ameta.Serialize(i.out, true, false); +} + + +void dir_last_admin_meta(Info & i) +{ + space(i, cur->request->dir_tab.back()->ameta); +} + + +void dir_last_admin_meta_tab(Info & i) +{ + spaces_tab(i, cur->request->dir_tab.back()->ameta); +} + + +void dir_last_admin_meta_tab_value(Info & i) +{ + spaces_tab_value(i, cur->request->dir_tab.back()->ameta); +} + + +void dir_last_admin_meta_tab_has_next(Info & i) +{ + spaces_tab_has_next(i, cur->request->dir_tab.back()->ameta); +} + + + } // namespace TemplatesFunctions - - diff --git a/templates/item.cpp b/templates/item.cpp index 8b4cfac..2d461a4 100755 --- a/templates/item.cpp +++ b/templates/item.cpp @@ -393,10 +393,12 @@ void item_meta_str(Info & i) void item_meta(Info & i) { - space(i, cur->request->last_item->meta); + space(i, cur->request->last_item->meta); // !! a new interface (last_item instead of item) } + + void item_meta_tab(Info & i) { spaces_tab(i, cur->request->last_item->meta); @@ -418,6 +420,38 @@ void item_meta_tab_has_next(Info & i) +void item_admin_meta_str(Info & i) +{ + cur->request->item.ameta.Serialize(i.out, true, false); +} + + +void item_admin_meta(Info & i) +{ + space(i, cur->request->last_item->ameta); +} + + +void item_admin_meta_tab(Info & i) +{ + spaces_tab(i, cur->request->last_item->ameta); +} + + +void item_admin_meta_tab_value(Info & i) +{ + spaces_tab_value(i, cur->request->last_item->ameta); +} + + +void item_admin_meta_tab_has_next(Info & i) +{ + spaces_tab_has_next(i, cur->request->last_item->ameta); +} + + + + static size_t item_index; diff --git a/templates/templates.cpp b/templates/templates.cpp index ebd79c5..a290851 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -225,8 +225,36 @@ void Templates::CreateFunctions() ezc_functions.Insert("dir_last_html_template", dir_last_html_template); ezc_functions.Insert("dir_last_has_html_template", dir_last_has_html_template); ezc_functions.Insert("dir_last_meta_str", dir_last_meta_str); + ezc_functions.Insert("dir_last_meta", dir_last_meta); + ezc_functions.Insert("dir_last_meta_tab", dir_last_meta_tab); + ezc_functions.Insert("dir_last_meta_tab_value", dir_last_meta_tab_value); + ezc_functions.Insert("dir_last_meta_tab_has_next", dir_last_meta_tab_has_next); + ezc_functions.Insert("dir_last_admin_meta_str", dir_last_admin_meta_str); + ezc_functions.Insert("dir_last_admin_meta", dir_last_admin_meta); + ezc_functions.Insert("dir_last_admin_meta_tab", dir_last_admin_meta_tab); + ezc_functions.Insert("dir_last_admin_meta_tab_value", dir_last_admin_meta_tab_value); + ezc_functions.Insert("dir_last_admin_meta_tab_has_next", dir_last_admin_meta_tab_has_next); + /* + doc + */ + ezc_functions.Insert("doc_title", doc_title); + ezc_functions.Insert("doc_proto", doc_proto); + ezc_functions.Insert("doc_proto_static", doc_proto_static); + ezc_functions.Insert("doc_proto_common", doc_proto_common); + ezc_functions.Insert("doc_base_url", doc_base_url); + ezc_functions.Insert("doc_base_url_static", doc_base_url_static); + ezc_functions.Insert("doc_base_url_common", doc_base_url_common); + ezc_functions.Insert("doc_current_url", doc_current_url); + ezc_functions.Insert("doc_css_tab", doc_css_tab); + ezc_functions.Insert("doc_css_tab_file", doc_css_tab_file); + ezc_functions.Insert("doc_css_tab_file_is_global", doc_css_tab_file_is_global); + ezc_functions.Insert("doc_css_tab_has_next", doc_css_tab_has_next); + ezc_functions.Insert("doc_css_is_empty", doc_css_is_empty); + ezc_functions.Insert("doc_css_is_one", doc_css_is_one); + ezc_functions.Insert("doc_css_more_than_one", doc_css_more_than_one); + /* env */ @@ -253,26 +281,6 @@ void Templates::CreateFunctions() ezc_functions.Insert("fil_new_line_to_br", fil_new_line_to_br); - /* - doc - */ - ezc_functions.Insert("doc_title", doc_title); - ezc_functions.Insert("doc_proto", doc_proto); - ezc_functions.Insert("doc_proto_static", doc_proto_static); - ezc_functions.Insert("doc_proto_common", doc_proto_common); - ezc_functions.Insert("doc_base_url", doc_base_url); - ezc_functions.Insert("doc_base_url_static", doc_base_url_static); - ezc_functions.Insert("doc_base_url_common", doc_base_url_common); - ezc_functions.Insert("doc_current_url", doc_current_url); - ezc_functions.Insert("doc_css_tab", doc_css_tab); - ezc_functions.Insert("doc_css_tab_file", doc_css_tab_file); - ezc_functions.Insert("doc_css_tab_file_is_global", doc_css_tab_file_is_global); - ezc_functions.Insert("doc_css_tab_has_next", doc_css_tab_has_next); - ezc_functions.Insert("doc_css_is_empty", doc_css_is_empty); - ezc_functions.Insert("doc_css_is_one", doc_css_is_one); - ezc_functions.Insert("doc_css_more_than_one", doc_css_more_than_one); - - /* insert */ @@ -345,6 +353,11 @@ void Templates::CreateFunctions() ezc_functions.Insert("item_meta_tab", item_meta_tab); ezc_functions.Insert("item_meta_tab_value", item_meta_tab_value); ezc_functions.Insert("item_meta_tab_has_next", item_meta_tab_has_next); + ezc_functions.Insert("item_admin_meta_str", item_admin_meta_str); + ezc_functions.Insert("item_admin_meta", item_admin_meta); + ezc_functions.Insert("item_admin_meta_tab", item_admin_meta_tab); + ezc_functions.Insert("item_admin_meta_tab_value", item_admin_meta_tab_value); + ezc_functions.Insert("item_admin_meta_tab_has_next", item_admin_meta_tab_has_next); ezc_functions.Insert("item_tab", item_tab); ezc_functions.Insert("item_tab_index", item_tab_index); diff --git a/templates/templates.h b/templates/templates.h index ee707bd..cbecdc6 100755 --- a/templates/templates.h +++ b/templates/templates.h @@ -135,6 +135,15 @@ namespace TemplatesFunctions void dir_last_html_template(Info & i); void dir_last_has_html_template(Info & i); void dir_last_meta_str(Info & i); + void dir_last_meta(Info & i); + void dir_last_meta_tab(Info & i); + void dir_last_meta_tab_value(Info & i); + void dir_last_meta_tab_has_next(Info & i); + void dir_last_admin_meta_str(Info & i); + void dir_last_admin_meta(Info & i); + void dir_last_admin_meta_tab(Info & i); + void dir_last_admin_meta_tab_value(Info & i); + void dir_last_admin_meta_tab_has_next(Info & i); /* @@ -256,6 +265,11 @@ namespace TemplatesFunctions void item_meta_tab(Info & i); void item_meta_tab_value(Info & i); void item_meta_tab_has_next(Info & i); + void item_admin_meta_str(Info & i); + void item_admin_meta(Info & i); + void item_admin_meta_tab(Info & i); + void item_admin_meta_tab_value(Info & i); + void item_admin_meta_tab_has_next(Info & i); void item_tab(Info & i); void item_tab_index(Info & i);