This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Usage [[!contextKey]] | |
* */ | |
return $modx->context->key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dashboard widget to show number of Manager messages | |
$id = $modx->user->get('id'); | |
$output = 'No messages.'; | |
$total = $modx->getCount('modUserMessage',array( | |
'recipient' => $id, | |
)); | |
if($total) { | |
$output = 'You have ' . $total . ' messages'; | |
$unread = $modx->getCount('modUserMessage',array( | |
'recipient' => $id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sample plugin to add a "createdby and createdon" field on a resource form | |
* Background: Issue #12305 "Adding createdon/createdby/publishedby/etc. to settings" | |
* https://github.com/modxcms/revolution/issues/12305 | |
* | |
* Original author: rtripaul | |
* Original source: https://gist.github.com/rtripault/7306c8487a39fd1ce0db5f334c99be57 | |
* | |
* @var modX $modx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.clearImageTV + .x-panel.modx-panel.x-panel-noborder{ | |
margin-left: 30px; | |
margin-top: -34px; | |
} | |
</style> | |
<div id="tvbrowser{$tv->id}"></div> | |
<div id="tv-image-{$tv->id}"><a class="clearImageTV" href="#" onclick="javascript:Ext.getCmp('tvbrowser{$tv->id}').setValue('');document.getElementById('tv{$tv->id}').value='';document.getElementById('tv-image-preview-{$tv->id}').getElementsByTagName('img')[0].remove();"><i class="icon icon-2x icon-trash-o"></i></i></a></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>[[*pagetitle]] - [[++site_name]]</title> | |
<base href="[[!++site_url]]" /> | |
<meta charset="[[++modx_charset]]" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> | |
<meta http-equiv="refresh" content="0; URL=https://artmetropol.tv/"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This snippet will edit/add a number of settings to modx_system_settings. | |
* The $settings array MUST contain all relevant information. | |
* Use the example below to create your own list of relevant settings. | |
* | |
* Updating settings | |
* ----------------- | |
* All settings allready present in the database are updated by this script. | |
* Keep in mind to send the correct type of data. So don't add "hello" to a key with xtype "combo-bolean". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
ppbCarousel returns ids of specific sibling resources. | |
It can be used to build prev next links. | |
If the current Resource is at the beginning or the end of the list, | |
prev and next will circle to the first or last element. | |
[[ppbCarousel? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
ppb_ImageInfo | |
v0.1 | |
2017-02-04 19:45 | |
by info@pepebe.de | |
This is a MODx snippet. Use it as an output filter or as a standard snippet: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists(autoRotateImage)) { | |
function autoRotateImage($image) { | |
$orientation = $image->getImageOrientation(); | |
switch($orientation) { | |
case imagick::ORIENTATION_BOTTOMRIGHT: | |
$image->rotateimage("#000", 180); // rotate 180 degrees | |
break; | |