X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fadmin%2Fedit.php;h=510c70a9a8780ec0b4b6638671226a236e7a6691;hb=f3a0e7f138048b6d78f2a659754437870f75e0fc;hp=a0991073b0d0ab391f7282d0c83d532f0dea17fa;hpb=6855525e48fad5de270500a5445c4f4ff85d8bda;p=diogenes.git diff --git a/include/admin/edit.php b/include/admin/edit.php index a099107..510c70a 100644 --- a/include/admin/edit.php +++ b/include/admin/edit.php @@ -27,6 +27,14 @@ $myfile = $bbarrel->spool->spoolPath($dir,$file); $action = isset($_REQUEST["action"]) ? $_REQUEST["action"] : ""; switch($action) { +case "set_stylesheet": + if (isset($_REQUEST['preset_style_sheet'])) { + $sheet = $_REQUEST['preset_style_sheet']; + $page->info(__("Copying style sheet") . " $sheet.css"); + $rcs->commit($dir,$file,file_get_contents("{$globals->root}/styles/$sheet.css"), "replaced by $sheet.css"); + } + break; + case "update": // update the current file with form contents if (isset($_REQUEST['file_content'])) { @@ -49,8 +57,16 @@ $page->assign('msg_log',__("log message")); $page->assign('file_content',htmlspecialchars(file_get_contents($myfile), ENT_NOQUOTES)); $page->assign('submit',__("Submit")); +// menu for stylesheet replacement +if ($file == $globals->cssfile) { + $page->assign('style_sheets', $globals->style_sheets); + $page->assign('preset_style_sheet', $globals->barrel_style_sheet); + $page->assign('msg_set_stylesheet', __("replace by a preset style sheet")); + $page->assign('msg_replace',__("Replace")); +} + // top toolbar -$page->toolbar(__("Page"), $bpage->make_toolbar()); +$page->toolbar(__("Page"), $bpage->make_toolbar($page)); $page->toolbar(__("File"), $bfile->make_toolbar(true)); $page->display('admin-edit.tpl'); ?>