Last active
December 15, 2015 23:19
-
-
Save DavidOliver/5339113 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 | |
require_once(TOOLKIT . '/class.datasource.php'); | |
Class datasourcetour_l_current_presentation_images extends SectionDatasource{ | |
public $dsParamROOTELEMENT = 'tour-l-current-presentation-images'; | |
public $dsParamORDER = 'asc'; | |
public $dsParamPAGINATERESULTS = 'yes'; | |
public $dsParamLIMIT = '1'; | |
public $dsParamSTARTPAGE = '1'; | |
public $dsParamREDIRECTONEMPTY = 'no'; | |
public $dsParamSORT = 'system:id'; | |
public $dsParamASSOCIATEDENTRYCOUNTS = 'no'; | |
public $dsParamFILTERS = array( | |
'279' => '{$tour:0}', | |
'282' => 'en' | |
); | |
public function __construct($env=NULL, $process_params=true){ | |
parent::__construct($env, $process_params); | |
$this->_dependencies = array('$ds-tour-l-current.system-id'); | |
} | |
public function about(){ | |
return array( | |
'name' => 'Tour (L) (current): Presentation images', | |
'author' => array( | |
'name' => 'David Oliver', | |
'website' => '', | |
'email' => ''), | |
'version' => 'Symphony 2.3', | |
'release-date' => '2013-03-04T18:56:58+00:00' | |
); | |
} | |
public function getSource(){ | |
return '57'; | |
} | |
public function allowEditorToParse(){ | |
return false; | |
} | |
public function execute(array &$param_pool) { | |
$result = new XMLElement('tour-l-current-presentation-images'); | |
foreach(scandir(WORKSPACE . '/uploads/tours/presentations/by-tours-l/' . $param_pool['ds-tour-l-current.system-id'][0]) as $file) { | |
if (preg_match('#\.png$#', $file)) { | |
$result->appendChild(new XMLElement('image', $file)); | |
} | |
} | |
return $result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment