XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
settings.php
Go to the documentation of this file.
1 <?php
2 // $Id$
3 // --------------------------------------------------------------
4 // Designia v1.0
5 // Theme for Common Utilities 2
6 // Author: Eduardo Cortés <i.bitcero@gmail.com>
7 // Email: i.bitcero@gmail.com
8 // License: GPL 2.0
9 // --------------------------------------------------------------
10 
12 
13 include XOOPS_ROOT_PATH.'/include/cp_header.php';
14 require_once XOOPS_ROOT_PATH.'/modules/rmcommon/admin_loader.php';
15 
16 if(rmc_server_var($_POST, 'action', '')!=''){
17 
18  $settings = "<?php\n\nreturn array(\n'logo' => '".rmc_server_var($_POST, 'logo_url', RMCURL.'/themes/designia/images/logo.png')."',\n'scheme' => '".rmc_server_var($_POST, 'scheme', 'colors')."'\n);";
19  file_put_contents(XOOPS_CACHE_PATH.'/designia.php', $settings);
20  redirectMsg(RMCURL, __('Settings saved successfully!','designia'), RMMSG_SUCCESS);
21  die();
22 
23 }
24 
25 RMTemplate::get()->add_theme_style('settings.css','designia');
26 RMTemplate::get()->add_local_script('colorpicker.js', 'rmcommon', 'include');
27 RMTemplate::get()->add_style('colorpicker.css', 'rmcommon');
28 RMTemplate::get()->add_theme_script('settings.js', 'designia');
29 
30 RMTemplate::get()->assign('xoops_pagetitle', __('Designia Options','designia'));
31 
32 $dConfig = include(XOOPS_CACHE_PATH.'/designia.php');
33 
34 xoops_cp_header();
35 
36 ?>
37 
38 <h1 class=rmc_titles><?php _e('Designia Theme Settings','designia'); ?></h1>
39 
40 <div class="set_table">
41  <div class=set_row>
42  <div class="set_cell">
43  <h3><?php _e('Basic Theme Options','designia'); ?></h3>
44 
45  <form name="edForm" method="post" action="<?php echo RMCURL; ?>/?designia=settings">
46  <label class=opt_caption for="logo_url"><?php _e('Logo URL:','designia'); ?></label>
47  <input type="text" class="single" name="logo_url" value="<?php echo $dConfig['logo']; ?>" id="logo-url" />
48  <span class="opt_desc"><?php _e('Provide a URL for an image to be used as logo for theme.','designia'); ?></span>
49 
50  <label class=opt_caption><?php _e('Color scheme:','designia'); ?></label>
51  <table class="screens">
52  <tr>
53  <?php
54  $path = RMCPATH.'/themes/designia';
55  $handle = opendir($path.'/css');
56  while (false !== ($file = readdir($handle))) {
57  if (!is_file($path.'/css/' . $file) || substr($file, 0, 6)!='colors')
58  continue;
59 
60  ?>
61  <td align=center>
62  <label>
63  <img src="<?php echo RMCURL.'/themes/designia'; ?>/images/shots/<?php echo str_replace(".css", "", $file); ?>.jpg" />
64  <br />
65  <input type="radio" name="scheme" value="<?php echo $file; ?>"<?php echo $file==$dConfig['scheme'] ? ' checked="checked"' : ''; ?> /></label></td>
66  <?php
67 
68  }
69  closedir($handle);
70  ?>
71  </tr>
72  </table>
73 
74  <input type="hidden" name="action" value="save_settings" />
75  <input type="hidden" name="designia" value="settings" />
76  <input type="submit" value="<?php _e('Save Changes','designia'); ?>" class="buttonGreen" />
77  </form>
78  </div>
79  <div class="set_cell">
80 
81  </div>
82  </div>
83 </div>
84 
85 <?php
86 xoops_cp_footer();