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

Commit

Permalink
Merge pull request #1036 from modxcms/develop
Browse files Browse the repository at this point in the history
1.2
  • Loading branch information
Dmi3yy authored Dec 1, 2016
2 parents fcf821f + 31671c4 commit d3ee7a5
Show file tree
Hide file tree
Showing 8 changed files with 1,312 additions and 30 deletions.
1,247 changes: 1,247 additions & 0 deletions assets/docs/changelog.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/lib/MODxAPI/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public function save($fire_events = false, $clearCache = false)
$result = $this->query("SELECT `tmplvarid` FROM {$this->makeTable('site_tmplvar_contentvalues')} WHERE `contentid`={$this->id} AND `tmplvarid` IN ({$ids})");
$existedTVs = $this->modx->db->getColumn('tmplvarid',$result);
foreach ($existedTVs as $id) {
$_updateTVs[] = $_insertTVs[$id];
$_updateTVs[$id] = $_insertTVs[$id];
unset($_insertTVs[$id]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion install/assets/snippets/eform.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Robust form parser/processor with validation, multiple sending options, chunk/page support for forms and reports, and file uploads
*
* @category snippet
* @version 1.4.7
* @version 1.4.8
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @internal @properties
* @internal @modx_category Forms
Expand Down
80 changes: 57 additions & 23 deletions manager/includes/active_user_locks.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,64 @@
if($lockElementId > 0) {
?>
<script>
// Trigger unlock when leaving window
var form_save = false;
jQuery(window).on('beforeunload', function(){
var stay = jQuery('#stay').val();
var lastClickedElement = localStorage.getItem('MODX_lastClickedElement');
var sameElement = false;
if(lastClickedElement != null) {
try {
lastClickedElement = JSON.parse( lastClickedElement );
sameElement = lastClickedElement[0]==<?php echo $lockElementType;?> && lastClickedElement[1]==<?php echo $lockElementId;?> ? true : false;
} catch(err) {
console.log(err);
}
}

// Trigger unlock
if((stay != 2 || !form_save) && !sameElement) {
// console.log('unlock triggered:', 'stay='+stay, 'form_save='+form_save, 'sameElement='+sameElement, lastClickedElement);
var unlockRequest = new Ajax('index.php?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(), {
method: 'get'
}).request();
// Polyfill for Navigator.sendBeacon
(function(root) {
'use strict';

function sendBeacon(url, data) {
var xhr = ('XMLHttpRequest' in window) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
xhr.open('POST', url, false);
xhr.setRequestHeader('Accept', '*/*');
if (typeof data === 'string') {
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
xhr.responseType = 'text/plain';
} else if (Object.prototype.toString.call(data) === '[object Blob]') {
if (data.type) {
xhr.setRequestHeader('Content-Type', data.type);
}
}
xhr.send(data);
return true;
}

if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = sendBeacon;
}
exports.sendBeacon = sendBeacon;
} else if (typeof define === 'function' && define.amd) {
define([], function() {
return sendBeacon;
});
} else if ('navigator' in root && !('sendBeacon' in root.navigator)) {
root.navigator.sendBeacon = sendBeacon;
}
})(this);

// Trigger unlock when leaving window
var form_save = false;
window.addEventListener('unload', unlockThisElement, false);

function unlockThisElement() {
var stay = jQuery('#stay').val();
var lastClickedElement = localStorage.getItem('MODX_lastClickedElement');
var sameElement = false;
if(lastClickedElement != null) {
try {
lastClickedElement = JSON.parse( lastClickedElement );
sameElement = lastClickedElement[0]==<?php echo $lockElementType;?> && lastClickedElement[1]==<?php echo $lockElementId;?> ? true : false;
} catch(err) {
console.log(err);
}
}

// Trigger unlock
if((stay != 2 || !form_save) && !sameElement) {
// console.log('unlock triggered:', 'stay='+stay, 'form_save='+form_save, 'sameElement='+sameElement, lastClickedElement);
navigator.sendBeacon('index.php?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random());
top.mainMenu.reloadtree();
}
});
}
}
</script>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion manager/includes/lang/english.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
$_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>';
$_lang["already_deleted"] = 'has already been deleted.';
$_lang["attachment"] = 'Attachment';
$_lang["author_infos"] = 'Author infos';
$_lang["author_infos"] = 'Author information';
$_lang["automatic_alias_message"] = 'Select \'yes\' to have the system automatically generate a URL alias based on the Resource\'s page title when saving.';
$_lang["automatic_alias_title"] = 'Automatically generate URL alias';
$_lang["backup"] = 'Backup';
Expand Down
4 changes: 2 additions & 2 deletions manager/includes/version.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$modx_version = '1.2RC1'; // Current version number
$modx_release_date = 'Nov 29, 2016'; // Date of release
$modx_version = '1.2'; // Current version number
$modx_release_date = 'Dec 01, 2016'; // Date of release
$modx_branch = 'Evolution'; // Codebase name
$modx_full_appname = "MODX {$modx_branch} {$modx_version} ({$modx_release_date})";
1 change: 1 addition & 0 deletions manager/media/style/MODxRE2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,7 @@ li.breadcrumbs__li_current {
/* table styles*/

.table,
.tab-page table,
#documentPane [id*="table-tv"] {
width: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions manager/media/style/MODxRE2/welcome.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

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

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

0 comments on commit d3ee7a5

Please sign in to comment.