This file contains hidden or 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 | |
// config settings | |
$server = $hook->formit->config['server']; | |
$server = (!empty($server)) ? $server : 'https://www.modx.com'; | |
$formname = $hook->formit->config['formname']; | |
$formname = (!empty($formname)) ? $formname : ''; | |
$resultTpl = $hook->formit->config['resultTpl']; | |
$toPlaceholder = $hook->formit->config['toPlaceholder']; |
This file contains hidden or 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 | |
$svg_file = $modx->getOption('file',$scriptProperties, ''); | |
$svg_id = $modx->getOption('id',$scriptProperties,'mySVGId'); | |
$svg_class = $modx->getOption('class',$scriptProperties,'mySVGClass'); | |
$svg_name = $modx->getOption('name',$scriptProperties,'SVG'); | |
$svg_height = $modx->getOption('height',$scriptProperties,'440px'); | |
$svg_width = $modx->getOption('width',$scriptProperties,'440px'); | |
$svg_background_color = $modx->getOption('background_color',$scriptProperties,'transparent'); | |
$svg_svgstyle = $modx->getOption('svgstyle',$scriptProperties,'top:2px;position:inherit;'); |
This file contains hidden or 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 | |
// config settings | |
$server = $hook->formit->config['server']; | |
$server = (!empty($server)) ? $server : 'http://www.apiwebhook.com/rest/'; | |
$formname = $hook->formit->config['formname']; | |
$resultTpl = $hook->formit->config['resultTpl']; | |
$toPlaceholder = $hook->formit->config['toPlaceholder']; | |
// from system settings |
This file contains hidden or 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 | |
$url = $modx->getOption('url',$scriptProperties,'https://www.google.com'); | |
$elementId = $modx->getOption('elementId',$scriptProperties,'hplogo'); | |
$formatted = $modx->getOption('formatted',$scriptProperties,true); | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); |
This file contains hidden or 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 | |
$years = floor($input/12); | |
$months = $input%12; | |
$yearsDisplay = $years.($years > 1 ? ' years' : ' year'); | |
if($years == 0) { | |
$yearsDisplay = ''; | |
} | |
$monthsDisplay = $months.($months > 1 ? ' months' : ' month'); | |
if($months == 0) { |
This file contains hidden or 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 | |
$fileIn = $hook->formit->config['fileIn']; | |
$fileOut = $hook->formit->config['fileOut']; | |
$fileInPath = $modx->config['base_path'].$fileIn; | |
$fileOutPath = $modx->config['base_path'].$fileOut; | |
$formData = $hook->getValues(); | |
// FDF header section |
This file contains hidden or 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 | |
$setting = $modx->getOption('setting', $scriptProperties); | |
$value = $modx->getOption('value', $scriptProperties); | |
$systemSetting = $modx->getObject('modSystemSetting', $setting); | |
$systemSetting->set('value',$value); | |
$systemSetting->save(); | |
$modx->reloadConfig(); | |
return true; |
This file contains hidden or 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 | |
$content = $modx->getOption('content', $scriptProperties, 'eof'); | |
$filename = $modx->getOption('filename', $scriptProperties, 'text.txt'); | |
$filedir = $modx->getOption('filedir', $scriptProperties, 'assets'); | |
$append = $modx->getOption('append', $scriptProperties, false); | |
$fopen = "w"; | |
if ($append > 0){ | |
$fopen = "a"; | |
}; |
This file contains hidden or 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 | |
// [[!WebHook? &secret=`dh730>soteW` &runsnippet=`updateSettings` ¶ms=`setting=savings`]] | |
$mySecret = $modx->getOption('secret', $scriptProperties); | |
$mySnippet = $modx->getOption('runsnippet', $scriptProperties); | |
$myParams = $modx->getOption('params', $scriptProperties); | |
$achunks = array_chunk(preg_split('/(=|,)/', $myParams), 2); | |
$myParams = array_combine(array_column($achunks, 0), array_column($achunks, 1)); | |
$webhookContent = ""; |
This file contains hidden or 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 | |
return substr($input, 0, strpos($input, $options)); |