|
|
|
|
|
read()) {
if (!is_dir($module_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $file;
}
}
}
sort($directory_array);
$dir->close();
}
$installed_modules = array();
for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
$file = $directory_array[$i];
include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file);
include($module_directory . $file);
$class = substr($file, 0, strrpos($file, '.'));
if (tep_class_exists($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($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['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=sizeof($module_keys); $j<$k; $j++) {
$key_value_query = tep_db_query("select configuration_title, configuration_value, configuration_description, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_keys[$j] . "'");
$key_value = tep_db_fetch_array($key_value_query);
$keys_extra[$module_keys[$j]]['title'] = $key_value['configuration_title'];
$keys_extra[$module_keys[$j]]['value'] = $key_value['configuration_value'];
$keys_extra[$module_keys[$j]]['description'] = $key_value['configuration_description'];
$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; ?> |
code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
|
|
keys);
while (list($key, $value) = each($mInfo->keys)) {
$keys .= '' . $value['title'] . ' ' . $value['description'] . ' ';
if ($value['set_function']) {
eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
} else {
$keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
}
$keys .= '
';
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$heading[] = array('text' => '' . $mInfo->title . '');
$contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save'));
$contents[] = array('text' => $keys);
$contents[] = array('align' => 'center', 'text' => ' ' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
$heading[] = array('text' => '' . $mInfo->title . '');
if ($mInfo->status == '1') {
$keys = '';
reset($mInfo->keys);
while (list(, $value) = each($mInfo->keys)) {
$keys .= '' . $value['title'] . ' ';
if ($value['use_function']) {
$use_function = $value['use_function'];
if (ereg('->', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
${$class_method[0]} = new $class_method[0]();
}
$keys .= tep_call_function($class_method[1], $value['value'], ${$class_method[0]});
} else {
$keys .= tep_call_function($use_function, $value['value']);
}
} else {
$keys .= $value['value'];
}
$keys .= '
';
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_module_remove.gif', IMAGE_MODULE_REMOVE) . ' ' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '');
$contents[] = array('text' => ' ' . $mInfo->description);
$contents[] = array('text' => ' ' . $keys);
} else {
$contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_module_install.gif', IMAGE_MODULE_INSTALL) . '');
$contents[] = array('text' => ' ' . $mInfo->description);
}
break;
}
if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|