|
|
|
|
|
|
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 . $_SESSION['language'] . '/modules/' . $module_type . '/' . $file);
include($module_directory . $file);
$class = substr($file, 0, strrpos($file, '.'));
if (zen_class_exists($class)) {
$module = new $class;
if ($module->check() > 0) {
if ($module->sort_order > 0) {
if ($installed_modules[$module->sort_order] != '') {
$zc_valid = false;
}
$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=sizeof($module_keys); $j<$k; $j++) {
$key_value = $db->Execute("select configuration_title, configuration_value, configuration_key,
configuration_description, use_function, set_function
from " . TABLE_CONFIGURATION . "
where configuration_key = '" . $module_keys[$j] . "'");
$keys_extra[$module_keys[$j]]['title'] = $key_value->fields['configuration_title'];
$keys_extra[$module_keys[$j]]['value'] = $key_value->fields['configuration_value'];
$keys_extra[$module_keys[$j]]['description'] = $key_value->fields['configuration_description'];
$keys_extra[$module_keys[$j]]['use_function'] = $key_value->fields['use_function'];
$keys_extra[$module_keys[$j]]['set_function'] = $key_value->fields['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";
}
//print_r($module) . '
';
//echo (!empty($module->enabled) ? 'ENABLED' : 'NOT ENABLED') . ' vs ' . (is_numeric($module->sort_order) ? 'ON' : 'OFF') . '
' ;
?>
title; ?> |
code, 'paypal') ? 'PayPal' : $module->code); ?> |
sort_order)) echo $module->sort_order; ?>
enabled) && is_numeric($module->sort_order)) ? zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') : ((empty($module->enabled) && is_numeric($module->sort_order)) ? zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') : zen_image(DIR_WS_IMAGES . 'icon_status_red.gif')));
} else {
echo ' ' . (is_numeric($module->sort_order) ? zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') : zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'));
}
?>
|
Execute("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id='" . $module->order_status . "' and language_id='" . $_SESSION['languages_id'] . "'");
?>
sort_order) ? (($orders_status_name->fields['orders_status_id'] < 1) ? TEXT_DEFAULT : $orders_status_name->fields['orders_status_name']) : ''); ?> |
code) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
Execute("select configuration_value
from " . TABLE_CONFIGURATION . "
where configuration_key = '" . $module_key . "'");
if ($check->RecordCount() > 0) {
if ($check->fields['configuration_value'] != implode(';', $installed_modules)) {
$db->Execute("update " . TABLE_CONFIGURATION . "
set configuration_value = '" . implode(';', $installed_modules) . "', last_modified = now()
where configuration_key = '" . $module_key . "'");
}
} else {
$db->Execute("insert into " . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value,
configuration_description, configuration_group_id, sort_order, date_added)
values ('Installed Modules', '" . $module_key . "', '" . implode(';', $installed_modules) . "',
'This is automatically updated. No need to edit.', '6', '0', now())");
}
if (isset($zc_valid) && $zc_valid == false) {
echo '' . WARNING_MODULES_SORT_ORDER . '';
}
?>
|
|
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 .= zen_draw_input_field('configuration[' . $key . ']', $value['value']);
}
$keys .= '
';
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$heading[] = array('text' => '' . $mInfo->title . '');
$contents = array('form' => zen_draw_form('modules', FILENAME_MODULES, 'set=' . $set . ($_GET['module'] != '' ? '&module=' . $_GET['module'] : '') . '&action=save', 'post', '', true));
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => 'Key: ' . $mInfo->code . ' ');
}
$contents[] = array('text' => $keys);
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . zen_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 .= zen_call_function($class_method[1], $value['value'], ${$class_method[0]});
} else {
$keys .= zen_call_function($use_function, $value['value']);
}
} else {
$keys .= $value['value'];
}
$keys .= '
';
}
if (ADMIN_CONFIGURATION_KEY_ON == 1) {
$contents[] = array('text' => 'Key: ' . $mInfo->code . ' ');
}
$keys = substr($keys, 0, strrpos($keys, '
'));
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_module_remove.gif', IMAGE_MODULE_REMOVE) . ' ' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '');
$contents[] = array('text' => ' ' . $mInfo->description);
$contents[] = array('text' => ' ' . $keys);
} else {
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_module_install.gif', IMAGE_MODULE_INSTALL) . '');
$contents[] = array('text' => ' ' . $mInfo->description);
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|