2 require_once 'diogenes.common.inc.php';
3 require_once 'diogenes.toplevel.inc.php';
4 require_once 'diogenes/diogenes.table-editor.inc.php';
7 $page = new $globals->toplevel(true
);
8 $page->assign("greeting",__("Global options"));
9 $page->toolbar(__("Mode"), array( array( __("standard"), "options.php" ), __("expert")));
11 $action = isset($_REQUEST['action']) ?
$_REQUEST['action'] : "";
15 $page->info("converting spool from CVS to RCS..");
16 $res = $globals->db
->query("select alias from diogenes_site");
17 while(list($site) = mysql_fetch_row($res)) {
18 $page->info("processing '$site'..");
19 $spool = new DiogenesSpool($page,$site);
20 $page->info("-> deleting 'CVS' subdirectories from spool..");
21 $goners = System
::find($spool->datadir
.' -type d');
22 foreach($goners as $goner) {
23 if (basename($goner) == "CVS")
24 System
::rm("-r $goner");
26 $page->info("-> changing files in spool to read-only..");
27 $modfiles = System
::find($spool->datadir
.' -type f');
28 foreach($modfiles as $modfile) {
32 $globals->updateOption("rcs","DiogenesRcs");
36 $page->info("converting spool from RCS to CVS..");
37 if (!is_dir("{$globals->rcsroot}/CVSROOT")) {
38 $page->info("-> no CVSROOT not found, running init..");
39 if ($ret = shell_exec(escapeshellcmd("cvs -d".escapeshellarg($globals->rcsroot
)." init")))
43 // remove current spool dirs and do a clean checkout of each site
44 $res = $globals->db
->query("select alias from diogenes_site");
45 while(list($site) = mysql_fetch_row($res)) {
46 $page->info("processing '$site'..");
47 $page->info("-> removing '{$globals->spoolroot}/$site'..");
48 System
::rm("-r {$globals->spoolroot}/$site");
49 $page->info("-> doing a checkout of module '$site'..");
50 $spool = new DiogenesCvs($page,$site,$_SESSION['session']->username
,true
);
52 $globals->updateOption("rcs","DiogenesCvs");
56 $page->assign('msg_convert',__("Convert"));
57 $page->assign('msg_vcs',__("version control system"));
59 switch ($globals->rcs
) {
61 $page->assign('msg_current_vcs',__("You are currently using RCS as the version control system for your barrels."));
62 $page->append('conversions',array("rcs-cvs", __("You can switch to a full CVS repository by clicking here.")));
66 $page->assign('msg_current_vcs',__("You are currently using CVS as the version control system for your barrels."));
67 $page->append('conversions',array("cvs-rcs", __("You can switch back to RCS by clicking here.")));
73 $editor = new DiogenesTableEditor($globals->table_global_options
,"name",true
);
74 $editor->add_where_condition("barrel=''");
75 $editor->hide('barrel', '');
76 $editor->describe("name", __("option"), false
);
77 $editor->describe("value", __("value"), true
);
80 $editor->table_style
= "width:80%";
81 $editor->run($page,'editor_content');
83 $page->display('toplevel-options_expert.tpl');