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 #1103 from modxcms/develop
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
Dmi3yy authored Jan 11, 2017
2 parents d3ee7a5 + 252e3dd commit 41267f9
Show file tree
Hide file tree
Showing 135 changed files with 9,730 additions and 7,686 deletions.
11 changes: 2 additions & 9 deletions assets/cache/images/.htaccess
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>

<IfModule mod_authz_core.c>
## configuration for Apache 2.4
Require all granted
</IfModule>
order deny,allow
allow from all
233 changes: 213 additions & 20 deletions assets/docs/changelog.txt

Large diffs are not rendered by default.

Binary file removed assets/images/logo.png
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/js/jquery.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/jquery/jquery.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/lib/MODxAPI/modResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,11 @@ public function save($fire_events = false, $clearCache = false)
$this->field[$key] = $value;
}
switch (true) {
case $key == 'parent' || (!$this->newDoc && $this->isChanged($key)):
case $key == 'parent':
$parent = (int)$this->get($key);
$q = $this->query("SELECT count(`id`) FROM {$this->makeTable('site_content')} WHERE `id`='{$parent}'");
if ($this->modx->db->getValue($q) != 1) {
$parent = $value;
$parent = 0;
}
$this->field[$key] = $parent;
$this->Uset($key);
Expand Down
2 changes: 1 addition & 1 deletion assets/lib/SimpleTab/controller.abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(\DocumentParser $modx)
$this->FS = \Helpers\FS::getInstance();
$this->modx = $modx;
$this->params = $modx->event->params;
$this->rid = isset($_POST[$this->rfName]) ? (int)$_POST[$this->rfName] : 0;
$this->rid = isset($_REQUEST[$this->rfName]) ? (int)$_REQUEST[$this->rfName] : 0;
}

public function callExit()
Expand Down
15 changes: 10 additions & 5 deletions assets/lib/class.modxRTEbridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,10 @@ public function getModxSettings()
$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>' : '';

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

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

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

$settingsBody = $modx->parseText($settingsBody, $ph);
$settingsBody = $this->parsePlaceholders($settingsBody, $ph);
$settingsBody = $this->replaceTranslations($settingsBody);

return $settingsBody;
}

public function parsePlaceholders($content, $ph) {
foreach($ph as $key=>$value) $content = str_replace('[+'.$key.'+]', $value, $content);
return $content;
}

