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

Commit 41267f9

Browse files
authored
Merge pull request #1103 from modxcms/develop
1.2.1
2 parents d3ee7a5 + 252e3dd commit 41267f9

File tree

135 files changed

+9730
-7686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+9730
-7686
lines changed

assets/cache/images/.htaccess

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
1-
<IfModule !mod_authz_core.c>
2-
Order allow,deny
3-
Allow from all
4-
</IfModule>
5-
6-
<IfModule mod_authz_core.c>
7-
## configuration for Apache 2.4
8-
Require all granted
9-
</IfModule>
1+
order deny,allow
2+
allow from all

assets/docs/changelog.txt

+213-20
Large diffs are not rendered by default.

assets/images/logo.png

-2.74 KB
Binary file not shown.

assets/js/jquery.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/jquery/jquery.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/lib/MODxAPI/modResource.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,11 @@ public function save($fire_events = false, $clearCache = false)
552552
$this->field[$key] = $value;
553553
}
554554
switch (true) {
555-
case $key == 'parent' || (!$this->newDoc && $this->isChanged($key)):
555+
case $key == 'parent':
556556
$parent = (int)$this->get($key);
557557
$q = $this->query("SELECT count(`id`) FROM {$this->makeTable('site_content')} WHERE `id`='{$parent}'");
558558
if ($this->modx->db->getValue($q) != 1) {
559-
$parent = $value;
559+
$parent = 0;
560560
}
561561
$this->field[$key] = $parent;
562562
$this->Uset($key);

assets/lib/SimpleTab/controller.abstract.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(\DocumentParser $modx)
5252
$this->FS = \Helpers\FS::getInstance();
5353
$this->modx = $modx;
5454
$this->params = $modx->event->params;
55-
$this->rid = isset($_POST[$this->rfName]) ? (int)$_POST[$this->rfName] : 0;
55+
$this->rid = isset($_REQUEST[$this->rfName]) ? (int)$_REQUEST[$this->rfName] : 0;
5656
}
5757

5858
public function callExit()

assets/lib/class.modxRTEbridge.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,10 @@ public function getModxSettings()
573573
$row['default'] = isset($this->gSettingsDefaultValues[$name]) ? '<span class="default-val" style="margin:0.5em 0;float:left;">' . $this->lang('default') . '<i>' . $this->gSettingsDefaultValues[$name] . '</i></span>' : '';
574574

575575
// Simple nested parsing
576-
$output = $modx->parseText($settingsRowTpl, $row); // Replace general translations
577-
$output = $modx->parseText($output, $ph); // Replace values / settings
578-
$output = $modx->parseText($output, $row); // Replace new PHs from values / settings
579-
$output = $modx->parseText($output, $ph); // Replace last values / settings
576+
$output = $this->parsePlaceholders($settingsRowTpl, $row); // Replace general translations
577+
$output = $this->parsePlaceholders($output, $ph); // Replace values / settings
578+
$output = $this->parsePlaceholders($output, $row); // Replace new PHs from values / settings
579+
$output = $this->parsePlaceholders($output, $ph); // Replace last values / settings
580580

581581
$ph['rows'] .= $output . "\n";
582582
};
@@ -585,12 +585,17 @@ public function getModxSettings()
585585

586586
$ph['editorLogo'] = !empty($this->pluginParams['editorLogo']) ? '<img src="' . $this->pluginParams['base_url'] . $this->pluginParams['editorLogo'] . '" style="max-height:50px;width:auto;margin-right:50px;" />' : '';
587587

588-
$settingsBody = $modx->parseText($settingsBody, $ph);
588+
$settingsBody = $this->parsePlaceholders($settingsBody, $ph);
589589
$settingsBody = $this->replaceTranslations($settingsBody);
590590

591591
return $settingsBody;
592592
}
593593

