Index: branches/RC/core/install/upgrades.sql =================================================================== diff -u -N -r10024 -r10156 --- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 10024) +++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 10156) @@ -167,4 +167,17 @@ INSERT INTO ConfigurationAdmin VALUES ('KeepSessionOnBrowserClose', 'la_title_General', 'la_prompt_KeepSessionOnBrowserClose', 'checkbox', NULL, NULL, '13', '0', '0'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'KeepSessionOnBrowserClose', 0, 'Proj-Base', 'in-portal:configure_general'); -ALTER TABLE PersistantSessionData ADD VariableId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; \ No newline at end of file +ALTER TABLE PersistantSessionData ADD VariableId BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST; + +# ===== v 4.2.3 ===== +INSERT INTO ConfigurationAdmin VALUES ('u_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 30.01, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 30.02, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 30.03, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 30.04, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 30.05, 0, 0); + +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users'); \ No newline at end of file Index: branches/RC/core/units/users/users_tag_processor.php =================================================================== diff -u -N -r9071 -r10156 --- branches/RC/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 9071) +++ branches/RC/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 10156) @@ -220,6 +220,12 @@ return $this->Application->ProcessParsedTag('m', 'Link', $params); } + + function ImageSrc($params) + { + list ($ret, $tag_processed) = $this->processAggregatedTag('ImageSrc', $params, $this->getPrefixSpecial()); + return $tag_processed ? $ret : false; + } } ?> \ No newline at end of file Index: branches/RC/core/units/general/helpers/image_helper.php =================================================================== diff -u -N -r9697 -r10156 --- branches/RC/core/units/general/helpers/image_helper.php (.../image_helper.php) (revision 9697) +++ branches/RC/core/units/general/helpers/image_helper.php (.../image_helper.php) (revision 10156) @@ -287,15 +287,19 @@ $image_path = $item_image['ThumbPath']; if ($item_image['DefaultImg'] == 1 || $item_image['Name'] == 'main') { // process primary image separately - $object->SetDBField('PrimaryImage', $image_path); - $object->SetOriginalField('PrimaryImage', $image_path); - $object->Fields['PrimaryImage']['original_field'] = $item_image['Name']; + if (array_key_exists('PrimaryImage', $object->Fields)) { + $object->SetDBField('PrimaryImage', $image_path); + $object->SetOriginalField('PrimaryImage', $image_path); + $object->Fields['PrimaryImage']['original_field'] = $item_image['Name']; + } continue; } - $object->SetDBField('Image'.$image_counter, $image_path); - $object->SetOriginalField('Image'.$image_counter, $image_path); - $object->Fields['Image'.$image_counter]['original_field'] = $item_image['Name']; + if (array_key_exists('Image'.$image_counter, $object->Fields)) { + $object->SetDBField('Image'.$image_counter, $image_path); + $object->SetOriginalField('Image'.$image_counter, $image_path); + $object->Fields['Image'.$image_counter]['original_field'] = $item_image['Name']; + } $image_counter++; } } Index: branches/RC/themes/default2007/platform/my_account/my_profile.tpl =================================================================== diff -u -N -r9664 -r10156 --- branches/RC/themes/default2007/platform/my_account/my_profile.tpl (.../my_profile.tpl) (revision 9664) +++ branches/RC/themes/default2007/platform/my_account/my_profile.tpl (.../my_profile.tpl) (revision 10156) @@ -31,7 +31,7 @@ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

