".__("No Admin Menu Access")."

".__("Return to the Main Menu")."

"; template_display(); } if ($action=="cfgform") { // this is the frontend to the config // database. // Add help link for cfgform $menu_bar[__("Configuration Help")] = help_url("admin.php", "cfgform"); //----- Create notebook widget $book = CreateObject('PHP.notebook', array('action'), NOTEBOOK_TABS_LEFT | NOTEBOOK_COMMON_BAR | NOTEBOOK_STRETCH | NOTEBOOK_SCROLL ); $book->set_submit_name(__("Configure")); $book->set_refresh_name(__("Refresh")); $book->set_cancel_name(__("Cancel")); //----- Pull in all configuration variables if (!$book->been_here()) { $query = "SELECT * FROM config"; $result = $sql->query($query); while ($r = $sql->fetch_array($result)) { extract($r); ${$c_option} = stripslashes($c_value); } //----- Push page onto the stack page_push(); } $page_title = "Configuration"; // Form static portion of configuration array $book->add_page( __("Standard Config"), array($config_vars), html_form::form_table(array( __("Graphics Enhanced") => html_form::select_widget("gfx", array ( __("Disabled") => "0", __("Enabled") => "1" ) ), __("Scheduling Start Time") => html_form::select_widget("calshr", array ( __("Default") => "", "4 am" => "4", "5 am" => "5", "6 am" => "6", "7 am" => "7", "8 am" => "8", "9 am" => "9", "10 am" => "10" ) ), __("Scheduling End Time") => html_form::select_widget("calehr", array ( __("Default") => "", "2 pm" => "14", "3 pm" => "15", "4 pm" => "16", "5 pm" => "17", "6 pm" => "18", "7 pm" => "19", "8 pm" => "20", "9 pm" => "21", "10 pm" => "22", "11 pm" => "23" ) ), __("Calendar Overbooking") => html_form::select_widget("cal_ob", array ( __("Enabled") => "enable", __("Disabled") => "disable" ) ), __("Date Format") => html_form::select_widget("dtfmt", array ( "YYYY-MM-DD" => "ymd", "MM-DD-YYYY" => "mdy", "DD-MM-YYYY" => "dmy", "YYYY-DD-MM" => "ydm" ) ), __("Phone Number Format") => html_form::select_widget("phofmt", array ( __("United States")." (XXX) XXX-XXXX" => "usa", __("France")." (XX) XX XX XX XX" => "fr", __("Unformatted")." XXXXXXXXXX" => "unformatted" ) ), __("Prescription Drug Widget") => html_form::select_widget("drug_widget_type", array ( __("rxlist.com Drug Listing") => 'rxlist', __("Combo with past drugs") => 'combobox' ) ), __("Date Widget") => html_form::select_widget("date_widget_type", array ( __("javascript widget") => 'js', __("split text entry") => 'split' ) ), __("Fold Multipage Forms?") => html_form::select_widget("folded", array ( __("yes") => "yes", __("no") => "no" ) ), __("Fax Cover Page") => html_form::select_widget("fax_nocover", array ( __("Attach Cover Page") => "0", __("No Cover Page") => "1" ) ) )) ); // Check for dynamic components if (!is_object($module_list)) { $module_list = freemed::module_cache(); } // Loop foreach ($GLOBALS['__phpwebtools']['GLOBAL_MODULES'] AS $__crap => $v) { if (is_array($v['META_INFORMATION']['global_config'])) { $this_one = $v['META_INFORMATION']['global_config']; foreach ($this_one AS $gc_k => $gc_v) { // If we find ::'s... (for function) if (!(strpos($gc_v, '::') === false)) { $command = '$this_one["'.$gc_k.'"] = '.$gc_v.';'; //print "eval : ".$command."
\n"; eval($command); } else { $this_one["$gc_k"] = $gc_v; } } $book->add_page( __($v['MODULE_NAME']), $v['META_INFORMATION']['global_config_vars'], html_form::form_table($this_one) ); } } if ($book->is_done()) { $page_title = __("System Configuration"); $display_buffer .= "

\n"; // Check for dynamic components for config_vars if (!is_object($module_list)) { $module_list = CreateObject('PHP.module_list', PACKAGENAME, 'modules/'); } foreach ($GLOBALS['__phpwebtools']['GLOBAL_MODULES'] AS $__crap => $v) { if (is_array($v['META_INFORMATION']['global_config_vars'])) { $config_vars = array_merge ( $config_vars, $v['META_INFORMATION']['global_config_vars'] ); } } //----- Commit all configuration variables foreach ($config_vars AS $_garbage => $v) { $_q = "SELECT * FROM config WHERE ". "c_option='".addslashes($v)."'"; $_r = $sql->query($_q); if (!$sql->results($_r)) { $q = $sql->insert_query( 'config', array ( 'c_option' => $v, 'c_value' => ${$v} ) ); } else { $q = $sql->update_query( 'config', array ('c_value' => ${$v}), array('c_option' => $v) ); } $query = $sql->query($q); if (($debug) AND ($q)) $display_buffer .= "$v = ${$v}
\n"; } $display_buffer .= "

".__("Configuration Complete")."

".__("Return To Administration Menu")."
"; } elseif ($book->is_cancelled()) { Header("Location: ".page_name()); die(); } else { $display_buffer .= $book->display(); } } elseif ($action=="reinit") { $page_title = __("Reinitialize Database"); // here, to prevent problems, we ask the user to check that they // REALLY want to... $display_buffer .= "\n
\n"; $display_buffer .= __("Are you sure you want to reinitialize the database?")."\n"; $display_buffer .= "
".__("This is an IRREVERSIBLE PROCESS!")."
\n"; $display_buffer .= "\n
\n"; $display_buffer .= "
\n"; $display_buffer .= "
".__("First Initialization")."
".__("Reload Stock Data")."
"; } elseif ($action=="reinit_sure") { // here we actually put the reinitialization (read - wiping // and creating the database structure again) code... so that // stupids don't accidentally click on it and... oops! // Notice that all of the possible essential table definitions // (except for module) have been moved out of admin. This is // to increase ease of upgrade, etc. They are in hidden // modules. $display_buffer .= "".__("done").".
\n"; $display_buffer .= "

".template::link_button( __("Return to Administration Menu"), "admin.php" )."
"; } else { // actual menu code for admin menu goes here \/ //----- Set page title $page_title = __("Administration Menu"); //----- Push page onto the stack page_push(); $display_buffer .= "
"; // begin standard font $userdata = $_SESSION["authdata"]; $display_buffer .= " "; //----- This is depreciated with the use of the init_wizard //if ($userdata["user"]==1) // if we are root... // $display_buffer .= " // // "; $display_buffer .= " "; if ($userdata["user"] == 1) { // if we are root... $display_buffer .= " "; } // Load dynamic modules for administration via AdminMenu handler LoadObjectDependency('PHP.module'); $admin_actions = freemed::module_handler('AdminMenu'); if (is_array($admin_actions)) { foreach ($admin_actions as $class => $handler) { GettextXML::textdomain(strtolower($class)); $title = freemed::module_get_value($class, 'MODULE_NAME'); $icon = freemed::module_get_value($class, 'ICON'); $display_buffer .= " "; } } // end if is array admin_actions $display_buffer .= "
".__("Action")."
".__("Export Databases")."
".__("Import Databases")."
".__("Module Information")."
// \"\"/ // // ".__("Reinitialize Database")." //
".__("System Configuration")."
".__("User Maintenance")."
".__($title)."
\n"; } $display_buffer .= "

".__("Return to the Main Menu")."
"; // return to main menu tab... //----- Display template template_display(); ?>