Skip to content

Instantly share code, notes, and snippets.

@pepebe
Created March 31, 2014 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pepebe/9888881 to your computer and use it in GitHub Desktop.
Save pepebe/9888881 to your computer and use it in GitHub Desktop.
Hide tree if url paramter qe == 1
<?php
/*
Modx Manager Plugin
info@pepebe.de
Description: Hide tree on the left side if url paramter qe == 1
Usage: add &qe = 1 to your quickedit links
Example link: manager/index.php?a=30&id=51&qe=1
Event(s): onDocFormPrerender
*/
$html = "";
$html .= "<script>";
$html .= " Ext.onReady(function() {";
$html .= " q = window.location.search.substring(1);";
$html .= " o = Ext.urlDecode(q);";
$html .= " if(o.qe == 1){";
$html .= " Ext.getCmp('modx-layout').hideLeftbar();";
$html .= " }";
$html .= " });";
$html .= "</script>";
$modx->regClientStartupHTMLBlock($html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment