SSH into the primary clouds as the cXXXX user, then run the following commands:
> cd www
> curl http://modx.co/scripts/install.sh | sh
> source ~/.profile
<?php | |
$doc = $modx->newObject('modResource'); | |
$doc->set('createdby', $modx->user->get('id')); | |
$allFormFields = $hook->getValues(); | |
foreach ($allFormFields as $field=>$value) | |
{ | |
$doc->set($field, $value); | |
} |
<?php | |
/* Based on https://gist.github.com/OptimusCrime/dac5deec0d65872740c9d7bccdc5e336 | |
** Add system setting named "max_image_dimension" to set a max height or width for images | |
*/ | |
if(!function_exists(autoRotateImage)) { | |
function autoRotateImage($image,$max_image_dimension = 0) { | |
$orientation = $image->getImageOrientation(); | |
switch($orientation) { | |
case imagick::ORIENTATION_BOTTOMRIGHT: |
devices: ( | |
{ | |
name: "Wireless Mouse MX Master 2S"; | |
smartshift: | |
{ | |
# Do not enable free scroll | |
on: true; | |
threshold: 15; # 7 is ideal for work | |
}; | |
hiresscroll: |
<?php | |
//** On WebPage Pre-Render **// | |
$corePath = $modx->getOption('preview.core_path', null, $modx->getOption('core_path') . 'components/preview/'); | |
require_once $corePath . '/model/preview/preview.class.php'; | |
$preview = new Preview($modx); | |
if(!$modx->user->hasSessionContext('mgr')) return; // currently forcing manager context | |
if(!$modx->getOption('preview.frontendEnabled')) return; // currently forcing manager context | |
$qsItem = $modx->getOption('preview.previewKey'); | |
$compareItem = $modx->getOption('preview.compareKey'); |
<?php | |
$fields = $hook->getValues(); | |
$emailTo = $hook->formit->config['emailTo']; | |
if(strpos($emailTo,'[[+') !== false){ | |
$emailVar = str_replace('[[+','',$emailTo); | |
$emailVar = str_replace(']]','',$emailVar); | |
$hook->formit->config['emailTo'] = $fields[$emailVar]; | |
} | |
return true; |
<?php | |
/** | |
* Plugin to add a "created by" field on a resource form and moves "published on" to document tab | |
* | |
* @var modX $modx | |
* @var array $scriptProperties | |
* | |
* @event OnDocFormPrerender | |
*/ | |
$dateFormat = $modx->getOption('manager_date_format',null,'d.m.Y'); |
<?php | |
switch ($modx->event->name) { | |
case "OnFileManagerUpload": | |
if(!empty($files)){ | |
foreach($files as $file){ | |
$path = $directory . $source->sanitizePath($file['name']); | |
$object = $source->getObjectContents($path); | |
if(empty($object) || empty($object['mime']) || empty($object['content'])) continue; | |
switch($object['mime']) { | |
case 'image/svg': |
<?php | |
$base_path = dirname(__FILE__) . '/content/'; | |
if($_GET['q']) { | |
$q = explode('?', $_GET['q']); | |
$file_check = $base_path.preg_replace('"\.html$"', '.php', $q[0]); | |
if (substr($file_check, -1) == "/") { | |
$file_check .= "index.php"; | |
} |