array(), 'configuration' => array(), 'license' => ((OCC_LICENSE == 'Public') ? 'Public' : 'Pro'), 'modules' => array() ); // Module prep if (oc_hookSet('settings-export-prep')) { foreach ($OC_hooksAR['settings-export-prep'] as $f) { require_once $f; } } // Check for selected settings if (!isset($_POST['settings']) || (!is_array($_POST['settings'])) || (count($_POST['settings']) == 0)) { warn('No settings selected', $hdr, $hdrfn); exit; } // Configuration settings $settings['options'][] = 'configuration'; $r = ocsql_query("SELECT `module`, `setting`, `value` FROM `" . OCC_TABLE_CONFIG . "` ORDER BY `module`, `setting`"); while ($l = ocsql_fetch_assoc($r)) { if (((in_array('configuration', $_POST['settings']) && ($l['module'] == 'OC')) || isset($settings['modules'][$l['module']])) && !in_array($l['setting'], $excludeSettingsAR) ) { $settings['configuration'][$l['module'] . ':' . $l['setting']] = $l['value']; } } // Topics if (in_array('topics', $_POST['settings'])) { $settings['options'][] = 'topics'; $r = ocsql_query("SELECT * FROM `" . OCC_TABLE_TOPIC . "` ORDER BY `topicid`"); $settings['topics'] = array(); while ($l = ocsql_fetch_assoc($r)) { $settings['topics'][$l['topicid']] = array( 'topicname' => $l['topicname'], 'short' => $l['short'] ); } } // Reviewers if (in_array('reviewers', $_POST['settings'])) { $settings['options'][] = 'reviewers'; $r = ocsql_query("SELECT * FROM `" . OCC_TABLE_REVIEWER . "` ORDER BY `reviewerid`"); $settings['reviewers'] = array(); while ($l = ocsql_fetch_assoc($r)) { foreach ($l as $k => $v) { $settings['reviewers'][$l['reviewerid']][$k] = $v; } } // Reviewer Topics if (in_array('topics', $_POST['settings'])) { $settings['options'][] = 'reviewertopics'; $r = ocsql_query("SELECT * FROM `" . OCC_TABLE_REVIEWERTOPIC . "` ORDER BY `reviewerid`, `topicid`"); $settings['reviewertopics'] = array(); while ($l = ocsql_fetch_assoc($r)) { if (!isset($settings['reviewertopics'][$l['reviewerid']])) { $settings['reviewertopics'][$l['reviewerid']] = array($l['topicid']); } else { $settings['reviewertopics'][$l['reviewerid']][] = $l['topicid']; } } } } // Templates if (in_array('templates', $_POST['settings'])) { $settings['options'][] = 'templates'; $r = ocsql_query("SELECT * FROM `" . OCC_TABLE_TEMPLATE . "`"); $settings['templates'] = array(); while ($l = ocsql_fetch_assoc($r)) { if (($l['module'] == 'OC') || isset($settings['modules'][$l['module']])) { foreach ($l as $k => $v) { $settings['templates'][$l['templateid']][$k] = $v; } } } } // Module settings if (oc_hookSet('settings-export-process')) { foreach ($OC_hooksAR['settings-export-process'] as $f) { require_once $f; } } // Output file oc_sendNoCacheHeaders(); $fileName = 'openconf-settings'; if (preg_match("/^\w+$/", $GLOBALS['OC_configAR']['OC_confName'])) { $fileName .= '-' . $GLOBALS['OC_configAR']['OC_confName']; } $fileName .= '.oc'; header('Content-Type: application/binary'); header('Content-Disposition: attachment; filename="' . $fileName . '"'); print json_encode($settings); exit; } printHeader($hdr, $hdrfn); print '

In order to save your settings for use in another OpenConf installation, select what you would like exported below, then click the Export Settings button. A file dialog box will open up for you to save the settings file on your computer.





'; // Module settings if (oc_hookSet('settings-export-options')) { foreach ($OC_hooksAR['settings-export-options'] as $f) { require_once $f; } } print '

'; printFooter(); ?>