|
|
|
|
read()) {
if (!is_dir($module_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $file;
}
}
}
sort($directory_array);
$oDir->close();
}
$installed_modules = array();
for ($i = 0, $n = count($directory_array); $i < $n; $i++) {
$file = $directory_array[$i];
include OOS_ABSOLUTE_PATH . 'includes/languages/' . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file;
include $module_directory . $file;
$class = substr($file, 0, strrpos($file, '.'));
if (oos_class_exits($class)) {
$module = new $class;
if ($module->check() > 0) {
if ($module->sort_order > 0) {
$installed_modules[$module->sort_order] = $file;
} else {
$installed_modules[] = $file;
}
}
if ((!isset($_GET['module']) || (isset($_GET['module']) && ($_GET['module'] == $class))) && !isset($mInfo)) {
$module_info = array('code' => $module->code,
'title' => $module->title,
'description' => $module->description,
'status' => $module->check());
$module_keys = $module->keys();
$keys_extra = array();
for ($j = 0, $k = count($module_keys); $j < $k; $j++) {
$key_value_result = $dbconn->Execute("SELECT configuration_value, use_function, set_function FROM " . $oostable['configuration'] . " WHERE configuration_key = '" . $module_keys[$j] . "'");
$key_value = $key_value_result->fields;
$keys_extra[$module_keys[$j]]['title'] = constant(strtoupper($module_keys[$j] . '_TITLE'));
$keys_extra[$module_keys[$j]]['value'] = $key_value['configuration_value'];
$keys_extra[$module_keys[$j]]['description'] = constant(strtoupper($module_keys[$j] . '_DESC'));
$keys_extra[$module_keys[$j]]['use_function'] = $key_value['use_function'];
$keys_extra[$module_keys[$j]]['set_function'] = $key_value['set_function'];
}
$module_info['keys'] = $keys_extra;
$mInfo = new objectInfo($module_info);
}
if (isset($mInfo) && is_object($mInfo) && ($class == $mInfo->code) ) {
if ($module->check() > 0) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
} else {
echo ' ' . "\n";
}
?>
title; ?> |
sort_order)) echo $module->sort_order; ?> |
check() > 0) {
echo '' . oos_image(OOS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '';
} else {
echo '' . oos_image(OOS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '';
}
?> |
code) ) { echo ''; } else { echo ''; } ?> |
Execute("SELECT configuration_value FROM $configurationtable WHERE configuration_key = '" . $module_key . "'");
if ($check_result->RecordCount()) {
$check = $check_result->fields;
if ($check['configuration_value'] != implode(';', $installed_modules)) {
$configurationtable = $oostable['configuration'];
$dbconn->Execute("UPDATE $configurationtable SET configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now() WHERE configuration_key = '" . $module_key . "'");
}
} else {
$configurationtable = $oostable['configuration'];
$dbconn->Execute("INSERT INTO $configurationtable (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) VALUES ('" . $module_key . "', '" . implode(';', $installed_modules) . "', '6', '0', now())");
}
?>
|
|
keys);
foreach ($mInfo->keys as $key => $value) {
$keys .= '' . $value['title'] . '
' . $value['description'] . '
';
if ($value['set_function']) {
eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
} else {
$keys .= oos_draw_input_field('configuration[' . $key . ']', $value['value']);
}
$keys .= '
';
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$heading[] = array('text' => '' . $mInfo->title . '');
$contents = array('form' => oos_draw_form('id', 'modules', $aContents['modules'], 'set=' . $_GET['set'] . '&module=' . $_GET['module'] . '&action=save', 'post', FALSE));
$contents[] = array('text' => $keys);
$contents[] = array('align' => 'center', 'text' => '
' . oos_submit_button(IMAGE_UPDATE) . ' ' . BUTTON_CANCEL . '');
break;
default:
$heading[] = array('text' => '' . $mInfo->title . '');
if ($mInfo->status == '1') {
$keys = '';
reset($mInfo->keys);
foreach ($mInfo->keys as $value) {
$keys .= '' . $value['title'] . '
';
if ($value['use_function']) {
$use_function = $value['use_function'];
if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include 'includes/classes/class_'. $class_method[0] . '.php';
${$class_method[0]} = new $class_method[0]();
}
$keys .= oos_call_function($class_method[1], $value['value'], ${$class_method[0]});
} else {
$keys .= oos_call_function($use_function, $value['value']);
}
} else {
$keys .= $value['value'];
}
$keys .= '
';
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$contents[] = array('align' => 'center', 'text' => '' . oos_button(BUTTON_EDIT) . '');
$contents[] = array('text' => '
' . $mInfo->description);
$contents[] = array('text' => '
' . $keys);
} else {
$contents[] = array('text' => $mInfo->description);
}
break;
}
if ( (oos_is_not_null($heading)) && (oos_is_not_null($contents)) ) {
?>
infoBox($heading, $contents);
?>
|