Index: branches/5.3.x/core/kernel/db/db_event_handler.php
===================================================================
diff -u -r16532 -r16600
--- branches/5.3.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 16532)
+++ branches/5.3.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 16600)
@@ -1,6 +1,6 @@
setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true));
$status_checked = false;
- if ( $user_id == USER_ROOT || $this->CheckPermission($event) ) {
- // don't autoload item, when user doesn't have view permission
+ if ( $this->Application->permissionCheckingDisabled($user_id) || $this->CheckPermission($event) ) {
+ // Don't autoload item, when user doesn't have view permission.
$this->LoadItem($event);
$status_checked = true;
$editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false;
$id_from_request = $event->getEventParam(kEvent::FLAG_ID_FROM_REQUEST);
- if ( $user_id != USER_ROOT
+ if ( !$this->Application->permissionCheckingDisabled($user_id)
&& !$this->Application->isAdmin
&& !($editing_mode || ($id_from_request ? $this->checkItemStatus($event) : true))
) {
- // non-root user AND on front-end AND (not editing mode || incorrect status)
+ // Permissions are being checked AND on Front-End AND (not editing mode || incorrect status).
$perm_status = false;
}
}
@@ -1602,6 +1602,10 @@
$this->_update($event);
$event->SetRedirectParam('opener', 'u');
+
+ if ( $event->status == kEvent::erSUCCESS ) {
+ $this->saveChangesToLiveTable($event->Prefix);
+ }
}
/**
@@ -1639,6 +1643,26 @@
}
/**
+ * Automatically saves data to live table after sub-item was updated in Content Mode.
+ *
+ * @param string $prefix Prefix.
+ *
+ * @return void
+ */
+ protected function saveChangesToLiveTable($prefix)
+ {
+ $parent_prefix = $this->Application->getUnitConfig($prefix)->getParentPrefix();
+
+ if ( $parent_prefix === false ) {
+ return;
+ }
+
+ if ( $this->Application->GetVar('admin') && $this->Application->IsTempMode($parent_prefix) ) {
+ $this->Application->HandleEvent(new kEvent($parent_prefix . ':OnSave'));
+ }
+ }
+
+ /**
* Delete's kDBItem object
*
* @param kEvent $event
Index: branches/5.3.x/core/admin_templates/config/config_universal.tpl
===================================================================
diff -u -r16503 -r16600
--- branches/5.3.x/core/admin_templates/config/config_universal.tpl (.../config_universal.tpl) (revision 16503)
+++ branches/5.3.x/core/admin_templates/config/config_universal.tpl (.../config_universal.tpl) (revision 16600)
@@ -115,9 +115,11 @@
-
+
-
-
-
-
-
-
Index: branches/5.3.x/core/units/helpers/permissions_helper.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 16519)
+++ branches/5.3.x/core/units/helpers/permissions_helper.php (.../permissions_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
Application->permissionCheckingDisabled($user_id) ) {
return substr($name, -5) == '.deny' || $name == 'SYSTEM_ACCESS.READONLY' ? 0 : 1;
}
@@ -845,4 +844,4 @@
return 0;
}
- }
\ No newline at end of file
+ }
Index: branches/5.3.x/core/admin_templates/categories/categories_edit.tpl
===================================================================
diff -u -r15902 -r16600
--- branches/5.3.x/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 15902)
+++ branches/5.3.x/core/admin_templates/categories/categories_edit.tpl (.../categories_edit.tpl) (revision 16600)
@@ -315,4 +315,4 @@
disable_categories('', );
-
\ No newline at end of file
+
Index: branches/5.3.x/core/install/english.lang
===================================================================
diff -u -r16531 -r16600
--- branches/5.3.x/core/install/english.lang (.../english.lang) (revision 16531)
+++ branches/5.3.x/core/install/english.lang (.../english.lang) (revision 16600)
@@ -34,6 +34,7 @@
RGVwbG95
RGVzaWduIE1vZGU=
RG93bg==
+ RHVtcA==
RWRpdA==
RWRpdCBCbG9jaw==
RWRpdCBDb250ZW50
@@ -271,11 +272,13 @@
RW1haWwgRGVzaWduIFRlbXBsYXRlIHNob3VsZCBjb250YWluIGF0IGxlYXN0ICIkYm9keSIgdGFnIGluIGl0Lg==
RmlsZSBub3QgZm91bmQ=
RmlsZSBpcyB0b28gbGFyZ2U=
+ VGhpcyBVUkwgaXMgY29uZmxpY3Rpbmcgd2l0aCBleGlzdGluZyBVUkwgYW5kIGNhbid0IGJlIHVzZWQ=
Z3JvdXAgbm90IGZvdW5k
RmllbGQgZG9lc24ndCBleGlzdCBpbiAiJXMiIHVuaXQgY29uZmln
SW52YWxpZCBGaWxlIEZvcm1hdA==
VW5pdCBjb25maWcgcHJlZml4IG5vdCBmb3VuZA==
aW52YWxpZCBvcHRpb24=
+ VGhlIHVzZXJuYW1lIGNhbiBjb250YWluIG9ubHk6IGxldHRlcnMsIG51bWJlcnMsIHVuZGVyc2NvcmVzLCBkYXNoZXMgYW5kIGRvdHM=
TG9naW4gRmFpbGVk
UmVjZWl2aW5nIGxpc3Qgb2YgbWVzc2FnZXMgZnJvbSB0aGUgU2VydmVyIGhhcyBmYWlsZWQ=
RXJyb3IgbW92aW5nIHN1YnNlY3Rpb24=
@@ -299,7 +302,7 @@
dXNlciBub3QgZm91bmQ=
IlNjaGVkdWxlZCBUbyIgZGF0ZS90aW1lIG11c3QgYmUgYmVmb3JlICJTY2hlZHVsZWQgRnJvbSI=
WW91IG11c3Qgc2VsZWN0IG9ubHkgb25lIHVzZXI=
- SW5jb3JyZWN0IGRhdGUgZm9ybWF0LCBwbGVhc2UgdXNlICglcykgZXguICglcyk=
+ SW5jb3JyZWN0IGRhdGUgZm9ybWF0LCBwbGVhc2UgdXNlICh7Zm9ybWF0fSkgZXguICh7c2FtcGxlfSk=
SW5jb3JyZWN0IGRhdGEgZm9ybWF0LCBwbGVhc2UgdXNlIHt0eXBlfQ==
SW52YWxpZCBGb3JtYXQ=
RmllbGQgdmFsdWUgbGVuZ3RoIGlzIG91dCBvZiByYW5nZSwgcG9zc2libGUgdmFsdWUgbGVuZ3RoIGZyb20ge21pbl9sZW5ndGh9IHRvIHttYXhfbGVuZ3RofQ==
@@ -1574,7 +1577,8 @@
U3lzdGVtIFRvb2xz
Q2xlYXIgVGVtcGxhdGVzIENhY2hl
Q29tbW9ubHkgVXNlZCBLZXlz
- RGVwbG95IENoYW5nZXM=
+ RGVwbG95IENoYW5nZXM=
+ RHVtcCBBc3NldHM=
S2V5IE5hbWU=
S2V5IFZhbHVl
TG9jYXRlIFVuaXQgQ29uZmlnIEZpbGU=
Index: branches/5.3.x/core/kernel/processors/main_processor.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 16519)
+++ branches/5.3.x/core/kernel/processors/main_processor.php (.../main_processor.php) (revision 16600)
@@ -1,6 +1,6 @@
Application->ConfigValue('Require_AdminSSL');
}
Index: branches/5.3.x/core/units/helpers/col_picker_helper.php
===================================================================
diff -u -r16503 -r16600
--- branches/5.3.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 16503)
+++ branches/5.3.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
pickerData->allFields as $field ) {
- if ( $field == '__FREEZER__' ) {
+ if ( $field == '__FREEZER__' || $this->pickerData->isHidden($field) ) {
continue;
}
Index: branches/5.3.x/core/admin_templates/forms/forms_edit.tpl
===================================================================
diff -u -r15690 -r16600
--- branches/5.3.x/core/admin_templates/forms/forms_edit.tpl (.../forms_edit.tpl) (revision 15690)
+++ branches/5.3.x/core/admin_templates/forms/forms_edit.tpl (.../forms_edit.tpl) (revision 16600)
@@ -63,7 +63,7 @@
-
+
@@ -86,4 +86,4 @@
reflectSecurityImage();
-
\ No newline at end of file
+
Index: branches/5.3.x/core/units/forms/submission_log/submission_log_config.php
===================================================================
diff -u -r15483 -r16600
--- branches/5.3.x/core/units/forms/submission_log/submission_log_config.php (.../submission_log_config.php) (revision 15483)
+++ branches/5.3.x/core/units/forms/submission_log/submission_log_config.php (.../submission_log_config.php) (revision 16600)
@@ -1,6 +1,6 @@
Array ('type' => 'string', 'default' => NULL),
'Bcc' => Array ('type' => 'string', 'default' => NULL),
'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
- 'Message' => Array ('type' => 'string', 'required' => 1, 'using_fck' => 1, 'default' => NULL),
+ 'Message' => Array ('type' => 'string', 'required' => 1, 'default' => NULL),
'Attachment' => Array (
'type' => 'string',
@@ -127,4 +127,4 @@
),
),
),
- );
\ No newline at end of file
+ );
Index: branches/5.3.x/core/units/email_templates/email_template_eh.php
===================================================================
diff -u -r16597 -r16600
--- branches/5.3.x/core/units/email_templates/email_template_eh.php (.../email_template_eh.php) (revision 16597)
+++ branches/5.3.x/core/units/email_templates/email_template_eh.php (.../email_template_eh.php) (revision 16600)
@@ -1,6 +1,6 @@
CallSubEvent('email-queue:OnProcessAjax');
}
Index: branches/5.3.x/core/units/reviews/reviews_config.php
===================================================================
diff -u -r16171 -r16600
--- branches/5.3.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 16171)
+++ branches/5.3.x/core/units/reviews/reviews_config.php (.../reviews_config.php) (revision 16600)
@@ -1,6 +1,6 @@
'int',
'formatter' => 'kDateFormatter', 'default' => '#NOW#',
),
- 'ReviewText' => Array (
- 'type' => 'string',
- 'formatter' => 'kFormatter',
- 'using_fck' => 1, 'default' => null, 'required' => 1,
- ),
+ 'ReviewText' => Array ('type' => 'string', 'default' => null, 'required' => 1),
'Rating' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
Index: branches/5.3.x/core/units/categories/categories_config.php
===================================================================
diff -u -r16529 -r16600
--- branches/5.3.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16529)
+++ branches/5.3.x/core/units/categories/categories_config.php (.../categories_config.php) (revision 16600)
@@ -1,6 +1,6 @@
'*',
'DoEvent' => 'OnCloneSubItem',
),
+
+ array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'adm',
+ 'HookToSpecial' => '',
+ 'HookToEvent' => array('OnStartup'),
+ 'DoPrefix' => '',
+ 'DoSpecial' => '',
+ 'DoEvent' => 'OnAfterStartupHook',
+ ),
),
'AutoLoad' => true,
@@ -327,7 +338,7 @@
),
'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1,'default' => 1),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
- 'MetaKeywords' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'MetaKeywords' => Array ('type' => 'string', 'default' => null),
'CachedDescendantCatsQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'CachedNavbar' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => null),
'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'),'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'default' => NULL),
@@ -337,7 +348,7 @@
'TreeRight' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'NamedParentPath' => Array ('type' => 'string', 'default' => null),
'NamedParentPathHash' => Array ('type' => 'string', 'not_null' => 1, 'default' => 0),
- 'MetaDescription' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'MetaDescription' => Array ('type' => 'string', 'default' => null),
'HotItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'NewItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
'PopItem' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
@@ -380,7 +391,7 @@
'Title' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'default' => '', 'not_null'=>1),
'MenuTitle' => Array ('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'default' => ''),
'MetaTitle' => Array ('type' => 'string', 'default' => null),
- 'IndexTools' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'IndexTools' => Array ('type' => 'string', 'default' => null),
'IsMenu' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Show', 0 => 'la_Hide'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
'Protected' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'FormId' => Array (
@@ -391,7 +402,12 @@
'default' => NULL
),
'FormSubmittedTemplate' => Array ('type' => 'string', 'default' => null),
- 'FriendlyURL' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'FriendlyURL' => Array (
+ 'type' => 'string',
+ 'unique' => array(),
+ 'error_msgs' => array('unique' => '!la_error_FriendlyUrlIsNotUnique!'),
+ 'not_null' => 1, 'default' => '',
+ ),
'ThemeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'EnablePageCache' => Array (
Index: branches/5.3.x/core/units/languages/languages_item.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/units/languages/languages_item.php (.../languages_item.php) (revision 16519)
+++ branches/5.3.x/core/units/languages/languages_item.php (.../languages_item.php) (revision 16600)
@@ -1,6 +1,6 @@
IsTempTable() ) {
+ $cachable = false;
+ }
+
$default = false;
if ($id == 'default') {
// domain based primary language
@@ -301,4 +305,4 @@
return true;
}
- }
\ No newline at end of file
+ }
Index: branches/5.3.x/core/units/themes/theme_item.php
===================================================================
diff -u -r16124 -r16600
--- branches/5.3.x/core/units/themes/theme_item.php (.../theme_item.php) (revision 16124)
+++ branches/5.3.x/core/units/themes/theme_item.php (.../theme_item.php) (revision 16600)
@@ -1,6 +1,6 @@
IsTempTable() ) {
+ $cachable = false;
+ }
+
$default = false;
if ($id == 'default') {
// domain based primary theme
Index: branches/5.3.x/core/kernel/utility/validator.php
===================================================================
diff -u -r16395 -r16600
--- branches/5.3.x/core/kernel/utility/validator.php (.../validator.php) (revision 16395)
+++ branches/5.3.x/core/kernel/utility/validator.php (.../validator.php) (revision 16600)
@@ -1,6 +1,6 @@
Application->isAdmin ? 'la_fld_' . $field : 'lu_fld_' . $field;
- $params['field'] = $this->Application->Phrase($field_phrase);
-
- foreach ( $params as $param_name => $param_value ) {
- $msg = str_replace('{' . $param_name . '}', $param_value, $msg, $replacement_count);
+ if ( $params && preg_match('/%[^\s]/', $msg) ) {
+ $msg = vsprintf($msg, array_values($params));
}
+ else {
+ $field_phrase = $this->Application->isAdmin ? 'la_fld_' . $field : 'lu_fld_' . $field;
+ $params['field'] = $this->Application->Phrase($field_phrase);
- if ( strpos($msg, '%s') !== false ) {
- trigger_error('Unexpected "%s" in field "' . $field . '" validation error message (pseudo: "' . $error_pseudo . '") in "' . $this->dataSource->Prefix . '" unit', E_USER_WARNING);
+ foreach ( $params as $param_name => $param_value ) {
+ $msg = str_replace('{' . $param_name . '}', $param_value, $msg);
+ }
}
return $msg;
Index: branches/5.3.x/core/units/content/content_tp.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/units/content/content_tp.php (.../content_tp.php) (revision 16519)
+++ branches/5.3.x/core/units/content/content_tp.php (.../content_tp.php) (revision 16600)
@@ -1,6 +1,6 @@
getObject($params);
-
- $params['pass'] = 'm,c,content';
- $params['c_id'] = $object->GetDBField('PageId');
$params['admin'] = 1;
$params['temp_mode'] = 0;
@@ -50,4 +45,5 @@
return parent::AdminEditButton($params);
}
-}
\ No newline at end of file
+
+}
Index: branches/5.3.x/core/admin_templates/js/template_manager.js
===================================================================
diff -u -r16395 -r16600
--- branches/5.3.x/core/admin_templates/js/template_manager.js (.../template_manager.js) (revision 16395)
+++ branches/5.3.x/core/admin_templates/js/template_manager.js (.../template_manager.js) (revision 16600)
@@ -183,9 +183,9 @@
});
$('body').on('click', '#cms-revision-dropdown .top .item', function ($e) {
- $('a:first', this).click();
-
- $e.preventDefault();
+ window.location.assign(
+ $('a:first', this).attr('href')
+ );
});
$template_manager.requirePageInfoUpdate();
Index: branches/5.3.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl
===================================================================
diff -u -r15690 -r16600
--- branches/5.3.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl (.../mailing_list_edit.tpl) (revision 15690)
+++ branches/5.3.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl (.../mailing_list_edit.tpl) (revision 16600)
@@ -120,7 +120,7 @@
-
+
@@ -147,4 +147,4 @@
-
\ No newline at end of file
+
Index: branches/5.3.x/core/units/helpers/user_helper.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 16519)
+++ branches/5.3.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
""';
$cache = $this->Conn->GetCol($sql, 'GroupId');
}
@@ -344,7 +344,7 @@
if ( $user_info ) {
if ( $remember_login_cookie ) {
- return md5($user_info['Password']) == $password;
+ return md5($user_info['Password']) == $password ? $user_info['PortalUserId'] : false;
}
else {
/** @var kPasswordFormatter $password_formatter */
Index: branches/5.3.x/core/admin_templates/regional/email_template_edit.tpl
===================================================================
diff -u -r15690 -r16600
--- branches/5.3.x/core/admin_templates/regional/email_template_edit.tpl (.../email_template_edit.tpl) (revision 15690)
+++ branches/5.3.x/core/admin_templates/regional/email_template_edit.tpl (.../email_template_edit.tpl) (revision 16600)
@@ -73,4 +73,4 @@
-
\ No newline at end of file
+
Index: branches/5.3.x/core/units/helpers/category_helper.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 16519)
+++ branches/5.3.x/core/units/helpers/category_helper.php (.../category_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
Application->recallObject($event->Prefix . '_EventHandler');
- if ( ($this->Application->RecallVar('user_id') == USER_ROOT) || $event_handler->CheckPermission($event) ) {
+ if ( $this->Application->permissionCheckingDisabled() || $event_handler->CheckPermission($event) ) {
$this->Application->HandleEvent($event);
$this->Application->notifyEventSubscribers($event);
}
@@ -475,4 +475,4 @@
$opener_stack->push($template, $params, $index_file);
$opener_stack->save();
}
-}
\ No newline at end of file
+}
Index: branches/5.3.x/core/admin_templates/js/grid_filters.js
===================================================================
diff -u -r15902 -r16600
--- branches/5.3.x/core/admin_templates/js/grid_filters.js (.../grid_filters.js) (revision 15902)
+++ branches/5.3.x/core/admin_templates/js/grid_filters.js (.../grid_filters.js) (revision 16600)
@@ -82,14 +82,17 @@
$('#' + jq($form_name)).append($div);
// set click handlers
- $('#_mutlioptions_cb_' + $cur_index + '_all')
- .click(
- function ($e) {
- MultiOptions.SelectAll($cur_index);
- }
- )
- .prop('checked', $options.length == $options.filter(':selected').length > 0);
+ var $select_all = $('#_mutlioptions_cb_' + $cur_index + '_all'),
+ $new_checked = $options.length === $options.filter(':selected').length;
+ $select_all.click(function ($e) {
+ MultiOptions.SelectAll($cur_index);
+ });
+
+ if ( $select_all.prop('checked') !== $new_checked ) {
+ $select_all.prop('checked', $new_checked).change();
+ }
+
$('input._mutlioptions_cb_' + $cur_index).click(
function ($e) {
MultiOptions.ItemChecked($cur_index);
@@ -136,17 +139,26 @@
// update "Select All" checkbox
var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all');
var $options = $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all);
+ var $new_checked = $options.length === $options.filter(':checked').length;
- $select_all.prop('checked', $options.length == $options.filter(':checked').length > 0);
+ if ( $select_all.prop('checked') !== $new_checked ) {
+ $select_all.prop('checked', $new_checked).change();
+ }
}
MultiOptions.SelectAll = function(selector_index) {
// set all checkbox to match "Select All" checkbox
var $select_all = $('#_mutlioptions_cb_' + selector_index + '_all');
var $checked = $select_all.prop('checked');
- $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all).prop('checked', $checked);
+ $("input[type='checkbox']", '#' + jq(MultiOptions.Selectors[selector_index]) + '_div').not($select_all).each(function () {
+ var $checkbox = $(this);
+ if ( $checkbox.prop('checked') !== $checked ) {
+ $checkbox.prop('checked', $checked).change();
+ }
+ });
+
// sync hidden field
var $reg_exp = new RegExp('^_mutlioptions_cb_' + selector_index + '_(?!all)([0-9A-Za-z-]+)');
update_checkbox_options($reg_exp, MultiOptions.Selectors[selector_index]);
Index: branches/5.3.x/core/units/forms/forms/forms_config.php
===================================================================
diff -u -r16195 -r16600
--- branches/5.3.x/core/units/forms/forms/forms_config.php (.../forms_config.php) (revision 16195)
+++ branches/5.3.x/core/units/forms/forms/forms_config.php (.../forms_config.php) (revision 16600)
@@ -1,6 +1,6 @@
Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'ReplyCc' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
'ReplyBcc' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
- 'ReplyMessageSignature' => Array ('type' => 'string', 'default' => NULL),
+ 'ReplyMessageSignature' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kFormatter', 'using_fck' => 1,
+ 'default' => NULL,
+ ),
'ReplyServer' => Array (
'type' => 'string', 'max_len' => 255,
'error_msgs' => Array (
Index: branches/5.3.x/core/units/themes/themes_config.php
===================================================================
diff -u -r16124 -r16600
--- branches/5.3.x/core/units/themes/themes_config.php (.../themes_config.php) (revision 16124)
+++ branches/5.3.x/core/units/themes/themes_config.php (.../themes_config.php) (revision 16600)
@@ -1,6 +1,6 @@
Array (0 => 'la_Disabled', 1 => 'la_Enabled'),
'use_phrases' => 1, 'not_null' => 1, 'default' => 1,
),
- 'Description' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ 'Description' => Array ('type' => 'string', 'default' => null),
'PrimaryTheme' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
Index: branches/5.3.x/core/units/helpers/image_helper.php
===================================================================
diff -u -r16395 -r16600
--- branches/5.3.x/core/units/helpers/image_helper.php (.../image_helper.php) (revision 16395)
+++ branches/5.3.x/core/units/helpers/image_helper.php (.../image_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
0 || $params['max_height'] > 0) {
+ if ( !$this->isSVG($src_image) && ($params['max_width'] > 0 || $params['max_height'] > 0) ) {
list ($params['target_width'], $params['target_height'], $needs_resize) = $this->GetImageDimensions($src_image, $params['max_width'], $params['max_height'], $params);
if (!is_numeric($params['max_width'])) {
@@ -128,6 +128,15 @@
$params['max_height'] = $params['target_height'];
}
+ // Optimize, because when cropping from center without resize we'll get same image back.
+ if ( !$needs_resize
+ && isset($params['crop_x'])
+ && $params['crop_x'] == 'c'
+ && $params['crop_y'] == 'c'
+ ) {
+ unset($params['crop_x'], $params['crop_y'], $params['fill']);
+ }
+
$src_path = dirname($src_image);
$transform_keys = Array ('crop_x', 'crop_y', 'fill', 'wm_filename', 'filter_type');
@@ -164,8 +173,12 @@
}
}
- if ($image_size) {
- // return only image size (resized or not)
+ if ( $image_size ) {
+ if ( $this->isSVG($src_image) ) {
+ return 'width="' . $params['max_width'] . '" height="' . $params['max_height'] . '"';
+ }
+
+ // Return only image size (resized or not).
$image_info = $this->getImageInfo($src_image);
return $image_info ? $image_info[3] : '';
}
@@ -482,6 +495,11 @@
*/
function GetImageDimensions($src_image, $dst_width, $dst_height, $params)
{
+ // The SVG file is in vector format and can scale to any size.
+ if ( $this->isSVG($src_image) ) {
+ return array($dst_width, $dst_height, false);
+ }
+
$image_info = $this->getImageInfo($src_image);
if (!$image_info) {
return false;
@@ -552,7 +570,7 @@
*/
function getImageInfo($src_image)
{
- if (!file_exists($src_image)) {
+ if ( !file_exists($src_image) || $this->isSVG($src_image) ) {
return false;
}
@@ -566,6 +584,18 @@
}
/**
+ * Checks if image is an SVG file.
+ *
+ * @param string $src_image Full path to source image (already existing).
+ *
+ * @return boolean
+ */
+ protected function isSVG($src_image)
+ {
+ return pathinfo($src_image, PATHINFO_EXTENSION) == 'svg';
+ }
+
+ /**
* Returns maximal image size (width & height) among fields specified
*
* @param kDBItem $object
Index: branches/5.3.x/core/admin_templates/groups/groups_edit_permissions.tpl
===================================================================
diff -u -r15483 -r16600
--- branches/5.3.x/core/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 15483)
+++ branches/5.3.x/core/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 16600)
@@ -129,12 +129,13 @@
while($i < $permissions.length) {
$test_perm = '_cb_g-perm[' + $rets[1] + '][' + $permissions[$i] + ']';
$test_perm = document.getElementById($test_perm);
- if ($test_perm) {
- $test_perm.checked = $source_perm.checked;
- update_checkbox($test_perm, document.getElementById('g-perm[' + $rets[1] + '][' + $permissions[$i] + ']'));
+
+ if ( $test_perm && $test_perm.checked !== $source_perm.checked ) {
+ $($test_perm).prop('checked', $source_perm.checked).change();
}
+
$i++;
}
}
-
\ No newline at end of file
+
Index: branches/5.3.x/core/kernel/utility/formatters/upload_formatter.php
===================================================================
diff -u -r16519 -r16600
--- branches/5.3.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 16519)
+++ branches/5.3.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 16600)
@@ -1,6 +1,6 @@
DestinationPath && !isset($field_options['upload_dir']) ) {
+ $base_path = $object->getUnitConfig()->getBasePath();
+ $field_options['upload_dir'] = WRITEBALE_BASE . '/' . basename($base_path) . '/';
+ }
+
+ if ( !isset($field_options['max_size']) ) {
+ $field_options['max_size'] = MAX_UPLOAD_SIZE;
+ }
+ }
+
+ /**
* Processes file uploads from form
*
* @param mixed $value
@@ -71,11 +92,18 @@
}
if ( is_array($value) && isset($value['tmp_ids']) ) {
- // SWF Uploader
- return $this->_processFlashUploader($value, $field_name, $object);
+ $ret = $this->_processFlashUploader($value, $field_name, $object);
}
+ else {
+ $ret = $this->_processRegularUploader($value, $field_name, $object);
+ }
- return $this->_processRegularUploader($value, $field_name, $object);
+ if ( getArrayValue($options, 'upload_dir') ) {
+ $this->DestinationPath = null;
+ $this->FullPath = null;
+ }
+
+ return $ret;
}
/**
@@ -186,8 +214,6 @@
if ( is_array($value) && count($value) > 1 && $value['size'] ) {
if ( is_array($value) && (int)$value['error'] === UPLOAD_ERR_OK ) {
- $max_file_size = isset($options['max_size']) ? $options['max_size'] : MAX_UPLOAD_SIZE;
-
// we can get mime type based on file content and don't use one, provided by the client
// $value['type'] = kUtil::mimeContentType($value['tmp_name']);
@@ -209,7 +235,7 @@
$object->SetError($field_name, 'bad_file_format', 'la_error_InvalidFileFormat', $error_params);
}
- elseif ( $value['size'] > $max_file_size ) {
+ elseif ( $value['size'] > $options['max_size'] ) {
$object->SetError($field_name, 'bad_file_size', 'la_error_FileTooLarge');
}
elseif ( !is_writable($this->FullPath) ) {
@@ -219,20 +245,14 @@
$real_name = $this->_getRealFilename($value['name'], $options, $object);
$file_name = $this->FullPath . $real_name;
+ $moved = move_uploaded_file($value['tmp_name'], $file_name);
$storage_format = isset($options['storage_format']) ? $options['storage_format'] : false;
if ( $storage_format ) {
- /** @var ImageHelper $image_helper */
- $image_helper = $this->Application->recallObject('ImageHelper');
-
- move_uploaded_file($value['tmp_name'], $value['tmp_name'] . '.jpg'); // add extension, so ResizeImage can work
- $url = $image_helper->ResizeImage($value['tmp_name'] . '.jpg', $storage_format);
- $tmp_name = preg_replace('/^' . preg_quote($this->Application->BaseURL(), '/') . '/', '/', $url);
- $moved = rename($tmp_name, $file_name);
+ /** @var kUploadHelper $upload_helper */
+ $upload_helper = $this->Application->recallObject('kUploadHelper');
+ $moved = $upload_helper->resizeUploadedFile($file_name, $storage_format);
}
- else {
- $moved = move_uploaded_file($value['tmp_name'], $file_name);
- }
if ( !$moved ) {
$object->SetError($field_name, 'cant_save_file', 'la_error_cant_save_file');
Index: branches/5.3.x/core/kernel/application.php
===================================================================
diff -u -r16534 -r16600
--- branches/5.3.x/core/kernel/application.php (.../application.php) (revision 16534)
+++ branches/5.3.x/core/kernel/application.php (.../application.php) (revision 16600)
@@ -1,6 +1,6 @@
GetVar('admin') ) {
- /** @var Session $admin_session */
- $admin_session = $this->recallObject('Session.admin');
- // store Admin Console User's ID to Front-End's session for cross-session permission checks
- $this->StoreVar('admin_user_id', (int)$admin_session->RecallVar('user_id'));
-
- if ( $this->CheckAdminPermission('CATEGORY.MODIFY', 0, $this->getBaseCategory()) ) {
- // user can edit cms blocks (when viewing front-end through admin's frame)
- $editing_mode = $this->GetVar('editing_mode');
- define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE);
- }
- }
-
- kUtil::safeDefine('EDITING_MODE', ''); // user can't edit anything
$this->Phrases->setPhraseEditing();
$this->EventManager->ProcessRequest();
@@ -2554,6 +2540,22 @@
}
/**
+ * Determines if access permissions should not be checked.
+ *
+ * @param integer|null $user_id User ID.
+ *
+ * @return boolean
+ */
+ public function permissionCheckingDisabled($user_id = null)
+ {
+ if ( !isset($user_id) ) {
+ $user_id = $this->RecallVar('user_id');
+ }
+
+ return $user_id == USER_ROOT;
+ }
+
+ /**
* Check current user permissions based on it's group permissions in specified category
*
* @param string $name permission name
Index: branches/5.3.x/core/admin_templates/tools/system_tools.tpl
===================================================================
diff -u -r15974 -r16600
--- branches/5.3.x/core/admin_templates/tools/system_tools.tpl (.../system_tools.tpl) (revision 15974)
+++ branches/5.3.x/core/admin_templates/tools/system_tools.tpl (.../system_tools.tpl) (revision 16600)
@@ -133,13 +133,21 @@
"/>
-
Index: branches/5.3.x/core/units/helpers/mailing_list_helper.php
===================================================================
diff -u -r16597 -r16600
--- branches/5.3.x/core/units/helpers/mailing_list_helper.php (.../mailing_list_helper.php) (revision 16597)
+++ branches/5.3.x/core/units/helpers/mailing_list_helper.php (.../mailing_list_helper.php) (revision 16600)
@@ -1,6 +1,6 @@
getMessages();
}
else {
- kUtil::deprecatedArgument(__METHOD__, '5.3.0-B1', 'The "$messages" parameter is deprecated.');
+ kUtil::deprecatedArgument(__METHOD__, '5.2.2-B2', 'The "$messages" parameter is deprecated.');
}
$message_count = count($messages);
Index: branches/5.3.x/core/units/general/MainRouter.php
===================================================================
diff -u -r16252 -r16600
--- branches/5.3.x/core/units/general/MainRouter.php (.../MainRouter.php) (revision 16252)
+++ branches/5.3.x/core/units/general/MainRouter.php (.../MainRouter.php) (revision 16600)
@@ -1,6 +1,6 @@
Conn->GetRow($sql);
if ( $friendly ) {
+ $params['is_friendly_url'] = true;
$params['m_cat_id'] = $friendly['CategoryId'];
$params['t'] = preg_replace('/^Content\//i', '', $friendly['NamedParentPath']);