Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Feb 1, 9:00 PM

in-portal

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
Index: trunk/kernel/admin/include/navmenu.php
===================================================================
--- trunk/kernel/admin/include/navmenu.php (revision 325)
+++ trunk/kernel/admin/include/navmenu.php (revision 326)
@@ -1,377 +1,374 @@
<?php
##############################################################
## In-portal :: Section & Navigation Structure Library ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law.. ##
##############################################################
$objSections->AddSection("in-portal:install","la_tab_Install","la_title_Install",$admin."/", "",
$admin."/images/icon_install.gif","",
NULL,"in-portal:site",NULL,null,0,"",1,NULL,NULL,NULL,"");
// Catalog - browse data tree items
$objSections->AddSection("in-portal:browse","la_tab_Browse","la_title_Browse",$admin."/", "browse.php",
$admin."/icons/icon46_catalog.gif",$admin."/icons/icon24_catalog.gif",
NULL,"in-portal:site",NULL,"in-portal:advanced_view",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_catalog.gif");
// Advanced View
$objSections->AddSection("in-portal:advanced_view","la_tab_AdvancedView","la_title_AdvancedView",$admin."/", "advanced_view.php",
$admin."/icons/icon46_advanced_view.gif",$admin."/icons/icon24_advanced_view.gif",
NULL,"in-portal:site",NULL,"in-portal:configure_categories",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_advanced_view.gif");
$objSections->AddSection("in-portal:configure_categories", "la_tab_Settings", "la_tab_Settings", $admin."/config/",
"edit_config.php?&module=In-Portal&section=in-portal:configure_categories",
$admin."/icons/icon46_cat_settings.gif", $admin."/icons/icon24_cat_settings.gif",
NULL, "in-portal:site","in-portal:advanced_view", "in-portal:configuration_search",0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_cat_settings.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch", $admin."/config/",
"config_search.php?&module=In-Portal&section=in-portal:configuration_search",
$admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif",
NULL, "in-portal:site", "in-portal:configure_categories","in-portal:configuration_email",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
"module_email.php?&module=In-Portal:Category&section=in-portal:configuration_email&lpn=1",
$admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
NULL,"in-portal:site", "in-portal:configuration_search", "in-portal:configuration_custom",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
$objSections->AddSection("in-portal:configuration_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin."/config/",
"edit_customfields.php?&section=in-portal:configuration_custom&DataType=1",
$admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
NULL, "in-portal:site", "in-portal:configuration_email", NULL,0,"",1,NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
/* check datatype either 1 or 0 */
$objSections->AddSection("in-portal:tools","la_tab_Tools","la_title_Tools",$admin."/","subitems.php",
$admin."/icons/icon46_tools.gif",$admin."/icons/icon24_tools.gif",
"in-portal:backup","in-portal:root","in-portal:system","in-portal:help",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_tools.gif","la_section_overview");
$objSections->AddSection("in-portal:backup","la_tab_Backup","la_tab_Backup",$admin."/backup/","backup1.php",
$admin."/icons/icon46_tool_backup.gif",$admin."/icons/icon24_tool_backup.gif",
NULL,"in-portal:tools",NULL,"in-portal:restore",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_backup.gif","la_performing_backup");
$objSections->AddSection("in-portal:backup_toolbar","la_tab_Backup","la_tab_Backup",NULL,NULL,
$admin."/icons/icon46_tool_backup.gif",$admin."/icons/icon24_tool_backup.gif",
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,NULL);
$objSections->AddSection("in-portal:restore_toolbar",NULL,NULL,NULL,NULL,
NULL,NULL,
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,NULL);
$objSections->AddSection("in-portal:restore","la_tab_Restore","la_tab_Restore",$admin."/backup/","restore1.php",
$admin."/icons/icon46_tool_restore.gif",$admin."/icons/icon24_tool_restore.gif",
NULL,"in-portal:tools","in-portal:backup","in-portal:export",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_restore.gif","la_performing_restore");
$objSections->AddSection("in-portal:export","la_tab_ExportData","la_tab_ExportData",$admin."/backup/","export1.php",
$admin."/icons/icon46_tool_export.gif",$admin."/icons/icon24_tool_export.gif",
- NULL,"in-portal:tools","in-portal:restore","in-portal:inlink_inport",0,"",1,
+ NULL,"in-portal:tools","in-portal:restore","in-portal:main_import",0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_export.gif","la_performing_export");
-//if( !$objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY") )
-//{
- $objSections->AddSection("in-portal:inlink_inport","la_tab_ImportData","la_tab_ImportData",$admin."/import/","inlinkimport1.php",
+ $objSections->AddSection("in-portal:main_import","la_tab_ImportData","la_tab_ImportData",$admin."/import/","step1.php",
$admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
NULL,"in-portal:tools","in-portal:export","in-portal:sql_query",1,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_tool_import.gif","la_performing_import");
$objSections->AddSection("in-portal:sql_query","la_tab_QueryDB","la_tab_QueryDB",$admin."/tools/","sql_query.php",
$admin."/icons/icon46_tool_import.gif",$admin."/icons/icon24_tool_import.gif",
NULL,"in-portal:tools","in-portal:inlink_inport",NULL,0,"",1,
NULL,"in-portal:tools",NULL,$admin."/icons/icon46_list_tool_import.gif","la_running_query");
-//}
$objSections->AddSection("in-portal:system","la_tab_Sys_Config","la_title_Sys_Config",$admin."/","subitems.php",
$admin."/icons/icon46_conf.gif",$admin."/icons/icon24_conf.gif",NULL,
"in-portal:root","in-portal:reports","in-portal:tools",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf.gif","la_section_overview");
$objSections->AddSection("in-portal:tag_library","la_tab_TagLibrary","la_tab_TagLibrary",$admin."/","tag_listing.php",
$admin."/icons/icon46_modules.gif",$admin."/icons/icon24_modules.gif",
NULL,NULL,NULL,NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_modules.gif","la_tag_library");
/* system configuration tree items */
$objSections->AddSection("in-portal:configure_general", "la_tab_General", "la_tab_General", $admin."/config/",
"edit_config.php?&module=In-Portal&section=in-portal:configure_general",
$admin."/icons/icon46_conf_general.gif", $admin."/icons/icon24_conf_general.gif",
NULL, "in-portal:system", NULL, "in-portal:configure_themes",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_general.gif","la_updating_config");
$objSections->AddSection("in-portal:configure_themes", "la_tab_Themes", "la_tab_Themes", $admin."/config/","config_theme.php",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:system", "in-portal:configure_general", "in-portal:configure_lang",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_themes.gif");
$objSections->AddSection( "in-portal:template_editor",
"la_tab_Themes",
"la_tab_Themes",
'',
'',
$admin."/icons/icon46_conf_themes.gif",
$admin."/icons/icon24_conf_themes.gif",
NULL, NULL, NULL, NULL, 1,'',1,
0,1,0,$admin."/icons/icon46_list_conf_themes.gif");
$objSections->AddSection("in-portal:configure_lang", "la_tab_Regional", "la_tab_Regional", $admin."/config/","config_lang.php",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:system", "in-portal:configure_themes", NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_conf_regional.gif");
/* theme tabs */
$objSections->AddSection("in-portal:theme_general", "la_tab_General", NULL, $admin."/config/",
"javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme.php',0);",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:configure_themes", NULL, "in-portal:theme_templates",-1);
$objSections->AddSection("in-portal:theme_templates", "la_tab_Templates", NULL, $admin."/config/",
"javascript:edit_submit('theme','ThemeEditStatus','".$admin."/config/addtheme_templates.php',0);",
$admin."/icons/icon46_conf_themes.gif", $admin."/icons/icon24_conf_themes.gif",
NULL, "in-portal:configure_themes", "in-portal:theme_general",NULL,-1);
/*language tabs */
$objSections->AddSection("in-portal:lang_general", "la_tab_General", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", NULL, "in-portal:lang_labels",-1);
$objSections->AddSection("in-portal:lang_labels", "la_tab_Labels", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang_labels.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", "in-portal:lang_general", "in-portal:lang_email",-1);
$objSections->AddSection("in-portal:lang_email", "la_tab_EmailEvents", NULL, $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang_email.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, "in-portal:configure_lang", "in-portal:lang_labels", NULL,-1);
$objSections->AddSection("in-portal:lang_import", "la_tab_ImportLang", "la_tab_ImportLang", $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, NULL, NULL, NULL,-1);
$objSections->AddSection("in-portal:lang_export", "la_tab_ExportLang", "la_tab_ExportLang", $admin."/config/",
"javascript:edit_submit('language','LangEditStatus','".$admin."/config/addlang.php',0);",
$admin."/icons/icon46_conf_regional.gif", $admin."/icons/icon24_conf_regional.gif",
NULL, NULL, NULL, NULL,-1, "", 1);
/*Community Section tree items */
$objSections->AddSection("in-portal:user_list","la_tab_User_List","la_tab_User_List",$admin."/users/","user_list.php?resetpage=1",
$admin."/icons/icon46_users.gif",$admin."/icons/icon24_users.gif",
NULL, "in-portal:users", NULL, "in-portal:user_groups",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_users.gif");
$objSections->AddSection("in-portal:user_groups","la_tab_User_Groups","la_tab_User_Groups", $admin."/users/", "user_groups.php?resetpage=1", $admin."/icons/icon46_usergroups.gif",$admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:users", "in-portal:user_list","in-portal:configure_users",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_usergroups.gif");
$objSections->AddSection("in-portal:configure_users", "la_tab_ConfigSettings", "la_tab_ConfigSettings", $admin."/config/",
"edit_config.php?&module=In-Portal:Users&section=in-portal:configure_users",
$admin."/icons/icon46_users_settings.gif", $admin."/icons/icon24_users_settings.gif",
NULL, "in-portal:users","in-portal:user_groups", "in-portal:user_email",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_users_settings.gif","la_updating_config");
$objSections->AddSection("in-portal:user_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/",
"module_email.php?&module=In-Portal:Users&section=in-portal:user_email&lpn=1",
$admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
NULL,"in-link", "in-portal:configure_users", "in-portal:user_custom",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
$objSections->AddSection("in-portal:user_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin."/config/",
"edit_customfields.php?&section=in-portal:user_custom&DataType=6",
$admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
NULL, "in-portal:users", "in-portal:user_email", "in-portal:user_banlist",0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
$objSections->AddSection("in-portal:user_banlist","la_tab_BanList","la_tab_UserBanList",$admin."/config/",
"edit_banlist.php?&section=in-portal:user_banlist&DataType=6",
$admin."/icons/icon46_banlist.gif",$admin."/icons/icon24_banlist.gif",
NULL, "in-portal:users", "in-portal:user_custom",NULL,0,"",1,
NULL,NULL,NULL,$admin."/icons/icon46_list_banlist.gif","la_updating_rules");
/*Edit Category Section*/
$objSections->AddSection("in-portal:editcategory_general","la_tab_General",NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse",NULL, "in-portal:editcategory_relations",-1);
$objSections->AddSection("in-portal:editcategory_relations","la_tab_Relations",NULL, $admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_relations.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL,"in-portal:browse","in-portal:editcategory_general","in-portal:editcategory_images",-1);
$objSections->AddSection("in-portal:editcategory_images","la_tab_Images", NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_images.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse", "in-portal:editcategory_relations", "in-portal:editcategory_permissions",-1);
$objSections->AddSection("in-portal:editcategory_permissions","la_tab_Permissions", NULL,$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_permissions.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif",
NULL, "in-portal:browse", "in-portal:editcategory_images","in-portal:editcategory_custom",-1);
$objSections->AddSection("in-portal:editcategory_custom", "la_tab_Custom", NULL, $admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addcategory_custom.php',0);",
$admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", NULL,
"in-portal:browse", "in-portal:editcategory_permissions", NULL,-1);
/* category edit subitems */
$objSections->AddSection("in-portal:cat_imageedit","la_tab_Images","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addimage.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:editcategory_relation","la_tab_Relations","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addrelation.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
/* permission edit subtabs */
$objSections->AddSection("in-portal:catperm_modules","la_tab_Permissions","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:catperm_setperm","la_tab_Permissions","la_title_edit_category",$admin."/category/",
"javascript:edit_submit('category','CatEditStatus','".$admin."/category/addpermission_modules.php',0);",
$admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_catalog.gif",
NULL, NULL, NULL,NULL,-1);
/*user list toolbar - edit user*/
/*$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_title_edit_ban",$admin."/users/",
"javascript:edit_submit('rule','RuleEditStatus','".$admin."/config/edit_banlist.php',1,'$addSection&DataType=6');",
$admin."/icons/icon46_banlist.gif", $admin."/icons/icon24_banlist.gif",
NULL, NULL, NULL,NULL,-1);*/
$objSections->AddSection("in-portal:edituser_general", "la_tab_General", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", NULL, 'in-portal:edituser_groups',-1);
$objSections->AddSection("in-portal:edituser_groups", "la_tab_Groups", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_groups.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_general", "in-portal:edituser_images",-1);
$objSections->AddSection("in-portal:edituser_images", "la_tab_Images", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_images.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_groups", "in-portal:edituser_permissions",-1);
$objSections->AddSection("in-portal:edituser_permissions", "la_tab_Permissions", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_permissions.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_images", "in-portal:edituser_items",-1);
$objSections->AddSection("in-portal:edituser_items", "la_tab_Items", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_items.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_permissions", "in-portal:edituser_custom",-1);
$objSections->AddSection("in-portal:edituser_custom","la_tab_Custom", NULL, $admin."/users/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/adduser_custom.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, "in-portal:user_list", "in-portal:edituser_permissions", NULL,-1);
/* user edit subitems */
$objSections->AddSection("in-portal:edituser_image","la_tab_Images","la_title_edit_user",$admin."/category/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addimage.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, NULL, NULL,NULL,-1);
$objSections->AddSection("in-portal:edituser_permission","la_tab_Permissions","la_title_edit_user",$admin."/category/",
"javascript:edit_submit('edituser','UserEditStatus','".$admin."/users/user_addpermission.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL, NULL, NULL,NULL,-1);
/* group list toolbar - edit group */
$objSections->AddSection("in-portal:editgroup_general", "la_tab_General",NULL, $admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup.php',0);",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", NULL, "in-portal:editgroup_users",-1);
$objSections->AddSection("in-portal:editgroup_users", "la_tab_Users", NULL,$admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_users.php',0)",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", "in-portal:editgroup_general","in-portal:editgroup_permissions",-1);
$objSections->AddSection("in-portal:editgroup_permissions", "la_tab_Permissions", NULL,$admin."/users/",
"javascript:edit_submit('editgroup','GroupEditStatus','".$admin."/users/addgroup_permissions.php',0)",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_usergroups.gif",
NULL, "in-portal:user_groups", "in-portal:editgroup_users",NULL,-1);
/* reports tree items */
/*
*/
//$notree=0,$onClick = "",$notabs=0,$nonavbar=0,$notitle=0,$toolbar=0
$objSections->AddSection("in-portal:editcategory_relationselect","la_tab_Category_RelationSelect",
"la_title_Category_RelationSelect", $admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",
$admin."/icons/icon24_navigate.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:catselect","la_tab_Category_Select","la_title_Category_Select",
$admin."/","relation_select.php",$admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_navigate.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:groupselect","la_tab_GroupSelect","la_title_GroupSelect",
$admin."/users","group_select.php",
$admin."/icons/icon46_navigate.gif",$admin."/icons/icon24_usergroups.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:userselect","la_tab_UserSelect","la_title_UserSelect",
$admin."/users","user_select.php",
$admin."/icons/icon46_community.gif",$admin."/icons/icon24_usergroups.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:phrase_editor","la_tab_Label","la_title_Label",
$admin."/config","edit_label.php",
$admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:sendmail","la_tab_SendMail","la_title_SendMail",
$admin."/email","sendmail.php",
$admin."/icons/icon46_conf_regional.gif",$admin."/icons/icon24_conf_regional.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,1,1);
$objSections->AddSection("in-portal:user_rule_edit","la_tab_UserBan","la_tab_UserBan",
$admin."/users","addrule.php",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
$objSections->AddSection("in-portal:banuser","la_Text_BanUserFields","la_Text_BanUserFields",
$admin."/users","banuser.php",
$admin."/icons/icon46_community.gif", $admin."/icons/icon24_users.gif",
NULL,NULL,NULL,NULL,-1,"",1,0,0,1);
?>
Property changes on: trunk/kernel/admin/include/navmenu.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/inlink_inport.php
===================================================================
--- trunk/kernel/admin/include/toolbar/inlink_inport.php (revision 325)
+++ trunk/kernel/admin/include/toolbar/inlink_inport.php (nonexistent)
@@ -1,94 +0,0 @@
-<?php
- // import scripts definitions: begin
- global $import_scripts, $var, $objSession, $ro_perm;
- $import_scripts = GetImportScripts();
-
- // import scripts definitions: end
- $ro_perm = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY");
-?>
-
-<script language="javascript" type="text/javascript">
-
-<?php
- if(!$ro_perm)
- {
-?>
- function ImportRedirect(form, import_id)
- {
- if( import_id === false ) return false;
- var frm = document.getElementById(form);
- frm.import_id.value = import_id;
- frm.submit();
- }
-
- function CheckFinalForm(form)
- {
- // checks if all required fields are filled
- var frm = document.getElementById(form);
- <?php
- $required = Array('user_admin','user_regular','init_cat');
- $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
- if( ($import_script !== false) && strlen($import_script['required_fields']) > 0 )
- {
- $script_required = explode(',', $import_script['required_fields']);
- $required = array_merge($required, $script_required);
- }
- echo "var required_fields = Array('".implode("','", $required)."');\n";
- ?>
- var form_is_valid = true;
- if(frm)
- {
- var i = 0;
- var field_count = required_fields.length;
- for(i = 0; i < field_count; i++)
- form_is_valid &= frm.elements[ required_fields[i] ].value.length ? true : false;
- }
- else
- return false;
- return form_is_valid;
- }
-
- function import_submit(formname,formaction,action)
- {
- f = document.getElementById(formname);
- if(f)
- {
- f.action = formaction;
- f.Action.value = (action.length>0) ? action : 'Import';
- f.submit();
- }
- }
-
- function SetPercent(step_id, new_percent, additional, time_str)
- {
- var step_element = document.getElementById(step_id);
- step_element.innerHTML = new_percent;
-
- var add_element = document.getElementById(step_id+'_additional');
- add_element.innerHTML = additional;
-
- var time_element = document.getElementById('total_time');
- time_element.innerHTML = time_str;
- }
-
-<?php
- }
-?>
-
- function ChoiseMade(form, radio_name)
- {
- // checks if user has selected enabled radio button
- var frm = document.getElementById(form);
- if(frm)
- {
- var i = 0;
- var element_count = frm.elements.length;
- for(i = 0; i < element_count; i++)
- if(frm[i].type == 'radio' && frm[i].name == radio_name)
- if(frm[i].checked == true)
- return frm[i].value;
-
- return false;
- }
- }
-</script>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/toolbar/inlink_inport.php
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/toolbar/main_import.php
===================================================================
--- trunk/kernel/admin/include/toolbar/main_import.php (nonexistent)
+++ trunk/kernel/admin/include/toolbar/main_import.php (revision 326)
@@ -0,0 +1,111 @@
+<?php
+ // import scripts definitions: begin
+ global $import_scripts, $var, $objSession, $ro_perm;
+ $import_scripts = GetImportScripts();
+
+ // import scripts definitions: end
+ $ro_perm = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY");
+?>
+
+<script language="javascript" type="text/javascript">
+
+<?php
+ if(!$ro_perm)
+ {
+?>
+ function PageOnLoad(step_no)
+ {
+ if( step_no == 1 )
+ {
+ // uncheck "agree" checkbox if toolbar button is disabled
+ var cb = document.getElementById('agree');
+ var next_btn = document.getElementById('moveright');
+ if(cb.checked == true && next_btn.getAttribute('ButtonState') == 'disabled')
+ cb.checked = false;
+ }
+ }
+
+ function UsedAgreed()
+ {
+ return document.getElementById('agree').checked ? 1 : 0;
+ }
+
+ function ImportRedirect(form, import_id)
+ {
+ if( import_id === false ) return false;
+ var frm = document.getElementById(form);
+ frm.import_id.value = import_id;
+ frm.submit();
+ }
+
+ function CheckFinalForm(form)
+ {
+ // checks if all required fields are filled
+ var frm = document.getElementById(form);
+ <?php
+ $required = Array('user_admin','user_regular','init_cat');
+ $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
+ if( ($import_script !== false) && strlen($import_script['required_fields']) > 0 )
+ {
+ $script_required = explode(',', $import_script['required_fields']);
+ $required = array_merge($required, $script_required);
+ }
+ echo "var required_fields = Array('".implode("','", $required)."');\n";
+ ?>
+ var form_is_valid = true;
+ if(frm)
+ {
+ var i = 0;
+ var field_count = required_fields.length;
+ for(i = 0; i < field_count; i++)
+ form_is_valid &= frm.elements[ required_fields[i] ].value.length ? true : false;
+ }
+ else
+ return false;
+ return form_is_valid;
+ }
+
+ function import_submit(formname,formaction,action)
+ {
+ f = document.getElementById(formname);
+ if(f)
+ {
+ f.action = formaction;
+ f.Action.value = HasParam(action) ? action : 'Import';
+ f.submit();
+ }
+ }
+
+ function SetPercent(step_id, new_percent, additional, time_str)
+ {
+ var step_element = document.getElementById(step_id);
+ step_element.innerHTML = new_percent;
+
+ var add_element = document.getElementById(step_id+'_additional');
+ add_element.innerHTML = additional;
+
+ var time_element = document.getElementById('total_time');
+ time_element.innerHTML = time_str;
+ }
+
+<?php
+ }
+?>
+
+ function ChoiseMade(form, radio_name)
+ {
+ // checks if user has selected enabled radio button
+ var frm = document.getElementById(form);
+ if(frm)
+ {
+ var i = 0;
+ var element_count = frm.elements.length;
+ for(i = 0; i < element_count; i++)
+ if(frm[i].type == 'radio' && frm[i].name == radio_name)
+ if(frm[i].checked == true)
+ return frm[i].value;
+
+ return false;
+ }
+ }
+</script>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/toolbar/main_import.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/kernel/admin/include/help/inlink_inport.txt
===================================================================
--- trunk/kernel/admin/include/help/inlink_inport.txt (revision 325)
+++ trunk/kernel/admin/include/help/inlink_inport.txt (nonexistent)
@@ -1,15 +0,0 @@
-This section allows the administrator to import the data from other applications into your existing In-portal system.<br><br>
-<b>Step 1</b> of the import begins with a disclaimer that the data in your current system will be affected. Please ensure you understand the import process and the particular kind of import you are doing before proceeding.
-
-<br><br>
-<b>In-link 2 Import</b><br>
-In the current version, only the import from In-link2 is available. The import is designed for In-link version 2.3.4, however it will work, or partially work, for most of the older In-link2 versions up to 2.0.10. If you have one of the older In-link2 versions and are experiencing problems, please upgrade your In-link2 to the version 2.3.4, and then run this import. It is not possible to use In-link2 import if you do not have In-link3 installed on your In-portal platform. Some In-link2 license holders are entitled to a complimentary In-link3 license, please go to your account at <a href="http://www.intechnic.com/myaccount">http://www.intechnic.com/myaccount</a> for more information, or submit a support ticket.
-<br><br>
-<b>Step 3</b><br>
-In this step, the administrator will be asked to enter all database information for the In-link2 data. The current version of In-portal only supports import from the MySQL databases of In-link2.<br><br>
-<b>Step 4</b><br>
-In this step, the administrator will need to designate the options of the import – how the In-link2 data is supposed to be integrated into In-portal and In-link3.
-<li> Administrative Group – this field designates the In-portal administrative group (by default, ‘Admin'), into which the old In-link2 administrators should be imported. You can choose a different group for the import, and then designate the administrative users later. Clicking on the group button will pop up a list of In-portal groups.
-<li> Regular User Group - this field designates the In-portal group (by default, ‘Members'), into which the old In-link2 users (link owners) should be imported. It is recommended to import then into a group that will give them access to the front-end, and to modify their links. However, you can choose a different group for the import, and then manage the users later. Clicking on the group button will pop up a list of In-portal groups.
-<li> Initial Import Category – this field designates the In-portal category, which will serve as a root for the In-link2 import. This category will be the equivalent of the Home category in In-link2, and all of the sub-categories will be created underneath. Clicking on the category button (folder icon) will pop up a catalog navigator, where you can select the category.
-<li> Link Image Name – this field designates the link image field in the In-link2 database, which was used to store the link image name. By default, it is ‘link_image' , however many users have used a custom field for this purpose, in which case you should enter the custom field name here.
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/help/inlink_inport.txt
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.1
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: trunk/kernel/admin/include/help/main_import.txt
===================================================================
--- trunk/kernel/admin/include/help/main_import.txt (nonexistent)
+++ trunk/kernel/admin/include/help/main_import.txt (revision 326)
@@ -0,0 +1,15 @@
+This section allows the administrator to import the data from other applications into your existing In-portal system.<br><br>
+<b>Step 1</b> of the import begins with a disclaimer that the data in your current system will be affected. Please ensure you understand the import process and the particular kind of import you are doing before proceeding.
+
+<br><br>
+<b>In-link 2 Import</b><br>
+In the current version, only the import from In-link2 is available. The import is designed for In-link version 2.3.4, however it will work, or partially work, for most of the older In-link2 versions up to 2.0.10. If you have one of the older In-link2 versions and are experiencing problems, please upgrade your In-link2 to the version 2.3.4, and then run this import. It is not possible to use In-link2 import if you do not have In-link3 installed on your In-portal platform. Some In-link2 license holders are entitled to a complimentary In-link3 license, please go to your account at <a href="http://www.intechnic.com/myaccount">http://www.intechnic.com/myaccount</a> for more information, or submit a support ticket.
+<br><br>
+<b>Step 3</b><br>
+In this step, the administrator will be asked to enter all database information for the In-link2 data. The current version of In-portal only supports import from the MySQL databases of In-link2.<br><br>
+<b>Step 4</b><br>
+In this step, the administrator will need to designate the options of the import – how the In-link2 data is supposed to be integrated into In-portal and In-link3.
+<li> Administrative Group – this field designates the In-portal administrative group (by default, ‘Admin'), into which the old In-link2 administrators should be imported. You can choose a different group for the import, and then designate the administrative users later. Clicking on the group button will pop up a list of In-portal groups.
+<li> Regular User Group - this field designates the In-portal group (by default, ‘Members'), into which the old In-link2 users (link owners) should be imported. It is recommended to import then into a group that will give them access to the front-end, and to modify their links. However, you can choose a different group for the import, and then manage the users later. Clicking on the group button will pop up a list of In-portal groups.
+<li> Initial Import Category – this field designates the In-portal category, which will serve as a root for the In-link2 import. This category will be the equivalent of the Home category in In-link2, and all of the sub-categories will be created underneath. Clicking on the category button (folder icon) will pop up a catalog navigator, where you can select the category.
+<li> Link Image Name – this field designates the link image field in the In-link2 database, which was used to store the link image name. By default, it is ‘link_image' , however many users have used a custom field for this purpose, in which case you should enter the custom field name here.
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/help/main_import.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/users/user_list.php
===================================================================
--- trunk/admin/users/user_list.php (revision 325)
+++ trunk/admin/users/user_list.php (revision 326)
@@ -1,364 +1,363 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!strlen($pathtoroot))
{
$path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
if(strlen($path))
{
/* determine the OS type for path parsing */
$pos = strpos($path,":");
if ($pos === false)
{
$gOS_TYPE="unix";
$pathchar = "/";
}
else
{
$gOS_TYPE="win";
$pathchar="\\";
}
$p = $path.$pathchar;
/*Start looking for the root flag file */
while(!strlen($pathtoroot) && strlen($p))
{
$sub = substr($p,strlen($pathchar)*-1);
if($sub==$pathchar)
{
$filename = $p."root.flg";
}
else
$filename = $p.$pathchar."root.flg";
if(file_exists($filename))
{
$pathtoroot = $p;
}
else
{
$parent = realpath($p.$pathchar."..".$pathchar);
if($parent!=$p)
{
$p = $parent;
}
else
$p = "";
}
}
if(!strlen($pathtoroot))
$pathtoroot = ".".$pathchar;
}
else
{
$pathtoroot = ".".$pathchar;
}
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if($sub!=$pathchar)
{
$pathtoroot = $pathtoroot.$pathchar;
}
//echo $pathtoroot;
require_once($pathtoroot."kernel/startup.php");
if (!admin_login())
{
if(!headers_sent())
setcookie("sid"," ",time()-3600);
$objSession->Logout();
header("Location: ".$adminURL."/login.php");
die();
//require_once($pathtoroot."admin/login.php");
}
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
$pathtolocal = $pathtoroot."kernel/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
//require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$pathtolocal = $pathtoroot;
/* -------------------------------------- Section configuration ------------------------------------------- */
$section = 'in-portal:user_list';
$envar = "env=" . BuildEnv();
$SortFieldVar = "User_SortField";
$SortOrderVar = "User_SortOrder";
$DefaultSortField = "Login";
$PerPageVar = "Perpage_User";
$CurrentPageVar = "Page_UserList";
$CurrentFilterVar = "User_View";
$ListForm = "userlistform";
$CheckClass = "UserChecks";
/* ------------------------------------- Configure the toolbar ------------------------------------------- */
$objListToolBar = new clsToolBar();
$objListToolBar->Set("section",$section);
$objListToolBar->Set("load_menu_func","");
$objListToolBar->Set("CheckClass",$CheckClass);
$objListToolBar->Set("CheckForm",$ListForm);
$listImages = array();
//$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
$objListToolBar->Add("new_user", "la_ToolTip_New_User",$adminURL."/users/adduser.php?$envar&new=1","swap('new_user','toolbar/tool_new_user_f2.gif');",
"swap('new_user', 'toolbar/tool_new_user.gif');","");
$objListToolBar->Add("user_edit","la_ToolTip_Edit","#", "if (UserChecks.itemChecked()) swap('user_edit','toolbar/tool_edit_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_edit', 'toolbar/tool_edit.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('adduser', '');",
"tool_edit.gif",TRUE,TRUE);
$listImages[] = "UserChecks.addImage('user_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
$objListToolBar->Add("user_del","la_ToolTip_Delete","#", "if (UserChecks.itemChecked()) swap('user_del','toolbar/tool_delete_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_del', 'toolbar/tool_delete.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_delete_user');",
"tool_delete.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
$objListToolBar->Add("user_primary","la_ToolTip_PrimaryGroup","#", "if (UserChecks.itemChecked()) swap('user_primary','toolbar/tool_primary_user_group_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_primary', 'toolbar/tool_primary_user_group.gif');","if (UserChecks.itemChecked()) SelectPrimaryGroup();",
"tool_primary_user_group.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_primary','$imagesURL/toolbar/tool_primary_user_group.gif','$imagesURL/toolbar/tool_primary_user_group_f3.gif',1); ";
$objListToolBar->Add("divider");
$objListToolBar->Add("user_app","la_ToolTip_Approve","#","if (UserChecks.itemChecked()) swap('user_app','toolbar/tool_approve_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_app', 'toolbar/tool_approve.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_approve_user');",
"tool_approve.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_app','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); ";
$objListToolBar->Add("user_deny","la_ToolTip_Deny","#","if (UserChecks.itemChecked()) swap('user_deny','toolbar/tool_decline_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_deny', 'toolbar/tool_decline.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('user_list', 'm_deny_user');",
"tool_deny.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_deny','$imagesURL/toolbar/tool_decline.gif','$imagesURL/toolbar/tool_decline_f3.gif',1); ";
$objListToolBar->Add("user_ban","la_ToolTip_Ban","#","if (UserChecks.itemChecked()) swap('user_ban','toolbar/tool_ban_user_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_ban', 'toolbar/tool_ban_user.gif');","if (UserChecks.itemChecked()) UserChecks.check_submit('banuser', '');",
"tool_deny.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_ban','$imagesURL/toolbar/tool_ban_user.gif','$imagesURL/toolbar/tool_ban_user_f3.gif',1); ";
$objListToolBar->Add("divider");
$objListToolBar->Add("user_mail","la_ToolTip_SendMail","#", "if (UserChecks.itemChecked()) swap('user_mail','toolbar/tool_e-mail_f2.gif');",
"if (UserChecks.itemChecked()) swap('user_mail', 'toolbar/tool_e-mail.gif');","if (UserChecks.itemChecked()) openEmailPopup('','sendmail',$CheckClass);",
"tool_e-mail.gif",FALSE,TRUE);
$listImages[] = "UserChecks.addImage('user_mail','$imagesURL/toolbar/tool_e-mail.gif','$imagesURL/toolbar/tool_e-mail_f3.gif',1); ";
$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');",
"swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif");
$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
"swap('viewmenubutton', 'toolbar/tool_view.gif');",
"ShowViewMenu();","tool_view.gif");
$objListToolBar->AddToInitScript($listImages);
/* ----------------------------------------- Set the View Filter ---------------------------------------- */
/* bit place holders for category view menu */
$Bit_Pending=4;
$Bit_Disabled=2;
$Bit_Valid=1;
$Bit_All = 7;
$FilterLabels = array();
$FilterLabels[0] = admin_language("la_Text_Enabled");
$FilterLabels[1] = admin_language("la_Text_Disabled");
$FilterLabels[2] = admin_language("la_Text_Pending");
/* determine current view menu settings */
$UserView = $objConfig->Get("User_View");
if(!is_numeric($UserView))
{
$UserView = $Bit_All; //Set all bits ON
$UserFilter = "";
}
if($UserView & $Bit_Valid)
$Status[] = 1;
if($UserView & $Bit_Disabled)
$Status[] = 0;
if($UserView & $Bit_Pending)
$Status[] = 2;
if(count($Status)>0)
{
$UserFilter = "Status IN (".implode(",",$Status).")";
}
else
$UserFilter = "Status = -1";
$order = $objConfig->Get($SortOrderVar);
$SearchWords = $objSession->GetVariable("UserSearchWord");
$where = "(ug.PrimaryGroup!=0 OR ug.PrimaryGroup IS NULL)";
$SearchWhere = $SearchWords ? $objUsers->AdminSearchWhereClause($SearchWords) : '';
if(strlen($SearchWhere))
{
$where .= " AND (".$SearchWhere.")";
}
if(strlen($UserFilter))
$where .= " AND (".$UserFilter.")";
/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/
$sql = "SELECT u.*,g.Name as GroupName,ELT(u.status+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")." ','".admin_language("la_Text_Pending")."') as UserStatus, ";
$sql .="FROM_UNIXTIME(u.CreatedOn,'%m-%d-%Y %H:%i:%s') as DateCreated FROM ".GetTablePrefix()."PortalUser as u ";
$sql .="LEFT JOIN ".GetTablePrefix()."UserGroup as ug ON (u.PortalUserId=ug.PortalUserId) ";
$sql .="LEFT JOIN ".GetTablePrefix()."PortalGroup as g ON (ug.GroupId=g.GroupId) WHERE $where";
if(!strlen($objConfig->Get($SortFieldVar)))
$objConfig->Set($SortFieldVar,$DefaultSortField);
$orderBy = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar));
if(strlen($orderBy))
$sql .=" ORDER BY ".$orderBy;
if( GetVar('resetpage') )
{
$page = 1;
$objSession->SetVariable($CurrentPageVar,1);
}
else
{
if( GetVar('lpn') )
{
$page = GetVar('lpn');
$objSession->SetVariable($CurrentPageVar, $page);
}
else
{
$page = $objSession->GetVariable($CurrentPageVar);
}
}
//$sql .=" ".GetLimitSQL($page,(int)$objConfig->Get($PerPageVar));
if($objSession->HasSystemPermission("DEBUG.LIST"))
echo htmlentities($sql,ENT_NOQUOTES)."<br>\n";
$objListView = new clsListView($objListToolBar);
$objListView->CurrentPageVar = $CurrentPageVar;
$objListView->PerPageVar = $PerPageVar;
//echo "SQL: $sql<br>";
$objUsers->Query_Item($sql, false, 'set_first');
$objSession->SetVariable($CurrentPageVar, 1);
$itemcount = QueryCount($sql);
//$title = prompt_language("la_Text_ShowingUsers")." (".$objUsers->NumItems().")";
//removed by PSK 2004-10-21
if(strlen($SearchWords))
{
$title = prompt_language("la_Text_Search_Results")." (".$itemcount.")";
}
else
$title = prompt_language("la_Text_ShowingUsers")." (".$itemcount.")";
$objListView->SetListItems($objUsers);
/* ---------------------------------------- Configure the list view ---------------------------------------- */
$objListView->IdField = "ResourceId";
$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl";
$objListView->ColumnHeaders->Add("Login",admin_language("la_prompt_Username"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"Login");
$objListView->ColumnHeaders->Add("LastName",admin_language("la_prompt_Last_Name"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"LastName");
$objListView->ColumnHeaders->Add("FirstName",admin_language("la_prompt_First_Name"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"FirstName");
$objListView->ColumnHeaders->Add("Email",admin_language("la_prompt_Email"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"Email");
$objListView->ColumnHeaders->Add("GroupName",admin_language("la_prompt_PrimaryGroup"),1,0,$order,"width=\"20%\"",$SortFieldVar,$SortOrderVar,"GroupName");
$objListView->ColumnHeaders->Add("DateCreated",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"u.CreatedOn");
$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar));
$objListView->PrintToolBar = FALSE;
$objListView->SearchBar = TRUE;
$objListView->SearchKeywords = $SearchWords;
$objListView->SearchAction="m_user_search";
$objListView->CheckboxName = "itemlist[]";
$objListView->TotalItemCount = $itemcount;
$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,
$CurrentFilterVar,$UserView,$Bit_All);
foreach($FilterLabels as $Bit=>$Label)
{
$objListView->AddViewMenuFilter($Label,$Bit);
}
for($i=0;$i<count($objUsers->Items);$i++)
{
$u =& $objUsers->GetItemRefByIndex($i);
$objListView->RowIcons[] = $u->StatusIcon();
}
$objListToolBar->AddToInitScript("fwLoadMenus();");
$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
int_header($objListToolBar,NULL, $title,NULL,$h);
?>
<FORM method="POST" ACTION="" NAME="userlistform" ID="userlistform">
<?php
print $objListView->PrintList();
?>
<input type="hidden" name="Action" value="">
</FORM>
<FORM method=POST NAME="sendmail" ID="sendmail" target="sendmail" ACTION="<?php echo $adminURL."/email/sendmail.php?env=".BuildEnv(); ?>">
<INPUT TYPE="HIDDEN" NAME="idlist" ID="idlist" VALUE="">
<INPUT TYPE="hidden" NAME="idtype" ID="idtype" VALUE="user">
</FORM>
<!-- CODE FOR VIEW MENU -->
<form ID="viewmenu" method="post" action="user_list.php?env=<?php echo BuildEnv(); ?>" name="viewmenu">
<input type="hidden" name="fieldname" value="">
<input type="hidden" name="varvalue" value="">
<input type="hidden" name="varvalue2" value="">
<input type="hidden" name="Action" value="">
</form>
<form ID="popup" method="post" action="user_list.php?env=<?php echo BuildEnv(); ?>" name="popup">
<INPUT TYPE="hidden" NAME="grouplist">
<input TYPE="hidden" NAME="Action" VALUE="m_user_primarygroup">
<input type="hidden" NAME="userlist">
</FORM>
<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>">
<INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
<INPUT TYPE="HIDDEN" NAME="list_search">
</FORM>
-
<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
<script>
initSelectiorContainers();
<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
</script>
<!-- END CODE-->
<?php int_footer(); ?>
Property changes on: trunk/admin/users/user_list.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/admin/include/checkarray.js
===================================================================
--- trunk/admin/include/checkarray.js (revision 325)
+++ trunk/admin/include/checkarray.js (revision 326)
@@ -1,184 +1,178 @@
/* CheckArray - used to enable or disable toolbar images if items are checked or unchecked*/
function CheckArray()
{ /* class properties */
//alert('test');
this.paste_ = false;
this.ImageList = new Array(); // 2D array to hold image information
//[x][0] = image ID
//[x][1] = 'on' URL
//[x][2] = 'off' URL
//[x][3] = min. # of items required for 'on' state
this.CheckList = new Array(); // 1D array that contains document IDs for checkboxes
this.CheckValues = new Array();//1D array that contains values for each checkbox
this.itemschecked=0; // number of checked items
this.formname = null; // name of form containing checkboxes
this.envar = null; // envar of the document (from the query_string)
this.uncheckClassName = new Array(); //class to set element class to when unchecking item
/* class methods */
this.addImage = addImage; //adds an image to the image array
this.selectAll = selectAll; //set all check boxes to a value (true/false)
this.invertItems = invertItems; //invert all checkboxes
this.addCheck = addCheck; //called when an item is checked
this.removeCheck = removeCheck; //called when an item is unchecked
this.setImages = setImages; //used to set images to their on or off state
this.check_submit = check_submit; //called to submit the form
this.itemChecked=itemChecked; //returns true if at least 1 item is checked
this.countChecks=countChecks; //returns the # of checked items
this.getItemList=getItemList; //returns an array of the IDs currently checked
}
function addImage(Id,onURL,offURL,count)
{
img = new Array(Id,onURL,offURL,count);
this.ImageList[this.ImageList.length] = img;
}
function itemChecked()
{
- if(this.itemschecked>0)
- {
- return true;
- }
- else
- {
- return false;
- }
+ return (this.itemschecked > 0) ? true : false;
}
function selectAll(value)
{
checkcount = this.CheckList.length;
for(var i=0; i<checkcount; i++)
{
var ob = document.getElementById(this.CheckList[i]);
var inputs = ob.getElementsByTagName("INPUT");
for (var j = 0; j < inputs.length; j++)
{
if (inputs[j].type == "checkbox")
{
if(inputs[j].checked != value)
{
inputs[j].checked = value;
if(value==true)
{
this.addCheck(ob.id);
}
else
{
this.removeCheck(ob.id);
}
}
}
}
}
}
function invertItems()
{
checkcount = this.CheckList.length;
for(var i=0; i<checkcount; i++)
{
ob = document.getElementById(this.CheckList[i]);
var inputs = ob.getElementsByTagName("INPUT");
for (var j = 0; j < inputs.length; j++)
{
if (inputs[j].type == "checkbox")
{
value = inputs[j].checked;
if(value == false)
{
inputs[j].checked = true;
this.addCheck(ob.id);
}
else
{
inputs[j].checked = false;
this.removeCheck(ob.id);
}
}
}
}
}
function addCheck(el_id)
{
el = document.getElementById(el_id);
this.itemschecked++;
this.setImages();
this.uncheckClassName[el.id] = el.className;
el.className = 'selection';
idval = parseInt(el.id);
//alert(el_id+'='+idval);
this.CheckValues[el_id]=1;
}
function removeCheck(el_id)
{
el = document.getElementById(el_id);
this.itemschecked--;
this.setImages();
el.className = this.uncheckClassName[el.id];
idval = parseInt(el.id);
//alert(el_id+'='+idval);
this.CheckValues[el_id]=0;
}
function countChecks()
{
return this.itemschecked;
}
function setImages()
{
for(var i=0; i<this.ImageList.length; i++)
{
id = this.ImageList[i][0];
img = document.getElementById(id);
if(img)
{
if(this.itemschecked < this.ImageList[i][3])
{
img.src=this.ImageList[i][2];
}
else
{
img.src=this.ImageList[i][1];
}
+ SetButtonStateByImage(id);
}
else
alert('An Image [' +id+ '] not found');
}
}
function getItemList()
{
var res = new Array();
for(var i=0; i<this.CheckList.length; i++)
{
if(this.CheckValues[this.CheckList[i]]>0)
{
res[res.length] = this.CheckList[i];
}
}
return res;
}
function check_submit(location, ActionValue, EnvVar)
{
if( ActionValue.match(/_del/) || ActionValue.match(/del_/) )
if (!theMainScript.Confirm(lang_DeleteConfirm)) return;
f = document.getElementById(this.formname);
if(f)
{
f.Action.value = ActionValue;
f.action = location + '.php?' + this.envar;
if( HasParam(EnvVar) ) f.action += EnvVar;
f.submit();
}
else
alert('Form ' + this.formname + ' was not found.');
}
Property changes on: trunk/admin/include/checkarray.js
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/include/mainscript.php
===================================================================
--- trunk/admin/include/mainscript.php (revision 325)
+++ trunk/admin/include/mainscript.php (revision 326)
@@ -1,514 +1,540 @@
<?php
global $imagesURL,$objConfig,$adminURL,$rootURL, $en;
$group_select = $adminURL."/users/group_select.php";
$item_select = $adminURL."/relation_select.php";
$user_select = $adminURL."/users/user_select.php";
$cat_select = $adminURL."/cat_select.php";
$missing_edit = $adminURL."/config/missing_label_search.php";
$lang_Filter = language("la_Text_Filter");
$lang_View = language("la_Text_View");
$lang_Sort = language("la_Text_Sort");
$lang_Select = language("la_Text_Select");
$lang_Unselect = language("la_Text_Unselect");
$lang_Invert = language("la_Text_Invert");
$lang_PerPage = language("la_prompt_PerPage");
$lang_All = language("la_Text_All");
$lang_Asc = language("la_common_ascending");
$lang_Desc = language("la_common_descending");
$lang_Disabled = language("la_Text_Disabled");
$lang_Enabled = language("la_Text_Enabled");
$lang_Pending = language("la_Text_Pending");
$lang_Default = language("la_Text_Default");
$lang_CreatedOn = language("la_prompt_CreatedOn");
$lang_None = language("la_Text_None");
$lang_PerPage = language("la_prompt_PerPage");
$lang_Views = language("la_Text_Views");
$lang_URL = language("la_ColHeader_Url");
$lang_Status = language("la_prompt_Status");
$lang_Name = language("la_prompt_Name");
$lang_MoveDn = language("la_prompt_MoveDown");
$lang_MoveUp = language("la_prompt_MoveUp");
$lang_Delete = language("la_prompt_Delete");
$lang_Edit = language("la_prompt_Edit");
$errormsg = language("la_validation_AlertMsg");
$env2 = BuildEnv();
if(is_numeric($en))
{
$env2 = BuildEnv() . "&en=$en";
}
$editor_url = $adminURL."/editor/editor.php?env=$env2";
$email_url = $adminURL."/email/sendmail.php?env=$env2";
$phrase_edit = $adminURL."/config/edit_label.php?env=".$env2;
$submit_done = isset($_REQUEST['submit_done']) ? 1 : 0; // returns form submit status
$Cal = GetDateFormat();
if(strpos($Cal,"y"))
{
$Cal = str_replace("y","yy",$Cal);
}
else
$Cal = str_replace("Y","y",$Cal);
$Cal = str_replace("m","mm",$Cal);
$Cal = str_replace("n","m",$Cal);
$Cal = str_replace("d","dd",$Cal);
$format = GetStdFormat(GetDateFormat());
$yearpos = (int)DateFieldOrder($format,"year");
$monthpos = (int)DateFieldOrder($format,"month");
$daypos = (int)DateFieldOrder($format,"day");
$ampm = "false";
if($objConfig->Get("ampm_time")=="1")
{
$ampm = "true";
}
require_once($pathtoroot.$admin."/lv/js/js_lang.php");
print <<<END
<script type="text/javascript" src="$adminURL/lv/js/in-portal.js"></script>
<script language="Javascript">
var CurrentTab= new String();
var lang_Filter = "$lang_Filter";
var lang_Sort = "$lang_Sort";
var lang_Select = "$lang_Select";
var lang_Unselect = "$lang_Unselect";
var lang_Invert = "$lang_Invert";
var lang_PerPage = "$lang_PerPage";
var lang_All = "$lang_All";
var lang_Asc = "$lang_Asc";
var lang_Desc = "$lang_Desc";
var lang_Disabled = "$lang_Disabled";
var lang_Pending = "$lang_Pending";
var lang_Default = "$lang_Default";
var lang_CreatedOn = "$lang_CreatedOn";
var lang_View = "$lang_View";
var lang_Views = "$lang_Views";
var lang_None = "$lang_None";
var lang_PerPage = "$lang_PerPage";
var lang_Enabled = "$lang_Enabled";
var lang_URL = "$lang_URL";
var lang_Status = "$lang_Status";
var lang_Name = "$lang_Name";
var lang_Edit = "$lang_Edit";
var lang_Delete = "$lang_Delete";
var lang_MoveUp = "$lang_MoveUp";
var lang_MoveDn = "$lang_MoveDn";
var ampm = $ampm;
var listview_clear=1;
var CalDateFormat = "$Cal";
var yearpos = $yearpos;
var monthpos = $monthpos;
var daypos = $daypos;
var ErrorMsg = '$errormsg';
//en = $en
var rootURL = '$rootURL';
function clear_list_checkboxes()
{
var inputs = document.getElementsByTagName("INPUT");
for (var i = 0; i < inputs.length; i++)
if (inputs[i].type == "checkbox" && inputs[i].getAttribute("isSelector"))
{
inputs[i].checked=false;
}
}
function getRealLeft(el) {
xPos = el.offsetLeft;
tempEl = el.offsetParent;
while (tempEl != null) {
xPos += tempEl.offsetLeft;
tempEl = tempEl.offsetParent;
}
return xPos;
}
function getRealTop(el) {
yPos = el.offsetTop;
tempEl = el.offsetParent;
while (tempEl != null) {
yPos += tempEl.offsetTop;
tempEl = tempEl.offsetParent;
}
return yPos;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
+function SetButtonStateByImage(btn_id, img_src)
+{
+ // set state depending on image name
+ var btn = document.getElementById(btn_id);
+ if(btn)
+ {
+ if( !HasParam(img_src) ) img_src = btn.getAttribute('src');
+ var img_name = img_src.split('/');
+ img_name = img_name.length ? img_name[img_name.length - 1] : img_name;
+ img_name = img_name.split('.');
+ img_name = img_name[0].split('_');
+ img_name = img_name.length ? img_name[img_name.length - 1] : img_name;
+ if(img_name)
+ {
+ switch(img_name)
+ {
+ case 'f2': btn.setAttribute('ButtonState','over'); break;
+ case 'f3': btn.setAttribute('ButtonState','disabled'); break;
+ default: btn.setAttribute('ButtonState','enabled'); break;
+ }
+ }
+ }
+}
+
+
function swap(imgid, src, module_name){
// swaps toobar icons from kernel
// admin or from module specified
var ob = document.getElementById(imgid);
if(ob)
{
+ SetButtonStateByImage(imgid, src);
var s = src;
s = s.slice(0,4);
if(s=='http')
{
ob.src = src;
}
else
{
if(module_name == null)
ob.src = '$adminURL' + '/images/' + src;
else
{
ob.src = '$rootURL' + module_name + '/$admin/images/' + src;
}
}
}
}
function flip(val)
{
if (val == 0)
return 1;
else
return 0;
}
function config_val(field, val2,url){
//alert('Setting ' + field + ' to ' + val2);
if(url)
document.viewmenu.action=url;
document.viewmenu.Action.value = "m_SetVariable";
document.viewmenu.fieldname.value = field;
document.viewmenu.varvalue.value = val2;
document.viewmenu.submit();
}
function session_val(field, val2){
//alert('Setting ' + field + ' to ' + val2);
document.viewmenu.Action.value = "m_SetSessionVariable";
document.viewmenu.fieldname.value = field;
document.viewmenu.varvalue.value = val2;
document.viewmenu.submit();
}
function Submit_ListSearch(action)
{
f = document.getElementById('ListSearchForm');
s = document.getElementById('ListSearchWord');
if(f)
{
f.Action.value = action;
f.list_search.value = s.value;
f.submit();
}
}
function ValidTime(time_str)
{
var valid = true;
if( trim(time_str) == '' ) return true; // is valid in case if not entered
time_str = time_str.toUpperCase();
parts = time_str.split(/\s*[: ]\s*/);
hour = parseInt(parts[0]);
minute = parseInt(parts[1]);
sec = parseInt(parts[2]);
if(ampm == true)
{
amstr = parts[3];
var am_valid = (amstr == 'AM' || amstr == 'PM');
if(am_valid && hour > 12) valid = false;
if(amstr == 'PM' && hour <= 12) hour = hour + 12;
if(hour == 24) hour = 0;
if(!am_valid) valid = false;
}
valid = valid && (hour > -1 && hour < 24);
valid = valid && (minute > -1 && minute < 60);
valid = valid && (sec > -1 && sec < 60);
return valid;
}
function DaysInMonth(month,year)
{
timeA = new Date(year, month,1);
timeDifference = timeA - 86400000;
timeB = new Date(timeDifference);
return timeB.getDate();
}
function ValidDate(date_str)
{
var valid = true;
if( trim(date_str) == '' ) return true; // is valid in case if not entered
parts = date_str.split(/\s*\D\s*/);
year = parts[yearpos-1];
month = parts[monthpos-1];
day = parts[daypos-1];
valid = (year>0);
valid = valid && ((month>0) && (month<13));
valid = valid && (day<DaysInMonth(month,year)+1);
return valid;
}
function trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g,'');
}
function ValidateNumber(aValue, aNumberType)
{
var valid = true;
if( trim(aValue) == '' ) return true;
return (parseInt(aValue) == aValue);
}
function OpenEditor(extra_env,TargetForm,TargetField)
{
var url = '$editor_url';
url = url+'&TargetForm='+TargetForm+'&TargetField='+TargetField+'&destform=popup';
if(extra_env.length>0)
url = url+extra_env;
window.open(url,"html_edit","width=800,height=575,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
}
function BitStatus(Value,bit)
{
var val = Math.pow(2,bit);
if((Value & val))
{
return 1;
}
else
return 0;
}
function FlipBit(ValueName,Value,bit)
{
var val = Math.pow(2,bit);
//alert("Setting bit "+bit);
if(BitStatus(Value,bit))
{
Value = Value - val;
}
else
Value = Value + val;
session_val(ValueName,Value);
}
function PerPageSelected(Value,PageCount)
{
if(Value==PageCount)
{
return 2;
}
else
return 0;
}
function RadioIsSelected(Value1,Value2)
{
if(Value1 == Value2)
{
return 2;
}
else
return 0;
}
function OpenItemSelector(envstr)
{
//alert(envstr);
window.open('$item_select?'+envstr,"groupselect","width=750,height=400,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
}
function OpenUserSelector(CheckIdField,Checks,envstr)
{
if(Checks) var retval = Checks.getItemList();
f = document.getElementById('userpopup');
if(f)
{
if(CheckIdField)
f.elements[CheckIdField].value = retval;
}
SessionPrepare('$user_select', envstr, 'userselect');
}
function SessionPrepare(url, get_str, window_name)
{
var params = ExtractParams(get_str);
if(params['destform'])
{
if(params['destform'] == 'popup')
{
CreatePopup(window_name, url + '?' + get_str);
return true;
}
else
var frm = CreateFakeForm();
}
else
var frm = CreateFakeForm();
if(!frm) return false;
frm.destform.value = params['destform'];
params['destform'] = 'popup';
get_str = MergeParams(params);
CreatePopup(window_name);
frm.target = window_name;
frm.method = 'POST';
frm.action = url + '?' + get_str;
frm.submit();
}
function addField(form, type, name, value)
{
// create field in form
var field = document.createElement("INPUT");
field.type = type;
field.name = name;
field.id = name;
field.value = value;
form.insertBefore(field, form.nextSibling);
}
function CreateFakeForm()
{
if($submit_done == 0)
{
var theBody = document.getElementsByTagName("BODY");
if(theBody.length == 1)
{
var frm = document.createElement("FORM");
frm.name = "fake_form";
frm.id = "fake_form";
frm.method = "post";
theBody[0].insertBefore(frm, theBody[0].nextSibling);
addField(frm, 'hidden', 'submit_done', 1);
addField(frm, 'hidden', 'destform', '');
return document.getElementById('fake_form');
}
}
return false;
}
function CreatePopup(window_name, url, width, height)
{
// creates a popup window & returns it
if(url == null && typeof(url) == 'undefined' ) url = '';
if(width == null && typeof(width) == 'undefined' ) width = 750;
if(height == null && typeof(height) == 'undefined' ) height = 400;
return window.open(url,window_name,'width='+width+',height='+height+',status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no');
}
function ShowHelp(section)
{
var frm = document.getElementById('help_form');
frm.section.value = section;
frm.method = 'POST';
CreatePopup('HelpPopup','$rootURL$admin/help/blank.html'); // , null, 600
frm.target = 'HelpPopup';
frm.submit();
}
function ExtractParams(get_str)
{
// extract params into associative array
var params = get_str.split('&');
var result = Array();
var temp_var;
var i = 0;
var params_count = params.length;
while(i < params_count)
{
temp_var = params[i].split('=');
result[temp_var[0]] = temp_var[1];
i++;
}
return result;
}
function MergeParams(params)
{
// join splitted params into GET string
var key;
var result = '';
for(key in params)
result += key + '=' + params[key] + '&';
if(result.length) result = result.substring(0, result.length - 1);
return result;
}
function show_props(obj, objName)
{
var result = "";
for (var i in obj) {
result += objName + "." + i + " = " + obj[i] + "\\n";
}
return result;
}
function OpenGroupSelector(envstr)
{
//alert(envstr);
SessionPrepare('$group_select', envstr, 'groupselect');
//window.open('$group_select?'+envstr,"groupselect","width=750,height=400,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
}
function OpenCatSelector(envstr)
{
//alert(envstr);
window.open('$cat_select?'+envstr,"catselect","width=750,height=400,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
}
function openEmailPopup(envar,form,Checks)
{
var email_url='$email_url';
var url = email_url+envar;
if(Checks.itemChecked())
{
f = document.getElementById(form);
if(f)
{
window.open('',"sendmail","width=750,height=400,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
f.idlist.value = Checks.getItemList();
f.submit();
}
}
}
function OpenPhraseEditor(extra_env)
{
//SessionPrepare('$phrase_edit', extra_env, 'phrase_edit');
var url = '$phrase_edit'+extra_env+'&destform=popup';
window.open(url,"phrase_edit","width=750,height=400,status=yes,resizable=yes,menubar=no,scrollbars=yes,toolbar=no");
}
var env = '$env2';
var SubmitFunc = false;
</script>
END;
?>
Property changes on: trunk/admin/include/mainscript.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.4
\ No newline at end of property
+1.5
\ No newline at end of property
Index: trunk/admin/toolbar.php
===================================================================
--- trunk/admin/toolbar.php (revision 325)
+++ trunk/admin/toolbar.php (revision 326)
@@ -1,303 +1,323 @@
<?php
##############################################################
## In-portal :: Administration Interfaces :: Tool Bar ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
class clsToolBarItem
{
var $m_img;
var $m_alt;
var $link;
var $onMouseOver;
var $onMouseOut;
var $onClick;
var $filename;
function clsToolBarItem()
{
}
function GetItem()
{
global $imagesURL;
$o = "";
if ($this->img=="divider")
{
$o .= "<img src=\"".$imagesURL."/toolbar/tool_divider.gif\" width=\"4\" height=\"32\" border=\"0\">\n";
}
else
{
if(strlen($this->link)>1)
{
$o .= "<a href=\"".$this->link."\" onMouseOut=\"".$this->onMouseOut."\"";
$o .= " onMouseOver=\"".$this->onMouseOver."\" onClick=\"".$this->onClick."\">\n";
$o .= "<img ID=\"".$this->img."\" alt=\"".language($this->alt)."\" src=\"".$this->filename."\" width=\"32\" height=\"32\" border=\"0\">";
$o .= "</a>\n";
}
else
{
$o .= "<img ID=\"".$this->img."\" alt=\"".language($this->alt)."\" src=\"".$this->filename."\" width=\"32\" height=\"32\" border=\"0\"";
$o .= " onMouseOut=\"".$this->onMouseOut."\"";
$o .= " onMouseOver=\"".$this->onMouseOver."\" onClick=\"".$this->onClick."\">";
}
}
return $o;
}
+
+ function GetID()
+ {
+ // get image id (for javascript operations)
+ return $this->img;
+ }
}
class clsToolBar
{
var $Items;
var $m_section;
var $m_load_menu_func;
var $m_CheckClass;
var $m_CheckForm;
var $InitScript;
var $DoubleClickAction;
var $ContextMenu;
function clsToolBar()
{
$this->Items = array();
$this->InitScript = array();
$this->ContextMenu = array();
}
function Get($name)
{
$var = "m_" . $name;
return $this->$var;
}
function Set($name, $value)
{
if (is_array($name))
{
for ($i=0; $i<sizeof($name); $i++)
{ $var = "m_" . $name[$i];
$this->$var = $value[$i];
$this->m_dirtyFieldsMap[$name[$i]] = $value[$i];
echo "$var = ".$value[$i]."<br>\n";
}
}
else
{
$var = "m_" . $name;
$this->$var = $value;
$this->m_dirtyFieldsMap[$name] = $value;
}
}
function Add($img,$alt="",$link="",$MouseOver="",$MouseOut="",$onClick="", $filename="",$IsDblClick=FALSE,$ContextMenu=FALSE)
{
global $imagesURL;
$t = new clsToolBarItem();
$t->img = $img;
$t->alt = $alt;
$t->link = $link;
$t->onMouseOver = $MouseOver;
$t->onMouseOut = $MouseOut;
$t->onClick = $onClick;
if(strlen($filename)==0)
{
$t->filename = $imagesURL."/toolbar/tool_".$img.".gif";
}
else
{
if(substr($filename,0,4)=="http")
{
$t->filename = $filename;
}
else
{
if(substr($filename,0,8)!="toolbar/")
$filename = "toolbar/".$filename;
if(substr($filename,0,1)!="/")
$filename = "/".$filename;
$t->filename = $imagesURL.$filename;
}
}
array_push($this->Items,$t);
if($IsDblClick)
$this->DoubleClickAction=$onClick;
if($ContextMenu)
$this->ContextMenu[] = "contextMenu.addMenuItem('".admin_language($alt)."',\"$onClick\",\"\");";
return $t;
}
function AddToInitScript($s)
{
if(is_array($s))
{
for($i=0;$i<count($s);$i++)
array_push($this->InitScript,$s[$i]);
}
else
array_push($this->InitScript,$s);
}
function GetInitScript()
{
global $envar;
$s="";
if(count($this->InitScript)>0)
$s = implode("\n",$this->InitScript);
if(strlen($this->Get("CheckClass")))
{
$c = $this->Get("CheckClass")." = new CheckArray();\n";
$c .=$this->Get("CheckClass").".formname='".$this->Get("CheckForm")."';\n";
$c .=$this->Get("CheckClass").".envar='$envar';\n";
$s = $c.$s;
}
$s .= "\n".$this->GetActionHandlerScript();
// $s .= "\n".$this->Get("CheckClass").".setImages();\n";
return "<SCRIPT language=\"JavaScript\">$s</SCRIPT>";
}
function GetActionHandlerScript()
{
$o = '';
if(strlen($this->DoubleClickAction)>0)
{
$o .= "function handleDoubleClick()\n{\n";
$o .= " ".$this->DoubleClickAction."\n";
$o .= "}\n\n";
}
if(count($this->ContextMenu))
{
$o .= "function initContextMenu()\n{\n";
$o .= " window.contextMenu = new Menu(\"Context\");";
for($x=0;$x<count($this->ContextMenu);$x++)
{
$o .= " ".$this->ContextMenu[$x]."\n";
}
$o .= " window.triedToWriteMenus = false;\n window.contextMenu.writeMenus();\n return true;\n}\n";
}
return $o;
}
function Build()
{
global $imagesURL;
+ $btn_ids = Array();
- $o = "<table border=0 cellpadding=0 cellspacing=0 width=\"100%\" class=\"toolbar\">";
- $o .= "<tr><td><img alt="|" src=\"".$imagesURL."/toolbar_start.gif\" width=10 height=50 border=0></td>\n";
+ $o = '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="toolbar">';
+ //$o .= '<tr><td><img alt="|" src="'.$imagesURL.'/toolbar_start.gif" width="10" height="50" border="0"></td>'."\n";
foreach($this->Items as $t)
{
- $o .= "<TD>".$t->GetItem()."</TD>";
+ $o .= '<TD>'.$t->GetItem().'</TD>';
+ $btn_ids[] = $t->GetID();
}
- $o .= "<TD width=\"100%\"></TD></TR></TABLE>";
+ $o .= '<TD width="100%"></TD></TR></TABLE>'."\n";
+
+ $btn_ids = "'".implode("','", $btn_ids)."'";
+ $o .= '<script language="javascript">
+ var toolbar_btns = Array('.$btn_ids.');
+ var i = 0, btn_count = toolbar_btns.length;
+ while(i < btn_count)
+ {
+ SetButtonStateByImage(toolbar_btns[i]);
+ i++;
+ }
+ </script>';
+
return $o;
}
function onLoadString()
{
return "";
}
}
class clsItemTabs
{
var $Tabs;
var $ItemCount;
function clsItemTabs()
{
$this->Tabs = array();
$this->ItemCount = array();
}
function SetItemCount($divname,$Value)
{
$this->ItemCount[$divname] = $Value;
}
function GetItemCount($divname)
{
return (int)$this->ItemCount[$divname];
}
function AddTab($Caption,$divname,$ItemCount,$selected,$numfunc="")
{
$t["caption"]=$Caption;
$t["divname"]=$divname;
$this->SetItemCount($divname,$ItemCount);
$t["selected"]=$selected;
$t["numfunc"]=$numfunc;
$this->Tabs[] = $t;
}
function TabItem($i)
{
global $imagesURL;
$t = $this->Tabs[$i];
if($t["selected"]==1)
{
$divimage="/divider_up.gif";
}
else
$divimage="/divider_dn.gif";
$div = $t["divname"];
$o .= "<td width=\"138\" height=\"22\" noWrap";
$o .= " background=\"".$imagesURL."/itemtabs/tab_inactive.gif\" ";
$o .= "tabHeaderOf=\"$div\" ";
$o .= "onclick=\"toggleTab('$div');\" style=\"cursor:hand\">\n";
$o .= " <img height=\"20\" src=\"".$imagesURL."/itemtabs/divider_empty.gif\" ";
$o .= "width=\"20\" border=\"0\" align=\"middle\">";
$o .= $t["caption"]."<span class=\"cats_stats\">";
$func = $t["numfunc"];
if(is_numeric($func))
{
$total = $func;
}
else
{
if(function_exists($func))
{
$total = $func();
}
}
if(!is_numeric($total))
$total = $this->GetItemCount($div);
if($total==$this->GetItemCount($div))
{
$o .= "(".$this->GetItemCount($div).")</span></td>\n";
}
else
$o .= "(".$this->GetItemCount($div)." / ".$total.")</span></td>\n";
return $o;
}
function tabRow()
{
$o = "<table width=\"100%\" border=0 cellspacing=0 cellpadding=0>";
$o .= "<tr>";
for($i=0;$i<count($this->Tabs);$i++)
{
$o .= $this->TabItem($i);
}
$o .= "<td width=\"100%\"></td>";
//$o .= "<tr class=\"divider\">";
//$o .= "<td colspan=4><img src=\"".$imagesURL."/spacer.gif\" border=0 width=1 height=1></td>";
$o .= "</tr></table>";
return $o;
}
}
?>
Property changes on: trunk/admin/toolbar.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2
\ No newline at end of property
+1.3
\ No newline at end of property
Index: trunk/admin/import/step1.php
===================================================================
--- trunk/admin/import/step1.php (nonexistent)
+++ trunk/admin/import/step1.php (revision 326)
@@ -0,0 +1,153 @@
+<?php
+
+if(!strlen($pathtoroot))
+{
+ $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+
+$sub = substr($pathtoroot,strlen($pathchar)*-1);
+if($sub!=$pathchar)
+{
+ $pathtoroot = $pathtoroot.$pathchar;
+}
+//echo $pathtoroot;
+//echo $pathtoroot;
+require_once($pathtoroot."kernel/startup.php");
+$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+$localURL=$rootURL."kernel/";
+$adminURL = $rootURL.$admin;
+$imagesURL = $adminURL."/images";
+//admin only util
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+//Set Section
+$section = "in-portal:main_import";
+//Set Environment Variable
+$envar = "env=" . BuildEnv();
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+// Clean Up Import DB Connection Variables
+$objSession->SetVariable("import_sql_type",""); // sql server type
+$objSession->SetVariable("import_server",""); // sql server address
+$objSession->SetVariable("import_db",""); // database name
+$objSession->SetVariable("import_user",""); // connection user
+$objSession->SetVariable("import_pass",""); // connection password
+$objSession->SetVariable("error_importing",""); // connection error
+
+// Clean Up Last Step Variables
+$objSession->SetVariable('import_table_prefix','');
+
+$objSession->SetVariable('user_admin_names','');
+$objSession->SetVariable('user_regular_names','');
+$objSession->SetVariable('user_admin_values','');
+$objSession->SetVariable('user_regular_values','');
+$objSession->SetVariable('catnavbar','');
+$objSession->SetVariable('init_cat','');
+$objSession->SetVariable('user_input1',''); // in use ?
+$objSession->SetVariable('user_input2',''); // in use ?
+$objSession->SetVariable('importtodo','');
+
+ $var="?env=".BuildEnv();
+
+ // Prev Button (no use at a time :)
+ $MouseOver="";
+ $MouseOut="";
+ $onClick="";
+ $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),"#","","","","tool_prev_f3.gif");
+
+ // Next Button
+ $MouseOver="if( UsedAgreed() ) swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut="if( UsedAgreed() ) swap('moveright', 'toolbar/tool_next.gif');";
+
+ $link2=$adminURL."/import/step2.php".$var;
+ $onClick="if( UsedAgreed() ) document.location= '$link2';";
+ $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
+
+
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 1";
+
+ int_header($objCatToolBar,NULL,$title,' onload="PageOnLoad(1);"');
+
+?>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+<form name="import_form" METHOD="POST" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
+<?php int_subsection_title(admin_language("la_Prompt_Warning")); ?>
+ <TR <?php echo int_table_color(); ?>>
+ <TD COLSPAN="2"><span class=\"text\">This utility allows you to import data from other databases and applications, including third party products and earlier versions of this software.
+ </span>
+ </TD>
+ </TR>
+ <tr <?php echo int_table_color(); ?>>
+ <TD>
+ <?php
+ echo int_hint(prompt_language("la_text_disclaimer_part1")." ".prompt_language("la_text_disclaimer_part2"));
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td COLSPAN="2">
+ <input type="checkbox" value="0" id="agree" name="agree" onclick="if( UsedAgreed() ) swap('moveright', 'toolbar/tool_next.gif'); else swap('moveright', 'toolbar/tool_next_f3.gif'); "><label for="agree"><?php echo admin_language("la_Text_IAgree"); ?></label>
+ </td>
+ </tr>
+</FORM>
+</TABLE>
+
+<?php
+int_footer();
+?>
\ No newline at end of file
Property changes on: trunk/admin/import/step1.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/import/step2.php
===================================================================
--- trunk/admin/import/step2.php (nonexistent)
+++ trunk/admin/import/step2.php (revision 326)
@@ -0,0 +1,135 @@
+<?php
+
+if(!strlen($pathtoroot))
+{
+ $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+
+$sub = substr($pathtoroot,strlen($pathchar)*-1);
+if($sub!=$pathchar)
+{
+ $pathtoroot = $pathtoroot.$pathchar;
+}
+//echo $pathtoroot;
+//echo $pathtoroot;
+require_once($pathtoroot."kernel/startup.php");
+$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+
+$localURL=$rootURL."kernel/";
+$adminURL=$rootURL.$admin;
+$imagesURL = $adminURL."/images";
+//admin only util
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+ //Set Section
+ $section = "in-portal:main_import";
+
+ //Set Environment Variable
+ $envar = "env=" . BuildEnv();
+ $var = '?env='.BuildEnv();
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+ // Previous Button
+ $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
+ $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
+ $link = $adminURL.'/import/step1.php'.$var;
+ $objCatToolBar->Add('moveleft','la_ToolTip_PreviousStep', $link, $MouseOver, $MouseOut,'','tool_prev.gif');
+
+ // Next Button
+ $MouseOver = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright', 'toolbar/tool_next.gif');";
+
+ if($ro_perm)
+ {
+ $click_url = $adminURL."/import/step1.php".$var;
+ $onClick = "if( ChoiseMade('import_form','choose') ) document.location= '$click_url'; ";
+ }
+ else
+ {
+ $click_url = $adminURL."/import/step3.php".$var;
+ $onClick = "ImportRedirect('import_form', ChoiseMade('import_form','choose'), '$click_url');";
+ }
+ $objCatToolBar->Add("moveright",'la_ToolTip_NextStep','#',$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
+
+ // header
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 2";
+ int_header($objCatToolBar,NULL,$title);
+
+?>
+<form name="import_form" id="import_form" method="post" action="<?php echo $click_url; ?>">
+ <input type="hidden" name="import_id" id="import_id" value="">
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+
+ <?php int_subsection_title("Import Source"); ?>
+ <tr <?php echo int_table_color(); ?>>
+ <td><span class="text">Select the program you are importing the data from:</span></td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td>
+ <?php
+ foreach($import_scripts as $id => $iscript)
+ echo '<input type="radio" name="choose" id="ch'.$id.'" value="'.$id.'" onclick="swap(\'moveright\', \'toolbar/tool_next.gif\')"'.(!$iscript['enabled'] ? ' disabled="true"' : '').'><span class="text"><label for="ch'.$id.'">'.$iscript['label'].'</label></span><br />'."\n";
+ ?>
+ </td>
+ </tr>
+</table>
+</form>
+<?php
+int_footer();
+?>
\ No newline at end of file
Property changes on: trunk/admin/import/step2.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/import/step3.php
===================================================================
--- trunk/admin/import/step3.php (nonexistent)
+++ trunk/admin/import/step3.php (revision 326)
@@ -0,0 +1,155 @@
+<?php
+
+if(!strlen($pathtoroot))
+{
+ $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+
+$sub = substr($pathtoroot,strlen($pathchar)*-1);
+if($sub!=$pathchar)
+{
+ $pathtoroot = $pathtoroot.$pathchar;
+}
+//echo $pathtoroot;
+//echo $pathtoroot;
+require_once($pathtoroot."kernel/startup.php");
+$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+
+$localURL=$rootURL."kernel/";
+$adminURL=$rootURL.$admin;
+$imagesURL = $adminURL."/images";
+
+//admin only util
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+ //Set Section
+ $section = "in-portal:main_import";
+
+ //Set Environment Variable
+ $envar = "env=" . BuildEnv();
+ $var = "?env=".BuildEnv();
+
+
+ if( isset($_POST['import_id']) ) $objSession->SetVariable('ImportScriptID', $_POST['import_id']);
+ $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
+
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+ // Previous Button
+ $MouseOver = "swap('moveleft','toolbar/tool_prev_f2.gif');";
+ $MouseOut = "swap('moveleft', 'toolbar/tool_prev.gif');";
+ $link = $adminURL."/import/step2.php".$var;
+ $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
+
+ // Next Button
+ $MouseOver = "swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut = "swap('moveright', 'toolbar/tool_next.gif');";
+ $link2 = $adminURL."/import/step4.php".$var;
+ $onClick = "document.import_form.submit();";
+ $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next.gif");
+
+ // Header
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 3";
+ int_header($objCatToolBar,NULL,$title);
+?>
+
+<form name="import_form" METHOD="POST" action='<?php echo $adminURL."/import/step4.php".$var ; ?>' >
+<input type="hidden" name="Action" value="checkconn">
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <?php int_subsection_title(admin_language("la_prompt_DatabaseSettings").' - '.$import_script['label']); ?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_SqlType"); ?></span></td>
+ <td>
+ <select name="db_sql_type" style="width: 197px;">
+ <option value="mysql" selected>MySQL</option>
+ </select>
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_Server"); ?></span></td>
+ <td>
+ <input type="text" name="db_server" class="text" size="30" value="<?php echo $objSession->GetVariable("import_server"); ?>">
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_DbName"); ?></span></td>
+ <td>
+ <input type="text" name="db_db" class="text" size="30" value="<?php echo $objSession->GetVariable("import_db"); ?>">
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_DbUsername"); ?></span></td>
+ <td>
+ <input type="text" name="db_user" class="text" size="30" value="<?php echo $objSession->GetVariable("import_user"); ?>">
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo $import_script['field_prefix'].' '.admin_language("la_prompt_DbPass"); ?></span></td>
+ <td>
+ <input type="password" name="db_pass" class="text" size="30" value="<?php echo $objSession->GetVariable("import_pass"); ?>">
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"><span class="error"><?php echo $objSession->GetVariable("error_importing"); ?></span></td>
+ </tr>
+</table>
+</form>
+<?php
+int_footer();
+?>
\ No newline at end of file
Property changes on: trunk/admin/import/step3.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/admin/import/step4.php
===================================================================
--- trunk/admin/import/step4.php (nonexistent)
+++ trunk/admin/import/step4.php (revision 326)
@@ -0,0 +1,210 @@
+<?php
+
+if(!strlen($pathtoroot))
+{
+ $path=dirname(realpath($_SERVER['SCRIPT_FILENAME']));
+ if(strlen($path))
+ {
+ /* determine the OS type for path parsing */
+ $pos = strpos($path,":");
+ if ($pos === false)
+ {
+ $gOS_TYPE="unix";
+ $pathchar = "/";
+ }
+ else
+ {
+ $gOS_TYPE="win";
+ $pathchar="\\";
+ }
+ $p = $path.$pathchar;
+ /*Start looking for the root flag file */
+ while(!strlen($pathtoroot) && strlen($p))
+ {
+ $sub = substr($p,strlen($pathchar)*-1);
+ if($sub==$pathchar)
+ {
+ $filename = $p."root.flg";
+ }
+ else
+ $filename = $p.$pathchar."root.flg";
+ if(file_exists($filename))
+ {
+ $pathtoroot = $p;
+ }
+ else
+ {
+ $parent = realpath($p.$pathchar."..".$pathchar);
+ if($parent!=$p)
+ {
+ $p = $parent;
+ }
+ else
+ $p = "";
+ }
+ }
+ if(!strlen($pathtoroot))
+ $pathtoroot = ".".$pathchar;
+ }
+ else
+ {
+ $pathtoroot = ".".$pathchar;
+ }
+}
+
+$sub = substr($pathtoroot,strlen($pathchar)*-1);
+if($sub!=$pathchar)
+{
+ $pathtoroot = $pathtoroot.$pathchar;
+}
+//echo $pathtoroot;
+//echo $pathtoroot;
+require_once($pathtoroot."kernel/startup.php");
+$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
+
+$admin = $objConfig->Get("AdminDirectory");
+if(!strlen($admin))
+ $admin = "admin";
+
+$localURL=$rootURL."kernel/";
+$adminURL = $rootURL.$admin;
+$imagesURL = $adminURL."/images";
+//admin only util
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+
+ //Set Section
+ $section = "in-portal:main_import";
+
+ //Set Environment Variable
+ $envar = "env=" . BuildEnv();
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+ //check if the previous input is correct
+ if( $_POST["Action"] == 'checkconn')
+ {
+ // save supplied connection info
+ $objSession->SetVariable("import_sql_type", $_POST["db_sql_type"]);
+ $objSession->SetVariable("import_server", $_POST["db_server"]);
+ $objSession->SetVariable("import_db", $_POST["db_db"]);
+ $objSession->SetVariable("import_user", $_POST["db_user"]);
+ $objSession->SetVariable("import_pass", $_POST["db_pass"]);
+ $objSession->SetVariable("error_importing", '');
+
+ // get them for using here
+ $db_sql_type = $objSession->GetVariable("import_sql_type");
+ $db_server = $objSession->GetVariable("import_server");
+ $db_db = $objSession->GetVariable("import_db");
+ $db_user = $objSession->GetVariable("import_user");
+ $db_pass = $objSession->GetVariable("import_pass");
+
+ // check supplied connection
+ $linkconn = ADONewConnection($db_sql_type);
+ if( !$linkconn->PConnect($db_server, $db_user, $db_pass, $db_db) || !$db_server || !$db_db )
+ {
+ $objSession->SetVariable("error_importing","Error: The connection to the DB failed please check your settings");
+ header('Location: step3.php?'.$envar);
+ }
+ unset($linkconn);
+ }
+
+ $import_script = GetImportScript( $objSession->GetVariable('ImportScriptID') );
+
+ $var = "?env=".BuildEnv();
+
+ // Previous Button
+ $MouseOver = "swap('moveleft','toolbar/tool_prev_f2.gif');";
+ $MouseOut = "swap('moveleft', 'toolbar/tool_prev.gif');";
+ $link = $adminURL."/import/step3.php".$var;
+ $objCatToolBar->Add("moveleft",admin_language("la_ToolTip_Previous")." ".admin_language("la_Text_Step"),$link,$MouseOver,$MouseOut,"","tool_prev.gif");
+
+ // Next Button
+ $MouseOver = "swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut = "swap('moveright', 'toolbar/tool_next.gif');";
+
+ $formaction = $rootURL.$import_script['module'].'/'.$admin.'/import/'.$import_script['url'].'.php?'.$envar;
+
+ $onClick = "if( !CheckFinalForm('import_form') ) alert('Please fill in all of the fields'); else import_submit('import_form','$formaction',''); ";
+ $objCatToolBar->Add("moveright",admin_language("la_ToolTip_Next")." ".admin_language("la_Text_Step"),'#',$MouseOver,$MouseOut,$onClick,"tool_next.gif");
+
+ // Header
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 4";
+ int_header($objCatToolBar,NULL,$title);
+
+?>
+
+<form id="import_form" name="import_form" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?".$envar; ?>">
+ <input type="hidden" name="Action" value="m_save_import_config">
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <?php int_subsection_title("Matching Fields - Intechnic In-Portal "); ?>
+<!-- script common fields: begin -->
+<?php
+if( $import_script['id'] == 'in-link' )
+{
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_AdminId"); ?></span></td>
+ <td>
+ <b><?php echo $objSession->GetVariable("user_admin_names"); ?></b>
+ <input type="hidden" name="user_admin" size="15" class="text" value="<?php echo $objSession->GetVariable("user_admin_values"); ?>">
+ <input type="hidden" name="grouplist1" value="<?php echo $objSession->GetVariable('grouplist1'); ?>">
+ <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist1&Selector=radio');"></a>
+ </td>
+ </tr>
+<?php
+}
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_RegUserId"); ?></span></td>
+ <td>
+ <b><?php echo $objSession->GetVariable("user_regular_names"); ?></b>
+ <input type="hidden" name="user_regular" size="15" class="text" value="<?php echo $objSession->GetVariable("user_regular_values"); ?>">
+ <input type="hidden" name="grouplist2" value="<?php echo $objSession->GetVariable('grouplist2'); ?>">
+ <a href="#"><img src="../images/icon_users_sm.gif" style="cursor:hand;" border="0" onclick="OpenGroupSelector('<?php echo $envar; ?>&en=0&destform=import_form&destfield=grouplist2&Selector=radio');"></a>
+ </td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php
+ echo admin_language("la_prompt_InitImportCat");
+ $catid = $objSession->GetVariable('categoryid');
+ $path = prompt_language($objConfig->Get("Root_Name"));
+ if($catid > 0)
+ {
+ $c = $objCatList->GetItemByField('ResourceId', $catid);
+ $path .= "&gt;".$c->GetCachedNavBar();
+ }
+ ?>
+ </td>
+ <td>
+ <b><?php echo $path; ?></b>
+ <input type="hidden" name="init_cat" size="15" class="text" value="<?php echo $objSession->GetVariable("categoryid"); ?>">
+ <a href="#"><img src="<?php echo $imagesURL; ?>/folder.gif" style="cursor:hand;" border="0" ONCLICK="OpenCatSelector('<?php echo $envar; ?>&source=inlinkimport4&continue_sess=1&destform=import_form&destfield=categorylist&Selector=radio');"></a>
+ <input type="hidden" name="categorylist" value="<?php echo $objSession->GetVariable('categorylist'); ?>">
+ </td>
+ </tr>
+<!-- script common fields: end -->
+<!-- script spefific fields: begin -->
+<?php
+ if( $import_script['id'] == 'in-link' )
+ {
+?>
+ <tr <?php echo int_table_color(); ?>>
+ <td width="60%" valign="top"><span class="text"><?php echo admin_language("la_prompt_Import_ImageName"); ?></span></td>
+ <td>
+ <input type="text" name="link_image" class="text" size="30" value="<?php echo $objSession->GetVariable("link_image"); ?>">
+ </td>
+ </tr>
+<?php
+ }
+?>
+<!-- script spefific fields: end -->
+</table>
+</form>
+<?php
+int_footer();
+?>
Property changes on: trunk/admin/import/step4.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/globals.php
===================================================================
--- trunk/globals.php (revision 325)
+++ trunk/globals.php (revision 326)
@@ -1,1401 +1,1402 @@
<?php
$vars = parse_portal_ini($pathtoroot."config.php");
while($key = key($vars))
{
$key = "g_".$key;
global $$key;
$$key = current($vars); //variable variables
next($vars);
}
/*list the tables which contain item data */
$ItemTables = array();
$KeywordIgnore = array();
global $debuglevel;
$debuglevel = 0;
//$GLOBALS['debuglevel'] = 0;
/*New, Hot, Pop field values */
define('NEVER', 0);
define('ALWAYS', 1);
define('AUTO', 2);
/*Status Values */
define('STATUS_DISABLED', 0);
define('STATUS_ACTIVE', 1);
define('STATUS_PENDING', 2);
$LogLevel=0;
$LogFile = NULL;
function parse_portal_ini($file, $parse_section = false) {
if(!file_exists($file) && !is_readable($file))
die('Could Not Open Ini File');
$contents = file($file);
$retval = array();
$section = '';
$ln = 1;
$resave = false;
foreach($contents as $line) {
if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") {
$resave = true;
}
$ln++;
$line = trim($line);
$line = eregi_replace(';[.]*','',$line);
if(strlen($line) > 0) {
//echo $line . " - ";
if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) {
//echo 'section';
$section = substr($line,1,(strlen($line)-2));
if ($parse_section) {
$retval[$section] = array();
}
continue;
} elseif(eregi('=',$line)) {
//echo 'main element';
list($key,$val) = explode(' = ',$line);
if (!$parse_section) {
$retval[trim($key)] = str_replace('"', '', $val);
}
else {
$retval[$section][trim($key)] = str_replace('"', '', $val);
}
} //end if
//echo '<br />';
} //end if
} //end foreach
if ($resave) {
$fp = fopen($file, "w");
reset($contents);
fwrite($fp,'<'.'?'.'php die() ?'.">\n\n");
foreach($contents as $line) fwrite($fp,"$line");
fclose($fp);
}
return $retval;
}
function &GetADODBConnection()
{
global $g_adodbConnection, $g_DBType, $g_DBHost,$g_DBUser,$g_DBUserPassword,$g_DBName,$g_DebugMode;
global $ADODB_FETCH_MODE,$ADODB_COUNTRECS,$ADODB_CACHE_DIR,$pathtoroot;
//echo '<pre>'.print_r( debug_backtrace() , true).'</pre>';
if(!isset($g_adodbConnection) && strlen($g_DBType)>0)
{
$g_adodbConnection = ADONewConnection($g_DBType);
$connected = $g_adodbConnection->Connect($g_DBHost,$g_DBUser,$g_DBUserPassword,$g_DBName);
if(!$connected)
{
echo "Error connecting to database $g_DBHost <br>\n";
die();
}
$ADODB_CACHE_DIR = $pathtoroot."cache";
$ADODB_FETCH_MODE = 2;
$ADODB_COUNTRECS = FALSE;
$g_adodbConnection->debug = defined('ADODB_OUTP') ? 1 : 0;
$g_adodbConnection->cacheSecs = 3600;
$g_adodbConnection->Execute('SET SQL_BIG_SELECTS=1');
}
elseif (!strlen($g_DBType)) {
global $rootURL;
echo "In-Portal is probably not installed, or configuration file is missing.<br>";
echo "Please use the installation script to fix the problem.<br><br>";
if (!preg_match('/admin/', $_SERVER['SCRIPT_FILENAME'])) {
$ins = 'admin/';
}
echo "<a href='$rootURL".$ins."install.php'>Go to installation script</a><br><br>";
flush();
die();
}
return $g_adodbConnection;
}
function GetNextResourceId($Increment=1)
{
$sql = "UPDATE ".GetTablePrefix()."IdGenerator SET lastid=lastid+".$Increment;
$adodbConnection = GetADODBConnection();
$adodbConnection->Execute($sql);
$rs = $adodbConnection->Execute("SELECT lastid FROM ".GetTablePrefix()."IdGenerator");
$val = $rs->fields["lastid"];
if(!$rs || $rs->EOF)
{
echo $adodbConnection->ErrorMsg();
$sql = "INSERT INTO ".GetTablePrefix()."IdGenerator (lastid) VALUES ($Increment)";
$adodbConnection->Execute($sql);
$val = 1;
}
$val = $val-($Increment-1);
return $val;
}
function AddSlash($s)
{
if(substr($s,-1) != "/")
{
return $s."/";
}
else
return $s;
}
function StripNewline($s)
{
$bfound = false;
while (strlen($s)>0 && !$bfound)
{
if(ord(substr($s,-1))<32)
{
$s = substr($s,0,-1);
}
else
$bfound = true;
}
return $s;
}
function DeleteElement($array, $indice)
{
for($i=$indice;$i<count($array)-1;$i++)
$array[$i] = $array[$i+1];
unset($array[count($array)-1]);
return $array;
}
function DeleteElementValue($needle, &$haystack)
{
while(($gotcha = array_search($needle,$haystack)) > -1)
unset($haystack[$gotcha]);
}
function TableCount($TableName, $where="",$JoinCats=1)
{
$db = GetADODBConnection();
if(!$JoinCats)
{
$sql = "SELECT count(*) as TableCount FROM $TableName";
}
else
$sql = "SELECT count(*) as TableCount FROM $TableName INNER JOIN ".GetTablePrefix()."CategoryItems ON ".GetTablePrefix()."CategoryItems.ItemResourceId=$TableName.ResourceId";
if(strlen($where)>0)
$sql .= " WHERE ".$where;
$rs = $db->Execute($sql);
// echo "SQL TABLE COUNT: ".$sql."<br>\n";
$res = $rs->fields["TableCount"];
return $res;
}
Function QueryCount($sql)
{
$countsql = "SELECT count(*) as TableCount ".substr($sql,strpos($sql," FROM "));
if(strpos($countsql,"LIMIT"))
$countsql = substr($countsql,0,strpos($countsql,"LIMIT"));
if(strpos($countsql,"ORDER BY"))
$countsql = substr($countsql,0,strpos($countsql,"ORDER BY"));
$db = GetADODBConnection();
$rs = $db->Execute($countsql);
//echo $countsql."<br>\n";
$res = $rs->fields["TableCount"];
return $res;
}
function GetPageCount($ItemsPerPage,$NumItems)
{
if($ItemsPerPage==0 || $NumItems==0)
{
return 1;
}
$value = $NumItems/$ItemsPerPage;
return ceil($value);
}
function GetTablePrefix()
{
global $g_TablePrefix;
return $g_TablePrefix;
}
function TableHasPrefix($t)
{
$pre = GetTablePrefix();
if(strlen($pre)>0)
{
if(substr($t,0,strlen($pre))==$pre)
{
return TRUE;
}
else
return FALSE;
}
else
return TRUE;
}
function AddTablePrefix($t)
{
if(!TableHasPrefix($t))
$t = GetTablePrefix().$t;
return $t;
}
function ThisDomain()
{
global $objConfig, $g_Domain;
if($objConfig->Get("DomainDetect"))
{
$d = $_SERVER['HTTP_HOST'];
}
else
$d = $g_Domain;
return $d;
}
function GetIndexUrl($secure=0)
{
global $indexURL, $rootURL, $secureURL;
switch($secure)
{
case 0:
$ret = $indexURL;
break;
case 1:
$ret = $secureURL."index.php";
break;
case 2:
$ret = $rootURL."index.php";
break;
default:
$ret = $i;
}
return $ret;
}
function GetLimitSQL($Page,$PerPage)
{
if($Page<1)
$Page=1;
if(is_numeric($PerPage))
{
if($PerPage==0)
$PerPage = 20;
$Start = ($Page-1)*$PerPage;
$limit = "LIMIT ".$Start.",".$PerPage;
}
else
$limit = NULL;
return $limit;
}
function filelist ($currentdir, $startdir=NULL,$ext=NULL)
{
global $pathchar;
//chdir ($currentdir);
// remember where we started from
if (!$startdir)
{
$startdir = $currentdir;
}
$d = @opendir($currentdir);
$files = array();
if(!$d)
return $files;
//list the files in the dir
while (false !== ($file = readdir($d)))
{
if ($file != ".." && $file != ".")
{
if (is_dir($currentdir."/".$file))
{
// If $file is a directory take a look inside
$a = filelist ($currentdir."/".$file, $startdir,$ext);
if(is_array($a))
$files = array_merge($files,$a);
}
else
{
if($ext!=NULL)
{
$extstr = stristr($file,".".$ext);
if(strlen($extstr))
$files[] = $currentdir."/".$file;
}
else
$files[] = $currentdir.'/'.$file;
}
}
}
closedir ($d);
return $files;
}
function DecimalToBin($dec,$WordLength=8)
{
$bits = array();
$str = str_pad(decbin($dec),$WordLength,"0",STR_PAD_LEFT);
for($i=$WordLength;$i>0;$i--)
{
$bits[$i-1] = (int)substr($str,$i-1,1);
}
return $bits;
}
function inp_escape($in, $html_enable=0)
{
$out = stripslashes($in);
$out = str_replace("\n", "\n^br^", $out);
if($html_enable==0)
{
$out=ereg_replace("<","&lt;",$out);
$out=ereg_replace(">","&gt;",$out);
$out=ereg_replace("\"","&quot;",$out);
$out = str_replace("\n^br^", "\n<br />", $out);
}
else
$out = str_replace("\n^br^", "\n", $out);
$out=addslashes($out);
return $out;
}
function inp_unescape($in)
{
$out=stripslashes($in);
return $out;
}
function inp_textarea_unescape($in)
{
$out=stripslashes($in);
$out = str_replace("\n<br />", "\n", $out);
return $out;
}
function HighlightKeywords($Keywords, $html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$r = preg_split('((>)|(<))', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($Keywords as $k) {
for ($i = 0; $i < count($r); $i++) {
if ($r[$i] == "<") {
$i++; continue;
}
$r[$i] = preg_replace("/($k)/i", "$OpenTag\\1$CloseTag", $r[$i]);
}
}
return join("", $r);
}
/*
function HighlightKeywords($Keywords,$html, $OpenTag="", $CloseTag="")
{
global $objConfig;
if(!strlen($OpenTag))
$OpenTag = "<B>";
if(!strlen($CloseTag))
$CloseTag = "</B>";
$ret = strip_tags($html);
foreach ($Keywords as $k)
{
if(strlen($k))
{
//$html = str_replace("<$k>", ":#:", $html);
//$html = str_replace("</$k>", ":##:", $html);
//$html = strip_tags($html);
if ($html = preg_replace("/($k)/Ui","$OpenTag\\1$CloseTag", $html))
//if ($html = preg_replace("/(>[^<]*)($k)([^<]*< )/Ui","$OpenTag\\1$CloseTag", $html))
$ret = $html;
//$ret = str_replace(":#:", "<$k>", $ret);
//$ret = str_replace(":##:", "</$k>", $ret);
}
}
return $ret;
}
*/
function ExtractDatePart($part,$datestamp)
{
switch($part)
{
case "month":
if($datestamp<=0)
{
$ret = "";
}
else
$ret = adodb_date("m",$datestamp);
break;
case "day":
if($datestamp<=0)
{
$ret = "";
}
else
$ret = adodb_date("d", $datestamp);
break;
case "year":
if($datestamp<=0)
{
$ret = "";
}
else
$ret = adodb_date("Y", $datestamp);
break;
case "time_24hr":
if($datestamp<=0)
{
$ret = "";
}
else
$ret = adodb_date("H:i", $datestamp);
break;
case "time_12hr":
if($datestamp<=0)
{
$ret = "";
}
else
$ret = adodb_date("g:i a",$datestamp);
break;
}
return $ret;
}
function GetLocalTime($TimeStamp,$TargetZone=NULL)
{
if($TargetZone==NULL)
$TargetZone = $objConfig->Get("Config_Site_Time");
$server = $objConfig->Get("Config_Server_Time");
if($TargetZone!=$server)
{
$offset = ($server - $TargetZone) * -1;
$TimeStamp = $TimeStamp + (3600 * $offset);
}
return $TimeStamp;
}
function _unhtmlentities ($string)
{
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
function getLastStr($hay, $need){
$getLastStr = 0;
$pos = strpos($hay, $need);
if (is_int ($pos)){ //this is to decide whether it is "false" or "0"
while($pos) {
$getLastStr = $getLastStr + $pos + strlen($need);
$hay = substr ($hay , $pos + strlen($need));
$pos = strpos($hay, $need);
}
return $getLastStr - strlen($need);
} else {
return -1; //if $need wasn´t found it returns "-1" , because it could return "0" if it´s found on position "0".
}
}
function ReplaceSingleTag($tag,$text)
{
$opentag = "[".$tag;
$closetag = "[/".$tag."]";
if(strstr($text,$opentag))
{
$pos = strpos($text,$opentag." ");
if($pos === false)
{
$pos = strpos($text,$opentag."]");
}
$endopen = strpos($text,"]",$pos);
$closepos = strpos($text,$closetag,$pos);
if($closepos)
{
$taglength = ($closepos - $endopen) + strlen($closetag);
$tagText = substr($text,$pos, $closepos + strlen($closetag) - $pos);
$innerText = substr($text,$endopen+1,$closepos - $endopen-1);
if($tag=="UL")
$innerText = str_replace("[*]","<LI>",$innerText);
$tagText = substr($tagText,1,($endopen - $pos)-1);
//echo "Matched $tagText <br>\n";
$tagText = "<".$tagText.">";
$replace_text = $tagText.$innerText."</".$tag.">";
$text = substr($text,0,$pos).$replace_text.substr($text,$closepos+strlen($closetag));
return $text;
}
else
return $text;
}
else
return $text;
}
function ReplaceTag($tag,$text)
{
$new_text = ReplaceSingleTag($tag,$text);
while($new_text != $text)
{
$text = $new_text;
$new_text = ReplaceSingleTag($tag,$text);
}
return $new_text;
}
function ReplaceURL($text)
{
while(strstr($text,"[URL"))
{
$urlpos = strpos($text,"[URL");
$endopen = strpos($text,"]",$urlpos);
if($endopen)
{
$url = "<A TARGET=\"_blank\"".substr($text,$urlpos+4,$endopen - ($urlpos+4));
$url .= ">";
$url = _unhtmlentities($url);
$text = substr($text,0,$urlpos).$url.substr($text,$endopen+1);
}
}
$text = str_replace("[/URL]","</A>",$text);
return $text;
}
function ReplaceBBCode($text)
{
global $objConfig;
$tags = explode(",",$objConfig->Get("BBTags"));
for($i=0;$i<count($tags);$i++)
{
$text = ReplaceTag(strtoupper($tags[$i]),$text);
}
$text = ReplaceURL($text);
return $text;
}
function GetMinValue($Table,$Field, $Where=NULL)
{
$ret = 0;
$sql = "SELECT min($Field) as val FROM $Table ";
if(strlen($where))
$sql .= "WHERE $Where";
$ado = GetADODBConnection();
$rs = $ado->execute($sql);
if($rs)
$ret = (int)$rs->fields["val"];
return $ret;
}
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function SetMissingDataErrors($f)
{
global $FormError;
$count = 0;
if(is_array($_POST))
{
if(is_array($_POST["required"]))
{
foreach($_POST["required"] as $r)
{
$found = FALSE;
if(is_array($_FILES))
{
if( isset($_FILES[$r]) && $_FILES[$r]['size'] > 0 ) $found = TRUE;
}
if(!strlen(trim($_POST[$r])) && !$found)
{
$count++;
if (($r == "dob_day") || ($r == "dob_month") || ($r == "dob_year"))
$r = "dob";
$tag = isset($_POST["errors"]) ? $_POST["errors"][$r] : '';
if(!strlen($tag))
$tag = "lu_ferror_".$f."_".$r;
$FormError[$f][$r] = language($tag);
}
}
}
}
return $count;
}
function makepassword($length=10)
{
$pass_length=$length;
$p1=array('b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z');
$p2=array('a','e','i','o','u');
$p3=array('1','2','3','4','5','6','7','8','9');
$p4=array('(','&',')',';','%'); // if you need real strong stuff
// how much elements in the array
// can be done with a array count but counting once here is faster
$s1=21;// this is the count of $p1
$s2=5; // this is the count of $p2
$s3=9; // this is the count of $p3
$s4=5; // this is the count of $p4
// possible readable combinations
$c1='121'; // will be like 'bab'
$c2='212'; // will be like 'aba'
$c3='12'; // will be like 'ab'
$c4='3'; // will be just a number '1 to 9' if you dont like number delete the 3
// $c5='4'; // uncomment to active the strong stuff
$comb='4'; // the amount of combinations you made above (and did not comment out)
for ($p=0;$p<$pass_length;)
{
mt_srand((double)microtime()*1000000);
$strpart=mt_rand(1,$comb);
// checking if the stringpart is not the same as the previous one
if($strpart<>$previous)
{
$pass_structure.=${'c'.$strpart};
// shortcutting the loop a bit
$p=$p+strlen(${'c'.$strpart});
}
$previous=$strpart;
}
// generating the password from the structure defined in $pass_structure
for ($g=0;$g<strlen($pass_structure);$g++)
{
mt_srand((double)microtime()*1000000);
$sel=substr($pass_structure,$g,1);
$pass.=${'p'.$sel}[mt_rand(0,-1+${'s'.$sel})];
}
return $pass;
}
function LogEntry($text,$writefile=FALSE)
{
global $g_LogFile,$LogFile, $LogData, $LogLevel, $timestart;
static $last;
if(strlen($g_LogFile))
{
$el = str_pad(getmicrotime()- $timestart,10," ");
if($last>0)
$elapsed = getmicrotime() - $last;
if(strlen($el)>10)
$el = substr($el,0,10);
$indent = str_repeat(" ",$LogLevel);
$text = str_pad($text,$LogLevel,"==",STR_PAD_LEFT);
$LogData .= "$el:". round($elapsed,6).":$indent $text";
$last = getmicrotime();
if($writefile==TRUE && is_writable($g_LogFile))
{
if(!$LogFile)
{
if(file_exists($g_LogFile))
unlink($g_LogFile);
$LogFile=@fopen($g_LogFile,"w");
}
if($LogFile)
{
fputs($LogFile,$LogData);
}
}
}
}
function ValidEmail($email)
{
if (eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email))
{
return TRUE;
}
else
{
return FALSE;
}
}
function language($phrase,$LangId=0)
{
global $objSession, $objLanguageCache, $objLanguages;
if($LangId==0)
$LangId = $objSession->Get("Language");
if($LangId==0)
$LangId = $objLanguages->GetPrimary();
$translation = $objLanguageCache->GetTranslation($phrase,$LangId);
return $translation;
}
function admin_language($phrase,$lang=0,$LinkMissing=FALSE)
{
global $objSession, $objLanguageCache, $objLanguages;
//echo "Language passed: $lang<br>";
if($lang==0)
$lang = $objSession->Get("Language");
//echo "Language from session: $lang<br>";
if($lang==0)
$lang = $objLanguages->GetPrimary();
//echo "Language after primary: $lang<br>";
//echo "Phrase: $phrase<br>";
$translation = $objLanguageCache->GetTranslation($phrase,$lang);
if($LinkMissing && substr($translation,0,1)=="!" && substr($translation,-1)=="!")
{
$res = "<A href=\"javascript:OpenPhraseEditor('&direct=1&label=$phrase'); \">$translation</A>";
return $res;
}
else
return $translation;
}
function prompt_language($phrase,$lang=0)
{
return admin_language($phrase,$lang,TRUE);
}
function GetPrimaryTranslation($Phrase)
{
global $objLanguages;
$l = $objLanguages->GetPrimary();
return language($Phrase,$l);
}
function CategoryNameCount($ParentId,$Name)
{
$cat_table = GetTablePrefix()."Category";
$sql = "SELECT Name from $cat_table WHERE ParentId=$ParentId AND ";
$sql .="(Name LIKE '".addslashes($Name)."' OR Name LIKE 'Copy of ".addslashes($Name)."' OR Name LIKE 'Copy % of ".addslashes($Name)."')";
$ado = GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields["Name"];
$rs->MoveNext();
}
return $ret;
}
function CategoryItemNameCount($CategoryId,$Table,$Field,$Name)
{
$cat_table = GetTablePrefix()."CategoryItems";
$sql = "SELECT $Field FROM $Table INNER JOIN $cat_table ON ($Table.ResourceId=$cat_table.ItemResourceId) ";
$sql .=" WHERE ($Field LIKE 'Copy % of $Name' OR $Field LIKE '$Name' OR $Field LIKE 'Copy of $Name') AND CategoryId=$CategoryId";
//echo $sql."<br>\n ";
$ado = GetADODBConnection();
$rs = $ado->Execute($sql);
$ret = array();
while($rs && !$rs->EOF)
{
$ret[] = $rs->fields[$Field];
$rs->MoveNext();
}
return $ret;
}
function &GetItemCollection($ItemName)
{
global $objItemTypes;
if(is_numeric($ItemName))
{
$item = $objItemTypes->GetItem($ItemName);
}
else
$item = $objItemTypes->GetTypeByName($ItemName);
if(is_object($item))
{
$module = $item->Get("Module");
$prefix = ModuleTagPrefix($module);
$func = $prefix."_ItemCollection";
if(function_exists($func))
{
$var =& $func();
}
}
return $var;
}
function UpdateCategoryCount($ItemTypeName=0,$ListType=NULL)
{
global $objCountCache, $objItemTypes;
if(is_numeric($ItemTypeName))
$item = $objItemTypes->GetItem($ItemTypeName);
else
$item = $objItemTypes->GetTypeByName($ItemTypeName);
if(is_object($item))
{
$ItemType = $item->Get("ItemType");
$sql = "DELETE FROM ".$objCountCache->SourceTable." WHERE ItemType=$ItemType";
if( is_numeric($ListType) ) $sql .= " AND ListType=$ListType";
$objCountCache->adodbConnection->Execute($sql);
}
}
function UpdateModifiedCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$ExtraId=NULL)
{
}
function UpdateGroupCategoryCount($ItemTypeName,$CatId=NULL,$Modifier=0,$GroupId=NULL)
{
}
function GetTagCache($module,$tag,$attribs,$env)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $n => $val)
{
$name .= "-".$val;
}
}
$CachedValue = $objSystemCache->GetContextValue($name,$module,$env, $objSession->Get("GroupList"));
}
else
$CachedValue="";
return $CachedValue;
}
function SaveTagCache($module, $tag, $attribs, $env, $newvalue)
{
global $objSystemCache, $objSession, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$name = $tag;
if(is_array($attribs))
{
foreach($attribs as $a => $val)
{
$name .= "-".$val;
}
}
$objSystemCache->EditCacheItem($name,$newvalue,$module,0,$env,$objSession->Get("GroupList"));
}
}
function DeleteTagCache($name,$extraparams, $env="")
{
global $objSystemCache, $objConfig;
if($objConfig->Get("SystemTagCache"))
{
$where = "Name LIKE '$name%".$extraparams."'";
if(strlen($env))
$where .= " AND Context LIKE $env";
$objSystemCache->DeleteCachedItem($where);
}
}
function ParseTagLibrary()
{
$objTagList = new clsTagList();
$objTagList->ParseInportalTags();
unset($objTagList);
}
function GetDateFormat($LangId=0)
{
global $objLanguages;
if(!$LangId)
$LangId= $objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
if(is_object($l))
{
$fmt = $l->Get("DateFormat");
}
else
$fmt = "m-d-Y";
return $fmt;
}
function GetTimeFormat($LangId=0)
{
global $objLanguages;
if(!$LangId)
$LangId= $objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
if(is_object($l))
{
$fmt = $l->Get("TimeFormat");
}
else
$fmt = "H:i:s";
return $fmt;
}
function LangDate($TimeStamp=NULL,$LangId=0)
{
$fmt = GetDateFormat($LangId);
$ret = adodb_date($fmt,$TimeStamp);
return $ret;
}
function LangTime($TimeStamp=NULL,$LangId=0)
{
$fmt = GetTimeFormat($LangId);
$ret = adodb_date($fmt,$TimeStamp);
return $ret;
}
function LangNumber($Num,$DecPlaces=NULL,$LangId=0)
{
global $objLanguages;
if(!$LangId)
$LangId= $objLanguages->GetPrimary();
$l = $objLanguages->GetItem($LangId);
if(is_object($l))
{
$ret = number_format($Num,$DecPlaces,$l->Get("DecimalPoint"),$l->Get("ThousandSep"));
}
else
$ret = $num;
return $ret;
}
function replacePngTags($x, $spacer="images/spacer.gif")
{
global $rootURL,$pathtoroot;
// make sure that we are only replacing for the Windows versions of Internet
// Explorer 5+, and not Opera identified as MSIE
$msie='/msie\s([5-9])\.?[0-9]*.*(win)/i';
$opera='/opera\s+[0-9]+/i';
if(!isset($_SERVER['HTTP_USER_AGENT']) ||
!preg_match($msie,$_SERVER['HTTP_USER_AGENT']) ||
preg_match($opera,$_SERVER['HTTP_USER_AGENT']))
return $x;
// find all the png images in backgrounds
preg_match_all('/background-image:\s*url\(\'(.*\.png)\'\);/Uis',$x,$background);
for($i=0;$i<count($background[0]);$i++){
// simply replace:
// "background-image: url('image.png');"
// with:
// "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
// enabled=true, sizingMethod=scale src='image.png');"
// haven't tested to see if background-repeat styles work...
$x=str_replace($background[0][$i],'filter:progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale'.
' src=\''.$background[1][$i].'\');',$x);
}
// OK, time to find all the IMG tags with ".png" in them
preg_match_all('/(<img.*\.png.*>|<input.*type=([\'"])image\\2.*\.png.*>)/Uis',$x,$images);
while(list($imgnum,$v)=@each($images[0])){
$original=$v;
$atts=''; $width=0; $height=0;
// If the size is defined by styles, find
preg_match_all('/style=".*(width: ([0-9]+))px.*'.
'(height: ([0-9]+))px.*"/Ui',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
// size was defined by styles, get values
$width=$arr2[2][0];
$height=$arr2[4][0];
}
// size was not defined by styles, get values
preg_match_all('/width=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$width=$arr2[1][0];
}
preg_match_all('/height=\"?([0-9]+)\"?/i',$v,$arr2);
if(is_array($arr2) && count($arr2[0])){
$height=$arr2[1][0];
}
preg_match_all('/src=\"([^\"]+\.png)\"/i',$v,$arr2);
if(isset($arr2[1][0]) && !empty($arr2[1][0]))
$image=$arr2[1][0];
else
$image=NULL;
// We do this so that we can put our spacer.gif image in the same
// directory as the image
$tmp=split('[\\/]',$image);
array_pop($tmp);
$image_path=join('/',$tmp);
if(substr($image,0,strlen($rootURL))==$rootURL)
{
$path = str_replace($rootURL,$pathtoroot,$image);
}
else
{
$path = $pathtoroot."themes/telestial/$image";
}
// echo "Sizing $path.. <br>\n";
// echo "Full Tag: ".htmlentities($image)."<br>\n";
//if(!$height || !$width)
//{
$g = imagecreatefrompng($path);
if($g)
{
$height = imagesy($g);
$width = imagesx($g);
}
//}
if(strlen($image_path)) $image_path.='/';
// end quote is already supplied by originial src attribute
$replace_src_with=$spacer.'" style="width: '.$width.
'px; height: '.$height.'px; filter: progid:DXImageTransform.'.
'Microsoft.AlphaImageLoader(src=\''.$image.'\', sizingMethod='.
'\'scale\')';
// now create the new tag from the old
$new_tag=str_replace($image,$replace_src_with,$original);
// now place the new tag into the content
$x=str_replace($original,$new_tag,$x);
}
return $x;
}
function print_pre($str)
{
// no comments here :)
echo '<pre>'.print_r($str, true).'</pre>';
}
function GetOptions($field) // by Alex
{
// get dropdown values from custom field
$tmp =& new clsCustomField();
$tmp->LoadFromDatabase($field, 'FieldName');
$tmp_values = $tmp->Get('ValueList');
unset($tmp);
$tmp_values = explode(',', $tmp_values);
foreach($tmp_values as $mixed)
{
$elem = explode('=', trim($mixed));
$ret[ $elem[0] ] = $elem[1];
}
return $ret;
}
function ResetPage($module_prefix, $page_variable = 'p')
{
// resets page in specific module when category is changed
global $objSession;
if( !is_object($objSession) ) // when changing pages session doesn't exist -> InPortal BUG
{
global $var_list, $SessionQueryString, $FrontEnd;
//if(!$var_list["sid"]) $var_list["sid"] = $_COOKIE["sid"];
$objSession = new clsUserSession($var_list["sid"],($SessionQueryString && $FrontEnd==1));
}
//echo "SID_RESET: ".$GLOBALS['var_list']["sid"].'(COOKIE_SID: '.$_COOKIE["sid"].')<br>';
$last_cat = $objSession->GetVariable('last_category');
$prev_cat = $objSession->GetVariable('prev_category');
//echo "Resetting Page [$prev_cat] -> [$last_cat]<br>";
if($prev_cat != $last_cat) $GLOBALS[$module_prefix.'_var_list'][$page_variable] = 1;
}
if( !function_exists('GetVar') )
{
function GetVar($name, $post_priority = false)
{
if(!$post_priority) // follow gpc_order in php.ini
return isset($_REQUEST[$name]) ? $_REQUEST[$name] : false;
else // get variable from post 1stly if not found then from get
return isset($_POST[$name]) && $_POST[$name] ? $_POST[$name] : ( isset($_GET[$name]) && $_GET[$name] ? $_GET[$name] : false );
}
}
function PassVar(&$source)
{
// source array + any count of key names in passed array
$params = func_get_args();
array_shift($params);
if( count($params) )
{
$ret = Array();
foreach($params as $var_name)
if( isset($source[$var_name]) )
$ret[] = $var_name.'='.$source[$var_name];
$ret = '&'.implode('&', $ret);
}
return $ret;
}
function GetSubmitVariable(&$array, $postfix)
{
// gets edit status of module
// used in case if some modules share
// common action parsed by kernel parser,
// but each module uses own EditStatus variable
$modules = Array('In-Link' => 'Link', 'In-News' => 'News', 'In-Bulletin' => 'Topic');
foreach($modules as $module => $prefix)
if( isset($array[$prefix.$postfix]) )
return Array('Module' => $module, 'variable' => $array[$prefix.$postfix]);
return false;
}
function GetModuleByAction()
{
$prefix2module = Array('m' => 'In-Portal', 'l' => 'In-Link', 'n' => 'In-News', 'bb' => 'In-Bulletin');
$action = $_REQUEST['Action'];
$module_prefix = explode('_', $action);
return $prefix2module[ $module_prefix[0] ];
}
function dir_size($dir) {
// calculates folder size based on filesizes inside it (recursively)
$totalsize=0;
if ($dirstream = @opendir($dir)) {
while (false !== ($filename = readdir($dirstream))) {
if ($filename!="." && $filename!="..")
{
if (is_file($dir."/".$filename))
$totalsize+=filesize($dir."/".$filename);
if (is_dir($dir."/".$filename))
$totalsize+=dir_size($dir."/".$filename);
}
}
}
closedir($dirstream);
return $totalsize;
}
function size($bytes) {
// shows formatted file/directory size
$types = Array("la_bytes","la_kilobytes","la_megabytes","la_gigabytes","la_terabytes");
$current = 0;
while ($bytes > 1024) {
$current++;
$bytes /= 1024;
}
return round($bytes,2)." ".language($types[$current]);
}
function echod($str)
{
// echo debug output
echo str_replace( Array('[',']'), Array('[<b>', '</b>]'), $str).'<br>';
}
function PrepareParams($source, $to_lower, $mapping)
{
// prepare array with form values to use with item
$result = Array();
foreach($to_lower as $field)
$result[ $field ] = $source[ strtolower($field) ];
if( is_array($mapping) )
{
foreach($mapping as $field_from => $field_to)
$result[$field_to] = $source[$field_from];
}
return $result;
}
function GetELT($field, $phrases = Array())
{
// returns FieldOptions equivalent in In-Portal
$ret = Array();
foreach($phrases as $phrase)
$ret[] = admin_language($phrase);
$ret = "'".implode("','", $ret)."'";
return 'ELT('.$field.','.$ret.')';
}
function GetModuleImgPath($module)
{
global $rootURL, $admin;
return $rootURL.$module.'/'.$admin.'/images';
}
function ActionPostProcess($StatusField, $ListClass, $ListObjectName = '', $IDField = null)
{
// each action postprocessing stuff from admin
if( !isset($_REQUEST[$StatusField]) ) return false;
$list =& $GLOBALS[$ListObjectName];
if( !is_object($list) ) $list = new $ListClass();
$SFValue = $_REQUEST[$StatusField]; // status field value
switch($SFValue)
{
case 1: // User hit "Save" button
$list->CopyFromEditTable($IDField);
break;
case 2: // User hit "Cancel" button
$list->PurgeEditTable($IDField);
break;
}
if( function_exists('SpecificProcessing') ) SpecificProcessing($StatusField, $SFValue);
if($SFValue == 1 || $SFValue == 2) $list->Clear();
}
function GetElem(&$array, $index)
{
// returns array element by index if
// such index exists
return isset($array[$index]) ? $array[$index] : false;
}
function MakeHTMLTag($element, $attrib_prefix)
{
$result = Array();
$ap_length = strlen($attrib_prefix);
foreach($element->attributes as $attib_name => $attr_value)
if( substr($attib_name, $ap_length) == $ap_length )
$result[] = substr($attib_name, $ap_length, strlen($attib_name)).'="'.$attr_value.'"';
return count($result) ? implode(' ', $result) : false;
}
function GetImportScripts()
{
// return currently installed import scripts
static $import_scripts = Array();
if( count($import_scripts) == 0 )
{
$sql = 'SELECT * FROM '.GetTablePrefix().'ImportScripts ORDER BY is_id';
$db =& GetADODBConnection();
$rs = $db->Execute($sql);
while(!$rs->EOF)
{
$rec =& $rs->fields;
$import_scripts[] = Array( 'label' => $rec['is_label'], 'url' => $rec['is_script'],
'enabled' => $rec['is_enabled'], 'field_prefix' => $rec['is_field_prefix'],
- 'id' => $rec['is_string_id'], 'required_fields' => $rec['is_requred_fields']);
+ 'id' => $rec['is_string_id'], 'required_fields' => $rec['is_requred_fields'],
+ 'module' => strtolower($rec['is_Module']) );
$rs->MoveNext();
}
}
return $import_scripts;
}
function GetImportScript($id)
{
$scripts = GetImportScripts();
return isset($scripts[$id]) ? $scripts[$id] : false;
}
function GetNextTemplate($current_template)
{
// used on front, returns next template to make
// redirect to
$dest = GetVar('dest', true);
if(!$dest) $dest = GetVar('DestTemplate', true);
return $dest ? $dest : $current_template;
}
// functions for dealign with enviroment variable construction
function GenerateModuleEnv($prefix, $var_list)
{
// globalize module varible arrays
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
//echo "VAR: [$main]; VAR_UPDATE: [$update]<br>";
// enshure that we have no empty values in enviroment variable
foreach($update as $vl_key => $vl_value)
if(!$vl_value) $update[$vl_key] = '0'; // unset($update[$vl_key]);
// if update var count is zero, then do nothing
if(count($update) == 0) return '';
foreach($main as $vl_key => $vl_value)
if(!$vl_value) $main[$vl_key] = '0'; // unset($main[$vl_key]);
$ret = Array();
foreach($var_list as $var_name)
$ret[] = GetEnvVar($prefix, $var_name);
return ':'.$prefix.implode('-',$ret);
}
function GetEnvVar($prefix, $name)
{
// get variable from template variable's list
// (used in module parsers to build env string)
$main =& $GLOBALS[$prefix.'_var_list'];
$update =& $GLOBALS[$prefix.'_var_list_update'];
return isset($update[$name]) ? $update[$name] : ( isset($main[$name]) ? $main[$name] : '');
}
?>
Property changes on: trunk/globals.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.17
\ No newline at end of property
+1.18
\ No newline at end of property

Event Timeline