Skip to content

Instantly share code, notes, and snippets.

@pepebe
pepebe / plugin.quickedit.php
Created March 31, 2014 09:45
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
<?php
/* forked from MikeRogers0/twitter-proxy.php */
/**
* Usage:
* Send the url you want to access url encoded in the url paramater, for example (This is with JS):
* /twitter-proxy.php?url='+encodeURIComponent('statuses/user_timeline.json?screen_name=MikeRogers0&count=2')
*/
@pepebe
pepebe / youtubeid.snippet.php
Created April 10, 2014 09:42
Grab youtube id from any anything possibly inserted into youtube text tv
<?php
preg_match('#(\.be/|/embed/|/v/|/watch\?v=)([A-Za-z0-9_-]{5,11})#', $iframe, $matches);
if(isset($matches[2]) && $matches[2] != ''){
$youtubeID = $matches[2];
}
$modx->setPlaceholder($ph,$youtubeID);
return;
<?php
class videoThumb {
var $config;
function __construct($config = array()) {
$this->config = array_merge(array(
'imagesPath' => dirname(__FILE__) . '/images/'
,'imagesUrl' => '/images/'
var content = '';
content += '<h3>Hinweise</h3>';
content += '<p>Hinweistext</p>';
content += '<style>.hdkInfo-panel p {margin-bottom: 10px; line-height:1.6;} .hdkInfo-panel h4 {margin-top: 15px; margin-bottom: 5px;}</style>';
var hdkInfo = function(config) {
@pepebe
pepebe / hideTVs.plugin.php
Created April 15, 2014 13:06
Hide TVs from root resources in MODX Manager
<?php
/**
* Hide TVs for root elements...
*/
/* Set option(s) here */
$tvs_to_hide = '1,2';
/* ---------------------------------- */
@pepebe
pepebe / unzip.php
Created April 15, 2014 15:16
Unzip a package on your server from one directory into another one.
<?php
$filename = "";
if(empty($filename)){
$filename = basename($filename,'.zip');
$tmp_path = 'assets/tmp/';
$target_path = 'assets/tpl/';
$basepath = '/paas/cXXXX/www/'; /* Add your server path here... */
@pepebe
pepebe / gist:11168024
Created April 22, 2014 07:04 — forked from jpdevries/gist:5516772
Use phpthumbof in a cmp
$modAuth = $this->modx->user->getUserToken('mgr');
$thumbQuery = http_build_query(array(
'src' => $image['urlAbsolute'],
'w' => 360,
'h' => 270,
'HTTP_MODAUTH' => $modAuth,
//'f' => $thumbnailType,
'q' => 80,
'wctx' => 'mgr',
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@pepebe
pepebe / collections.grid.resources.js
Created May 6, 2014 09:06
Modified version of collections. Adds created on to the grid. 2do: add font awesome icons to each resource for each class_key
/*assets/components/collections/js/mgr/widgets/category/collections.grid.resources.js*/
Collections.grid.ContainerCollections = function(config) {
config = config || {};
this.sm = new Ext.grid.CheckboxSelectionModel();
Ext.applyIf(config,{
id: 'collections-grid-container-collections'
,title: _('collections.collections')
,url: Collections.connectorUrl
,autosave: true