19function b_legacy_themes_show($options): ?array
23 if (0 === (is_countable($xoopsConfig[
'theme_set_allowed']) ? count($xoopsConfig[
'theme_set_allowed']) : 0)) {
28 if (
'POST' === xoops_getenv(
'REQUEST_METHOD')) {
29 $block[
'isEnableChanger'] = 0;
33 $block[
'isEnableChanger'] = 1;
36 $handler = xoops_getmodulehandler(
'theme',
'legacy');
37 foreach ($xoopsConfig[
'theme_set_allowed'] as $name) {
38 $theme = $handler->get($name);
39 if ( $theme !==
null ) {
40 $theme_option[
'name'] = $name;
41 $theme_option[
'screenshot'] = $theme->getShow(
'screenshot');
42 $theme_option[
'screenshotUrl'] = XOOPS_THEME_URL .
'/' . $name .
'/' . $theme->getShow(
'screenshot');
43 if ($name === $xoopsConfig[
'theme_set']) {
44 $theme_option[
'selected'] =
'selected="selected"';
45 $block[
'theme_selected_screenshot'] = $theme->getShow(
'screenshot');
46 $block[
'theme_selected_name'] = $name;
48 $theme_option[
'selected'] =
'';
50 $theme_options[] = $theme_option;
54 $block[
'count'] = is_countable($xoopsConfig[
'theme_set_allowed']) ? count($xoopsConfig[
'theme_set_allowed']) : 0;
55 $block[
'mode'] = $options[0];
56 $block[
'width'] = $options[1];
57 $block[
'theme_options'] = $theme_options;
61function b_legacy_themes_edit($options)
64 $form =
'<div>'._MB_LEGACY_LANG_THSHOW.
' ';
65 if (1 == $options[0]) {
66 $chk =
' checked="checked"';
68 $form .=
'<input type="radio" name="options[0]" id="display-yes" value="1" '.$chk.
'><label for="display-yes">'._YES.
'</label>';
70 if (0 == $options[0]) {
71 $chk =
' checked="checked"';
73 $form .=
'<input type="radio" name="options[0]" id="display-no" value="0" '.$chk.
'><label for="display-no">'._NO.
'</label></div>';
74 $form .=
'<div><label for="screenshot">'._MB_LEGACY_LANG_THWIDTH.
' </label>';
75 $form .=
'<input type="text" name="options[1]" id="screenshot" size="3" value="'.$options[1].
'"></div>';