Source of file ExtendedConfigActions.php
Size: 1,133 Bytes - Last Modified: 2021-12-23T10:02:03+00:00
/var/www/docs.ssmods.com/process/src/code/extensions/ExtendedConfigActions.php
12345678910111213141516171819202122232425262728293031323334353637 | <?php /** * Created by PhpStorm. * User: Julian Scheuchenzuber <js@lvl51.de> * Date: 11.08.15 * Time: 21:08 */ class ExtendedConfigActions extends Extension { /** * Loads the contents of the specified location. * @param $data * @param $form * @return mixed * @throws ValidationException * @throws null */ public function loadProfile($data, $form) { // Set update flag and save $sC = SiteConfig::current_site_config(); $form->saveInto($sC); $sC->TripAdvisorLastUpdate = SS_Datetime::now()->getValue(); $sC->write(); // New TripAdvisor service $service = new TripAdvisorService(); // Delete old data and fetch new $service->getLocationProfile(true); // Set response $this->owner->response->addHeader('X-Status', rawurlencode(_t('ExtendedConfigActions.SYNCED_PROFILE', 'Synced TripAdvisor profile "{location}".', null, array( 'location' => TripAdvisorLocation::current()->Name )))); return $this->owner->getResponseNegotiator()->respond($this->owner->request); } } |