getAll(); if (empty($set) || !$cfgModules->exists($set)) { $set = $modules[0]['code']; } $module_type = $cfgModules->get($set, 'code'); $module_directory = $cfgModules->get($set, 'directory'); $module_language_directory = $cfgModules->get($set, 'language_directory'); $module_key = $cfgModules->get($set, 'key');; define('HEADING_TITLE', $cfgModules->get($set, 'title')); $template_integration = $cfgModules->get($set, 'template_integration'); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': reset($HTTP_POST_VARS['configuration']); while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { // bof Dynamic Template System if((is_array($value)) && (!empty($value))){ $pages = ''; $count = count($value); for($i=0 ; $i<$count; $i++){ $pages = "$pages$value[$i]"; tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $pages . "' where configuration_key = '" . $key . "'"); } } // eof Dynamic Template System else { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); break; case 'install': case 'remove': $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $class = basename($HTTP_GET_VARS['module']); if (file_exists($module_directory . $class . $file_extension)) { include($module_directory . $class . $file_extension); $module = new $class; if ($action == 'install') { $module->install(); $modules_installed = explode(';', constant($module_key)); $modules_installed[] = $class . $file_extension; tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $modules_installed) . "' where configuration_key = '" . $module_key . "'"); tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class)); } elseif ($action == 'remove') { $module->remove(); $modules_installed = explode(';', constant($module_key)); unset($modules_installed[array_search($class . $file_extension, $modules_installed)]); tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $modules_installed) . "' where configuration_key = '" . $module_key . "'"); tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set)); } } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $class)); break; } } require(DIR_WS_INCLUDES . 'template_top.php'); $modules_installed = (defined($module_key) ? explode(';', constant($module_key)) : array()); $new_modules_counter = 0; $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $directory_array = array(); if ($dir = @dir($module_directory)) { while ($file = $dir->read()) { if (!is_dir($module_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { if (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] = 'new')) { if (!in_array($file, $modules_installed)) { $directory_array[] = $file; } } else { if (in_array($file, $modules_installed)) { $directory_array[] = $file; } else { $new_modules_counter++; } } } } } sort($directory_array); $dir->close(); } ?>
' . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_MODULES, 'set=' . $set)) . ''; } else { echo ' '; } ?>
' . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '
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 . "');"); // STS V4.6 drop start } else { if($key == 'MODULE_STS_TEMPLATE_FOLDER'){ $dir_name = array(); if ($handle = opendir('../'.MODULE_STS_TEMPLATES_FOLDER.'/')) { while (false !== ($file = readdir($handle))) { $pos = strpos($file, "."); if($pos === false){ $dir_name[] = array("id" => $file, "text" => $file); $i++; } } closedir($handle); } $keys .= tep_draw_pull_down_menu('configuration[MODULE_STS_TEMPLATE_FOLDER]', $dir_name, $value['value']); }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_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']))); 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 (preg_match('/->/', $use_function)) { $class_method = explode('->', $use_function); if (!isset(${$class_method[0]}) || !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_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MODULES, 'set=' . $set . (isset($HTTP_GET_VARS['module']) ? '&module=' . $HTTP_GET_VARS['module'] : '') . '&action=edit')) . tep_draw_button(IMAGE_MODULE_REMOVE, 'minus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=remove'))); if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) { $contents[] = array('text' => '
' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' ' . TEXT_INFO_VERSION . ' ' . $sversion . ' (' . TEXT_INFO_ONLINE_STATUS . ')'); } if (isset($mInfo->api_version)) { $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' ' . TEXT_INFO_API_VERSION . ' ' . $mInfo->api_version); } $contents[] = array('text' => '
' . $mInfo->description); // bof Dynamic Template System $files = explode(";", $keys); foreach($files as $file){ $contents[] = array('text' => $file); } // eof Dynamic Template System } elseif (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] == 'new')) { if (isset($mInfo)) { $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_MODULE_INSTALL, 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=install'))); if (isset($mInfo->signature) && (list($scode, $smodule, $sversion, $soscversion) = explode('|', $mInfo->signature))) { $contents[] = array('text' => '
' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' ' . TEXT_INFO_VERSION . ' ' . $sversion . ' (' . TEXT_INFO_ONLINE_STATUS . ')'); } if (isset($mInfo->api_version)) { $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ' ' . TEXT_INFO_API_VERSION . ' ' . $mInfo->api_version); } $contents[] = array('text' => '
' . $mInfo->description); } } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' ' . "\n"; } ?>
check() > 0) { if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) { $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(), 'signature' => (isset($module->signature) ? $module->signature : null), 'api_version' => (isset($module->api_version) ? $module->api_version : null)); $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) . ''; } ?> 
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '