templator->getSourceContent($name); $name = $file['f']; } if (preg_match('/^category-(.+).html$/',$name,$cat_id)) { $category = $core->blog->getCategory($cat_id[1]); $full_name = ''; $cat_parents = $core->blog->getCategoryParents($cat_id[1]); while ($cat_parents->fetch()) {$full_name = $cat_parents->cat_title.' › ';}; $full_name = $full_name.$core->blog->getCategory($cat_id)->cat_title; $name .= ' ('.$full_name.$category->cat_title.')'; } } catch (Exception $e) { $file = $file_default; throw $e; } # Write file if (!empty($_POST['write'])) { $file['c'] = $_POST['file_content']; $core->templator->writeTpl($file['f'],$file['c']); } } catch (Exception $e) { $core->error->add($e->getMessage()); } ?> <?php echo __('Templator'); ?> '.html::escapeHTML($core->blog->name).' › '.__('Supplementary templates').''.__('Edit the template').''; if (($file['c'] !== null)) { echo '
'. '
'. '
'.__('File editor').''. '

'.sprintf(__('Editing file %s'),''.$name).'

'. '

'.form::textarea('file_content',72,30,html::escapeHTML($file['c']),'maximal','',!$file['w']).'

'; if ($file['w']) { echo '

'. $core->formNonce(). form::hidden(array('file_id'),html::escapeHTML($file['f'])). '

'; } else { echo '

'.__('This file is not writable. Please check your files permissions.').'

'; } echo '
'; } ?>