public function updateStructure($structure)
{
$originalData = $this->getPagesConfig();
$originalData['static-pages'] = $structure;
$yamlData = Yaml::render($originalData);
$filePath = $this->getConfigFilePath();
$dirPath = dirname($filePath);
if (!file_exists($dirPath) || !is_dir($dirPath)) {
if (!File::makeDirectory($dirPath, 0777, true, true)) {
throw new ApplicationException(Lang::get('cms::lang.cms_object.error_creating_directory', ['name' => $dirPath]));
}
}
if (@File::put($filePath, $yamlData) === false) {
throw new ApplicationException(Lang::get('cms::lang.cms_object.error_saving', ['name' => $filePath]));
}
}