diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php
index 07902c3bfa..6bdf526ea4 100644
--- a/assets/lib/class.modxRTEbridge.php
+++ b/assets/lib/class.modxRTEbridge.php
@@ -175,6 +175,12 @@ public function setPlaceholder($ph, $value)
}
}
+ // Function to get custom-placeholders
+ public function getPlaceholder($ph)
+ {
+ return isset($this->customPlaceholders[$ph]) ? $this->customPlaceholders[$ph] : NULL;
+ }
+
// Set new/overwrite translations manually (via bridge)
public function setLang($key, $string, $overwriteExisting = false)
{
@@ -205,6 +211,9 @@ public function getEditorScript()
$this->pluginParams['elements'] = !is_array($this->pluginParams['elements']) ? explode(',', $this->pluginParams['elements']) : $this->pluginParams['elements']; // Allow setting via plugin-configuration
+ // Allows bridging elements+TV-options etc before looping
+ $this->renderBridgeParams('initBridge');
+
// Now loop through tvs
foreach ($this->pluginParams['elements'] as $selector) {
@@ -286,21 +295,24 @@ public function initTheme($selector)
}
// Call bridge-functions and receive optional bridged-values
+ // $selector = "initBridge" allows executing bridging function without modifying $this->themeConfig
public function renderBridgeParams($selector)
{
// Call functions - for optional translation of params/values via bridge.xxxxxxxxxx.inc.php
foreach ($this->bridgeParams as $editorParam => $editorKey) {
if (is_callable($this->bridgeParams[$editorParam])) { // Call function, get return
- $return = $this->bridgeParams[$editorParam]();
- if ($return !== NULL && isset($this->themeConfig[$editorParam])) {
+ $return = $this->bridgeParams[$editorParam]($selector);
+ if ($return !== NULL && isset($this->themeConfig[$editorParam]) && $selector !== 'initBridge') {
$this->themeConfig[$editorParam]['bridged'] = $return;
}
}
}
// Load Tv-Options as bridged-params
- foreach($this->themeConfig as $key=>$conf) {
- if (isset($this->tvOptions[$selector][$key])) {
- $this->themeConfig[$key]['bridged'] = $this->tvOptions[$selector][$key];
+ if($selector !== 'initBridge') {
+ foreach ($this->themeConfig as $key => $conf) {
+ if (isset($this->tvOptions[$selector][$key])) {
+ $this->themeConfig[$key]['bridged'] = $this->tvOptions[$selector][$key];
+ }
}
}
}
diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php
index ecc93aa3fc..bbd9124990 100644
--- a/manager/actions/mutate_htmlsnippet.dynamic.php
+++ b/manager/actions/mutate_htmlsnippet.dynamic.php
@@ -177,7 +177,7 @@ function deletedocument() {
-
+
diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php
index 0897237601..e335d23dc7 100644
--- a/manager/actions/mutate_templates.dynamic.php
+++ b/manager/actions/mutate_templates.dynamic.php
@@ -223,8 +223,8 @@ function deletedocument() {
foreach($selectedTvs as $row) {
$desc = !empty($row['tvdescription']) ? ' ('.$row['tvdescription'].')' : '';
$locked = $row['tvlocked'] ? ' ('.$_lang['locked'].')' : "" ;
- $tvList .= sprintf('%s %s',
- $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $_lang['edit']);
+ $tvList .= sprintf('%s %s',
+ $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']);
}
$tvList .= '';
@@ -248,8 +248,8 @@ function deletedocument() {
$desc = !empty($row['tvdescription']) ? ' ('.$row['tvdescription'].')' : '';
$locked = $row['tvlocked'] ? ' ('.$_lang['locked'].')' : "" ;
- $tvList .= sprintf('%s %s',
- $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $_lang['edit']);
+ $tvList .= sprintf('%s %s',
+ $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $_lang['edit']);
$tvList .= '';
$preCat = $row['category'];
diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php
index 2407e7d3a9..89a1c9e6c7 100644
--- a/manager/actions/mutate_tmplvars.dynamic.php
+++ b/manager/actions/mutate_tmplvars.dynamic.php
@@ -8,6 +8,8 @@
}
$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
+$origin = isset($_REQUEST['or']) ? intval($_REQUEST['or']) : 76;
+$originId = isset($_REQUEST['oid']) ? intval($_REQUEST['oid']) : NULL;
$tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
$tbl_site_templates = $modx->getFullTableName('site_templates');
@@ -252,6 +254,8 @@ function decode(s){
?>
+
+
@@ -277,7 +281,7 @@ function decode(s){
" />
" />
-
" />
+
" />
diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php
index a4c3da64e9..43f2ff132f 100755
--- a/manager/processors/save_tmplvars.processor.php
+++ b/manager/processors/save_tmplvars.processor.php
@@ -15,6 +15,8 @@
$display = $modx->db->escape($_POST['display']);
$params = $modx->db->escape($_POST['params']);
$locked = $_POST['locked']=='on' ? 1 : 0 ;
+$origin = isset($_REQUEST['or']) ? intval($_REQUEST['or']) : 76;
+$originId = isset($_REQUEST['oid']) ? intval($_REQUEST['oid']) : NULL;
//Kyle Jaebker - added category support
if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
@@ -158,10 +160,10 @@
// finished emptying cache - redirect
if($_POST['stay']!='') {
$a = ($_POST['stay']=='2') ? "301&id=$id":"300";
- $header="Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
+ $header="Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']."&or=".$origin."&oid=".$originId;
header($header);
} else {
- $header="Location: index.php?a=76&r=2";
+ $header="Location: index.php?a=".$origin."&r=2".($originId!=NULL?'&id='.$originId:'');
header($header);
}