Use a fqn prefix for modTransport classes:
$modx->getTableName('modTransportPackage')
to
// This utility method allows downloading files with a failure and a success callback. | |
// It uses the following setting in the fields property: | |
// | |
// Key | Default | Description | |
// ------- | ------------------------- | ----------- | |
// url | MODx.config.connector_url | The connector url | |
// timeout | 30 | Set a polling timeout | |
// debug | false | Log the polling in the console | |
// params | {} | Additional params for the connector url | |
// success | null | Callback called after a successful download, |
<?php | |
/** | |
* Use the cbGetLayoutSettings snippet to get a templated list of settings from a particular layout. | |
* Based on cbGetLayoutSetting snippet https://gist.github.com/sepiariver/302ab3cc7bd47233f0136f4379de89cf | |
* | |
* @param (id) &resource allows checking for fields on other resources. | |
* @param (bool) &showDebug return debugging info as JSON. | |
* @param (string) &toPlaceholder set a placeholder with this string as key, instead of returning. | |
* @param (int) &layout - (required) ID of ContentBlocks layout from which to fetch the settings. | |
* @param (string) &tpl - name of chunk for templating the settings of one layout. |
<?php | |
$selectField = $modx->getOption('emailSelectField', $scriptProperties, 'department'); | |
$selectTo = $modx->getOption('emailSelectTo', $scriptProperties, ''); | |
$selectTo = ($selectTo) ? explode(',', $selectTo) : array(); | |
if ($selectField && $selectTo) { | |
$selected = intval($hook->getValue($selectField)) - 1; | |
if ($selected && isset($selectTo[$selected])) { | |
$hook->formit->config['emailTo'] = $selectTo[$selected]; | |
} |
<?php | |
/** | |
* Resolve access permissions | |
* | |
* @package sample | |
* @subpackage build | |
* | |
* @var mixed $object | |
* @var array $options | |
*/ |
/** | |
* Load data from URL with curl | |
* | |
* @param $url | |
* @return mixed | |
*/ | |
public function loadData($url) | |
{ | |
$curloptHeader = false; |
<?php | |
/** | |
* RedirectByValue | |
* | |
* Copyright 2016 by Thomas Jakobi <[email protected]> | |
* | |
* Description: | |
* This FormIt Hook redirects to different targets on base of the | |
* formItRedirectByValue property. The property has to contain a json encoded | |
* object of fieldnames, values, redirects and redirect parameters. Only a |