-
+ @@ -52,7 +52,8 @@ - + + "/> Index: branches/RC/core/install/install_data.sql =================================================================== diff -u -N -r10021 -r10156 --- branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 10021) +++ branches/RC/core/install/install_data.sql (.../install_data.sql) (revision 10156) @@ -71,8 +71,12 @@ INSERT INTO ConfigurationAdmin VALUES ('CSVExportEnclosure', 'la_Text_CSV_Export', 'la_config_CSVExportEnclosure', 'radio', NULL, '0=la_Doublequotes,1=la_Quotes', 40.2, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('CSVExportSeparator', 'la_Text_CSV_Export', 'la_config_CSVExportSeparator', 'radio', NULL, '0=la_Linux,1=la_Windows', 40.3, 0, 1); INSERT INTO ConfigurationAdmin VALUES ('CSVExportEncoding', 'la_Text_CSV_Export', 'la_config_CSVExportEncoding', 'radio', NULL, '0=la_Unicode,1=la_Regular', 40.4, 0, 1); +INSERT INTO ConfigurationAdmin VALUES ('u_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 30.01, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 30.02, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 30.03, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 30.04, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 30.05, 0, 0); - INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Columns_Category', '2', 'In-Portal', 'Categories'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DomainSelect','1','In-Portal','in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_general'); @@ -216,6 +220,11 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEnclosure', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportSeparator', '0', 'In-Portal', 'in-portal:configure_general'); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'CSVExportEncoding', '0', 'In-Portal', 'in-portal:configure_general'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users'); INSERT INTO Events VALUES (DEFAULT, 'USER.ADD', NULL, 1, 0, 'In-Portal:Users', 'la_event_user.add', 0); INSERT INTO Events VALUES (DEFAULT, 'USER.ADD', NULL, 2, 0, 'In-Portal:Users', 'la_event_user.add', 1); Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -N -r10024 -r10156 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10024) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 10156) @@ -427,6 +427,8 @@ */ function OnAfterItemCreate(&$event) { + $this->saveUserImages($event); + if ($this->Application->GetVar('skip_set_primary')) return; $is_subscriber = $this->Application->GetVar('IsSubscriber'); if(!$is_subscriber) @@ -1328,6 +1330,8 @@ */ function OnAfterItemUpdate(&$event) { + $this->saveUserImages($event); + $object =& $event->getObject(); /* @var $object UsersItem */ @@ -1430,6 +1434,11 @@ $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); } + + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + + $file_helper->createItemFiles($event->Prefix, true); // create image fields } /** @@ -1556,6 +1565,44 @@ } } } + + /** + * Loads user images + * + * @param kEvent $event + */ + function OnAfterItemLoad(&$event) + { + parent::OnAfterItemLoad($event); + + // linking existing images for item with virtual fields + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ + + $object =& $event->getObject(); + /* @var $object kDBItem */ + + $image_helper->LoadItemImages($object); + } + + /** + * Save user images + * + * @param kEvent $event + */ + function saveUserImages(&$event) + { + if (!$this->Application->IsAdmin()) { + $image_helper =& $this->Application->recallObject('ImageHelper'); + /* @var $image_helper ImageHelper */ + + $object =& $event->getObject(); + /* @var $object kDBItem */ + + // process image upload in virtual fields + $image_helper->SaveItemImages($object); + } + } } ?> \ No newline at end of file Index: branches/RC/admin/install/inportal_data.sql =================================================================== diff -u -N -r9866 -r10156 --- branches/RC/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 9866) +++ branches/RC/admin/install/inportal_data.sql (.../inportal_data.sql) (revision 10156) @@ -233,4 +233,4 @@ INSERT INTO Stylesheets VALUES (8, 'Default', 'In-Portal Default Theme', '', 1124952555, 1); -INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.2.2', 1, 0, '', 0, '1054738405'); +INSERT INTO Modules VALUES ('In-Portal', 'kernel/', 'm', '4.2.3', 1, 0, '', 0, '1054738405'); Index: branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.3.sql =================================================================== diff -u -N --- branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.3.sql (revision 0) +++ branches/RC/admin/install/upgrades/inportal_upgrade_v4.2.3.sql (revision 10156) @@ -0,0 +1,14 @@ +INSERT INTO ConfigurationAdmin VALUES ('u_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 30.01, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 30.02, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 30.03, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 30.04, 0, 0); +INSERT INTO ConfigurationAdmin VALUES ('u_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 30.05, 0, 0); + +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_MaxImageCount', 5, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageWidth', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_ThumbnailImageHeight', 120, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageWidth', 450, 'In-Portal:Users', 'in-portal:configure_users'); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'u_FullImageHeight', 450, 'In-Portal:Users', 'in-portal:configure_users'); + +UPDATE Modules SET Version = '4.2.3' WHERE Name = 'Core'; +UPDATE Modules SET Version = '4.2.3' WHERE Name = 'In-Portal'; \ No newline at end of file