Default Theme Etc.

From Roaring Penguin
Jump to: navigation, search

There are two approaches to do this depending on whether your CanIt is on-premise or hosted.

On Premise Solution:

The $Config variable in the CanIt software is a large array holding the settings for a wide variety of CanIt configurations. It can be used to control CanIt's default behaviour. To access it you need to create the file, If it does not already exist:

  /var/www/canit/site/config.php

In the file if not already there you need to add:

  <?php
  global $Config;
  $Config['>>config_item<<'] = '>>config_value<<';
  ?>

Where:

  • - where $Config['>>config_item<<'] = '>>config_value<<'; will be specific to the configuration you are changing (multiple entries allowed), and
  • - There's no whitespace before <?php or after ?>.

To set the default theme to use you need the following setting:

  $Config['Theme:Name'] = 'postmodern';

To set the list of allowable themes the user can select:

  $Config['Themes:permitted'] = array('postmodern', 'rpweb');

These must be entered in the file /var/www/canit/site/config.php. See CanIt $Config page for details.

Hosted CanIt Solution:

To make the setting in Hosted CanIt the Roaring Penguin support staff need to execute the following SQL statement using your choice of defaul theme (postmodern used in example) and realm setting.

  BEGIN;
  INSERT INTO preferences (user_id, variable, value, realm) VALUES('*', '_switcheroo_theme', 'postmodern', 'some-realm-name');
  <if it returns "INSERT 0 1" which indicates ONLY one row inserted, then> 
  COMMIT; 
  <otherwise> 
  ROLLBACK;