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 #1183 from Deesen/develop
Browse files Browse the repository at this point in the history
Version-Notice: Added "improved debug-info", fixed "top.tree.setLastClickedElement() is undefined"
  • Loading branch information
Dmi3yy authored Jan 11, 2017
2 parents 0d60e42 + 230930a commit 252e3dd
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
11 changes: 11 additions & 0 deletions assets/templates/help/version_notices/1.2.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,14 @@
<p>Will get invoked before parsing a snippet-params string like <code>&amp;param1=`value`</code> to allow replacing custom-placeholders like EvoBabel´s <code>[%ph%]</code> before parsing a params-string. Example:<br/><br/><code>[[Wayfinder? &amp;startId=`[%lang%]` ..]]</code></p>
</li>
</ul>
<h1>Debug-Infos</h1>
<ul>
<li><strong>Improved Debug-Infos for <code>$modx->dumpSnippets</code> and <code>$modx->dumpPlugins</code></strong>
<p>To display infos for plugins/snippets create a plugin with the following code and activate event "OnWebPageInit":</p>
<pre>$e = & $modx->Event;
if ( $e->name == "OnWebPageInit" ) {
$modx->dumpSnippets=true;
$modx->dumpPlugins=true;
}</pre>
</li>
</ul>
10 changes: 7 additions & 3 deletions manager/actions/mutate_content.dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ function decode(s) {
return s;
}

function setLastClickedElement(type, id) {
localStorage.setItem('MODX_lastClickedElement', '['+type+','+id+']' );
}

<?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?>
var lastImageCtrl;
var lastFileCtrl;
Expand Down Expand Up @@ -641,10 +645,10 @@ function SetUrl(url, width, height, alt) {
<li id="Button6" class="disabled"><a href="#" onclick="duplicatedocument();"><img src="<?php echo $_style["icons_resource_duplicate"] ?>" alt="icons_resource_duplicate" /> <?php echo $_lang['duplicate']?></a></li>
<li id="Button3" class="disabled"><a href="#" onclick="deletedocument();"><img src="<?php echo $_style["icons_delete_document"] ?>" alt="icons_delete_document" /> <?php echo $_lang['delete']?></a></li>
<?php } else { ?>
<li id="Button6"><a href="#" onclick="top.tree.setLastClickedElement(0,0);duplicatedocument();"><img src="<?php echo $_style["icons_resource_duplicate"] ?>" alt="icons_resource_duplicate" /> <?php echo $_lang['duplicate']?></a></li>
<li id="Button3"><a href="#" onclick="top.tree.setLastClickedElement(0,0);deletedocument();"><img src="<?php echo $_style["icons_delete_document"] ?>" alt="icons_delete_document" /> <?php echo $_lang['delete']?></a></li>
<li id="Button6"><a href="#" onclick="setLastClickedElement(0,0);duplicatedocument();"><img src="<?php echo $_style["icons_resource_duplicate"] ?>" alt="icons_resource_duplicate" /> <?php echo $_lang['duplicate']?></a></li>
<li id="Button3"><a href="#" onclick="setLastClickedElement(0,0);deletedocument();"><img src="<?php echo $_style["icons_delete_document"] ?>" alt="icons_delete_document" /> <?php echo $_lang['delete']?></a></li>
<?php } ?>
<li id="Button5" class="transition"><a href="#" onclick="top.tree.setLastClickedElement(0,0);documentDirty=false;<?php echo $id==0 ? "document.location.href='index.php?a=2';" : "document.location.href='index.php?a=3&amp;r=1&amp;id=$id".htmlspecialchars($add_path)."';"?>"><img alt="icons_cancel" src="<?php echo $_style["icons_cancel"] ?>" /> <?php echo $_lang['cancel']?></a></li>
<li id="Button5" class="transition"><a href="#" onclick="setLastClickedElement(0,0);documentDirty=false;<?php echo $id==0 ? "document.location.href='index.php?a=2';" : "document.location.href='index.php?a=3&amp;r=1&amp;id=$id".htmlspecialchars($add_path)."';"?>"><img alt="icons_cancel" src="<?php echo $_style["icons_cancel"] ?>" /> <?php echo $_lang['cancel']?></a></li>
<li id="Button4"><a href="#" onclick="window.open('<?php echo $modx->makeUrl($id); ?>','previeWin');"><img alt="icons_preview_resource" src="<?php echo $_style["icons_preview_resource"] ?>" /> <?php echo $_lang['preview']?></a></li>
</ul>
</div>
Expand Down
4 changes: 4 additions & 0 deletions manager/frames/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ function NavToggle(element) {
// remove focus from top nav
if(element) element.blur();
}

function setLastClickedElement(type, id) {
localStorage.setItem('MODX_lastClickedElement', '['+type+','+id+']' );
}
</script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion manager/includes/menu.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function DrawSub($parentid,$level){
$ph['href'] = $value[3];
$ph['alt'] = $value[4];
$ph['target'] = $value[7];
$ph['onclick'] = 'top.tree.setLastClickedElement(0,0);'.$value[5];
$ph['onclick'] = 'setLastClickedElement(0,0);'.$value[5];
$ph['a_class'] = $this->get_a_class($id);
$ph['LinkAttr'] = $this->getLinkAttr($id);
$ph['itemName'] = $value[2] . $this->getItemName($id);
Expand Down

0 comments on commit 252e3dd

Please sign in to comment.