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 file is part of MODX Revolution. | |
* | |
* Copyright (c) MODX, LLC. All Rights Reserved. | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
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 | |
class TestcmpParsedManagerController extends modParsedManagerController | |
{ | |
public function getPageTitle() { | |
return 'Test CMP'; | |
} | |
public function process(array $scriptProperties = []) | |
{ |
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 | |
$options = isset($options) ? $options : 'htmlToBottom'; | |
$function = $modx->getOption('function', $scriptProperties, $options); | |
$plaintext = (strstr($input, PHP_EOL)) ? true : false; | |
switch ($function) { | |
case 'cssToHead': | |
$modx->regClientCSS($input); | |
break; | |
case 'htmlToHead': | |
$modx->regClientStartupHTMLBlock($input); |
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
on alfred_script(q) | |
tell application "Google Chrome" | |
set ActivePage to window 1 | |
set CallTab to make new tab at end of tabs of ActivePage | |
set URL of CallTab to "https://app.sipgate.com/" | |
delay 1 | |
set jscode to "function post(path, params, method) { method = method || 'post'; var form = document.createElement('form'); form.setAttribute('method', method); form.setAttribute('action', path); for(var key in params) { if(params.hasOwnProperty(key)) { var hiddenField = document.createElement('input'); hiddenField.setAttribute('type', 'hidden'); hiddenField.setAttribute('name', key); hiddenField.setAttribute('value', params[key]); form.appendChild(hiddenField); } } document.body.appendChild(form); form.submit(); } post('https://secure.live.sipgate.de/ajax-fast.php/account/click2dial/', {from: '2373479e0', to: '" & q & "'});" | |
execute front window's active tab javascript jscode | |
delay 1 |
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 | |
switch($modx->event->name) { | |
case 'OnFileManagerDirCreate': | |
$modx->log(modX::LOG_LEVEL_ERROR, 'fix folder permissions for: '.$directory.'/'); | |
chmod($directory.'/', octdec($modx->getOption('new_folder_permissions'))); | |
break; | |
case 'OnFileManagerFileCreate': | |
$modx->log(modX::LOG_LEVEL_ERROR, 'fix file permissions for: '.$path); | |
chmod($path, octdec($modx->getOption('new_file_permissions'))); | |
break; |
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 | |
switch ($modx->event->name) { | |
// "refresh cache" part | |
case 'OnContextSave': | |
case 'OnContextRemove': | |
case 'OnSiteRefresh': | |
$contexts = array(); | |
$cacheKey = 'xrouting_contextmap'; |
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
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
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
<? | |
$c = $modx->newQuery('modResource'); | |
$resources = $modx->getCollection('modResource', $c); | |
foreach ($resources as $res) { | |
$properties = $res->getProperties('contentblocks'); | |
if (empty($properties)) continue; | |
if (empty($properties['content'])) continue; |
NewerOlder