// Replace all translation-placeholders
public function replaceTranslations($output)
{
Expand Down
8 changes: 6 additions & 2 deletions assets/modules/docmanager/classes/docmanager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,19 @@ function getFileContents($file) {
function loadTemplates() {
$this->fileGetContents('main.tpl');
}

function parseTemplate($tpl, $values = array()) {
$tpl = array_key_exists($tpl, $this->fileRegister) ? $this->fileRegister[$tpl] : $this->getFileContents($tpl);
if($tpl) {
if(strpos($tpl,'</body>')!==false) {
if(!isset($this->modx->config['mgr_date_picker_path'])) $this->modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php';
$dp = $this->modx->manager->loadDatePicker($this->modx->config['mgr_date_picker_path']);
$tpl = str_replace('</body>',$dp.'</body>',$tpl);
}
global $modx;
$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock');
$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
$tpl = str_replace('[+onManagerMainFrameHeaderHTMLBlock+]',$onManagerMainFrameHeaderHTMLBlock,$tpl);
}
if(!isset($this->modx->config['mgr_jquery_path'])) $this->modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js';
$tpl = $this->modx->mergeSettingsContent($tpl);
foreach ($values as $key => $value) {
Expand Down
4 changes: 2 additions & 2 deletions assets/modules/docmanager/templates/changeauthors.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br /><h3>[+lang.DM_adjust_authors_header+]</h3><br />
<br /><h3><i class="fa fa-user" aria-hidden="true"></i> [+lang.DM_adjust_authors_header+]</h3><br />
<p>[+lang.DM_adjust_authors_desc+]</p><br />

<form style="margin-left:50px;" name="authors" method="post" action="">
<form name="authors" method="post" action="">
<label for="author_createdby">[+lang.DM_adjust_authors_createdby+]</label>
<select name="author_createdby" style="width:50%">
<option value="0">[+lang.DM_adjust_authors_noselection+]</option>
Expand Down
1 change: 1 addition & 0 deletions assets/modules/docmanager/templates/main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
return true;
}
</script>
[+onManagerMainFrameHeaderHTMLBlock+]
</head>
<body>
<h1 class="pagetitle">
Expand Down
16 changes: 8 additions & 8 deletions assets/modules/docmanager/templates/misc.tpl
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<br /><h3>[+lang.DM_adjust_dates_header+]</h3><br />
<br /><h3><i class="fa fa-calendar" aria-hidden="true"></i> [+lang.DM_adjust_dates_header+]</h3><br />
<p>[+lang.DM_adjust_dates_desc+]</p><br />
<form id="dates" name="dates" method="post" action="">
<table style="margin-left: 50px">
<table>
<tr>
<td><label for="date_pubdate" id="date_pubdate_label">[+lang.DM_date_pubdate+]</label></td>
<td>
<input type="text" id="date_pubdate" class="DatePicker" name="date_pubdate" />
<a href="#" onclick="document.forms['dates'].elements['date_pubdate'].value=''; return true;">[+lang.DM_clear_date+]</a>
<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>
</td>
</tr>
<tr>
<td><label for="date_unpubdate" id="date_unpubdate_label">[+lang.DM_date_unpubdate+]</label></td>
<td>
<input type="text" id="date_unpubdate" class="DatePicker" name="date_unpubdate" />
<a href="#" onclick="document.forms['dates'].elements['date_unpubdate'].value=''; return true;">[+lang.DM_clear_date+]</a>
<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>
</td>
</tr>
<tr>
<td><label for="date_createdon" id="date_createdon_label">[+lang.DM_date_createdon+]</label></td>
<td>
<input type="text" id="date_createdon" class="DatePicker" name="date_createdon" />
<a href="#" onclick="document.forms['dates'].elements['date_createdon'].value=''; return true;">[+lang.DM_clear_date+]</a>
<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>
</td>
</tr>
<tr>
<td><label for="date_editedon" id="date_editedon_label">[+lang.DM_date_editedon+]</label></td>
<td>
<input type="text" id="date_editedon" class="DatePicker" name="date_editedon" />
<a href="#" onclick="document.forms['dates'].elements['date_editedon'].value=''; return true;">[+lang.DM_clear_date+]</a>
<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>
</td>
</tr>
</table>
</form>


<br />
<h3>[+lang.DM_other_header+]</h3>
<h3><i class="fa fa-sliders" aria-hidden="true"></i> [+lang.DM_other_header+]</h3>
<br />
<p>[+lang.DM_misc_desc+]</p><br />
<form style="margin-left:50px;" name="other" method="post" action="">
<form name="other" method="post" action="">
<input type="hidden" id="option1" name="option1" value="[+lang.DM_other_publish_radio1+]" />
<input type="hidden" id="option2" name="option2" value="[+lang.DM_other_publish_radio2+]" />
<input type="hidden" id="option3" name="option3" value="[+lang.DM_other_show_radio1+]" />
Expand Down
9 changes: 6 additions & 3 deletions assets/modules/store/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ function get_version($text){
}

static function parse($tpl,$field){
global $modx;
foreach($field as $key=>$value) $tpl = str_replace('[+'.$key.'+]',$value,$tpl);
return $tpl;
$evtOut = $modx->invokeEvent('OnManagerMainFrameHeaderHTMLBlock');
$onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : '';
$tpl = str_replace('[+onManagerMainFrameHeaderHTMLBlock+]',$onManagerMainFrameHeaderHTMLBlock,$tpl);
return $tpl;
}

function tpl($file){
function tpl($file){
$lang = $this->lang;
ob_start();
include($file);
Expand Down
1 change: 1 addition & 0 deletions assets/modules/store/template/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script src="[+site_url+]/assets/modules/store/js/store.js" type="text/javascript"></script>
<script type="text/javascript" src="[+site_url+]/assets/modules/store/js/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="[+site_url+]/assets/modules/store/js/fancybox/jquery.fancybox.pack.js"></script>
[+onManagerMainFrameHeaderHTMLBlock+]
</head>
<body>
<h1 class="pagetitle">
Expand Down
16 changes: 8 additions & 8 deletions assets/plugins/elementsintree/includes/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

function renderLockIcon($elmTable, $id)
{
global $modx, $_lang, $_style;
global $modx;

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

function getLockedByUser($lockType,$rowLock,$id) {
global $modx,$_lang,$_style;
global $modx,$_lang,$_style;
$ph = array();
$ph['element_type'] = $_lang['lock_element_type_'.$lockType];
$ph['firsthit_df'] = $rowLock['firsthit_df'];
$ph['lasthit_df'] = $rowLock['lasthit_df'];

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

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

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

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

$output .= '<div class="panel-group"><div class="panel panel-default" id="tree_site_modules">';
Expand Down
2 changes: 1 addition & 1 deletion assets/plugins/filesource/plugin.filesource.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
mE12 = new Element("td",{"align":"left","styles":{"padding-top":"14px"}});
mE122 = new Element("input",{"name":"filebinding","type":"text","maxlength":"75","value":"'.$content['file_binding'].'","class":"inputBox","styles":{"width":"300px"},"events":{"change":function(){documentDirty=true;}}});
mE11.appendText("' . _lang('Static file path') . ':");
mE11.appendText("' . _lang('Static file path') . '");
mE11.inject(mE1);
mE122.inject(mE12);
mE12.inject(mE1);
Expand Down
21 changes: 10 additions & 11 deletions assets/plugins/forgotmanagerlogin/plugin.forgotmanagerlogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,28 @@ function getUser($user_id=false, $username='', $email='', $hash='') {
$hash = $modx->db->escape($hash);
$tbl_manager_users = $modx->getFullTableName('manager_users');
$tbl_user_attributes = $modx->getFullTableName('user_attributes');
$tbl_active_users = $modx->getFullTableName('active_users');

$site_id = $modx->config['site_id'];
// $site_id = $modx->config['site_id'];
$today = date('Yz'); // Year and day of the year
$wheres = array();
$where = '';
$user = null;

if($user_id !== false) { $wheres[] = "usr.id='{$user_id}'"; }
if(!empty($username)) { $wheres[] = "usr.username='{$username}'"; }
if(!empty($email)) { $wheres[] = "attr.email='{$email}'"; }
if(!empty($hash)) { $wheres[] = "MD5(CONCAT(auser.lasthit,usr.password))='{$hash}'"; }

if(!empty($hash)) { $wheres[] = "MD5(CONCAT('{$today}',attr.lastlogin,usr.password))='{$hash}'"; }
$wheres[] = "attr.lastlogin > 0";

if($wheres) {
$result = $modx->db->select(
"usr.id, usr.username, attr.email, MD5(CONCAT(auser.lasthit,usr.password)) AS hash",
"usr.id, usr.username, attr.email, MD5(CONCAT('{$today}',attr.lastlogin,usr.password)) AS hash",
"{$tbl_manager_users} usr
INNER JOIN {$tbl_user_attributes} attr ON usr.id=attr.internalKey
INNER JOIN {$tbl_active_users} auser ON usr.username=auser.username",
INNER JOIN {$tbl_user_attributes} attr ON usr.id=attr.internalKey",
implode(' AND ',$wheres),
"",
1
);
$user = $modx->db->getRow($result);
);
$user = $modx->db->getRow($result);
}

if($user == null) { $this->errors[] = $_lang['could_not_find_user']; }
Expand Down Expand Up @@ -159,7 +157,7 @@ function getErrorOutput() {
$output = $forgot->getForm();
break;
case 'send_email':
if($forgot->sendEmail($to)) { $output = $_lang['email_sent']; }
if($forgot->sendEmail($to)) { $output = '<p><b>'.$_lang['email_sent'].'</b></p>'; }
break;
default:
$output = $forgot->getLink();
Expand All @@ -182,6 +180,7 @@ function getErrorOutput() {
if(isset($_REQUEST['captcha_code']) && !empty($_REQUEST['captcha_code']))
$_SESSION['veriword'] = $_REQUEST['captcha_code'];
$output = true;
$_SESSION['onLoginForwardToAction'] = 28; // action "change password"
}
else $output = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
font: 12px/1.2em Verdana,Helvetica,sans-serif !important;
}

.ddMultipleField input {height: 1.2em;}
.ddMultipleField input {height: 2em;}

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

Expand Down Expand Up @@ -121,4 +121,4 @@
padding: 0.05em 0.15em;
text-align: center;
vertical-align: super;
}
}
18 changes: 18 additions & 0 deletions assets/plugins/qm/qm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ function Run() {
}

// Insert jQuery and ColorBox in head if needed
$head = '';
if ($this->loadfrontendjq == 'true') $head .= '<script src="'.$this->modx->config['site_url'].$this->jqpath.'" type="text/javascript"></script>';
if ($this->loadtb == 'true') {
$head .= '
Expand Down Expand Up @@ -613,6 +614,23 @@ function getCookie(cookieName)
</script>
';

$head .= "
<script>
// Assure keeping session and related locks alive
$(document).ready(function($) {
function updateMODXsession() {
$.ajax({ url: '".MODX_MANAGER_URL."index.php', method:'post', data:{'updateMsgCount':true},
success: function(data) {},
complete: function() {
setTimeout(updateMODXsession, ". ($this->modx->config['mail_check_timeperiod'] * 1000) .");
}
});
}
setTimeout(updateMODXsession, ". ($this->modx->config['mail_check_timeperiod'] * 1000) .");
});
</script>
";

// Insert QM+ css in head
$head .= $css;
Expand Down
Loading

0 comments on commit 41267f9

Please sign in to comment.