Created
February 2, 2016 05:48
-
-
Save sergant210/c730268134fe84cbdec0 to your computer and use it in GitHub Desktop.
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 | |
$oneBooking = $modx->getService('onebooking','oneBooking',$modx->getOption('core_path').'components/onebooking/model/onebooking/', $scriptProperties); | |
if (!($oneBooking instanceof oneBooking)) return ''; | |
$included = array(); | |
if (!empty($scriptProperties['fields'])) { | |
$included = explode(',',$scriptProperties['fields']); | |
array_walk($included,'trim'); | |
} | |
$fields = false; | |
foreach($oneBooking->extras as $name=>$data) { | |
if ($included && !in_array($name,$included)) { | |
$fields[$name] = ''; | |
} else { | |
$fields[$name] = $data['field']; | |
} | |
} | |
if ($fields) $modx->setPlaceholders($fields,'ob.'); | |
return ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment