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 | |
/** | |
* Proof of Concept of PDF to image conversion, working in MODX Cloud | |
*/ | |
$file = $scriptProperties['file']; | |
$targetFolder = $modx->getOption('target', $scriptProperties, '/assets/images'); | |
$fullTargetFolderPath = MODX_BASE_PATH . $targetFolder; | |
if (!preg_match("/\.pdf$/", $file)) { |
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
# Pass robots.txt requests to MODX unless the hostname matches modxcloud.com | |
# Note: robots.txt files on the filesystem will be completely ignored | |
set $roboloco "@modx-rewrite"; | |
if ($host ~* modxcloud\.com) { | |
set $roboloco "@robots-disallow"; | |
} | |
location ~ ^/robots\.txt$ { | |
try_files foobar $roboloco; | |
} |
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 | |
/** | |
* SimpleSearch | |
* | |
* Copyright 2010-11 by Shaun McCormick <[email protected]> | |
* | |
* This file is part of SimpleSearch, a simple search component for MODx | |
* Revolution. It is loosely based off of AjaxSearch for MODx Evolution by | |
* coroico/kylej, minus the ajax. | |
* |
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
location ~ ^/i/(.*) { | |
error_log /c0324/log/image.log notice; | |
rewrite_log on; | |
set $phptfn $1; | |
rewrite ^(.*?)\/w\/(\d+)\/(.*)$ $1/$3?w=$2&$args; | |
rewrite ^(.*?)\/h\/(\d+)\/(.*)$ $1/$3?h=$2&$args; | |
rewrite ^(.*?)\/new\/(\d+)\/(.*)$ $1/$3?new=$2&$args; | |
rewrite ^(.*?)\/wp\/(\d+)\/(.*)$ $1/$3?wp=$2&$args; | |
rewrite ^(.*?)\/hp\/(\d+)\/(.*)$ $1/$3?hp=$2&$args; | |
rewrite ^(.*?)\/w1\/(\d+)\/(.*)$ $1/$3?w1=$2&$args; |
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
# Adaptive-Images rewrite | |
# this example bypasses requests for any images in the root assets and ai-cache folders | |
rewrite ^/(?!assets|ai-cache).*\.(jpe?g|gif|png)$ /adaptive-images.php last; | |
location / { | |
try_files $uri $uri/ @modx-rewrite; | |
} |
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($modx->context->get('key') != "mgr"){ | |
/* grab the current langauge from the cultureKey request var */ | |
switch ($_REQUEST['cultureKey']) { | |
case 'en': | |
/* switch the context */ | |
$modx->switchContext('en'); | |
break; | |
default: | |
/* Set the default context here */ |
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 | |
/** | |
* plugin fragment for setting width of MODX Manager left panel | |
*/ | |
if($modx->event->name == 'OnBeforeManagerPageInit') { | |
// update layout manager state | |
$state = $modx->controller->getDefaultState(); | |
$state['modx-leftbar-tabs']['width'] = 525; | |
$response = $modx->runProcessor('system/registry/register/send',array( | |
'register' => 'state', |
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
<select name="mySelect" id="mySelectId" onchange="el=document.getElementById('mySelectId');u=el.options[el.selectedIndex].value;if(u!=''){window.location.href=u;}"> | |
[[getResources? &parents=`0` &tpl=`selectOption.tpl`]] | |
</select> |
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
--------------- core/components/migx/elements/tv/input/migx.php --------------- | |
index 11a9c2d..53370a5 100644 | |
@@ -133,6 +133,7 @@ $lang = $this->xpdo->lexicon->fetch(); | |
$lang['mig_add'] = !empty($properties['btntext'])?$properties['btntext']:$lang['mig_add']; | |
$modx->smarty->assign('i18n', $lang); | |
$this->xpdo->smarty->assign('properties', $properties); | |
+$this->xpdo->smarty->assign('resource', is_object($this->xpdo->resource) ? $this->xpdo->resource->toArray() : array()); | |
$this->xpdo->smarty->assign('pathconfigs', $this->xpdo->toJSON($pathconfigs)); | |
$this->xpdo->smarty->assign('columns', $this->xpdo->toJSON($cols)); | |
$this->xpdo->smarty->assign('fields', $this->xpdo->toJSON($fields)); |
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 ($modx->event->name == 'OnManagerPageInit') { | |
$script = <<<SCRIPT | |
<script type="text/javascript"> | |
Ext.ComponentMgr.onAvailable('modx-panel-resource', function(){ | |
Ext.getCmp('modx-panel-resource').on('ready', function(){ | |
window.setTimeout(function(){Ext.getCmp('modx-panel-resource').markDirty()}, 250); | |
}) | |
}) | |
</script> |
NewerOlder