Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit d3ee7a5

Browse files
authored
Merge pull request #1036 from modxcms/develop
1.2
2 parents fcf821f + 31671c4 commit d3ee7a5

8 files changed

Lines changed: 1312 additions & 30 deletions

File tree

assets/docs/changelog.txt

Lines changed: 1247 additions & 0 deletions
Large diffs are not rendered by default.

assets/lib/MODxAPI/modResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ public function save($fire_events = false, $clearCache = false)
604604
$result = $this->query("SELECT `tmplvarid` FROM {$this->makeTable('site_tmplvar_contentvalues')} WHERE `contentid`={$this->id} AND `tmplvarid` IN ({$ids})");
605605
$existedTVs = $this->modx->db->getColumn('tmplvarid',$result);
606606
foreach ($existedTVs as $id) {
607-
$_updateTVs[] = $_insertTVs[$id];
607+
$_updateTVs[$id] = $_insertTVs[$id];
608608
unset($_insertTVs[$id]);
609609
}
610610
}

install/assets/snippets/eform.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Robust form parser/processor with validation, multiple sending options, chunk/page support for forms and reports, and file uploads
66
*
77
* @category snippet
8-
* @version 1.4.7
8+
* @version 1.4.8
99
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
1010
* @internal @properties
1111
* @internal @modx_category Forms

manager/includes/active_user_locks.inc.php

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,64 @@
66
if($lockElementId > 0) {
77
?>
88
<script>
9-
// Trigger unlock when leaving window
10-
var form_save = false;
11-
jQuery(window).on('beforeunload', function(){
12-
var stay = jQuery('#stay').val();
13-
var lastClickedElement = localStorage.getItem('MODX_lastClickedElement');
14-
var sameElement = false;
15-
if(lastClickedElement != null) {
16-
try {
17-
lastClickedElement = JSON.parse( lastClickedElement );
18-
sameElement = lastClickedElement[0]==<?php echo $lockElementType;?> && lastClickedElement[1]==<?php echo $lockElementId;?> ? true : false;
19-
} catch(err) {
20-
console.log(err);
21-
}
22-
}
23-
24-
// Trigger unlock
25-
if((stay != 2 || !form_save) && !sameElement) {
26-
// console.log('unlock triggered:', 'stay='+stay, 'form_save='+form_save, 'sameElement='+sameElement, lastClickedElement);
27-
var unlockRequest = new Ajax('index.php?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(), {
28-
method: 'get'
29-
}).request();
9+
// Polyfill for Navigator.sendBeacon
10+
(function(root) {
11+
'use strict';
12+
13+
function sendBeacon(url, data) {
14+
var xhr = ('XMLHttpRequest' in window) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
15+
xhr.open('POST', url, false);
16+
xhr.setRequestHeader('Accept', '*/*');
17+
if (typeof data === 'string') {
18+
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
19+
xhr.responseType = 'text/plain';
20+
} else if (Object.prototype.toString.call(data) === '[object Blob]') {
21+
if (data.type) {
22+
xhr.setRequestHeader('Content-Type', data.type);
23+
}
24+
}
25+
xhr.send(data);
26+
return true;
27+
}
28+
29+
if (typeof exports !== 'undefined') {
30+
if (typeof module !== 'undefined' && module.exports) {
31+
exports = module.exports = sendBeacon;
32+
}
33+
exports.sendBeacon = sendBeacon;
34+
} else if (typeof define === 'function' && define.amd) {
35+
define([], function() {
36+
return sendBeacon;
37+
});
38+
} else if ('navigator' in root && !('sendBeacon' in root.navigator)) {
39+
root.navigator.sendBeacon = sendBeacon;
40+
}
41+
})(this);
42+
43+
// Trigger unlock when leaving window
44+
var form_save = false;
45+
window.addEventListener('unload', unlockThisElement, false);
46+
47+
function unlockThisElement() {
48+
var stay = jQuery('#stay').val();
49+
var lastClickedElement = localStorage.getItem('MODX_lastClickedElement');
50+
var sameElement = false;
51+
if(lastClickedElement != null) {
52+
try {
53+
lastClickedElement = JSON.parse( lastClickedElement );
54+
sameElement = lastClickedElement[0]==<?php echo $lockElementType;?> && lastClickedElement[1]==<?php echo $lockElementId;?> ? true : false;
55+
} catch(err) {
56+
console.log(err);
57+
}
58+
}
59+
60+
// Trigger unlock
61+
if((stay != 2 || !form_save) && !sameElement) {
62+
// console.log('unlock triggered:', 'stay='+stay, 'form_save='+form_save, 'sameElement='+sameElement, lastClickedElement);
63+
navigator.sendBeacon('index.php?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random());
3064
top.mainMenu.reloadtree();
31-
}
32-
});
65+
}
66+
}
3367
</script>
3468
<?php
3569
}

manager/includes/lang/english.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
$_lang["allow_mgr_access_message"] = 'Select this option to enable or disable access to the manager interface. <b>NOTE: If this option is set to no then the user will be redirected to the Manager Login Startup or Site Start web page.</b>';
6969
$_lang["already_deleted"] = 'has already been deleted.';
7070
$_lang["attachment"] = 'Attachment';
71-
$_lang["author_infos"] = 'Author infos';
71+
$_lang["author_infos"] = 'Author information';
7272
$_lang["automatic_alias_message"] = 'Select \'yes\' to have the system automatically generate a URL alias based on the Resource\'s page title when saving.';
7373
$_lang["automatic_alias_title"] = 'Automatically generate URL alias';
7474
$_lang["backup"] = 'Backup';

manager/includes/version.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$modx_version = '1.2RC1'; // Current version number
3-
$modx_release_date = 'Nov 29, 2016'; // Date of release
2+
$modx_version = '1.2'; // Current version number
3+
$modx_release_date = 'Dec 01, 2016'; // Date of release
44
$modx_branch = 'Evolution'; // Codebase name
55
$modx_full_appname = "MODX {$modx_branch} {$modx_version} ({$modx_release_date})";

manager/media/style/MODxRE2/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,7 @@ li.breadcrumbs__li_current {
25662566
/* table styles*/
25672567

25682568
.table,
2569+
.tab-page table,
25692570
#documentPane [id*="table-tv"] {
25702571
width: 100%;
25712572
}

manager/media/style/MODxRE2/welcome.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123

124124
<!---User Info--->
125125
<!--- panel --->
126-
<li id="modxonline_widget" data-row="2" data-col="2" data-sizex="2" data-sizey="6">
126+
<li id="modxonline_widget" data-row="2" data-col="3" data-sizex="2" data-sizey="6">
127127
<div class="panel panel-default widget-wrapper">
128128
<div class="panel-headingx widget-title sectionHeader clearfix">
129129
<span class="panel-handel pull-left"><i class="fa fa-user"></i> [%onlineusers_title%]</span>
@@ -182,7 +182,7 @@
182182

183183
<!---Security News--->
184184
<!--- panel --->
185-
<li id="modxsecurity_widget" data-row="4" data-col="2" data-sizex="2" data-sizey="5">
185+
<li id="modxsecurity_widget" data-row="4" data-col="3" data-sizex="2" data-sizey="5">
186186
<div class="panel panel-default widget-wrapper">
187187
<div class="panel-headingx widget-title sectionHeader clearfix">
188188
<span class="panel-handel pull-left"><i class="fa fa-exclamation-triangle"></i> [%security_notices_title%]</span>

0 commit comments

Comments
 (0)