Index: trunk/admin/import/import_funcs.php =================================================================== diff -u -N -r1152 -r4358 --- trunk/admin/import/import_funcs.php (.../import_funcs.php) (revision 1152) +++ trunk/admin/import/import_funcs.php (.../import_funcs.php) (revision 4358) @@ -122,6 +122,8 @@ // $NumCats = TableCount($objCatList->SourceTable,'',0); $dst_db->Execute('DROP TABLE IF EXISTS '.$ImportTable); $db->Close(); + + m_ParseEnv(); // sets default values to "m" prefix, because it is not passed through import anymore echo ''; } } Index: trunk/themes/default/register/register_form.tpl =================================================================== diff -u -N -r3983 -r4358 --- trunk/themes/default/register/register_form.tpl (.../register_form.tpl) (revision 3983) +++ trunk/themes/default/register/register_form.tpl (.../register_form.tpl) (revision 4358) @@ -40,10 +40,10 @@  
- + - +
@@ -59,49 +59,49 @@
- +
*

- +
 
- +
 
- +
 
- +
 
- +
*  
- +
* () @@ -115,45 +115,45 @@

- +


- +
 
- +
 
- +
 
- +
  - +
Index: trunk/kernel/units/users/users_event_handler.php =================================================================== diff -u -N -r4292 -r4358 --- trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4292) +++ trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4358) @@ -68,7 +68,7 @@ $this->Application->SetVar('u_id', $user_id); $this->Application->StoreVar('user_id', $user_id); $this->Application->setVisitField('PortalUserId', $user_id); - + $this_login = (int)$object->getPersistantVar('ThisLogin'); $object->setPersistantVar('LastLogin', $this_login); $object->setPersistantVar('ThisLogin', adodb_mktime()); @@ -81,6 +81,21 @@ } $next_template = $this->Application->GetVar('next_template'); + if ($next_template == '_ses_redirect') { + $location = $this->Application->BaseURL().$this->Application->RecallVar($next_template); + if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_REDIRECT') ) + { + $this->Application->Debugger->appendTrace(); + echo "Debug output above!!! Proceed to redirect: $a_location
"; + } + else { + header('Location: '.$location); + } + $session =& $this->Application->recallObject('Session'); + $session->SaveData(); + exit(); + } + if($next_template) $event->redirect = $next_template; if ($this->Application->ConfigValue('UseJSRedirect')) { $event->SetRedirectParam('js_redirect', 1); @@ -121,12 +136,12 @@ $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); $sync_manager->performAction('LogoutUser'); } - + function OnLogout(&$event) { $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); $sync_manager->performAction('LogoutUser'); - + $session =& $this->Application->recallObject('Session'); $session->SetField('PortalUserId', -2); $this->Application->SetVar('u_id', -2); @@ -335,6 +350,12 @@ $object->SetDBField('Status', 0); break; } + + /*if ($object->GetDBField('PaidMember') == 1) { + $this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart'); + $event->redirect = 'in-commerce/checkout/shop_cart'; + } */ + } @@ -607,9 +628,9 @@ { $this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId")); $this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email")); - $this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId")); + $event->redirect = $this->Application->GetVar('template_success'); } @@ -771,8 +792,8 @@ } } - - + + /** * Delete users from groups if their membership is expired * @@ -785,12 +806,12 @@ $sql = 'SELECT PortalUserId, GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')'; - + $skip_clause = $event->getEventParam('skip_clause'); if ($skip_clause) { $sql .= ' AND !('.implode(') AND !(', $skip_clause).')'; } - + $records = $this->Conn->Query($sql); if ($records) { $conditions = Array(); @@ -805,7 +826,7 @@ $this->Conn->Query($sql); } // send pre-expiration reminders: end - + // remove users from groups with expired membership: begin $sql = 'SELECT PortalUserId FROM '.TABLE_PREFIX.'UserGroup Index: trunk/admin/modules/mod_status.php =================================================================== diff -u -N -r2853 -r4358 --- trunk/admin/modules/mod_status.php (.../mod_status.php) (revision 2853) +++ trunk/admin/modules/mod_status.php (.../mod_status.php) (revision 4358) @@ -25,6 +25,8 @@ require_once($pathtoroot.$admin."/toolbar.php"); require_once($pathtoroot.$admin."/listview/listview.php"); +$objSession->SetVariable('HasChanges', 0); + $pathtolocal = $pathtoroot; //Set Section Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r4292 -r4358 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4292) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4358) @@ -68,7 +68,7 @@ $this->Application->SetVar('u_id', $user_id); $this->Application->StoreVar('user_id', $user_id); $this->Application->setVisitField('PortalUserId', $user_id); - + $this_login = (int)$object->getPersistantVar('ThisLogin'); $object->setPersistantVar('LastLogin', $this_login); $object->setPersistantVar('ThisLogin', adodb_mktime()); @@ -81,6 +81,21 @@ } $next_template = $this->Application->GetVar('next_template'); + if ($next_template == '_ses_redirect') { + $location = $this->Application->BaseURL().$this->Application->RecallVar($next_template); + if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_REDIRECT') ) + { + $this->Application->Debugger->appendTrace(); + echo "Debug output above!!! Proceed to redirect: $a_location
"; + } + else { + header('Location: '.$location); + } + $session =& $this->Application->recallObject('Session'); + $session->SaveData(); + exit(); + } + if($next_template) $event->redirect = $next_template; if ($this->Application->ConfigValue('UseJSRedirect')) { $event->SetRedirectParam('js_redirect', 1); @@ -121,12 +136,12 @@ $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); $sync_manager->performAction('LogoutUser'); } - + function OnLogout(&$event) { $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); $sync_manager->performAction('LogoutUser'); - + $session =& $this->Application->recallObject('Session'); $session->SetField('PortalUserId', -2); $this->Application->SetVar('u_id', -2); @@ -335,6 +350,12 @@ $object->SetDBField('Status', 0); break; } + + /*if ($object->GetDBField('PaidMember') == 1) { + $this->Application->HandleEvent($add_to_cart, 'ord:OnAddToCart'); + $event->redirect = 'in-commerce/checkout/shop_cart'; + } */ + } @@ -607,9 +628,9 @@ { $this->Application->StoreVar('tmp_user_id', $user_object->GetDBField("PortalUserId")); $this->Application->StoreVar('tmp_email', $user_object->GetDBField("Email")); - $this->Application->EmailEventUser('INCOMMERCEUSER.PSWDC', $user_object->GetDBField("PortalUserId")); + $event->redirect = $this->Application->GetVar('template_success'); } @@ -771,8 +792,8 @@ } } - - + + /** * Delete users from groups if their membership is expired * @@ -785,12 +806,12 @@ $sql = 'SELECT PortalUserId, GroupId FROM '.TABLE_PREFIX.'UserGroup WHERE (MembershipExpires IS NOT NULL) AND (ExpirationReminderSent = 0) AND (MembershipExpires < '.$pre_expiration.')'; - + $skip_clause = $event->getEventParam('skip_clause'); if ($skip_clause) { $sql .= ' AND !('.implode(') AND !(', $skip_clause).')'; } - + $records = $this->Conn->Query($sql); if ($records) { $conditions = Array(); @@ -805,7 +826,7 @@ $this->Conn->Query($sql); } // send pre-expiration reminders: end - + // remove users from groups with expired membership: begin $sql = 'SELECT PortalUserId FROM '.TABLE_PREFIX.'UserGroup Index: trunk/core/kernel/utility/factory.php =================================================================== diff -u -N -r3654 -r4358 --- trunk/core/kernel/utility/factory.php (.../factory.php) (revision 3654) +++ trunk/core/kernel/utility/factory.php (.../factory.php) (revision 4358) @@ -208,19 +208,19 @@ * @param Array $dependecies List of classes required for this class functioning * @access public */ - function registerClass($real_class,$file,$pseudo_class=null, $dependecies = Array() ) + function registerClass($real_class, $file, $pseudo_class=null, $dependecies = Array() ) { if(!isset($pseudo_class)) $pseudo_class = $real_class; if(!isset($this->Files[$real_class])) $this->Files[$real_class]=$file; - if( getArrayValue($this->realClasses, $pseudo_class) ) - { + if (getArrayValue($this->realClasses, $pseudo_class)) { $this->registerDependency($real_class, $pseudo_class); } + if($dependecies) { - foreach($dependecies as $required_class) - { + if (!is_array($dependecies)) $dependecies = array($dependecies); + foreach ($dependecies as $required_class) { $this->registerDependency($real_class, $required_class); } } @@ -238,7 +238,13 @@ */ function registerDependency($depended_class, $class_name) { - $this->Dependencies[$depended_class][] = $this->realClasses[$class_name]; + $conditions = Array(); + $conditions['exists'] = in_array($this->realClasses[$class_name], $this->Dependencies[$depended_class]); + $conditions['same_class'] = $this->realClasses[$class_name] == $depended_class; + + if (!$conditions['exists'] && !$conditions['same_class']) { + $this->Dependencies[$depended_class][] = $this->realClasses[$class_name]; + } } } Index: trunk/kernel/action.php =================================================================== diff -u -N -r4330 -r4358 --- trunk/kernel/action.php (.../action.php) (revision 4330) +++ trunk/kernel/action.php (.../action.php) (revision 4358) @@ -125,7 +125,7 @@ 'CreatedOn' => $CreatedOn, 'dob' => $dob ); - + $u =& $objEditItems->Add_User_NEW($fields_hash); saveCustomFields('u', $u->Get('ResourceId'), 6); } @@ -147,7 +147,7 @@ if (!GetVar('user_login')) { $dob = 0; } - + $fields_hash = Array( 'Login' => $_POST['user_login'], 'Password' => GetVar('password') ? md5(GetVar('password')) : '', 'FirstName' => $_POST['user_firstname'], @@ -2390,22 +2390,19 @@ { $objUserGroupsList = new clsUserGroupList(); $objUserGroupsList->CopyFromEditTable("GroupId"); - + $group_ids = $objGroups->CopyFromEditTable("GroupId"); if ($group_ids) { - $db =& GetADODBConnection(); - $sql = 'SELECT ResourceId FROM '.$objGroups->SourceTable.' WHERE GroupId IN ('.implode(',', $group_ids).')'; - $rids = $db->GetCol($sql); - $objCustomDataList->CopyFromEditTable("CustomDataId", $rids); +// $objCustomDataList->CopyFromEditTable('g'); } - + $objGroups->Clear(); } if( GetVar('GroupEditStatus') == 2 ) { $objUserGroupsList = new clsUserGroupList(); $objGroups->PurgeEditTable("GroupId"); - $objCustomDataList->PurgeEditTable("CustomDataId"); +// $objCustomDataList->PurgeEditTable('g'); $objUserGroupsList->PurgeEditTable("PortalUserId"); $objGroups->Clear(); } Index: trunk/core/units/general/xml_helper.php =================================================================== diff -u -N -r3866 -r4358 --- trunk/core/units/general/xml_helper.php (.../xml_helper.php) (revision 3866) +++ trunk/core/units/general/xml_helper.php (.../xml_helper.php) (revision 4358) @@ -75,7 +75,7 @@ function AddChild(&$a_child) { - $this->Children[$a_child->Name] =& $a_child; + $this->Children[] =& $a_child; $a_child->SetParent($this); } @@ -108,11 +108,11 @@ { $name = strtoupper($name); if ($this->Name == $name) return $this; - if (isset($this->Children[$name])) return $this->Children[$name]; - $children_names = array_keys($this->Children); - foreach ($children_names as $a_name) +// if (isset($this->Children[$name])) return $this->Children[$name]; +// $children = array_keys($this->Children); + foreach ($this->Children as $elem) { - $child =& $this->Children[$a_name]->FindChild($name); + $child =& $elem->FindChild($name); if ($child !== false) { return $child; Index: trunk/core/kernel/application.php =================================================================== diff -u -N -r4216 -r4358 --- trunk/core/kernel/application.php (.../application.php) (revision 4216) +++ trunk/core/kernel/application.php (.../application.php) (revision 4358) @@ -186,8 +186,8 @@ $this->DB = new kDBConnection(SQL_TYPE, Array(&$this,'handleSQLError') ); $this->DB->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB); $this->DB->debugMode = $this->isDebugMode(); - - $this->ModuleInfo = $this->DB->Query('SELECT * FROM '.TABLE_PREFIX.'Modules ORDER BY LoadOrder', 'Name'); + + $this->refreshModuleInfo(); $this->ConfigHash = $this->DB->GetCol('SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'ConfigurationValues', 'VariableName'); $rewrite_on = $this->ConfigValue('UseModRewrite'); @@ -239,6 +239,11 @@ return true; } + function refreshModuleInfo() + { + $this->ModuleInfo = $this->DB->Query('SELECT * FROM '.TABLE_PREFIX.'Modules ORDER BY LoadOrder', 'Name'); + } + /** * Checks if passed language id if valid and sets it to primary otherwise * Index: trunk/admin/install/upgrades/changelog_1_1_8.txt =================================================================== diff -u -N --- trunk/admin/install/upgrades/changelog_1_1_8.txt (revision 0) +++ trunk/admin/install/upgrades/changelog_1_1_8.txt (revision 4358) @@ -0,0 +1,129 @@ +File in-portal/compat.php changed +File in-portal/globals.php changed +File in-portal/admin/index.php changed +File in-portal/admin/install.php changed +File in-portal/admin/subitems.php changed +File in-portal/admin/category/addcategory.php changed +File in-portal/admin/category/addcategory_custom.php changed +File in-portal/admin/category/permcacheupdate.php changed +File in-portal/admin/config/addcustomfield.php is removed; release_1_1_7 revision 1.11 +File in-portal/admin/config/addlang.php is removed; release_1_1_7 revision 1.15 +File in-portal/admin/config/addlang_email.php is removed; release_1_1_7 revision 1.9 +File in-portal/admin/config/addlang_export.php is removed; release_1_1_7 revision 1.6 +File in-portal/admin/config/addlang_export_result.php is removed; release_1_1_7 revision 1.5 +File in-portal/admin/config/addlang_labels.php is removed; release_1_1_7 revision 1.9 +File in-portal/admin/config/config_lang.php is removed; release_1_1_7 revision 1.9 +File in-portal/admin/config/config_search.php is removed; release_1_1_7 revision 1.10 +File in-portal/admin/config/edit_customfields.php is removed; release_1_1_7 revision 1.10 +File in-portal/admin/config/importlang.php is removed; release_1_1_7 revision 1.7 +File in-portal/admin/config/importlang_progress.php is removed; release_1_1_7 revision 1.10 +File in-portal/admin/editor/FCKeditor/css/fck_editorarea.php changed +File in-portal/admin/editor/FCKeditor/filemanager/upload/php/upload.php changed +File in-portal/admin/import/import_funcs.php changed +File in-portal/admin/include/elements.php changed +File in-portal/admin/include/mainscript.php changed +File in-portal/admin/include/sections.php changed +File in-portal/admin/install/inportal_data.sql changed +File in-portal/admin/install/inportal_schema.sql changed +File in-portal/admin/install/install_lib.php changed +File in-portal/admin/install/langpacks/english.lang changed +File in-portal/admin/install/upgrades/changelog_1_1_8.txt is new; release_1_1_8 revision 1.1.2.1 +File in-portal/admin/install/upgrades/inportal_upgrade_v1.1.8.php is new; release_1_1_8 revision 1.1 +File in-portal/admin/install/upgrades/inportal_upgrade_v1.1.8.sql is new; release_1_1_8 revision 1.3 +File in-portal/admin/listview/listview.php changed +File in-portal/admin/logs/searchlog.php changed +File in-portal/admin/modules/mod_status.php changed +File in-portal/admin/tree/ftiens4.js changed +File in-portal/admin/tree/tree.php changed +File in-portal/admin/users/addgroup.php changed +File in-portal/admin/users/adduser.php changed +File in-portal/admin/users/adduser_custom.php changed +File in-portal/kernel/action.php changed +File in-portal/kernel/frontaction.php changed +File in-portal/kernel/startup.php changed +File in-portal/kernel/admin/include/navmenu.php changed +File in-portal/kernel/admin_templates/config/config_email.tpl is new; release_1_1_8 revision 1.1 +File in-portal/kernel/admin_templates/config/config_search.tpl is new; release_1_1_8 revision 1.2 +File in-portal/kernel/admin_templates/config/config_universal.tpl is new; release_1_1_8 revision 1.1 +File in-portal/kernel/admin_templates/config_email/config_email_list.tpl is removed; release_1_1_7 revision 1.2 +File in-portal/kernel/admin_templates/custom_fields/custom_fields_edit.tpl is new; release_1_1_8 revision 1.1 +File in-portal/kernel/admin_templates/custom_fields/custom_fields_list.tpl is new; release_1_1_8 revision 1.1 +File in-portal/kernel/admin_templates/incs/config_blocks.tpl is new; release_1_1_8 revision 1.1 +File in-portal/kernel/admin_templates/incs/custom_blocks.tpl changed +File in-portal/kernel/admin_templates/incs/form_blocks.tpl changed +File in-portal/kernel/admin_templates/incs/grid_blocks.tpl changed +File in-portal/kernel/admin_templates/incs/header.tpl changed +File in-portal/kernel/admin_templates/incs/script.js changed +File in-portal/kernel/admin_templates/incs/style.css changed +File in-portal/kernel/admin_templates/regional/languages_list.tpl changed +File in-portal/kernel/include/advsearch.php changed +File in-portal/kernel/include/category.php changed +File in-portal/kernel/include/customfield.php changed +File in-portal/kernel/include/custommetadata.php changed +File in-portal/kernel/include/image.php changed +File in-portal/kernel/include/item.php changed +File in-portal/kernel/include/itemdb.php changed +File in-portal/kernel/include/parseditem.php changed +File in-portal/kernel/include/portaluser.php changed +File in-portal/kernel/include/searchconfig.php changed +File in-portal/kernel/include/searchitems.php changed +File in-portal/kernel/units/categories/categories_config.php changed +File in-portal/kernel/units/categories/categories_event_handler.php changed +File in-portal/kernel/units/config_search/config_search_config.php changed +File in-portal/kernel/units/config_search/config_search_event_handler.php changed +File in-portal/kernel/units/config_search/config_search_tag_processor.php changed +File in-portal/kernel/units/configuration/configuration_config.php changed +File in-portal/kernel/units/configuration/configuration_event_handler.php changed +File in-portal/kernel/units/configuration/configuration_tag_processor.php changed +File in-portal/kernel/units/custom_data/custom_data_config.php is new; release_1_1_8 revision 1.2 +File in-portal/kernel/units/custom_data/custom_data_event_handler.php is new; release_1_1_8 revision 1.1 +File in-portal/kernel/units/custom_fields/custom_fields_config.php changed +File in-portal/kernel/units/custom_fields/custom_fields_event_handler.php changed +File in-portal/kernel/units/custom_fields/custom_fields_tag_processor.php is new; release_1_1_8 revision 1.2 +File in-portal/kernel/units/custom_values/custom_value_event_handler.php is removed; release_1_1_7 revision 1.8 +File in-portal/kernel/units/custom_values/custom_values_config.php is removed; release_1_1_7 revision 1.7 +File in-portal/kernel/units/email_events/email_events_event_handler.php changed +File in-portal/kernel/units/general/cat_dbitem.php changed +File in-portal/kernel/units/general/cat_dbitem_export.php changed +File in-portal/kernel/units/general/cat_event_handler.php changed +File in-portal/kernel/units/general/main_event_handler.php changed +File in-portal/kernel/units/general/my_application.php changed +File in-portal/kernel/units/general/helpers/multilanguage.php is new; release_1_1_8 revision 1.3.2.2 +File in-portal/kernel/units/general/helpers/search_helper.php is new; release_1_1_8 revision 1.2 +File in-portal/kernel/units/help/help_tag_processor.php changed +File in-portal/kernel/units/languages/languages_config.php changed +File in-portal/kernel/units/languages/languages_event_handler.php changed +File in-portal/kernel/units/languages/languages_item.php changed +File in-portal/kernel/units/modules/modules_event_handler.php changed +File in-portal/kernel/units/translator/translator_event_handler.php changed +File in-portal/kernel/units/users/users_config.php changed +File in-portal/kernel/units/users/users_item.php changed +File in-portal/themes/default/categories/catlist_element.tpl changed +File kernel4_dev/kernel4/application.php changed +File kernel4_dev/kernel4/event_handler.php changed +File kernel4_dev/kernel4/event_manager.php changed +File kernel4_dev/kernel4/globals.php changed +File kernel4_dev/kernel4/kbase.php changed +File kernel4_dev/kernel4/startup.php changed +File kernel4_dev/kernel4/db/db_connection.php changed +File kernel4_dev/kernel4/db/db_event_handler.php changed +File kernel4_dev/kernel4/db/db_tag_processor.php changed +File kernel4_dev/kernel4/db/dbitem.php changed +File kernel4_dev/kernel4/parser/tags.php changed +File kernel4_dev/kernel4/parser/template_parser.php changed +File kernel4_dev/kernel4/processors/main_processor.php changed +File kernel4_dev/kernel4/processors/tag_processor.php changed +File kernel4_dev/kernel4/utility/cache.php is new; release_1_1_8 revision 1.1 +File kernel4_dev/kernel4/utility/event.php changed +File kernel4_dev/kernel4/utility/formatters.php changed +File kernel4_dev/kernel4/utility/http_query.php changed +File kernel4_dev/kernel4/utility/params.php changed +File kernel4_dev/kernel4/utility/temp_handler.php changed +File kernel4_dev/kernel4/utility/unit_config_reader.php changed +File cmseditor/fckstyles.xml changed +File cmseditor/editor/dialog/fck_link/fck_link.js changed + + +Changes in phrases and events: + + Index: trunk/admin/tree/tree.php =================================================================== diff -u -N -r4199 -r4358 --- trunk/admin/tree/tree.php (.../tree.php) (revision 4199) +++ trunk/admin/tree/tree.php (.../tree.php) (revision 4358) @@ -1,6 +1,6 @@ Get('Site_Name'); $rootLink = $adminURL."/subitems.php?env=".BuildEnv()."§ion=in-portal:root"; $charset = GetRegionalOption('Charset'); - + $main_tag_processor =& $application->recallTagProcessor('m'); $phrase_EditingInProgress = $main_tag_processor->Phrase( Array('name' => 'la_EditingInProgress', 'escape' => 1) ); - + $phrase_EditingInProgress = str_replace(Array('<', '>', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $phrase_EditingInProgress); ?> @@ -64,10 +64,10 @@ var height = 200; var screen_x = (screen.availWidth-width)/2; var screen_y = (screen.availHeight-height)/2; - window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y); + window.open(url, 'credits', 'width=280,height=520,left='+screen_x+',top='+screen_y); } -BuildTree('in-portal:site', 'foldersTree'); $title = "In-Portal v ".$kernel_version."  "; ?> @@ -101,7 +101,7 @@ ?> - + Index: trunk/admin/users/addgroup.php =================================================================== diff -u -N -r3282 -r4358 --- trunk/admin/users/addgroup.php (.../addgroup.php) (revision 3282) +++ trunk/admin/users/addgroup.php (.../addgroup.php) (revision 4358) @@ -44,7 +44,7 @@ $action = "m_add_group"; $objGroups->CreateEmptyEditTable("GroupId"); // $objRelList->CreateEmptyEditTable("RelationshipId"); - $objCustomDataList->CreateEmptyEditTable("CustomDataId"); +// $objCustomDataList->CreateEmptyEditTable('g'); $objUserGroupsList->CreateEmptyEditTable("PortalUserId"); } else @@ -59,7 +59,7 @@ { /* make a copy of the relationship records */ $ids = $objEditItems->GetResourceIDList(); - $objCustomDataList->CopyToEditTable("ResourceId",$ids); +// $objCustomDataList->CopyToEditTable('g', $ids); // map group ResourceIds to group ids (because from list we always get ResourceIds) $db=&GetADODBConnection(); Index: trunk/kernel/units/general/xml_helper.php =================================================================== diff -u -N -r3866 -r4358 --- trunk/kernel/units/general/xml_helper.php (.../xml_helper.php) (revision 3866) +++ trunk/kernel/units/general/xml_helper.php (.../xml_helper.php) (revision 4358) @@ -75,7 +75,7 @@ function AddChild(&$a_child) { - $this->Children[$a_child->Name] =& $a_child; + $this->Children[] =& $a_child; $a_child->SetParent($this); } @@ -108,11 +108,11 @@ { $name = strtoupper($name); if ($this->Name == $name) return $this; - if (isset($this->Children[$name])) return $this->Children[$name]; - $children_names = array_keys($this->Children); - foreach ($children_names as $a_name) +// if (isset($this->Children[$name])) return $this->Children[$name]; +// $children = array_keys($this->Children); + foreach ($this->Children as $elem) { - $child =& $this->Children[$a_name]->FindChild($name); + $child =& $elem->FindChild($name); if ($child !== false) { return $child; Index: trunk/core/units/general/inp_db_event_handler.php =================================================================== diff -u -N -r1821 -r4358 --- trunk/core/units/general/inp_db_event_handler.php (.../inp_db_event_handler.php) (revision 1821) +++ trunk/core/units/general/inp_db_event_handler.php (.../inp_db_event_handler.php) (revision 4358) @@ -1,8 +1,8 @@ 'iterateItems', 'OnMassMoveDown'=>'iterateItems', ); - + $this->eventMethods = array_merge($this->eventMethods, $common_events); } - + /** * Apply same processing to each item beeing selected in grid * @@ -26,39 +26,39 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { return; } - + $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); $object =& $event->getObject(); $this->StoreSelectedIDs($event); $ids=$this->getSelectedIDs($event); - + if($ids) { $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') ); - + foreach($ids as $id) { $object->Load($id); - + switch ($event->Name) { case 'OnMassApprove': $object->SetDBField($status_field, 1); break; - + case 'OnMassDecline': $object->SetDBField($status_field, 0); break; - + case 'OnMassMoveUp': $object->SetDBField('Priority', $object->GetDBField('Priority') + 1); break; - + case 'OnMassMoveDown': $object->SetDBField('Priority', $object->GetDBField('Priority') - 1); break; } - + if( $object->Update() ) { $event->status=erSUCCESS; @@ -73,7 +73,7 @@ } } } - + /** * Enter description here... * @@ -84,20 +84,20 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { return; } - + $event->status=erSUCCESS; - + $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - + $this->StoreSelectedIDs($event); $ids=$this->getSelectedIDs($event); - + if($ids) { $temp->CloneItems($event->Prefix, $event->Special, $ids); } } - + function check_array($records, $field, $value) { foreach ($records as $record) @@ -109,6 +109,13 @@ } return false; } + + function OnPreSavePopup(&$event) + { + $event->CallSubEvent('OnPreSave'); + $this->Application->StoreVar('PermCache_UpdateRequired', 1); + $event->redirect = 'incs/just_close'; + } } Index: trunk/kernel/units/general/inp_db_event_handler.php =================================================================== diff -u -N -r1821 -r4358 --- trunk/kernel/units/general/inp_db_event_handler.php (.../inp_db_event_handler.php) (revision 1821) +++ trunk/kernel/units/general/inp_db_event_handler.php (.../inp_db_event_handler.php) (revision 4358) @@ -1,8 +1,8 @@ 'iterateItems', 'OnMassMoveDown'=>'iterateItems', ); - + $this->eventMethods = array_merge($this->eventMethods, $common_events); } - + /** * Apply same processing to each item beeing selected in grid * @@ -26,39 +26,39 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { return; } - + $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); $object =& $event->getObject(); $this->StoreSelectedIDs($event); $ids=$this->getSelectedIDs($event); - + if($ids) { $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') ); - + foreach($ids as $id) { $object->Load($id); - + switch ($event->Name) { case 'OnMassApprove': $object->SetDBField($status_field, 1); break; - + case 'OnMassDecline': $object->SetDBField($status_field, 0); break; - + case 'OnMassMoveUp': $object->SetDBField('Priority', $object->GetDBField('Priority') + 1); break; - + case 'OnMassMoveDown': $object->SetDBField('Priority', $object->GetDBField('Priority') - 1); break; } - + if( $object->Update() ) { $event->status=erSUCCESS; @@ -73,7 +73,7 @@ } } } - + /** * Enter description here... * @@ -84,20 +84,20 @@ if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { return; } - + $event->status=erSUCCESS; - + $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - + $this->StoreSelectedIDs($event); $ids=$this->getSelectedIDs($event); - + if($ids) { $temp->CloneItems($event->Prefix, $event->Special, $ids); } } - + function check_array($records, $field, $value) { foreach ($records as $record) @@ -109,6 +109,13 @@ } return false; } + + function OnPreSavePopup(&$event) + { + $event->CallSubEvent('OnPreSave'); + $this->Application->StoreVar('PermCache_UpdateRequired', 1); + $event->redirect = 'incs/just_close'; + } } Index: trunk/admin/index.php =================================================================== diff -u -N -r4199 -r4358 --- trunk/admin/index.php (.../index.php) (revision 4199) +++ trunk/admin/index.php (.../index.php) (revision 4358) @@ -1,12 +1,12 @@ - @@ -62,7 +62,7 @@ } else { document.write(""); } - + function getFrame($name) { var $frameset = window.frames; @@ -74,7 +74,7 @@ return window; } - + " name="main" marginwidth="0" marginheight="0" frameborder="NO" noresize scrolling="auto"> Index: trunk/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r4325 -r4358 --- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4325) +++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4358) @@ -1603,15 +1603,20 @@ function OnCreateCustomFields(&$event) { $main_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); + $item_type = $this->Application->getUnitOption($main_prefix, 'ItemType'); + if (!$item_type) { + // no main config of such type + return false; + } // 1. get custom field information - $item_type = $this->Application->getUnitOption($main_prefix, 'ItemType'); $sql = 'SELECT FieldName, CustomFieldId FROM '.TABLE_PREFIX.'CustomField WHERE Type = '.$item_type.' ORDER BY CustomFieldId'; $custom_fields = $this->Conn->GetCol($sql, 'CustomFieldId'); if (!$custom_fields) { + // config doesn't have custom fields return false; } Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -N -r4325 -r4358 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4325) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4358) @@ -138,7 +138,7 @@ foreach ($this->configData as $prefix => $config) { $this->parseConfig($prefix); } - + $this->Application->HandleEvent( new kEvent('m:OnAfterConfigRead') ); } @@ -284,36 +284,27 @@ { $config =& $this->configData[$prefix]; $event_manager =& $this->Application->recallObject('EventManager'); + + $register_classes = getArrayValue($config,'RegisterClasses'); + if (!$register_classes) $register_classes = Array(); $class_params=Array('ItemClass','ListClass','EventHandlerClass','TagProcessorClass'); foreach($class_params as $param_name) { if ( !(isset($config[$param_name]) ) ) continue; - $class_info =& $config[$param_name]; - $pseudo_class = $this->getPrefixByParamName($param_name,$prefix); - $this->Application->registerClass( $class_info['class'], - $config['BasePath'].'/'.$class_info['file'], - $pseudo_class); - $event_manager->registerBuildEvent($pseudo_class,$class_info['build_event']); - - // register classes on which current class depends - $require_classes = getArrayValue($class_info, 'require_classes'); - if($require_classes) - { - foreach($require_classes as $require_class) - { - $this->Application->Factory->registerDependency($class_info['class'], $require_class); - } - } + $config[$param_name]['pseudo'] = $this->getPrefixByParamName($param_name,$prefix); + $register_classes[] = $config[$param_name]; } - $register_classes = getArrayValue($config,'RegisterClasses'); - if($register_classes) + foreach($register_classes as $class_info) { - foreach($register_classes as $class_info) - { - $this->Application->registerClass( $class_info['class'], - $config['BasePath'].'/'.$class_info['file'], - $class_info['pseudo']); + $this->Application->registerClass( + $class_info['class'], + $config['BasePath'].'/'.$class_info['file'], + $class_info['pseudo'], + getArrayValue($class_info, 'require_classes') + ); + if (getArrayValue($class_info, 'build_event')) { + $event_manager->registerBuildEvent($class_info['pseudo'],$class_info['build_event']); } } @@ -446,7 +437,7 @@ else { $this->configData[$prefix][$name] = $value; } - + } function getPrefixByParamName($paramName,$prefix) Index: trunk/themes/default/register/register_dob.tpl =================================================================== diff -u -N -r3379 -r4358 --- trunk/themes/default/register/register_dob.tpl (.../register_dob.tpl) (revision 3379) +++ trunk/themes/default/register/register_dob.tpl (.../register_dob.tpl) (revision 4358) @@ -47,7 +47,7 @@ - + Index: trunk/kernel/admin_templates/incs/export.js =================================================================== diff -u -N -r4243 -r4358 --- trunk/kernel/admin_templates/incs/export.js (.../export.js) (revision 4243) +++ trunk/kernel/admin_templates/incs/export.js (.../export.js) (revision 4358) @@ -24,20 +24,15 @@ var $aborting = false; function queryProgress($url, $responce_func) { -// alert('queryProgress'); if ($http_request && $http_request.readyState != 0) { -// alert('aborting'); $aborting = true; $http_request.abort(); -// alert('After Abort: readyState: '+$http_request.readyState+' status: '+$http_request.status); $aborting = false; } -// alert('opening'); $http_request.open('POST', $url, true); $http_request.setRequestHeader("referer", $url); $http_request.onreadystatechange = function() { processExportResponce($url, $responce_func); }; -// alert('sending new req'); $http_request.send('is_xml=1'); $last_responce = new Date(); } Index: trunk/core/kernel/processors/main_processor.php =================================================================== diff -u -N -r4357 -r4358 --- trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 4357) +++ trunk/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 4358) @@ -500,9 +500,9 @@ $t = eregi_replace("\.tpl$", '', $t); $templates_cache =& $this->Application->recallObject('TemplatesCache'); - $res = $BlockParser->Parse( $templates_cache->GetTemplateBody($t, getArrayValue($params, 'is_silent')), $t ); - + + if ( !$BlockParser->DataExists && (isset($params['data_exists']) || isset($params['block_no_data'])) ) { if ($block_no_data = getArrayValue($params, 'block_no_data')) { $res = $BlockParser->Parse( @@ -518,7 +518,6 @@ $this->Application->Parser->DataExists = $this->Application->Parser->DataExists || $BlockParser->DataExists; return $res; } - function ModuleInclude($params) { $ret = ''; @@ -546,7 +545,6 @@ } return $ret; } - /*function Kernel_Scripts($params) { return ''; @@ -831,7 +829,7 @@ function ConstOn($params) { $name = $this->SelectParam($params,'name,const'); - return ConstOn($name); + return $this->Application->isDebugMode() && dbg_ConstOn($name); } function SetDefaultCategory($params) @@ -892,14 +890,12 @@ $this->Application->LinkVar('module'); $this->Application->LinkVar('section'); } - function StoreMainPrefix($params) { $this->Application->LinkVar('main_prefix'); // window prefix, that opener selector $this->Application->LinkVar('dst_field'); // field to set value choosed in selector $this->Application->LinkVar('return_template'); // template to go, when something was coosen from popup (from finalizePopup) } - function XMLTemplate($params) { define('DBG_SKIP_REPORTING', 1); Index: trunk/kernel/units/general/helpers/multilanguage.php =================================================================== diff -u -N -r4029 -r4358 --- trunk/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4029) +++ trunk/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4358) @@ -43,6 +43,10 @@ { $table_name = $this->Application->getUnitOption('lang', 'TableName'); $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name); + if (!$languages_count) { + // during installation we have not languages, but we need to created custom field columns + $languages_count = 1; + } return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 ); } @@ -75,9 +79,14 @@ * Creates missing multilanguage fields in table by specified prefix * * @param string $prefix + * @param bool $refresh Forces config field structure to be re-read from database */ - function createFields($prefix) + function createFields($prefix, $refresh = false) { + if ($refresh) { + $this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') ); + } + $table_name = $this->Application->getUnitOption($prefix, 'TableName'); $this->curFields = $this->Application->getUnitOption($prefix, 'Fields'); Index: trunk/core/units/general/helpers/multilanguage.php =================================================================== diff -u -N -r4029 -r4358 --- trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4029) +++ trunk/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 4358) @@ -43,6 +43,10 @@ { $table_name = $this->Application->getUnitOption('lang', 'TableName'); $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name); + if (!$languages_count) { + // during installation we have not languages, but we need to created custom field columns + $languages_count = 1; + } return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 ); } @@ -75,9 +79,14 @@ * Creates missing multilanguage fields in table by specified prefix * * @param string $prefix + * @param bool $refresh Forces config field structure to be re-read from database */ - function createFields($prefix) + function createFields($prefix, $refresh = false) { + if ($refresh) { + $this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') ); + } + $table_name = $this->Application->getUnitOption($prefix, 'TableName'); $this->curFields = $this->Application->getUnitOption($prefix, 'Fields');