Skip to content

Commit

Permalink
Dev: added a way to update option mode on update
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 5, 2018
1 parent 75b5110 commit 0ec0b3b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions application/models/TemplateConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,25 @@ public function getHasOptionPage()
return true;
}

/**
* Turn ON a given option at global setting level (survey level not affected)
* Will be used to turn ON ajax mode on update.
*/
public function setGlobalOptionOn($optionName="ajaxmode")
{

if ($this->options != 'inherit') {
$oOptions = json_decode($this->options);

if ($oOptions->$optionName === "off" && empty($this->sid)){
$oOptions->$optionName = "on";
$sOptions = json_encode($oOptions);
$this->options = $sOptions;
$this->save();
}
}
}

private function _filterImages($file)
{
$imagePath = (file_exists($this->filesPath.$file['name']))
Expand Down

0 comments on commit 0ec0b3b

Please sign in to comment.