$value) { $configurationtable = $oostable['configuration']; $dbconn->Execute("UPDATE $configurationtable SET configuration_value = '" . oos_db_input($value) . "' WHERE configuration_key = '" . oos_db_input($key) . "'"); } oos_redirect_admin(oos_href_link_admin($aContents['plugins'], 'plugin=' . $_GET['plugin'])); break; case 'remove': $sInstance = oos_db_prepare_input($_GET['plugin']); if (($key = array_search($sInstance, $installed)) !== false) { include OOS_ABSOLUTE_PATH . 'includes/plugins/' . 'oos_event_' . $sInstance . '/oos_event_' . $sInstance . '.php'; $class = 'oos_event_' . $sInstance; $oPlugin = new $class; if ($oPlugin->uninstallable) { $oPlugin->remove(); unset($installed[$key]); $configurationtable = $oostable['configuration']; $dbconn->Execute("UPDATE $configurationtable SET configuration_value = '" . implode(';', $installed) . "' WHERE configuration_key = 'MODULE_PLUGIN_EVENT_INSTALLED'"); } } oos_redirect_admin(oos_href_link_admin($aContents['plugins'], 'plugin=' . $_GET['plugin'])); break; case 'install': $sInstance = oos_db_prepare_input($_GET['plugin']); if (array_search($sInstance, $installed) === false) { include OOS_ABSOLUTE_PATH . 'includes/plugins/' . 'oos_event_' . $sInstance . '/oos_event_' . $sInstance . '.php'; $class = 'oos_event_' . $sInstance; $oPlugin = new $class; $bInstall = $oPlugin->install(); if ($bInstall) { if (isset($oPlugin->depends)) { if (is_string($oPlugin->depends) && (($key = array_search($oPlugin->depends, $installed)) !== false)) { if (isset($installed[$key+1])) { array_splice($installed, $key+1, 0, $sInstance); } else { $installed[] = $sInstance; } } elseif (is_array($oPlugin->depends)) { foreach ($oPlugin->depends as $depends_module) { if (($key = array_search($depends_module, $installed)) !== false) { if (!isset($array_position) || ($key > $array_position)) { $array_position = $key; } } } if (isset($array_position)) { array_splice($installed, $array_position+1, 0, $sInstance); } else { $installed[] = $sInstance; } } } elseif (isset($oPlugin->preceeds)) { if (is_string($oPlugin->preceeds)) { if ((($key = array_search($oPlugin->preceeds, $installed)) !== false)) { array_splice($installed, $key, 0, $sInstance); } else { $installed[] = $sInstance; } } elseif (is_array($oPlugin->preceeds)) { foreach ($oPlugin->preceeds as $preceeds_module) { if (($key = array_search($preceeds_module, $installed)) !== false) { if (!isset($array_position) || ($key < $array_position)) { $array_position = $key; } } } if (isset($array_position)) { array_splice($installed, $array_position, 0, $sInstance); } else { $installed[] = $sInstance; } } } else { $installed[] = $sInstance; } $configurationtable = $oostable['configuration']; $dbconn->Execute("UPDATE $configurationtable SET configuration_value = '" . implode(';', $installed) . "' WHERE configuration_key = 'MODULE_PLUGIN_EVENT_INSTALLED'"); } } oos_redirect_admin(oos_href_link_admin($aContents['plugins'], 'plugin=' . $_GET['plugin'])); break; } } $sLocaleDir = OOS_ABSOLUTE_PATH . 'includes/plugins/'; $aDirectory = array(); if (is_dir($sLocaleDir)) { if ($dh = opendir($sLocaleDir)) { while (($file = readdir($dh)) !== false) { if ($file == '.' || $file == '..' || $file == 'CVS' || $file == 'thirdparty' || $file == 'default' || filetype($sLocaleDir . $file) == 'file' ) continue; if (filetype(realpath($sLocaleDir . $file)) == 'dir') { $aDirectory[] = $file; } } closedir($dh); } } sort($aDirectory); require 'includes/header.php'; ?>

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' => '' . $pInfo->name . ''); $contents = array('form' => oos_draw_form('id', 'plugins', $aContents['plugins'], 'plugin=' . $_GET['plugin'] . '&action=save', 'post', FALSE)); $contents[] = array('text' => $keys); $contents[] = array('align' => 'center', 'text' => '
' . oos_submit_button(IMAGE_UPDATE) . ' ' . BUTTON_CANCEL . ''); break; default: if (isset($pInfo) && is_object($pInfo)) { $heading[] = array('text' => '' . $pInfo->name . ''); $keys = ''; if ( $pInfo->uninstallable || (!empty($pInfo->keys) && sizeof($pInfo->keys > 0)) ) { if ($pInfo->status) { $contents[] = array('align' => 'center', 'text' => ($pInfo->uninstallable ? '' . oos_button('modules_remove', IMAGE_PLUGINS_REMOVE) . '' : '') . ((sizeof($pInfo->keys) > 0) ? ' ' . oos_button(BUTTON_EDIT) . '' : '')); if (is_array($pInfo->config_item) && sizeof($pInfo->config_item) > 0) { $keys = '
'; foreach ($pInfo->config_item 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, '

')); } } else { $contents[] = array('align' => 'center', 'text' => '' . oos_button('module_install', IMAGE_PLUGINS_INSTALL) . ''); } } $contents[] = array('text' => $pInfo->description); if (!empty($pInfo->preceeds)) { $preceeds_string = 'Preceeds
'; if (is_string($pInfo->preceeds)) { $preceeds_string .= $pInfo->preceeds; } else { foreach ($pInfo->preceeds as $preceeds) { $preceeds_string .= $preceeds . '
'; } } $contents[] = array('text' => $preceeds_string); } $contents[] = array('text' => $keys); } break; } if ( (oos_is_not_null($heading)) && (oos_is_not_null($contents)) ) { ?>
$sInstance, 'name' => $oPlugin->name, 'description' => $oPlugin->description, 'status' => in_array($sInstance, $installed), 'uninstallable' => $oPlugin->uninstallable, 'preceeds' => $oPlugin->preceeds, 'preceeds' => $oPlugin->preceeds); $plugin_keys = $oPlugin->config_item(); $keys_extra = array(); if (is_array($plugin_keys) && (sizeof($plugin_keys) > 0)) { foreach ($plugin_keys as $key) { $configurationtable = $oostable['configuration']; $key_value_result = $dbconn->Execute("SELECT configuration_value, use_function, set_function FROM $configurationtable WHERE configuration_key = '" . oos_db_input($key) . "'"); $key_value = $key_value_result->fields; $keys_extra[$key]['title'] = constant(strtoupper($key . '_TITLE')); $keys_extra[$key]['value'] = $key_value['configuration_value']; $keys_extra[$key]['description'] = constant(strtoupper($key . '_DESC')); $keys_extra[$key]['use_function'] = $key_value['use_function']; $keys_extra[$key]['set_function'] = $key_value['set_function']; } } $plugin_info['keys'] = $keys_extra; $pInfo = new objectInfo($plugin_info); } if (isset($pInfo) && is_object($pInfo) && ($sInstance == $pInfo->instance) ) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } ?>
 
name; ?> uninstallable) { echo '' . oos_image(OOS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . ''; } else { 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) . ''; } ?> instance) ) { echo ''; } else { echo ''; } ?> 
infoBox($heading, $contents); ?>