templator->getSourceContent($name); $name = $file['f']; } if (preg_match('/^category-(.+).html$/', $name, $cat_id)) { $category = dcCore::app()->blog->getCategory($cat_id[1]); $full_name = ''; $cat_parents = dcCore::app()->blog->getCategoryParents($cat_id[1]); while ($cat_parents->fetch()) { $full_name = $cat_parents->cat_title . ' › '; }; $full_name = $full_name . dcCore::app()->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']; dcCore::app()->templator->writeTpl($file['f'], $file['c']); } } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } ?> <?php echo __('Templator'); ?> ' . html::escapeHTML(dcCore::app()->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 '

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

'; } else { echo '

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

'; } echo '
'; } ?>