Minahito
minah****@users*****
2006年 7月 25日 (火) 19:15:56 JST
Index: xoops2jp/html/modules/base/admin/class/ModuleUtils.class.php diff -u xoops2jp/html/modules/base/admin/class/ModuleUtils.class.php:1.1.2.18 xoops2jp/html/modules/base/admin/class/ModuleUtils.class.php:1.1.2.19 --- xoops2jp/html/modules/base/admin/class/ModuleUtils.class.php:1.1.2.18 Sat Jul 1 16:25:12 2006 +++ xoops2jp/html/modules/base/admin/class/ModuleUtils.class.php Tue Jul 25 19:15:56 2006 @@ -44,8 +44,8 @@ } /** - * This provides static methods for the module installation. Methods of this class - * may move to base class of installers. + * This provides static methods for the module installation. Methods of this + * class may move to base class of installers. */ class Legacy_ModuleUtils { @@ -405,9 +405,59 @@ ); } - // TODO comment - - // TODO notification + // + // Insert comment config by old style. + // + if ($this->mModule->get('hasnotification') != 0) { + require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; + require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; + + $t_options = array(); + $t_options['_NOT_CONFIG_DISABLE'] = XOOPS_NOTIFICATION_DISABLE; + $t_options['_NOT_CONFIG_ENABLEBLOCK'] = XOOPS_NOTIFICATION_ENABLEBLOCK; + $t_options['_NOT_CONFIG_ENABLEINLINE'] = XOOPS_NOTIFICATION_ENABLEINLINE; + $t_options['_NOT_CONFIG_ENABLEBOTH'] = XOOPS_NOTIFICATION_ENABLEBOTH; + + $configInfos[] = array( + 'name' => 'notification_enabled', + 'title' => '_NOT_CONFIG_ENABLE', + 'description' => '_NOT_CONFIG_ENABLEDSC', + 'formtype' => 'select', + 'valuetype' => 'int', + 'default' => XOOPS_NOTIFICATION_ENABLEBOTH, + 'options' => $t_options + ); + + // + // FIXME: doesn't work when update module... can't read back the + // array of options properly... " changing to " + // + + unset ($t_options); + + $t_options = array(); + $t_categoryArr =& notificationCategoryInfo('', $this->mModule->get('mid')); + foreach ($t_categoryArr as $t_category) { + $t_eventArr =& notificationEvents($t_category['name'], false, $module->get('mid')); + foreach ($t_eventArr as $t_event) { + if (!empty($event['invisible'])) { + continue; + } + $t_optionName = $t_category['title'] . ' : ' . $t_event['title']; + $t_options[$t_optionName] = $category['name'] . '-' . $t_event['name']; + } + + $configInfos[] = array( + 'name' => 'notification_events', + 'title' => '_NOT_CONFIG_EVENTS', + 'description' => '_NOT_CONFIG_EVENTSDSC', + 'formtype' => 'select_multi', + 'valuetype' => 'array', + 'default' => array_values($t_options), + 'options' => $t_options + ); + } + } $configHandler =& xoops_gethandler('config');