Minahito
minah****@users*****
2006年 1月 13日 (金) 01:22:14 JST
Index: xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderHelpAction.class.php diff -u xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderHelpAction.class.php:1.1.2.2 xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderHelpAction.class.php:removed --- xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderHelpAction.class.php:1.1.2.2 Sun Dec 25 19:48:44 2005 +++ xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderHelpAction.class.php Fri Jan 13 01:22:14 2006 @@ -1,26 +0,0 @@ -<?php - -/** - * This action shows easy help to user. Because we does not decide the method of - * multi-language, we does not read text file here. - * - */ -class LegacyRenderHelpAction extends LegacyRenderAction -{ - function getDefaultView(&$controller,&$xoopsUser) - { - return LEGACY_RENDER_FRAME_VIEW_INDEX; - } - - function execute(&$controller,&$xoopsUser) - { - return LEGACY_RENDER_FRAME_VIEW_NONE; - } - - function executeViewIndex(&$controller,&$xoopsUser,&$renderSystem) - { - $renderSystem->setTemplateName("help.html"); - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php diff -u xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:1.1.2.2 xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:removed --- xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php:1.1.2.2 Sun Dec 25 19:48:33 2005 +++ xoops2jp/html/modules/legacyRender/admin/actions/LegacyRenderDefaultAction.class.php Fri Jan 13 01:22:14 2006 @@ -1,49 +0,0 @@ -<?php - -require_once XOOPS_ROOT_PATH."/modules/legacyRender/admin/class/LegacyTheme.class.php"; - -/** - * This action shows the list of selectable themes to user. - */ -class LegacyRenderDefaultAction extends LegacyRenderAction -{ - var $mConfig; - var $mThemes; - - function getDefaultView(&$controller, &$xoopsUser) - { - $themeHandler =& new LegacyThemeHandler(); - $this->mThemes =& $themeHandler->enumAll(); - - return LEGACY_RENDER_FRAME_VIEW_INDEX; - } - - function execute(&$controller, &$xoopsUser) - { - $configHandler =& xoops_gethandler('config'); - - $criteria =& new CriteriaCompo(); - $criteria->add(new Criteria('conf_name', 'theme_set')); - $criteria->add(new Criteria('conf_catid', XOOPS_CONF)); - - $configs =& $configHandler->getConfigs($criteria); - - if (count($configs)>0 && is_object($configs[0])) { - $configs[0]->setVar('conf_value', $_POST['theme_name']); - if ($configHandler->insertConfig($configs[0])) { - $controller->mRoot->setThemeName($_POST['theme_name']); - } - } - - return $this->getDefaultView($controller, $xoopsUser); - } - - function executeViewIndex(&$controller, &$xoopsUser, &$render) - { - $render->setTemplateName("theme_list.html"); - $render->setAttribute("themes", $this->mThemes); - $render->setAttribute("currentThemeName", $controller->mRoot->getThemeName()); - } -} - -?> \ No newline at end of file Index: xoops2jp/html/modules/legacyRender/admin/actions/ImportAction.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/ImportAction.php:1.1.2.1 --- /dev/null Fri Jan 13 01:22:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/actions/ImportAction.php Fri Jan 13 01:22:14 2006 @@ -0,0 +1,5 @@ +<?php + +/* TODO: Add code here */ + +?> \ No newline at end of file Index: xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php:1.1.2.1 --- /dev/null Fri Jan 13 01:22:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/actions/DefaultAction.class.php Fri Jan 13 01:22:14 2006 @@ -0,0 +1,95 @@ +<?php + +require_once XOOPS_ROOT_PATH."/modules/legacyRender/admin/class/LegacyTheme.class.php"; + +/** + * This action shows the list of selectable themes to user. + */ +class LegacyRender_DefaultAction extends LegacyRender_Action +{ + var $mConfig; + var $mThemes; + + function getDefaultView(&$controller, &$xoopsUser) + { + $themeHandler =& new LegacyThemeHandler(); + $themes =& $themeHandler->enumAll(); + + $handler =& xoops_getmodulehandler('theme'); + foreach ($themes as $theme) { + $theme_obj =& $handler->getByName($theme->mDirName); + + if ($theme_obj->isNew()) { + $theme_obj->set('name', $theme->mDirName); + $handler->insert($theme_obj, true); + } + + $theme_obj->loadPackage(); + + if ($theme_obj->isActiveResource()) { + $this->mThemes[] =& $theme_obj; + } + + unset($theme_obj); + } + + return LEGACY_RENDER_FRAME_VIEW_INDEX; + } + + function execute(&$controller, &$xoopsUser) + { + $configHandler =& xoops_gethandler('config'); + + $criteria =& new CriteriaCompo(); + $criteria->add(new Criteria('conf_name', 'theme_set')); + $criteria->add(new Criteria('conf_catid', XOOPS_CONF)); + + $configs =& $configHandler->getConfigs($criteria); + + // + // selected + // + $handler =& xoops_getmodulehandler('theme'); + $themes =& $handler->getObjects(); + foreach ($themes as $theme) { + if (isset($_POST['select'][$theme->get('name')])) { + $theme->set('enable_select', 1); + } + else { + $theme->set('enable_select', 0); + } + $handler->insert($theme); + } + + if (isset($_POST['select']) && is_array($_POST['select'])) { + foreach ($_POST['select'] as $theme_name => $dummy) { + $theme =& $handler->get($theme_name); + + } + } + + // + // fetch selected theme + // + if (isset($_POST['choose']) && is_array($_POST['choose'])) { + foreach ($_POST['choose'] as $theme_name => $dummy) { + $configs[0]->setVar('conf_value', $theme_name); + if ($configHandler->insertConfig($configs[0])) { + $controller->mRoot->setThemeName($theme_name); + break; + } + } + } + + return $this->getDefaultView($controller, $xoopsUser); + } + + function executeViewIndex(&$controller, &$xoopsUser, &$render) + { + $render->setTemplateName("theme_list.html"); + $render->setAttribute("themes", $this->mThemes); + $render->setAttribute("currentThemeName", $controller->mRoot->getThemeName()); + } +} + +?> \ No newline at end of file