XOOPS  2.6.0
themes.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
23 {
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=\"" . intval($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 
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 }
const A_GO
Definition: en_US.php:98
static getInstance()
Definition: Xoops.php:160
$options['editor']
$xoops
Definition: admin.php:25
const SCREENSHOT_IMAGE_WIDTH
Definition: en_US.php:371
const F_THEMES
Definition: en_US.php:310
static get($name)
b_system_themes_edit($options)
Definition: themes.php:45
b_system_themes_show($options)
Definition: themes.php:22
const DISPLAY_SCREENSHOT_IMAGE
Definition: en_US.php:261