594+
public function parsePlaceholders($content, $ph) {
595+
foreach($ph as $key=>$value) $content = str_replace('[+'.$key.'+]', $value, $content);
596+
return $content;
597+
}
598+
594599
// Replace all translation-placeholders
595600
public function replaceTranslations($output)
596601
{

assets/modules/docmanager/classes/docmanager.class.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,19 @@ function getFileContents($file) {
7272
function loadTemplates() {
7373
$this->fileGetContents('main.tpl');
7474
}
75-
75+
7676
function parseTemplate($tpl, $values = array()) {
7777
$tpl = array_key_exists($tpl, $this->fileRegister) ? $this->fileRegister[$tpl] : $this->getFileContents($tpl);
7878
if($tpl) {
7979
if(strpos($tpl,'</body>')!==false) {
8080
if(!isset($this->modx->config['mgr_date_picker_path'])) $this->modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php';
8181
$dp = $this->modx->manager->loadDatePicker($this->modx->config['mgr_date_picker_path']);
8282
$tpl = str_replace('</body>',$dp.'</body>',$tpl);
83-
}
83+
global $modx;
84+
$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock');
85+
$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
86+
$tpl = str_replace('[+onManagerMainFrameHeaderHTMLBlock+]',$onManagerMainFrameHeaderHTMLBlock,$tpl);
87+
}
8488
if(!isset($this->modx->config['mgr_jquery_path'])) $this->modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js';
8589
$tpl = $this->modx->mergeSettingsContent($tpl);
8690
foreach ($values as $key => $value) {

assets/modules/docmanager/templates/changeauthors.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<br /><h3>[+lang.DM_adjust_authors_header+]</h3><br />
1+
<br /><h3><i class="fa fa-user" aria-hidden="true"></i> [+lang.DM_adjust_authors_header+]</h3><br />
22
<p>[+lang.DM_adjust_authors_desc+]</p><br />
33

4-
<form style="margin-left:50px;" name="authors" method="post" action="">
4+
<form name="authors" method="post" action="">
55
<label for="author_createdby">[+lang.DM_adjust_authors_createdby+]</label>
66
<select name="author_createdby" style="width:50%">
77
<option value="0">[+lang.DM_adjust_authors_noselection+]</option>

assets/modules/docmanager/templates/main.tpl

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
return true;
5252
}
5353
</script>
54+
[+onManagerMainFrameHeaderHTMLBlock+]
5455
</head>
5556
<body>
5657
<h1 class="pagetitle">

assets/modules/docmanager/templates/misc.tpl

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
<br /><h3>[+lang.DM_adjust_dates_header+]</h3><br />
1+
<br /><h3><i class="fa fa-calendar" aria-hidden="true"></i> [+lang.DM_adjust_dates_header+]</h3><br />
22
<p>[+lang.DM_adjust_dates_desc+]</p><br />
33
<form id="dates" name="dates" method="post" action="">
4-
<table style="margin-left: 50px">
4+
<table>
55
<tr>
66
<td><label for="date_pubdate" id="date_pubdate_label">[+lang.DM_date_pubdate+]</label></td>
77
<td>
88
<input type="text" id="date_pubdate" class="DatePicker" name="date_pubdate" />
9-
<a href="#" onclick="document.forms['dates'].elements['date_pubdate'].value=''; return true;">[+lang.DM_clear_date+]</a>
9+
<a href="#" title=" [+lang.DM_clear_date+]" onclick="document.forms['dates'].elements['date_pubdate'].value=''; return true;"><i class="fa fa-calendar-o" aria-hidden="true"></i></a>
1010
</td>
1111
</tr>
1212
<tr>
1313
<td><label for="date_unpubdate" id="date_unpubdate_label">[+lang.DM_date_unpubdate+]</label></td>
1414
<td>
1515
<input type="text" id="date_unpubdate" class="DatePicker" name="date_unpubdate" />
16-
<a href="#" onclick="document.forms['dates'].elements['date_unpubdate'].value=''; return true;">[+lang.DM_clear_date+]</a>
16+
<a href="#" title=" [+lang.DM_clear_date+]" onclick="document.forms['dates'].elements['date_unpubdate'].value=''; return true;"><i class="fa fa-calendar-o" aria-hidden="true"></i></a>
1717
</td>
1818
</tr>
1919
<tr>
2020
<td><label for="date_createdon" id="date_createdon_label">[+lang.DM_date_createdon+]</label></td>
2121
<td>
2222
<input type="text" id="date_createdon" class="DatePicker" name="date_createdon" />
23-
<a href="#" onclick="document.forms['dates'].elements['date_createdon'].value=''; return true;">[+lang.DM_clear_date+]</a>
23+
<a href="#" title=" [+lang.DM_clear_date+]" onclick="document.forms['dates'].elements['date_createdon'].value=''; return true;"><i class="fa fa-calendar-o" aria-hidden="true"></i></a>
2424
</td>
2525
</tr>
2626
<tr>
2727
<td><label for="date_editedon" id="date_editedon_label">[+lang.DM_date_editedon+]</label></td>
2828
<td>
2929
<input type="text" id="date_editedon" class="DatePicker" name="date_editedon" />
30-
<a href="#" onclick="document.forms['dates'].elements['date_editedon'].value=''; return true;">[+lang.DM_clear_date+]</a>
30+
<a href="#" title=" [+lang.DM_clear_date+]" onclick="document.forms['dates'].elements['date_editedon'].value=''; return true;"><i class="fa fa-calendar-o" aria-hidden="true"></i></a>
3131
</td>
3232
</tr>
3333
</table>
3434
</form>
3535

3636

3737
<br />
38-
<h3>[+lang.DM_other_header+]</h3>
38+
<h3><i class="fa fa-sliders" aria-hidden="true"></i> [+lang.DM_other_header+]</h3>
3939
<br />
4040
<p>[+lang.DM_misc_desc+]</p><br />
41-
<form style="margin-left:50px;" name="other" method="post" action="">
41+
<form name="other" method="post" action="">
4242
<input type="hidden" id="option1" name="option1" value="[+lang.DM_other_publish_radio1+]" />
4343
<input type="hidden" id="option2" name="option2" value="[+lang.DM_other_publish_radio2+]" />
4444
<input type="hidden" id="option3" name="option3" value="[+lang.DM_other_show_radio1+]" />

assets/modules/store/core.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,14 @@ function get_version($text){
122122
}
123123

124124
static function parse($tpl,$field){
125+
global $modx;
125126
foreach($field as $key=>$value) $tpl = str_replace('[+'.$key.'+]',$value,$tpl);
126-
return $tpl;
127+
$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock');
128+
$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
129+
$tpl = str_replace('[+onManagerMainFrameHeaderHTMLBlock+]',$onManagerMainFrameHeaderHTMLBlock,$tpl);
130+
return $tpl;
127131
}
128-
129-
function tpl($file){
132+
function tpl($file){
130133
$lang = $this->lang;
131134
ob_start();
132135
include($file);

assets/modules/store/template/main.html

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<script src="[+site_url+]/assets/modules/store/js/store.js" type="text/javascript"></script>
1414
<script type="text/javascript" src="[+site_url+]/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
1515
<script type="text/javascript" src="[+site_url+]/assets/modules/store/js/fancybox/jquery.fancybox.pack.js"></script>
16+
[+onManagerMainFrameHeaderHTMLBlock+]
1617
</head>
1718
<body>
1819
<h1 class="pagetitle">

assets/plugins/elementsintree/includes/functions.inc.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
function renderLockIcon($elmTable, $id)
66
{
7-
global $modx, $_lang, $_style;
7+
global $modx;
88

99
switch($elmTable) {
1010
case 'site_templates': $lockType = 1; break;
@@ -26,18 +26,18 @@ function renderLockIcon($elmTable, $id)
2626
}
2727

2828
function getLockedByUser($lockType,$rowLock,$id) {
29-
global $modx,$_lang,$_style;
30-
29+
global $modx,$_lang,$_style;
30+
3131
$ph = array();
3232
$ph['element_type'] = $_lang['lock_element_type_'.$lockType];
33-
$ph['firsthit_df'] = $rowLock['firsthit_df'];
33+
$ph['lasthit_df'] = $rowLock['lasthit_df'];
3434

35-
if($rowLock['internalKey'] == $modx->getLoginUserID()) {
35+
if($rowLock['sid'] == $modx->sid) {
3636
$title = $modx->parseText($_lang['lock_element_editing'], $ph);
3737
$tpl = '<span title="%s" class="editResource" style="cursor:context-menu;"><img src="%s" /></span>&nbsp;';
3838
$params = array($title, $_style['icons_preview_resource']);
3939
return vsprintf($tpl, $params);
40-
} else {
40+
} else {
4141
$ph['username'] = $rowLock['username'];
4242
$title = $modx->parseText($_lang['lock_element_locked_by'], $ph);
4343
if($modx->hasPermission('remove_locks')) {
@@ -78,7 +78,7 @@ function createElementsList($elmTable,$action,$nameField = 'name') {
7878

7979
$output = '
8080
<form class="filterElements-form filterElements-form--eit" style="margin-top: 0;">
81-
<input class="form-control" type="text" placeholder="Type here to filter list" id="tree_'.$elmTable.'_search">
81+
<input class="form-control" type="text" placeholder="'.$_lang['element_filter_msg'].'" id="tree_'.$elmTable.'_search">
8282
</form>';
8383

8484
$output .= '<div class="panel-group"><div class="panel panel-default" id="tree_'.$elmTable.'">';
@@ -132,7 +132,7 @@ function createModulesList($action) {
132132

133133
$output = '
134134
<form class="filterElements-form filterElements-form--eit" style="margin-top: 0;">
135-
<input class="form-control" type="text" placeholder="Type here to filter list" id="tree_site_modules_search">
135+
<input class="form-control" type="text" placeholder="'.$_lang['element_filter_msg'].'" id="tree_site_modules_search">
136136
</form>';
137137

138138
$output .= '<div class="panel-group"><div class="panel panel-default" id="tree_site_modules">';

assets/plugins/filesource/plugin.filesource.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
mE12 = new Element("td",{"align":"left","styles":{"padding-top":"14px"}});
117117
mE122 = new Element("input",{"name":"filebinding","type":"text","maxlength":"75","value":"'.$content['file_binding'].'","class":"inputBox","styles":{"width":"300px"},"events":{"change":function(){documentDirty=true;}}});
118118
119-
mE11.appendText("' . _lang('Static file path') . ':");
119+
mE11.appendText("' . _lang('Static file path') . '");
120120
mE11.inject(mE1);
121121
mE122.inject(mE12);
122122
mE12.inject(mE1);

assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php

+10-11
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,28 @@ function getUser($user_id=false, $username='', $email='', $hash='') {
3939
$hash = $modx->db->escape($hash);
4040
$tbl_manager_users = $modx->getFullTableName('manager_users');
4141
$tbl_user_attributes = $modx->getFullTableName('user_attributes');
42-
$tbl_active_users = $modx->getFullTableName('active_users');
4342

44-
$site_id = $modx->config['site_id'];
43+
// $site_id = $modx->config['site_id'];
4544
$today = date('Yz'); // Year and day of the year
4645
$wheres = array();
47-
$where = '';
4846
$user = null;
4947

5048
if($user_id !== false) { $wheres[] = "usr.id='{$user_id}'"; }
5149
if(!empty($username)) { $wheres[] = "usr.username='{$username}'"; }
5250
if(!empty($email)) { $wheres[] = "attr.email='{$email}'"; }
53-
if(!empty($hash)) { $wheres[] = "MD5(CONCAT(auser.lasthit,usr.password))='{$hash}'"; }
54-
51+
if(!empty($hash)) { $wheres[] = "MD5(CONCAT('{$today}',attr.lastlogin,usr.password))='{$hash}'"; }
52+
$wheres[] = "attr.lastlogin > 0";
53+
5554
if($wheres) {
5655
$result = $modx->db->select(
57-
"usr.id, usr.username, attr.email, MD5(CONCAT(auser.lasthit,usr.password)) AS hash",
56+
"usr.id, usr.username, attr.email, MD5(CONCAT('{$today}',attr.lastlogin,usr.password)) AS hash",
5857
"{$tbl_manager_users} usr
59-
INNER JOIN {$tbl_user_attributes} attr ON usr.id=attr.internalKey
60-
INNER JOIN {$tbl_active_users} auser ON usr.username=auser.username",
58+
INNER JOIN {$tbl_user_attributes} attr ON usr.id=attr.internalKey",
6159
implode(' AND ',$wheres),
6260
"",
6361
1
64-
);
65-
$user = $modx->db->getRow($result);
62+
);
63+
$user = $modx->db->getRow($result);
6664
}
6765

6866
if($user == null) { $this->errors[] = $_lang['could_not_find_user']; }
@@ -159,7 +157,7 @@ function getErrorOutput() {
159157
$output = $forgot->getForm();
160158
break;
161159
case 'send_email':
162-
if($forgot->sendEmail($to)) { $output = $_lang['email_sent']; }
160+
if($forgot->sendEmail($to)) { $output = '<p><b>'.$_lang['email_sent'].'</b></p>'; }
163161
break;
164162
default:
165163
$output = $forgot->getLink();
@@ -182,6 +180,7 @@ function getErrorOutput() {
182180
if(isset($_REQUEST['captcha_code']) && !empty($_REQUEST['captcha_code']))
183181
$_SESSION['veriword'] = $_REQUEST['captcha_code'];
184182
$output = true;
183+
$_SESSION['onLoginForwardToAction'] = 28; // action "change password"
185184
}
186185
else $output = false;
187186
}

assets/plugins/managermanager/widgets/ddmultiplefields/ddmultiplefields.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
font: 12px/1.2em Verdana,Helvetica,sans-serif !important;
1818
}
1919

20-
.ddMultipleField input {height: 1.2em;}
20+
.ddMultipleField input {height: 2em;}
2121

2222
.ddMultipleField input:focus {border-color: #E1A020 !important;}
2323

@@ -121,4 +121,4 @@
121121
padding: 0.05em 0.15em;
122122
text-align: center;
123123
vertical-align: super;
124-
}
124+
}

assets/plugins/qm/qm.inc.php

+18
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ function Run() {
490490
}
491491

492492
// Insert jQuery and ColorBox in head if needed
493+
$head = '';
493494
if ($this->loadfrontendjq == 'true') $head .= '<script src="'.$this->modx->config['site_url'].$this->jqpath.'" type="text/javascript"></script>';
494495
if ($this->loadtb == 'true') {
495496
$head .= '
@@ -613,6 +614,23 @@ function getCookie(cookieName)
613614
614615
</script>
615616
';
617+
618+
$head .= "
619+
<script>
620+
// Assure keeping session and related locks alive
621+
$(document).ready(function($) {
622+
function updateMODXsession() {
623+
$.ajax({ url: '".MODX_MANAGER_URL."index.php', method:'post', data:{'updateMsgCount':true},
624+
success: function(data) {},
625+
complete: function() {
626+
setTimeout(updateMODXsession, ". ($this->modx->config['mail_check_timeperiod'] * 1000) .");
627+
}
628+
});
629+
}
630+
setTimeout(updateMODXsession, ". ($this->modx->config['mail_check_timeperiod'] * 1000) .");
631+
});
632+
</script>
633+
";
616634

617635
// Insert QM+ css in head
618636
$head .= $css;

0 commit comments

Comments
 (0)