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_system_themes_show($options)
23: {
24:     $xoops = Xoops::getInstance();
25:     $theme_options = '';
26:     $theme_set_allowed = $xoops->getConfig('theme_set_allowed');
27:     foreach ($theme_set_allowed as $theme) {
28:         $theme_options .= '<option value="' . $theme . '"';
29:         if ($theme == $xoops->getConfig('theme_set')) {
30:             $theme_options .= ' selected="selected"';
31:         }
32:         $theme_options .= '>' . $theme . '</option>';
33:     }
34:     $block = array();
35:     if ($options[0] == 1) {
36:         $block['theme_select'] = "<img vspace=\"2\" id=\"xoops_theme_img\" src=\"" . \XoopsBaseConfig::get('themes-url') . "/" . $xoops->getConfig('theme_set') . "/screenshot.png\" alt=\"screenshot\" width=\"" . (int)($options[1]) . "\" /><br /><select class=\"span2\" id=\"xoops_theme_select\" name=\"xoops_theme_select\" onchange=\"showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/screenshot.png', '" . \XoopsBaseConfig::get('url') . "');\">" . $theme_options . "</select><br /><input type=\"submit\" value=\"" . XoopsLocale::A_GO . "\" />";
37:     } else {
38:         $block['theme_select'] = '<select class="span2" name="xoops_theme_select" onchange="submit();" size="3">' . $theme_options . '</select>';
39:     }
40: 
41:     $block['theme_select'] .= '<br />(' . sprintf(SystemLocale::F_THEMES, '<strong>' . count($theme_set_allowed) . '</strong>') . ')<br />';
42:     return $block;
43: }
44: 
45: function b_system_themes_edit($options)
46: {
47:     $block_form = new Xoops\Form\BlockForm();
48:     $block_form->addElement(new Xoops\Form\RadioYesNo(SystemLocale::DISPLAY_SCREENSHOT_IMAGE, 'options[0]', $options[0]));
49:     $block_form->addElement( new Xoops\Form\Text(SystemLocale::SCREENSHOT_IMAGE_WIDTH, 'options[1]', 1, 3, $options[1]), true);
50:     return $block_form->render();
51: }
52: