Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1033988
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 21, 8:33 AM
Size
106 KB
Mime Type
text/x-diff
Expires
Mon, Jun 23, 8:33 AM (15 m, 52 s)
Engine
blob
Format
Raw Data
Handle
668223
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/RC/kernel/units/sections/sections_config.php
===================================================================
--- branches/RC/kernel/units/sections/sections_config.php (revision 10720)
+++ branches/RC/kernel/units/sections/sections_config.php (revision 10721)
@@ -1,332 +1,322 @@
<?php
$config = Array (
'Prefix' => 'inportal-sections',
'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
// 'SectionPrefix' => 'u',
'Sections' => Array (
'in-portal:root' => Array (
'parent' => null,
'icon' => 'in-portal:site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array ('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array ('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:site' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:struct',
'label' => 'la_tab_Site_Structure',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
'SectionPrefix' => 'c',
),
'in-portal:browse' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:catalog',
'label' => 'la_tab_Browse',
'url' => Array ('t' => 'in-portal/catalog', 'pass' => 'm'),
'late_load' => Array ('t' => 'in-portal/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'onclick' => 'checkCatalog(0)',
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array ('t' => 'in-portal/advanced_view', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:reviews' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:reviews',
'label' => 'la_tab_Reviews',
'url' => Array ('t' => 'in-portal/reviews', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:cat_settings',
'label' => 'la_tab_Settings',
'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array ('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array ('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
'in-portal:users' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:community',
'label' => 'la_tab_Community',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2,
'type' => stTREE,
'SectionPrefix' => 'u',
),
'in-portal:user_list' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:users',
'label' => 'la_tab_User_List',
'url' => Array ('t' => 'in-portal/users/users_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
'priority' => 1,
'type' => stTREE,
),
'in-portal:user_groups' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:usergroups',
'label' => 'la_tab_User_Groups',
'url' => Array ('t' => 'in-portal/groups/groups_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:send_email', 'advanced:manage_permissions'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:configure_users' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array ('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array ('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:banlist',
'label' => 'la_tab_BanList',
'url' => Array ('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:help',
'label' => 'la_tab_Help',
'url' => Array ('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 7,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:summary_logs',
'label' => 'la_tab_Reports',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 4,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:log_summary' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:summary',
'label' => 'la_tab_Summary',
'url' => Array ('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:search_log',
'label' => 'la_tab_SearchLog',
'url' => Array ('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array ('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:email_log',
'label' => 'la_tab_EmailLog',
'url' => Array ('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:visits',
'label' => 'la_tab_Visits',
'url' => Array ('t' => 'in-portal/visits/visits_list', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:conf',
'label' => 'la_tab_Sys_Config',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 5,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:configure_general' => Array (
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_general',
'label' => 'la_tab_General',
'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'module' => 'In-Portal', 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_themes' => Array (
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_themes',
'label' => 'la_tab_Themes',
'url' => Array ('index_file' => 'config/config_theme.php', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:tools',
'label' => 'la_tab_Tools',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 6,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
- 'in-portal:restore' => Array (
- 'parent' => 'in-portal:tools',
- 'icon' => 'in-portal:tool_restore',
- 'label' => 'la_tab_Restore',
- 'url' => Array ('index_file' => 'backup/restore1.php', 'pass' => 'm'),
- 'permissions' => Array ('view'),
- 'priority' => 3,
- 'type' => stTREE,
- ),
-
'in-portal:main_import' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_ImportData',
'url' => Array ('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array ('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array ('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 6,
'type' => stTREE,
),
),
);
\ No newline at end of file
Property changes on: branches/RC/kernel/units/sections/sections_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.3
\ No newline at end of property
+1.5.2.4
\ No newline at end of property
Index: branches/RC/core/units/sections/sections_config.php
===================================================================
--- branches/RC/core/units/sections/sections_config.php (revision 10720)
+++ branches/RC/core/units/sections/sections_config.php (revision 10721)
@@ -1,332 +1,322 @@
<?php
$config = Array (
'Prefix' => 'inportal-sections',
'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
// 'SectionPrefix' => 'u',
'Sections' => Array (
'in-portal:root' => Array (
'parent' => null,
'icon' => 'in-portal:site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array ('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array ('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:site' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:struct',
'label' => 'la_tab_Site_Structure',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
'SectionPrefix' => 'c',
),
'in-portal:browse' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:catalog',
'label' => 'la_tab_Browse',
'url' => Array ('t' => 'in-portal/catalog', 'pass' => 'm'),
'late_load' => Array ('t' => 'in-portal/xml/tree_categories', 'pass' => 'm', 'm_cat_id' => 0),
'onclick' => 'checkCatalog(0)',
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:advanced_view' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:advanced_view',
'label' => 'la_tab_AdvancedView',
'url' => Array ('t' => 'in-portal/advanced_view', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:reviews' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:reviews',
'label' => 'la_tab_Reviews',
'url' => Array ('t' => 'in-portal/reviews', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:configure_categories' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:cat_settings',
'label' => 'la_tab_Settings',
'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:configuration_search' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_search',
'label' => 'la_tab_ConfigSearch',
'url' => Array ('t' => 'in-portal/config/config_search', 'module_key' => 'category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:configuration_email' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array ('t' => 'in-portal/config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 6,
'type' => stTREE,
),
'in-portal:configuration_custom' => Array (
'parent' => 'in-portal:site',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 1, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 7,
'type' => stTREE,
),
'in-portal:users' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:community',
'label' => 'la_tab_Community',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2,
'type' => stTREE,
'SectionPrefix' => 'u',
),
'in-portal:user_list' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:users',
'label' => 'la_tab_User_List',
'url' => Array ('t' => 'in-portal/users/users_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:ban', 'advanced:send_email', /*'advanced:add_favorite', 'advanced:remove_favorite',*/),
'priority' => 1,
'type' => stTREE,
),
'in-portal:user_groups' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:usergroups',
'label' => 'la_tab_User_Groups',
'url' => Array ('t' => 'in-portal/groups/groups_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:send_email', 'advanced:manage_permissions'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:configure_users' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:users_settings',
'label' => 'la_tab_ConfigSettings',
'url' => Array ('t' => 'config/config_universal', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:user_email' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_email',
'label' => 'la_tab_ConfigE-mail',
'url' => Array ('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:user_custom' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:settings_custom',
'label' => 'la_tab_ConfigCustom',
'url' => Array ('t' => 'custom_fields/custom_fields_list', 'cf_type' => 6, 'pass_section' => true, 'pass' => 'm,cf'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:user_banlist' => Array (
'parent' => 'in-portal:users',
'icon' => 'in-portal:banlist',
'label' => 'la_tab_BanList',
'url' => Array ('index_file' => 'config/edit_banlist.php', 'DataType' => 6, 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 6,
'type' => stTREE,
),
// "Help" section
'in-portal:help' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:help',
'label' => 'la_tab_Help',
'url' => Array ('index_file' => 'help/manual.pdf', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 7,
'type' => stTREE,
),
// "Summary & Logs" section
'in-portal:reports' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:summary_logs',
'label' => 'la_tab_Reports',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 4,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:log_summary' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:summary',
'label' => 'la_tab_Summary',
'url' => Array ('index_file' => 'logs/summary.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:searchlog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:search_log',
'label' => 'la_tab_SearchLog',
'url' => Array ('index_file' => 'logs/searchlog.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 2,
'type' => stTREE,
),
'in-portal:sessionlog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:sessions_log',
'label' => 'la_tab_SessionLog',
'url' => Array ('index_file' => 'logs/session_list.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 3,
'type' => stTREE,
),
'in-portal:emaillog' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:email_log',
'label' => 'la_tab_EmailLog',
'url' => Array ('index_file' => 'logs/email_log.php', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:visits' => Array (
'parent' => 'in-portal:reports',
'icon' => 'in-portal:visits',
'label' => 'la_tab_Visits',
'url' => Array ('t' => 'in-portal/visits/visits_list', 'pass' => 'm'),
'permissions' => Array ('view', 'delete'),
'priority' => 5,
'type' => stTREE,
),
// "Configuration" section
'in-portal:system' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:conf',
'label' => 'la_tab_Sys_Config',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 5,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
'in-portal:configure_general' => Array (
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_general',
'label' => 'la_tab_General',
'url' => Array ('t' => 'config/config_universal', 'pass_section' => true, 'module' => 'In-Portal', 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 1,
'type' => stTREE,
),
'in-portal:configure_themes' => Array (
'parent' => 'in-portal:system',
'icon' => 'in-portal:conf_themes',
'label' => 'la_tab_Themes',
'url' => Array ('index_file' => 'config/config_theme.php', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 3,
'type' => stTREE,
),
// "Tools" section
'in-portal:tools' => Array (
'parent' => 'in-portal:root',
'icon' => 'in-portal:tools',
'label' => 'la_tab_Tools',
'url' => Array ('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 6,
'type' => stTREE,
'SectionPrefix' => 'adm',
),
- 'in-portal:restore' => Array (
- 'parent' => 'in-portal:tools',
- 'icon' => 'in-portal:tool_restore',
- 'label' => 'la_tab_Restore',
- 'url' => Array ('index_file' => 'backup/restore1.php', 'pass' => 'm'),
- 'permissions' => Array ('view'),
- 'priority' => 3,
- 'type' => stTREE,
- ),
-
'in-portal:main_import' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_ImportData',
'url' => Array ('index_file' => 'import/step1.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 4,
'type' => stTREE,
),
'in-portal:sql_query' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_import',
'label' => 'la_tab_QueryDB',
'url' => Array ('index_file' => 'tools/sql_query.php', 'pass' => 'm'),
'permissions' => Array ('view', 'edit'),
'priority' => 5,
'type' => stTREE,
),
'in-portal:server_info' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:server_info',
'label' => 'la_tab_ServerInfo',
'url' => Array ('index_file' => 'tools/server_info.php', 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 6,
'type' => stTREE,
),
),
);
\ No newline at end of file
Property changes on: branches/RC/core/units/sections/sections_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5.2.3
\ No newline at end of property
+1.5.2.4
\ No newline at end of property
Index: branches/RC/core/units/admin/admin_events_handler.php
===================================================================
--- branches/RC/core/units/admin/admin_events_handler.php (revision 10720)
+++ branches/RC/core/units/admin/admin_events_handler.php (revision 10721)
@@ -1,763 +1,1056 @@
<?php
class AdminEventsHandler extends kDBEventHandler {
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
'OnSaveColumns' => array('self' => true),
'OnClosePopup' => array('self' => true),
'OnSaveSetting' => array('self' => true),
// export/import permissions is checked within events
'OnExportCSV' => Array('self' => true),
'OnGetCSV' => Array('self' => true),
'OnCSVImportBegin' => Array('self' => true),
'OnCSVImportStep' => Array('self' => true),
'OnDropTempTablesByWID' => array('self' => true),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
/**
* Checks permissions of user
*
* @param kEvent $event
*/
function CheckPermission(&$event)
{
$system_events = Array (
'OnResetModRwCache', 'OnResetCMSMenuCache', 'OnResetSections',
'OnResetConfigsCache', 'OnCompileTemplates', 'OnGenerateTableStructure',
'OnRebuildThemes', 'OnCheckPrefixConfig',
);
if ($this->Application->isDebugMode(false) && in_array($event->Name, $system_events)) {
return true;
}
return parent::CheckPermission($event);
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnResetModRwCache(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName LIKE "mod_rw%"');
}
function OnResetCMSMenuCache(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "cms_menu"');
}
function OnResetSections(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "sections_parsed"');
if (isset($this->Application->Memcached)) {
$this->Application->Memcached->delete('master:sections_parsed');
}
}
function OnResetConfigsCache(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
$this->Conn->Query('DELETE FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files" OR VarName = "configs_parsed" OR VarName = "sections_parsed"');
if (isset($this->Application->Memcached)) {
$this->Application->Memcached->delete('master:config_files');
$this->Application->Memcached->delete('master:configs_parsed');
$this->Application->Memcached->delete('master:sections_parsed');
}
}
function OnCompileTemplates(&$event)
{
$compiler =& $this->Application->recallObject('NParserCompiler');
/* @var $compiler NParserCompiler */
$compiler->CompileTemplatesStep();
$event->status = erSTOP;
}
/**
* Generates sturcture for specified table
*
* @param kEvent $event
* @author Alex
*/
function OnGenerateTableStructure(&$event)
{
$types_hash = Array(
'string' => 'varchar|text|mediumtext|longtext|date|datetime|time|timestamp|char|year|enum|set',
'int' => 'smallint|mediumint|int|bigint|tinyint',
'float' => 'float|double|decimal',
);
$table_name = $this->Application->GetVar('table_name');
if (!$table_name) {
echo 'error: no table name specified';
return ;
}
if (TABLE_PREFIX && !preg_match('/^'.preg_quote(TABLE_PREFIX, '/').'(.*)/', $table_name)) {
// table name without prefix, then add it
$table_name = TABLE_PREFIX.$table_name;
}
if (!$this->Conn->TableFound($table_name)) {
// table with prefix doesn't exist, assume that just config prefix passed -> resolve table name from it
$table_name = $this->Application->getUnitOption(substr($table_name, strlen(TABLE_PREFIX)), 'TableName');
}
$table_info = $this->Conn->Query('DESCRIBE '.$table_name);
// 1. prepare config keys
$id_field = '';
$fields = Array();
$float_types = Array ('float', 'double', 'numeric');
foreach ($table_info as $field_info) {
if (preg_match('/l[\d]+_.*/', $field_info['Field'])) {
// don't put multilingual fields in config
continue;
}
$field_options = Array ();
// 1. get php field type by mysql field type
foreach ($types_hash as $php_type => $db_types) {
if (preg_match('/'.$db_types.'/', $field_info['Type'])) {
$field_options['type'] = $php_type;
break;
}
}
$default_value = $field_info['Default'];
if (in_array($php_type, $float_types)) {
// this is float number
if (preg_match('/'.$db_types.'\([\d]+,([\d]+)\)/i', $field_info['Type'], $regs)) {
// size is described in structure -> add formatter
$field_options['formatter'] = 'kFormatter';
$field_options['format'] = '%01.'.$regs[1].'f';
if ($field_info['Null'] != 'YES') {
// null fields, will most likely have NULL as default value
$default_value = 0;
}
}
else {
// no size information, just convert to float
if ($field_info['Null'] != 'YES') {
// null fields, will most likely have NULL as default value
$default_value = (float)$default_value;
}
}
}
if (preg_match('/varchar\(([\d]+)\)/i', $field_info['Type'], $regs)) {
$field_options['max_len'] = (int)$regs[1];
}
if ($field_info['Null'] != 'YES') {
$field_options['not_null'] = 1;
}
if ($field_info['Key'] == 'PRI') {
$default_value = 0;
$id_field = $field_info['Field'];
}
if ($php_type == 'int' && ($field_info['Null'] != 'YES' || is_numeric($default_value))) {
// is integer field AND not null
$field_options['default'] = (int)$default_value;
}
else {
$field_options['default'] = $default_value;
}
$fields[ $field_info['Field'] ] = $this->transformDump($field_options);
}
$ret = stripslashes(var_export($fields, true));
$ret = preg_replace("/'(.*?)' => 'Array \((.*?), \)',/", "'\\1' => Array (\\2),", $ret);
$ret = preg_replace("/\n '/", "\n\t'", $ret);
$ret = "'IDField' => '".$id_field."',\n'Fields' => A".substr($ret, 1).',';
ob_start();
?>
<html>
<head>
<title>Table "<?php echo $table_name; ?>" Structure</title>
</head>
<body bgcolor="#E7E7E7">
<a href="javascript:window.close();">Close Window</a><br />
<?php echo $GLOBALS['debugger']->highlightString($ret); ?>
<br /><a href="javascript:window.close();">Close Window</a><br />
</body>
</html>
<?php
echo ob_get_clean();
$event->status = erSTOP;
}
function transformDump($dump)
{
if (is_array($dump)) {
$dump = var_export($dump, true);
}
$dump = preg_replace("/,\n[ ]*/", ', ', $dump);
$dump = preg_replace("/array \(\n[ ]*/", 'Array (', $dump); // replace array start
$dump = preg_replace("/,\n[ ]*\),/", "),", $dump); // replace array end
return $dump;
}
/**
* Refreshes ThemeFiles & Theme tables by actual content on HDD
*
* @param kEvent $event
*/
function OnRebuildThemes(&$event)
{
if ($this->Application->GetVar('ajax') == 'yes') {
$event->status = erSTOP;
}
$themes_helper =& $this->Application->recallObject('ThemesHelper');
/* @var $themes_helper kThemesHelper */
$themes_helper->refreshThemes();
}
function OnSaveColumns(&$event)
{
$picker_helper =& $this->Application->recallObject('ColumnPickerHelper');
/* @var $picker_helper kColumnPickerHelper */
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
$picked = trim($this->Application->GetVar('picked_str'), '|');
$hidden = trim($this->Application->GetVar('hidden_str'), '|');
$main_prefix = $this->Application->GetVar('main_prefix');
$picker_helper->SaveColumns($main_prefix, $picked, $hidden);
$this->finalizePopup($event);
}
/**
* Saves various admin settings via ajax
*
* @param kEvent $event
*/
function OnSaveSetting(&$event)
{
if ($this->Application->GetVar('ajax') != 'yes') {
return ;
}
$var_name = $this->Application->GetVar('var_name');
$var_value = $this->Application->GetVar('var_value');
$this->Application->StorePersistentVar($var_name, $var_value);
$event->status = erSTOP;
}
/**
* Just closes popup & deletes last_template & opener_stack if popup, that is closing
*
* @param kEvent $event
*/
function OnClosePopup(&$event)
{
$event->SetRedirectParam('opener', 'u');
}
/**
* Occurs right after initialization of the kernel, used mainly as hook-to event
*
* @param kEvent $event
*/
function OnStartup(&$event)
{
}
/**
* Occurs right before echoing the output, in Done method of application, used mainly as hook-to event
*
* @param kEvent $event
*/
function OnBeforeShutdown(&$event)
{
}
/**
* Is called after tree was build (when not from cache)
*
* @param kEvent $event
*/
function OnAfterBuildTree(&$event)
{
}
/**
* Called by AJAX to perform CSV export
*
* @param kEvent $event
*/
function OnExportCSV(&$event)
{
$export_helper =& $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$prefix_special = $this->Application->GetVar('PrefixSpecial');
if(!$prefix_special) {
$prefix_special = $export_helper->ExportData('prefix');
}
$prefix_elems = split('\.|_', $prefix_special, 2);
$perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection');
if(!$this->Application->CheckPermission($perm_sections['main'].'.view')) {
$this->Application->Redirect('no_permission');
}
$export_helper->PrefixSpecial = $prefix_special;
$export_helper->grid = $this->Application->GetVar('grid');
$export_helper->ExportStep();
$event->status = erSTOP;
}
/**
* Returning created by AJAX CSV file
*
* @param kEvent $event
*/
function OnGetCSV(&$event)
{
$export_helper =& $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$prefix_special = $export_helper->ExportData('prefix');
$prefix_elems = split('\.|_', $prefix_special, 2);
$perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection');
if(!$this->Application->CheckPermission($perm_sections['main'].'.view')) {
$this->Application->Redirect('no_permission');
}
$export_helper->GetCSV();
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnCSVImportBegin(&$event)
{
$prefix_special = $this->Application->GetVar('PrefixSpecial');
$prefix_elems = split('\.|_', $prefix_special, 2);
$perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection');
if(!$this->Application->CheckPermission($perm_sections['main'].'.add') && !$this->Application->CheckPermission($perm_sections['main'].'.edit')) {
$this->Application->Redirect('no_permission');
}
$object =& $event->getObject( Array('skip_autoload' => true) );
/* @var $object kDBItem */
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
$field_values = array_shift($items_info);
$object->SetFieldsFromHash($field_values);
$event->redirect = false;
$result = 'required';
if($object->GetDBField('ImportFile')) {
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
$import_helper->PrefixSpecial = $this->Application->GetVar('PrefixSpecial');
$import_helper->grid = $this->Application->GetVar('grid');
$result = $import_helper->ImportStart( $object->GetField('ImportFile', 'file_paths') );
if($result === true) {
$event->redirect = $this->Application->GetVar('next_template');
$event->SetRedirectParam('PrefixSpecial', $this->Application->GetVar('PrefixSpecial'));
$event->SetRedirectParam('grid', $this->Application->GetVar('grid'));
}
}
if($event->redirect === false) {
$object->SetError('ImportFile', $result);
$event->status = erFAIL;
}
}
/**
* Enter description here...
*
* @param kEvent $event
*/
function OnCSVImportStep(&$event)
{
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$prefix_special = $import_helper->ImportData('prefix');
$prefix_elems = split('\.|_', $prefix_special, 2);
$perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection');
if(!$this->Application->CheckPermission($perm_sections['main'].'.add') && !$this->Application->CheckPermission($perm_sections['main'].'.edit')) {
$this->Application->Redirect('no_permission');
}
$import_helper->ImportStep();
$event->status = erSTOP;
}
/**
* Shows unit config filename, where requested prefix is defined
*
* @param kEvent $event
*/
function OnCheckPrefixConfig(&$event)
{
$prefix = $this->Application->GetVar('config_prefix');
$config_file = $this->Application->UnitConfigReader->prefixFiles[$prefix];
ob_start();
?>
<html>
<head>
<title>Unit Config of "<?php echo $prefix; ?>" prefix</title>
</head>
<body bgcolor="#E7E7E7">
<a href="javascript:window.close();">Close Window</a><br /><br />
<strong>Prefix:</strong> <?php echo $prefix; ?><br />
<strong>Unit Config:</strong> <?php echo $GLOBALS['debugger']->highlightString($config_file); ?><br />
<br /><a href="javascript:window.close();">Close Window</a><br />
</body>
</html>
<?php
echo ob_get_clean();
$event->status = erSTOP;
}
function OnUploadFile(&$event)
{
// Flash uploader does NOT send correct cookies, so we need to make our own check
$cookie_name = 'adm_'.$this->Application->ConfigValue('SessionCookieName');
$this->Application->HttpQuery->Cookie['cookies_on'] = 1;
$this->Application->HttpQuery->Cookie[$cookie_name] = $this->Application->GetVar('flashsid');
$admin_ses =& $this->Application->recallObject('Session.admin');
/* @var $admin_ses Session */
$user = $admin_ses->RecallVar('user_id');
$perm_helper =& $this->Application->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
/*if() {
$prefix_special = $this->Application->GetVar('PrefixSpecial');
$prefix_elems = split('\.|_', $prefix_special, 2);
$perm_sections = $this->Application->getUnitOption($prefix_elems[0], 'PermSection');
$section = $perm_sections['main'];
}
else {*/
$section = $event->getSection();
/*}*/
if ($this->Application->GetVar('t') != 'import/import_start' && !$perm_helper->CheckUserPermission($user, $section.'.add') && !$perm_helper->CheckUserPermission($user, $section.'.edit')) {
$event->status = erPERM_FAIL;
header('HTTP/1.0 403 You don\'t have permissions to upload');
exit;
return;
}
if (!$cookie_name) $cookie_name = 'sid';
$value = $this->Application->GetVar('Filedata');
if (!$value) return ;
$tmp_path = WRITEABLE.'/tmp/';
$fname = $value['name'];
$id = $this->Application->GetVar('id');
if ($id) $fname = $id.'_'.$fname;
if (!is_writable($tmp_path)) {
header('HTTP/1.0 500 Write permissions not set on the server');
exit;
}
move_uploaded_file($value['tmp_name'], $tmp_path.$fname);
exit;
}
function OnDropTempTablesByWID(&$event)
{
$sid = $this->Application->GetSID();
$wid = $this->Application->GetVar('m_wid');
$tables = $this->Conn->GetCol('SHOW TABLES');
$mask_edit_table = '/'.TABLE_PREFIX.'ses_'.$sid.'_'.$wid.'_edit_(.*)$/';
foreach($tables as $table)
{
if( preg_match($mask_edit_table,$table,$rets) )
{
$this->Conn->Query('DROP TABLE IF EXISTS '.$table);
}
}
echo 'OK';
$event->status = erSTOP;
return ;
}
/**
* Backup all data
*
* @param kEvent $event
*/
function OnBackup(&$event)
{
$a_tables = $this->Conn->GetCol('SHOW TABLES'); // array_keys($tables);
$TableNames = Array();
for($x=0;$x<count($a_tables);$x++)
{
if(substr($a_tables[$x],0,strlen(TABLE_PREFIX))==TABLE_PREFIX)
{
if (!strstr($a_tables[$x], 'ses_')) {
$TableNames[] = $a_tables[$x];
}
}
}
// echo "<pre>"; print_r($TableNames); echo "</pre>";
// exit;
$backupProgress = Array (
'table_num' => 0,
'table_names' => $TableNames,
'table_count' => count($TableNames),
'record_count' => 0,
'file_name' => $this->Application->ConfigValue('Backup_Path')."/dump".adodb_mktime().".txt",
);
$this->Application->RemoveVar('adm.backupcomplete_filename');
$this->Application->RemoveVar('adm.backupcomplete_filesize');
$out = array();
for($x=0;$x<count($TableNames);$x++) {
if (!strstr($TableNames[$x], 'ses_')) {
$out[] = $this->GetTableCreate($TableNames[$x]);
}
}
$fp = fopen($backupProgress['file_name'], 'a');
$sql = "SELECT Name, Version FROM ".TABLE_PREFIX."Modules";
$r = $this->Conn->Query($sql);
foreach ($r AS $a_module) {
$version = $a_module['Version'];
fwrite($fp, "# ".$a_module['Name']." Version: $version;\n");
}
fwrite($fp, "#------------------------------------------\n\n");
fwrite($fp,implode("\n",$out));
fwrite($fp,"\n");
fclose($fp);
$this->Application->StoreVar('adm.backup_status', serialize($backupProgress));
$event->redirect = 'tools/backup2';
}
/**
* Perform next backup step
*
* @param kEvent $event
*/
function OnBackupProgress(&$event)
{
$done_percent = $this->performBackup();
if ($done_percent == 100) {
$event->redirect = 'tools/backup3';
return ;
}
echo $done_percent;
$event->status = erSTOP;
}
/**
- * Stops users import & redirect to import template
+ * Stops Backup & redirect to Backup template
*
* @param kEvent $event
*/
function OnBackupCancel(&$event)
{
$event->redirect = 'tools/backup1';
}
+ /**
+ * Stops Restore & redirect to Restore template
+ *
+ * @param kEvent $event
+ */
+ function OnRestoreCancel(&$event)
+ {
+ $event->redirect = 'tools/restore1';
+ }
+
function performBackup()
{
$backupProgress = unserialize($this->Application->RecallVar('adm.backup_status'));
// echo "<pre>"; print_r($backupProgress); echo "</pre>";
// exit;
$CurrentTable = $backupProgress['table_names'][$backupProgress['table_num']];
// get records
$a_records = $this->insert_data($CurrentTable,$backupProgress['record_count'],50,"");
// echo "<pre>"; print_r($a_records); echo "</pre>";
// exit;
if ($a_records['num'] < 50) {
$backupProgress['table_num']++;
+ if ($backupProgress['table_names'][$backupProgress['table_num']] == TABLE_PREFIX.'Cache') {
+ $backupProgress['table_num']++;
+ }
+ $backupProgress['record_count'] = 0;
} else {
$backupProgress['record_count']+=50;
}
if ($a_records['sql']) {
$fp = fopen($backupProgress['file_name'], 'a');
fwrite($fp, $a_records['sql']);
fclose($fp);
}
$percent = ($backupProgress['table_num'] / $backupProgress['table_count']) * 100;
if ($percent >= 100) {
$percent = 100;
$this->Application->StoreVar('adm.backupcomplete_filename', $backupProgress['file_name']);
$this->Application->StoreVar('adm.backupcomplete_filesize', filesize($backupProgress['file_name']));
} else {
$this->Application->StoreVar('adm.backup_status', serialize($backupProgress));
}
return round($percent);
}
//extracts the rows of data from tables using limits
function insert_data($table, $start, $limit, $mywhere)
{
// global $out;
if ($mywhere !="")
{
$whereclause= " WHERE ".$mywhere." ";
}
else
{
$whereclause = "";
}
$a_data = $this->Conn->Query("SELECT * from $table $whereclause LIMIT $start, $limit");
// echo "SELECT * from $table $whereclause LIMIT $start, $limit";
// echo "<pre>"; print_r($a_records); echo "</pre>";
// exit;
if (!$a_data) {
return Array(
'num' => 0,
'sql' => '',
);
}
// $prefix = GetTablePrefix();
$rowcount = 0;
$a_fields = array_keys($a_data[0]);
$fields_sql = '';
foreach ($a_fields AS $field_name) {
$fields_sql .= '`'.$field_name.'`,';
}
$fields_sql = preg_replace('/(.*),$/', '\\1', $fields_sql);
$temp = '';
foreach ($a_data AS $a_row)
{
$values_sql = '';
foreach ($a_row as $field_name => $field_value) {
$values_sql .= $this->Conn->qstr($field_value).',';
}
$values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
- $temp .= 'INSERT INTO '.$table.' ('.$fields_sql.') VALUES ('.$values_sql.')';
+ $sql = 'INSERT INTO '.$table.' ('.$fields_sql.') VALUES ('.$values_sql.');';
+ $sql=ereg_replace("\n","\\n", $sql);
+ $sql=ereg_replace("\r","\\r", $sql);
+ $temp .= $sql."\n";
}
- $temp=ereg_replace("\n","\\n", $temp);
- $temp=ereg_replace("\r","\\r", $temp);
if(strlen(TABLE_PREFIX))
{
- $temp = str_replace("INSERT INTO $prefix","INSERT INTO ",$temp);
+ $temp = str_replace("INSERT INTO ".TABLE_PREFIX, "INSERT INTO ", $temp);
}
return Array(
'num' => count($a_data),
'sql' => $temp,
);
}
function GetTableCreate($table, $crlf="\n")
{
$schema_create = 'DROP TABLE IF EXISTS ' . $table . ';' . $crlf;
$schema_create .="# --------------------------------------------------------".$crlf;
$this->Conn->Query("SET SQL_QUOTE_SHOW_CREATE = 0");
$tmpres = $this->Conn->Query("SHOW CREATE TABLE $table");
// echo "<pre>"; print_r($tmpres); echo "</pre>";
// exit;
if(is_array($tmpres) && isset($tmpres[0]))
{
$tmpres = $tmpres[0];
$pos = strpos($tmpres["Create Table"], ' (');
$pos2 = strpos($tmpres["Create Table"], '(');
if ($pos2 != $pos + 1)
{
$pos = $pos2;
$tmpres["Create Table"] = str_replace(",", ",\n ", $tmpres["Create Table"]);
}
$tmpres["Create Table"] = substr($tmpres["Create Table"], 0, 13)
. (($use_backquotes) ? $tmpres["Table"] : $tmpres["Table"])
. substr($tmpres["Create Table"], $pos);
$tmpres["Create Table"] = str_replace("\n", $crlf, $tmpres["Create Table"]);
if (preg_match_all('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', $tmpres["Create Table"], $regs)) {
if (!isset($sql_constraints)) {
if (isset($GLOBALS['no_constraints_comments'])) {
$sql_constraints = '';
} else {
$sql_constraints = $crlf . '#' . $crlf
. '# ' . $GLOBALS['strConstraintsForDumped'] . $crlf
. '#' . $crlf;
}
}
if (!isset($GLOBALS['no_constraints_comments'])) {
$sql_constraints .= $crlf .'#' . $crlf .'# ' . $GLOBALS['strConstraintsForTable'] . ' ' . $table . $crlf . '#' . $crlf;
}
$sql_constraints .= 'ALTER TABLE $table $crlf '
. preg_replace('/(,\r?\n|^)([\s]*)(CONSTRAINT|FOREIGN[\s]*KEY)/', '\1\2ADD \3', substr($regs[0][0], 2))
. ";\n";
$tmpres["Create Table"] = preg_replace('((,\r?\n[\s]*(CONSTRAINT|FOREIGN[\s]*KEY)[^\r\n,]+)+)', '', $tmpres["Create Table"]);
}
$schema_create .= $tmpres["Create Table"];
}
if(strlen($schema_create))
{
$schema_create = str_replace("DROP TABLE IF EXISTS ".TABLE_PREFIX,"DROP TABLE ",$schema_create);
$schema_create = str_replace("CREATE TABLE ".TABLE_PREFIX,"CREATE TABLE ",$schema_create);
while(strlen($schema_create && substr($schema_create,-1)!=")"))
{
$schema_create = substr($schema_create,0,-1);
}
}
$schema_create .= "\n# --------------------------------------------------------\n";
return $schema_create;
}
+ /**
+ * Deletes one backup file
+ *
+ * @param kEvent $event
+ */
+ function OnDeleteBackup(&$event)
+ {
+ @unlink($this->get_backup_file());
+ }
+
+ function get_backup_file()
+ {
+ return $this->Application->ConfigValue('Backup_Path').'/dump'.$this->Application->GetVar('backupdate').'.txt';
+ }
+
+ /**
+ * Starts restore process
+ *
+ * @param kEvent $event
+ */
+ function OnRestore(&$event)
+ {
+ $file = $this->get_backup_file();
+
+ $restoreProgress = Array (
+ 'file_pos' => 0,
+ 'file_name' => $file,
+ 'file_size' => filesize($file),
+ );
+ $this->Application->RemoveVar('adm.restore_success');
+ $this->Application->StoreVar('adm.restore_status', serialize($restoreProgress));
+ $event->redirect = 'tools/restore3';
+ }
+
+ function OnRestoreProgress(&$event)
+ {
+ $done_percent = $this->performRestore();
+
+ if ($done_percent == -3) {
+ $event->redirect = 'tools/restore4';
+ return ;
+ }
+
+ if ($done_percent < 0) {
+ $this->Application->StoreVar('adm.restore_error', 'File read error'); $event->redirect = 'tools/restore4';
+ return ;
+ }
+
+ if ($done_percent == 100) {
+ $this->replaceRestoredFiles();
+ $this->Application->StoreVar('adm.restore_success', 1);
+ $event->redirect = 'tools/restore4';
+ return ;
+ }
+
+ echo $done_percent;
+ $event->status = erSTOP;
+
+ }
+
+ function replaceRestoredFiles()
+ {
+ // gather restored table names
+ $tables = $this->Conn->GetCol('SHOW TABLES');
+ $mask_restore_table = '/^restore'.TABLE_PREFIX.'(.*)$/';
+ foreach($tables as $table)
+ {
+ if( preg_match($mask_restore_table,$table,$rets) )
+ {
+ $old_table = substr($table, 7);
+ $this->Conn->Query('DROP TABLE IF EXISTS '.$old_table);
+ $this->Conn->Query('CREATE TABLE '.$old_table.' LIKE '.$table);
+ $this->Conn->Query('INSERT INTO '.$old_table.' SELECT * FROM '.$table);
+ $this->Conn->Query('DROP TABLE '.$table);
+ }
+ }
+
+ }
+
+ function performRestore()
+ {
+ $restoreProgress = unserialize($this->Application->RecallVar('adm.restore_status'));
+ $filename = $restoreProgress['file_name'];
+ $FileOffset = $restoreProgress['file_pos'];
+ $MaxLines = 200;
+ $size = filesize($filename);
+
+ if($FileOffset > $size) {
+ return -2;
+ }
+
+ $fp = fopen($filename,"r");
+ if(!$fp) {
+ return -1;
+ }
+
+
+ if($FileOffset>0)
+ {
+ fseek($fp,$FileOffset);
+ }
+ else
+ {
+ $EndOfSQL = FALSE;
+ $sql = "";
+ while(!feof($fp) && !$EndOfSQL)
+ {
+ $l = fgets($fp,16384);
+ if(substr($l,0,11)=="INSERT INTO")
+ {
+ $EndOfSQL = TRUE;
+ }
+ else
+ {
+ $sql .= $l;
+ $FileOffset = ftell($fp) - strlen($l);
+ }
+ }
+ if(strlen($sql))
+ {
+ $error = $this->runSchemaText($sql);
+ if ($error != '') {
+
+ $this->Application->StoreVar('adm.restore_error', $error);
+ return -3;
+ }
+ }
+ fseek($fp,$FileOffset);
+ }
+
+ $LinesRead = 0;
+ $sql = "";
+ $AllSql = array();
+ while($LinesRead < $MaxLines && !feof($fp))
+ {
+ $sql = fgets($fp, 16384);
+ if(strlen($sql))
+ {
+ $AllSql[] = $sql;
+ $LinesRead++;
+ }
+ }
+ if(!feof($fp))
+ {
+ $FileOffset = ftell($fp);
+ }
+ else
+ {
+ $FileOffset = $size;
+ }
+ fclose($fp);
+
+ if(count($AllSql)>0) {
+ $error = $this->runSQLText($AllSql);
+ if ($error != '') {
+
+ $this->Application->StoreVar('adm.restore_error', $error);
+ return -3;
+ }
+
+ }
+ $restoreProgress['file_pos'] = $FileOffset;
+ $this->Application->StoreVar('adm.restore_status', serialize($restoreProgress));
+
+ return round($FileOffset/$size * 100);
+// $this->Application->StoreVar('adm.restore_error', 'lalalal');
+// $event->redirect = 'tools/restore4';
+ }
+
+
+ function runSchemaText($sql)
+ {
+ $table_prefix = 'restore'.TABLE_PREFIX;
+// $table_prefix = TABLE_PREFIX;
+ if(strlen($table_prefix))
+ {
+ $what = "CREATE TABLE ";
+ $replace = "CREATE TABLE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "DROP TABLE ";
+ $replace = "DROP TABLE IF EXISTS ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "INSERT INTO ";
+ $replace = "INSERT INTO ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "UPDATE ";
+ $replace = "UPDATE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "ALTER TABLE ";
+ $replace = "ALTER TABLE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+ }
+
+ $commands = explode("# --------------------------------------------------------",$sql);
+ if(count($commands)>0)
+ {
+// $query_func = getConnectionInterface('query',$dbo_type);
+// $errorno_func = getConnectionInterface('errorno',$dbo_type);
+// $errormsg_func = getConnectionInterface('errormsg',$dbo_type);
+
+ for($i = 0; $i < count($commands); $i++)
+ {
+ $cmd = $commands[$i];
+ $cmd = trim($cmd);
+ if(strlen($cmd)>0)
+ {
+ $this->Conn->Query($cmd);
+ if($this->Conn->errorCode != 0)
+ {
+ return $this->Conn->errorMessage." COMMAND:<PRE>$cmd</PRE>";
+ }
+ }
+ }
+ }
+ }
+
+ function runSQLText($allsql)
+ {
+ $line = 0;
+// $query_func = getConnectionInterface('query',$dbo_type);
+// $errorno_func = getConnectionInterface('errorno',$dbo_type);
+// $errormsg_func = getConnectionInterface('errormsg',$dbo_type);
+
+ while($line<count($allsql))
+ {
+ $sql = $allsql[$line];
+ if(strlen(trim($sql))>0 && substr($sql,0,1)!="#")
+ {
+ $table_prefix = 'restore'.TABLE_PREFIX;
+ if(strlen($table_prefix))
+ {
+ $what = "CREATE TABLE ";
+ $replace = "CREATE TABLE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "DELETE FROM ";
+ $replace = "DELETE FROM ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "DROP TABLE ";
+ $replace = "DROP TABLE IF EXISTS ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "INSERT INTO ";
+ $replace = "INSERT INTO ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "REPLACE INTO ";
+ $replace = "REPLACE INTO ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "UPDATE ";
+ $replace = "UPDATE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+
+ $what = "ALTER TABLE ";
+ $replace = "ALTER TABLE ".$table_prefix;
+ $sql = ereg_replace($what, $replace, $sql);
+ }
+ $sql = trim($sql);
+ if(strlen($sql)>0)
+ {
+ $this->Conn->Query($sql);
+
+ if($this->Conn->errorCode != 0)
+ {
+ return $this->Conn->errorMessage." COMMAND:<PRE>$sql</PRE>";
+ }
+ }
+ }
+ $line++;
+ }
+ }
+
}
\ No newline at end of file
Property changes on: branches/RC/core/units/admin/admin_events_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8.2.15
\ No newline at end of property
+1.8.2.16
\ No newline at end of property
Index: branches/RC/core/units/admin/admin_config.php
===================================================================
--- branches/RC/core/units/admin/admin_config.php (revision 10720)
+++ branches/RC/core/units/admin/admin_config.php (revision 10721)
@@ -1,97 +1,108 @@
<?php
$config = Array(
'Prefix' => 'adm',
'ItemClass' => Array('class' => 'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'EventHandlerClass' => Array('class' => 'AdminEventsHandler', 'file' => 'admin_events_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array('class' => 'AdminTagProcessor', 'file' => 'admin_tag_processor.php', 'build_event' => 'OnBuild'),
'QueryString' => Array(
1 => 'event',
),
'TitlePresets' => Array(
'tree_root' => Array('format' => '!la_section_overview!'),
'tree_reports' => Array('format' => '!la_section_overview!'),
'tree_system' => Array('format' => '!la_section_overview!'),
'tree_tools' => Array('format' => '!la_section_overview!'),
'system_tools' => Array('format' => '!la_title_SystemTools!'),
'backup' => Array('format' => '!la_performing_backup!'),
+ 'restore' => Array('format' => '!la_performing_restore!'),
'no_permissions' => Array('format' => '!la_title_NoPermissions!'),
'column_picker' => Array('format' => '!la_title_ColumnPicker!'),
'csv_export' => Array('format' => '!la_title_CSVExport!'),
'csv_import' => Array('format' => '!la_title_CSVImport!'),
),
'PermSection' => array('main' => 'in-portal:service'),
'Sections' => Array(
'in-portal:root' => Array(
'parent' => null,
'icon' => 'site',
'label' => $this->Application->ConfigValue('Site_Name'),
'url' => Array('t' => 'sections_list', 'pass' => 'm', 'pass_section' => true, 'no_amp' => 1),
'permissions' => Array('advanced:admin_login', 'advanced:front_login'),
'priority' => 0,
'type' => stTREE,
'icon_module' => 'in-portal',
),
'in-portal:service' => Array(
'parent' => 'in-portal:tools',
'icon' => 'conf_general',
'label' => 'la_tab_Service',
'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 10,
'show_mode' => smDEBUG,
'type' => stTREE,
),
- 'in-portal:backup_new' => Array (
+ 'in-portal:backup' => Array (
'parent' => 'in-portal:tools',
'icon' => 'in-portal:tool_backup',
'label' => 'la_tab_Backup',
'url' => Array ('t' => 'tools/backup1', 'pass' => 'm'),
'permissions' => Array ('view'),
- 'priority' => 2.5,
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-portal:restore' => Array (
+ 'parent' => 'in-portal:tools',
+ 'icon' => 'in-portal:tool_restore',
+ 'label' => 'la_tab_Restore',
+ 'url' => Array ('t' => 'tools/restore1', 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 3,
'type' => stTREE,
),
'in-portal:service' => Array(
'parent' => 'in-portal:tools',
'icon' => 'conf_general',
'label' => 'la_tab_Service',
'url' => Array('t' => 'tools/system_tools', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 10,
'show_mode' => smDEBUG,
'type' => stTREE,
),
),
'Fields' => Array(), // we need empty array because kernel doesn't use virtual fields else
'VirtualFields' => Array (
'ImportFile' => Array (
'type' => 'string',
'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, // in Bytes !
'error_msgs' => Array (
'cant_open_file' => '!la_error_CantOpenFile!',
'no_matching_columns' => '!la_error_NoMatchingColumns!',
),
'file_types' => '*.csv', 'files_description' => '!la_CSVFiles!',
'upload_dir' => '/system/import/', // relative to project's home
'multiple' => false, 'direct_links' => false,
'default' => null,
),
),
);
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/admin/admin_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.23.2.3
\ No newline at end of property
+1.23.2.4
\ No newline at end of property
Index: branches/RC/core/units/admin/admin_tag_processor.php
===================================================================
--- branches/RC/core/units/admin/admin_tag_processor.php (revision 10720)
+++ branches/RC/core/units/admin/admin_tag_processor.php (revision 10721)
@@ -1,920 +1,974 @@
<?php
class AdminTagProcessor extends kDBTagProcessor {
function SetConst($params)
{
$name = $this->SelectParam($params, 'name,const');
safeDefine($name, $params['value']);
}
/**
* Allows to execute js script after the page is fully loaded
*
* @param Array $params
* @return string
*/
function AfterScript($params)
{
$after_script = $this->Application->GetVar('after_script');
if ($after_script) {
return '<script type="text/javascript">'.$after_script.'</script>';
}
return '';
}
/**
* Returns section title with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionTitle($params)
{
if (array_key_exists('default', $params)) {
return $params['default'];
}
return $this->Application->Phrase( replaceModuleSection($params['phrase']) );
}
/**
* Returns section icon with #section# keyword replaced with current section
*
* @param Array $params
* @return string
*/
function GetSectionIcon($params)
{
return replaceModuleSection($params['icon']);
}
/**
* Allows to detect if current template is one of listed ones
*
* @param Array $params
* @return int
*/
function TemplateMatches($params)
{
$templates = explode(',' ,$params['templates']);
$t = $this->Application->GetVar('t');
return in_array($t, $templates) ? 1 : 0;
}
/**
* Save return script in cases, when old sections are opened from new sections
*
* @param Array $params
*/
function SaveReturnScript($params)
{
// admin/save_redirect.php?do=
$m =& $this->Application->recallObject('m_TagProcessor');
$url = str_replace($this->Application->BaseURL(), '', $m->Link($params) );
$url = explode('?', $url, 2);
$url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
$this->Application->StoreVar('ReturnScript', $url);
}
/**
* Redirects to correct next import step template based on import script data
*
* @param Array $params
*/
function ImportRedirect($params)
{
$import_id = $this->Application->GetVar('import_id');
if ($import_id) {
// redirect forward to step3 (import parameters coosing)
$this->Application->StoreVar('ImportScriptID', $import_id);
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'ImportScripts
WHERE is_id = '.$import_id;
$db =& $this->Application->GetADODBConnection();
$is_params = $db->GetRow($sql);
if ($is_params['is_type'] == 'db') {
$this->Application->Redirect('', null, '', 'import/step3.php');
}
elseif ($is_params['is_type'] == 'csv') {
$module = mb_strtolower($is_params['is_Module']);
$template = $module.'/import';
$module_info = $this->Application->findModule('Name', $module);
$item_prefix = $module_info['Var'];
$pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']);
$this->Application->Redirect($template, $pass_params);
}
}
else {
// redirect back to step2 (import type choosing)
$this->Application->Redirect('', null, '', 'import/step2.php');
}
}
/**
* Returns version of module by name
*
* @param Array $params
* @return string
*/
function ModuleVersion($params)
{
return $this->Application->findModule('Name', $params['module'], 'Version');
}
/**
* Used in table form section drawing
*
* @param Array $params
* @return string
*/
function DrawTree($params)
{
static $deep_level = 0;
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$params['deep_level'] = $deep_level++;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
if (!isset($section_data['children'])) {
return $ret;
}
$debug_mode = $this->Application->isDebugMode();
$super_admin_mode = $this->Application->RecallVar('super_admin');
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$section_data =& $sections_helper->getSectionData($section_name);
if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) {
$show_mode = $section_data['show_mode'];
// if super admin section -> show in super admin mode & debug mode
$show_section = (($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode);
if (!$show_section) {
// if section is in debug mode only && debug mode -> show
$show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode;
}
if (!$show_section) {
continue;
}
}
$params['section_name'] = $section_name;
$ret .= $this->DrawTree($params);
$deep_level--;
}
return $ret;
}
function SectionInfo($params)
{
$section = $params['section'];
if ($section == '#session#') {
$section = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section);
if (isset($params['parent']) && $params['parent']) {
do {
$section_data =& $sections_helper->getSectionData($section_data['parent']);
} while (isset($section_data['use_parent_header']) && $section_data['use_parent_header']);
}
$info = $params['info'];
switch ($info) {
case 'module_path':
if (isset($params['module']) && $params['module']) {
$module = $params['module'];
}
elseif (isset($section_data['icon_module'])) {
$module = $section_data['icon_module'];
}
else {
$module = '#session#';
}
$res = $this->ModulePath(array('module' => $module));
break;
case 'perm_section':
$res = $sections_helper->getPermSection($section);
break;
default:
$res = $section_data[$info];
}
if ($info == 'label' || isset($params['as_label'])) {
$res = $this->Application->Phrase($res);
}
return $res;
}
function PrintSection($params)
{
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
if (isset($params['use_first_child']) && $params['use_first_child']) {
$section_name = $sections_helper->getFirstChild($section_name, true);
}
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
$params['section_name'] = $section_name;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$ret = $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
return $ret;
}
/**
* Used in XML drawing for tree
*
* @param Array $params
* @return string
*/
function PrintSections($params)
{
// when processings, then sort children by priority (key of children array)
$ret = '';
$section_name = $params['section_name'];
if ($section_name == '#session#') {
$section_name = $this->Application->RecallVar('section');
}
$sections_helper =& $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
$section_data =& $sections_helper->getSectionData($section_name);
$params['name'] = $this->SelectParam($params, 'name,render_as,block');
if (!isset($section_data['children'])) {
return '';
}
$debug_mode = $this->Application->isDebugMode();
$super_admin_mode = $this->Application->RecallVar('super_admin');
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $section_name) {
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
if (isset($section_data['show_mode']) && is_numeric($section_data['show_mode'])) {
$show_mode = $section_data['show_mode'];
// if super admin section -> show in super admin mode & debug mode
$show_section = (($show_mode & smSUPER_ADMIN) == smSUPER_ADMIN) && ($super_admin_mode || $debug_mode);
if (!$show_section) {
// if section is in debug mode only && debug mode -> show
$show_section = (($show_mode & smDEBUG) == smDEBUG) && $debug_mode;
}
if (!$show_section) {
continue;
}
}
if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
$perm_status = false;
$folder_label = $section_data['label'];
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
// if only tabs in this section & none of them have permission, then skip section too
$section_name = $sections_helper->getPermSection($section_name);
$perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
if ($perm_status) {
break;
}
}
if (!$perm_status) {
// no permission for all tabs -> don't display tree node either
continue;
}
$params['section_name'] = $section_name;
$section_data =& $sections_helper->getSectionData($section_name);
$section_data['label'] = $folder_label; // use folder label in tree
$section_data['is_tab'] = 1;
}
else {
$section_name = $sections_helper->getPermSection($section_name);
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
}
$params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
$template = $section_data['url']['t'];
unset($section_data['url']['t']);
$section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
$late_load = getArrayValue($section_data, 'late_load');
if ($late_load) {
$t = $late_load['t'];
unset($late_load['t']);
$section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
$params['children_count'] = 99;
}
else {
$section_data['late_load'] = '';
}
$ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
$params['section_name'] = $section_name;
}
return preg_replace("/\r\n|\n/", '', $ret);
}
function ListSectionPermissions($params)
{
$section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($section_name);
$block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
$ret = '';
foreach ($section_data['permissions'] as $perm_name) {
if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
$block_params['perm_name'] = $perm_name;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function ModuleInclude($params)
{
foreach ($params as $param_name => $param_value) {
$params[$param_name] = replaceModuleSection($param_value);
}
$m =& $this->Application->recallObject('m_TagProcessor');
return $m->ModuleInclude($params);
}
function TodayDate($params)
{
return date($params['format']);
}
function TreeEditWarrning($params)
{
$ret = $this->Application->Phrase($params['label']);
$ret = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
if (getArrayValue($params, 'escape')) {
$ret = addslashes($ret);
}
$ret = str_replace('<br>', '\n', $ret);
return $ret;
}
/**
* Draws section tabs using block name passed
*
* @param Array $params
*/
function ListTabs($params)
{
$sections_helper =& $this->Application->recallObject('SectionsHelper');
$section_data =& $sections_helper->getSectionData($params['section_name']);
$ret = '';
$block_params = Array('name' => $params['render_as']);
ksort($section_data['children'], SORT_NUMERIC);
foreach ($section_data['children'] as $priority => $section_name) {
if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
$tab_data =& $sections_helper->getSectionData($section_name);
$block_params['t'] = $tab_data['url']['t'];
$block_params['title'] = $tab_data['label'];
$block_params['main_prefix'] = $section_data['SectionPrefix'];
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
/**
* Returns list of module item tabs that have view permission in current category
*
* @param Array $params
*/
function ListCatalogTabs($params)
{
$ret = '';
$special = isset($params['special']) ? $params['special'] : '';
$replace_main = isset($params['replace_m']) && $params['replace_m'];
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
$block_params = Array('name' => $params['render_as']);
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
$prefix = $module_info['Var'];
if (in_array($prefix, $skip_prefixes) || !$this->Application->prefixRegistred($prefix) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue;
if ($prefix == 'm' && $replace_main) $prefix = 'c';
$label = $this->Application->getUnitOption($prefix, $params['title_property']);
$block_params['title'] = $label;
$block_params['prefix'] = $prefix;
$ret .= $this->Application->ParseBlock($block_params);
}
return $ret;
}
function FCKEditor($params)
{
if (file_exists(FULL_PATH.'/core/cmseditor/fckeditor.php')) {
$editor_path = 'core/cmseditor/';
}
else {
$editor_path = 'admin/editor/cmseditor/';
}
include_once(FULL_PATH.'/'.$editor_path.'/fckeditor.php');
$oFCKeditor = new FCKeditor($params['name']);
$oFCKeditor->BasePath = BASE_PATH.'/'.$editor_path;
$oFCKeditor->Width = $params['width'] ;
$oFCKeditor->Height = $params['height'] ;
$oFCKeditor->ToolbarSet = 'Advanced' ;
$oFCKeditor->Value = '' ;
if ($this->Application->isModuleEnabled('In-Portal')) {
$config_path = $this->Application->BaseURL().'kernel/admin_templates/incs/inp_fckconfig.js';
}
else {
$config_path = $this->Application->BaseURL().'core/admin_templates/js/inp_fckconfig.js';
}
$oFCKeditor->Config = Array(
// 'UserFilesPath' => FULL_PATH.'/kernel/user_files',
'ProjectPath' => BASE_PATH.'/',
'CustomConfigurationsPath' => $config_path,
// 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(),
//'StylesXmlPath' => '../../inp_styles.xml',
// 'Debug' => 1,
'Admin' => 1,
'K4' => 1,
);
return $oFCKeditor->CreateHtml();
}
/**
* Allows to construct link for opening any type of catalog item selector
*
* @param Array $params
* @return string
*/
function SelectorLink($params)
{
$mode = 'catalog';
if (isset($params['mode'])) { // {catalog, advanced_view}
$mode = $params['mode'];
unset($params['mode']);
}
$params['t'] = 'in-portal/item_selector/item_selector_'.$mode;
$default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
unset($params['prefix']);
$pass_through = Array();
if (isset($params['tabs_dependant'])) { // {yes, no}
$pass_through['td'] = $params['tabs_dependant'];
unset($params['tabs_dependant']);
}
if (isset($params['selection_mode'])) { // {single, multi}
$pass_through['tm'] = $params['selection_mode'];
unset($params['selection_mode']);
}
if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list}
$pass_through['tp'] = $params['tab_prefixes'];
unset($params['tab_prefixes']);
}
if ($pass_through) {
// add pass_through to selector url if any
$params['pass_through'] = implode(',', array_keys($pass_through));
$params = array_merge_recursive2($params, $pass_through);
}
// user can override default parameters (except pass_through of course)
$params = array_merge_recursive2($default_params, $params);
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function TimeFrame($params)
{
$w = adodb_date('w');
$m = adodb_date('m');
$y = adodb_date('Y');
//FirstDayOfWeek is 0 for Sunday and 1 for Monday
$fdow = $this->Application->ConfigValue('FirstDayOfWeek');
if ($fdow && $w == 0) $w = 7;
$today_start = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),$y);
$first_day_of_this_week = $today_start - ($w - $fdow)*86400;
$first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y);
$this_quater = ceil($m/3);
$this_quater_start = adodb_mktime(0,0,0,$this_quater*3-2,1,$y);
switch ($params['type']) {
case 'last_week_start':
$timestamp = $first_day_of_this_week - 86400*7;
break;
case 'last_week_end':
$timestamp = $first_day_of_this_week - 1;
break;
case 'last_month_start':
$timestamp = $m == 1 ? adodb_mktime(0,0,0,12,1,$y-1) : adodb_mktime(0,0,0,$m-1,1,$y);
break;
case 'last_month_end':
$timestamp = $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y) - 1;
break;
case 'last_quater_start':
$timestamp = $this_quater == 1 ? adodb_mktime(0,0,0,10,1,$y-1) : adodb_mktime(0,0,0,($this_quater-1)*3-2,1,$y);
break;
case 'last_quater_end':
$timestamp = $this_quater_start - 1;
break;
case 'last_6_months_start':
$timestamp = $m <= 6 ? adodb_mktime(0,0,0,$m+6,1,$y-1) : adodb_mktime(0,0,0,$m-6,1,$y);
break;
case 'last_year_start':
$timestamp = adodb_mktime(0,0,0,1,1,$y-1);
break;
case 'last_year_end':
$timestamp = adodb_mktime(23,59,59,12,31,$y-1);
break;
}
if (isset($params['format'])) {
$format = $params['format'];
if(preg_match("/_regional_(.*)/", $format, $regs))
{
$lang =& $this->Application->recallObject('lang.current');
$format = $lang->GetDBField($regs[1]);
}
return adodb_date($format, $timestamp);
}
return $timestamp;
}
function CheckPermCache($params)
{
if ($this->Conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\'')) {
$this->Application->Redirect($params['cache_update_t'], array('continue' => 1));
}
}
/**
* Checks if current protocol is SSL
*
* @param Array $params
* @return int
*/
function IsSSL($params)
{
return (PROTOCOL == 'https://')? 1 : 0;
}
function PrintColumns($params)
{
$picker_helper =& $this->Application->RecallObject('ColumnPickerHelper');
$picker_helper->SetGridName($this->Application->GetLinkedVar('grid_name'));
/* @var $picker_helper kColumnPickerHelper */
$main_prefix = $this->Application->RecallVar('main_prefix');
$cols = $picker_helper->LoadColumns($main_prefix);
$this->Application->Phrases->AddCachedPhrase('__FREEZER__', '-------------');
$o = '';
if (isset($params['hidden']) && $params['hidden']) {
foreach ($cols['hidden_fields'] as $col) {
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
else {
foreach ($cols['order'] as $col) {
if (in_array($col, $cols['hidden_fields'])) continue;
$title = $this->Application->Phrase($cols['titles'][$col]);
$o .= "<option value='$col'>".$title;
}
}
return $o;
}
/**
* Allows to set popup size (key - current template name)
*
* @param Array $params
*/
function SetPopupSize($params)
{
$width = $params['width'];
$height = $params['height'];
if ($this->Application->GetVar('ajax') == 'yes') {
// during AJAX request just output size
die($width.'x'.$height);
}
if (!$this->UsePopups($params)) {
return ;
}
$t = $this->Application->GetVar('t');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
// create new popup size record
$fields_hash = Array (
'TemplateName' => $t,
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PopupSizes');
}
elseif ($popup_info['PopupWidth'] != $width || $popup_info['PopupHeight'] != $height) {
// popup found and size in tag differs from one in db -> update in db
$fields_hash = Array (
'PopupWidth' => $width,
'PopupHeight' => $height,
);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PopupSizes', 'PopupId = '.$popup_info['PopupId']);
}
}
/**
* Returns popup size (by template), if not cached, then parse template to get value
*
* @param Array $params
* @return string
*/
function GetPopupSize($params)
{
$t = $this->Application->GetVar('template_name');
$sql = 'SELECT *
FROM '.TABLE_PREFIX.'PopupSizes
WHERE TemplateName = '.$this->Conn->qstr($t);
$popup_info = $this->Conn->GetRow($sql);
if (!$popup_info) {
$this->Application->InitParser();
$this->Application->ParseBlock(array('name' => $t)); // dies when SetPopupSize tag found & in ajax requrest
return '750x400'; // tag SetPopupSize not found in template -> use default size
}
return $popup_info['PopupWidth'].'x'.$popup_info['PopupHeight'];
}
function UsePopups($params)
{
return (int)$this->Application->ConfigValue('UsePopups');
}
function UseToolbarLabels($params)
{
return (int)$this->Application->ConfigValue('UseToolbarLabels');
}
/**
* Checks if debug mode enabled (optionally) and specified constant is on
*
* @param Array $params
* @return bool
*/
function ConstOn($params)
{
$constant_name = $this->SelectParam($params, 'name,const');
$debug_mode = isset($params['debug_mode']) && $params['debug_mode'] ? $this->Application->isDebugMode() : true;
return $debug_mode && constOn($constant_name);
}
/**
* Builds link to last template in main frame of admin
*
* @param Array $params
* @return string
*/
function MainFrameLink($params)
{
$persistent = isset($params['persistent']) && $params['persistent'];
if ($persistent && $this->Application->ConfigValue('RememberLastAdminTemplate')) {
// check last_template in persistent session
$last_template = $this->Application->RecallPersistentVar('last_template_popup');
}
else {
// check last_template in session
$last_template = $this->Application->RecallVar('last_template_popup'); // because of m_opener=s there
}
if (!$last_template) {
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
list($index_file, $env) = explode('|', $last_template);
$vars = $this->Application->HttpQuery->processQueryString($env, 'pass');
$recursion_templates = Array ('login', 'index', 'no_permission');
if (isset($vars['admin']) && $vars['admin'] == 1) {
// index template doesn't begin recursion on front-end (in admin frame)
$vars['m_theme'] = '';
if (isset($params['m_opener']) && $params['m_opener'] == 'r') {
// front-end link for highlighting purposes
$vars['t'] = 'index';
$vars['m_cat_id'] = $this->Application->findModule('Name', 'Proj-CMS', 'RootCat');
}
unset($recursion_templates[ array_search('index', $recursion_templates)]);
}
if (in_array($vars['t'], $recursion_templates)) {
// prevents redirect recursion OR old in-portal pages
$params['persistent'] = 1;
return $persistent ? false : $this->MainFrameLink($params);
}
$vars = array_merge_recursive2($vars, $params);
$t = $vars['t'];
unset($vars['t'], $vars['persistent']);
return $this->Application->HREF($t, '', $vars, $index_file);
}
/**
* Returns menu frame width or 200 in case, when invalid width specified in config
*
* @param Array $params
* @return string
*/
function MenuFrameWidth($params)
{
$width = (int)$this->Application->ConfigValue('MenuFrameWidth');
return $width > 0 ? $width : 200;
}
function AdminSkin($params)
{
static $style;
if (!isset($style)) {
$style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1');
}
$css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel').'/user_files';
$css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel').'user_files/';
if (isset($params['type']) && $params['type'] == 'logo') {
return $style['Logo'] ? $css_url.$style['Logo'] : '';
}
$last_compiled = $style['LastCompiled'];
$style_name = mb_strtolower( $style['Name'] );
if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') )
{
$ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
}
else
{
// search for previously compiled stylesheet
$last_compiled = 0;
if( $dh = opendir($css_path) )
{
while( ($file = readdir($dh)) !== false )
{
if( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) )
{
if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2];
}
}
closedir($dh);
}
if ($last_compiled) {
// found
$ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
}
else {
// not found (try to compile on the fly)
$object =& $this->Application->recallObject('skin.-item', null, Array ('skip_autoload' => true));
/* @var $object kDBItem */
$skin_eh =& $this->Application->recallObject('skin_EventHandler');
/* @var $skin_eh SkinEventHandler */
$object->Load(1, 'IsPrimary');
$skin_eh->Compile($object);
$ret = $css_url.'admin-'.$style_name.'-'.adodb_mktime().'.css';
}
}
if (isset($params['file_only'])) return $ret;
return '<link rel="stylesheet" rev="stylesheet" href="'.$ret.'" type="text/css" media="screen" />';
}
function PrintCompileErrors($params)
{
$errors = unserialize($this->Application->RecallVar('compile_errors'));
$o = '<table class="edit-form" style="width: 100%;" border="1"><tr><td><b>File</b></td><td><b>Line</b></td><td><b>Message</b></td></tr>';
$class = 'table-color1';
foreach ($errors as $an_error) {
$f = str_replace(FULL_PATH, '', $an_error['file']);
$o .= "<tr class=\'$class\'><td>{$f}</td><td>{$an_error['line']}</td><td>{$an_error['msg']}</td></tr>";
$class = $class == 'table-color1' ? 'table-color2' : 'table-color1';
}
$o .= '</table>';
$this->Application->RemoveVar('compile_errors');
return $o;
}
function ExportData($params)
{
$export_helper =& $this->Application->recallObject('CSVHelper');
/* @var $export_helper kCSVHelper */
$result = $export_helper->ExportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function ImportData($params)
{
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
$result = $import_helper->ImportData( $this->SelectParam($params, 'var,name,field') );
return ($result === false) ? '' : $result;
}
function PrintCSVNotImportedLines($params)
{
$import_helper =& $this->Application->recallObject('CSVHelper');
/* @var $import_helper kCSVHelper */
return $import_helper->GetNotImportedLines();
}
/**
* Returns input field name to
* be placed on form (for correct
* event processing)
*
* @param Array $params
* @return string
* @access public
*/
function InputName($params)
{
list($id, $field) = $this->prepareInputName($params);
$ret = $this->getPrefixSpecial().'[0]['.$field.']'; // 0 always, as has no idfield
if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/');
return $ret;
}
+
+ /**
+ * Returns list of all backup file dates formatted
+ * in passed block
+ *
+ * @param Array $params
+ * @return string
+ * @access public
+ */
+ function PrintBackupDates($params)
+ {
+ $datearray=$this->getDirList($this->Application->ConfigValue('Backup_Path'));
+ $ret = '';
+ foreach($datearray as $key => $value)
+ {
+ $params['backuptimestamp'] = $value;
+ $params['backuptime'] = date('F j, Y, g:i a', $value);
+ $ret .= $this->Application->ParseBlock($params);
+ }
+ return $ret;
+ }
+
+ function getDirList ($dirName)
+ {
+ $filedates = array();
+ $d = dir($dirName);
+
+ while($entry = $d->read())
+ {
+ if ($entry != "." && $entry != "..")
+ {
+ if (!is_dir($dirName."/".$entry) && eregi("dump",$entry))
+ {
+ $filedate[]=$this->chopchop($entry);
+ }
+ }
+ }
+ $d->close();
+ rsort($filedate);
+
+ return $filedate;
+
+ }
+
+ function chopchop ($filename)
+ {
+ $p = pathinfo($filename);
+ $ext = '.'.$p["extension"];
+ $filename;
+ $filename= ereg_replace("dump","",$filename);
+ $filename= ereg_replace($ext,"",$filename);
+ return $filename;
+ }
+
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.43.2.11
\ No newline at end of property
+1.43.2.12
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/restore1.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore1.tpl (nonexistent)
+++ branches/RC/core/admin_templates/tools/restore1.tpl (revision 10721)
@@ -0,0 +1,83 @@
+<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
+ <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap width="80%" valign="middle">
+ <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
+ </td>
+ <td align="right" class="tablenav" width="20%" valign="middle">
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <script>
+ var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
+ $help_url = $help_url.replace(/#/g, '%23');
+ set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+ </script>
+ <a href="javascript: OpenHelp($help_url);">
+ <img src="img/blue_bar_help.gif" border="0">
+ </a>
+ </inp2:m_if>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
+
+<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
+
+<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="1"/>
+
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ location.href = '<inp2:m_Link t="tools/restore2"/>';
+ }
+ ) );
+ a_toolbar.Render();
+ a_toolbar.DisableButton('prev');
+ a_toolbar.DisableButton('next');
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
+ <inp2:m_RenderElement name="subsection" title="la_Prompt_Warning"/>
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td colspan="3" class="text">
+ <inp2:m_Phrase label="la_Text_Restore_Heading"/>
+ </td>
+ </tr>
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" colspan="3">
+ <span class="hint"><img src="../../admin/images/smicon7.gif" align="absmiddle" height="14" width="14">
+ <inp2:m_Phrase label="la_text_disclaimer_part1"/>
+ <inp2:m_Phrase label="la_text_disclaimer_part2"/>
+ </span>
+ </td>
+ </tr>
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" colspan="3">
+ <input id="agree" value="0" name="agree" onclick="if (this.checked == true) a_toolbar.EnableButton('next'); else a_toolbar.DisableButton('next');" type="checkbox"><label for="agree"><inp2:m_Phrase label="la_Text_IAgree"/></label> </td>
+ </tr>
+
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore1.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/restore2.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore2.tpl (nonexistent)
+++ branches/RC/core/admin_templates/tools/restore2.tpl (revision 10721)
@@ -0,0 +1,83 @@
+<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
+ <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap width="80%" valign="middle">
+ <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
+ </td>
+ <td align="right" class="tablenav" width="20%" valign="middle">
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <script>
+ var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
+ $help_url = $help_url.replace(/#/g, '%23');
+ set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+ </script>
+ <a href="javascript: OpenHelp($help_url);">
+ <img src="img/blue_bar_help.gif" border="0">
+ </a>
+ </inp2:m_if>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
+
+<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
+
+<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="2"/>
+
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ location.href = '<inp2:m_Link t="tools/restore1"/>';
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ submit_event('adm.restore','OnRestore');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>', function() {
+ submit_event('adm.restore','OnDeleteBackup');
+ }
+ ) );
+ a_toolbar.Render();
+ a_toolbar.DisableButton('next');
+ a_toolbar.DisableButton('delete');
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
+ <inp2:m_RenderElement name="subsection" title="la_Prompt_Restore_Filechoose"/>
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text">
+ <img src="../../admin/images/arrow.gif" align="middle" border="0" height="15" width="15">
+ <span class="NAV_CURRENT_ITEM"><inp2:m_Phrase label="la_Prompt_Backup_Date"/></span>
+ </td>
+ </tr>
+ <inp2:m_DefineElement name="backup_date">
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text">
+ <input type=radio name="backupdate" onclick="a_toolbar.EnableButton('next');a_toolbar.EnableButton('delete')" value="<inp2:m_Param name='backuptimestamp'/>" /><inp2:m_Param name='backuptime'/>
+ </td>
+ </tr>
+ </inp2:m_DefineElement>
+ <inp2:adm_PrintBackupDates name="backup_date"/>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore2.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/restore3.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore3.tpl (nonexistent)
+++ branches/RC/core/admin_templates/tools/restore3.tpl (revision 10721)
@@ -0,0 +1,46 @@
+<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
+ <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap width="80%" valign="middle">
+ <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
+ </td>
+ <td align="right" class="tablenav" width="20%" valign="middle">
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <script>
+ var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
+ $help_url = $help_url.replace(/#/g, '%23');
+ set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+ </script>
+ <a href="javascript: OpenHelp($help_url);">
+ <img src="img/blue_bar_help.gif" border="0">
+ </a>
+ </inp2:m_if>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
+
+<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
+
+<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_backup" step="3"/>
+
+
+<inp2:m_RenderElement name="ajax_progress_bar" cancel_action="cancel_action();"/>
+
+<script type="text/javascript">
+ function cancel_action() {
+ submit_event('adm.backup', 'OnRestoreCancel');
+ }
+
+ $Restore = new AjaxProgressBar('<inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore" js_escape="1"/>');
+</script>
+<!--<a href="<inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore"/>"><inp2:m_t t="dummy" adm.restore_event="OnRestoreProgress" pass="m,adm.restore"/></a>
+--><inp2:m_include t="incs/footer"/>
+
Property changes on: branches/RC/core/admin_templates/tools/restore3.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/tools/restore4.tpl
===================================================================
--- branches/RC/core/admin_templates/tools/restore4.tpl (nonexistent)
+++ branches/RC/core/admin_templates/tools/restore4.tpl (revision 10721)
@@ -0,0 +1,73 @@
+<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+
+<inp2:m_DefineElement name="blue_bar_step" module="" icon="" pagination="0">
+ <table border="0" cellpadding="2" cellspacing="0" class="bordered-no-bottom" width="100%" height="30">
+ <tr>
+ <td class="header_left_bg" nowrap width="80%" valign="middle">
+ <span class="tablenav_link" id="blue_bar"><inp2:{$prefix}_SectionTitle title_preset="$title_preset" title="Invalid OR Missing title preset [#preset_name#]" cut_first="100" pass_params="true"/> - <inp2:m_Phrase label="la_Step"/> <inp2:m_Param name="step"/></span>
+ </td>
+ <td align="right" class="tablenav" width="20%" valign="middle">
+ <inp2:m_if check="m_ModuleEnabled" module="In-Portal">
+ <script>
+ var $help_url='<inp2:m_t t="help" h_prefix="$prefix" h_icon="$icon" h_module="$module" h_title_preset="$title_preset" pass="all,m,h" m_opener="p" escape="escape"/>';
+ $help_url = $help_url.replace(/#/g, '%23');
+ set_window_title( RemoveTranslationLink(document.getElementById('blue_bar').innerHTML, false).replace(/(<[^<]+>)/g, '') );
+ </script>
+ <a href="javascript: OpenHelp($help_url);">
+ <img src="img/blue_bar_help.gif" border="0">
+ </a>
+ </inp2:m_if>
+ <inp2:m_if check="m_Param" name="pagination">
+ <inp2:m_RenderElement name="grid_pagination_elem" grid="st" PrefixSpecial="$prefix" pass_params="1"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+</inp2:m_DefineElement>
+
+
+<inp2:m_RenderElement name="section_header" icon="icon46_tool_restore" title="!la_title_Restore!"/>
+
+<inp2:m_RenderElement name="blue_bar_step" prefix="adm" title_preset="restore" module="in-portal" icon="icon46_tool_restore" step="4"/>
+
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ location.href = '<inp2:m_Link t="tools/restore1"/>';;
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ }
+ ) );
+ a_toolbar.Render();
+ a_toolbar.DisableButton('next');
+
+
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="bordered" id="config_table">
+ <inp2:m_RenderElement name="subsection" title="la_Prompt_Restore_Status"/>
+ <tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td colspan="3" class="text">
+ <inp2:m_if check="m_Recall" var="adm.restore_success"/>
+ <inp2:m_Phrase label="la_Prompt_Restore_Success"/>
+ <inp2:m_else/>
+ <inp2:m_Phrase label="la_Prompt_Restore_Failed"/> <inp2:m_Recall var="adm.restore_error"/>
+ </inp2:m_if>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/RC/core/admin_templates/tools/restore4.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Index: branches/RC/core/admin_templates/img/icons/icon46_tool_restore.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/RC/core/admin_templates/img/icons/icon46_tool_restore.gif
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Event Timeline
Log In to Comment