1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22: function b_legacy_themes_show($options)
23: {
24: global $xoopsConfig;
25:
26: if (count($xoopsConfig['theme_set_allowed']) == 0) {
27: return null;
28: }
29:
30: $block = array();
31: if (xoops_getenv('REQUEST_METHOD') == 'POST') {
32: $block['isEnableChanger'] = 0;
33: return $block;
34: }
35:
36: $block['isEnableChanger'] = 1;
37:
38: $theme_options = array();
39: $handler =& xoops_getmodulehandler('theme', 'legacy');
40: foreach ($xoopsConfig['theme_set_allowed'] as $name) {
41: $theme =& $handler->get($name);
42: if ($theme != null) {
43: $theme_option['name'] = $name;
44: $theme_option['screenshot'] = $theme->getShow('screenshot');
45: $theme_option['screenshotUrl'] = XOOPS_THEME_URL . "/" . $name . "/" . $theme->getShow('screenshot');
46: if ($name == $xoopsConfig['theme_set']) {
47: $theme_option['selected'] = 'selected="selected"';
48: $block['theme_selected_screenshot'] = $theme->getShow('screenshot');
49: } else {
50: $theme_option['selected'] = '';
51: }
52: $theme_options[] = $theme_option;
53: }
54: }
55:
56: $block['count'] = count($xoopsConfig['theme_set_allowed']);
57: $block['mode'] = $options[0];
58: $block['width'] = $options[1];
59: $block['theme_options'] = $theme_options;
60: return $block;
61: }
62:
63: function b_legacy_themes_edit($options)
64: {
65:
66: $chk = "";
67: $form = _MB_LEGACY_LANG_THSHOW." ";
68: if ( $options[0] == 1 ) {
69: $chk = ' checked="checked"';
70: }
71: $form .= '<input type="radio" name="options[0]" value="1"'.$chk.' /> '._YES;
72: $chk = "";
73: if ( $options[0] == 0 ) {
74: $chk = ' checked="checked"';
75: }
76: $form .= ' <input type="radio" name="options[0]" value="0"'.$chk.' />'._NO;
77: $form .= '<br />'._MB_LEGACY_LANG_THWIDTH.' ';
78: $form .= '<input type="text" name="options[1]" value="'.$options[1].'" />';
79: return $form;
80: }
81: ?>
82: