plugins/EnaniumBackgrounds.php
author Dan
Sun, 10 May 2009 13:13:04 -0400
changeset 2 178d22e361d6
parent 1 b69d36dc637e
child 3 f0a844799a0c
permissions -rw-r--r--
Now skips any of the included/localized backgrounds if they don't exist.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
     1
<?php
e8db3e017691 First revision.
Dan
parents:
diff changeset
     2
/**!info**
e8db3e017691 First revision.
Dan
parents:
diff changeset
     3
{
e8db3e017691 First revision.
Dan
parents:
diff changeset
     4
  "Plugin Name"  : "Enanium backgrounds",
e8db3e017691 First revision.
Dan
parents:
diff changeset
     5
  "Plugin URI"   : "http://enanocms.org/plugin/enaniumbg",
e8db3e017691 First revision.
Dan
parents:
diff changeset
     6
  "Description"  : "Provides several additional background images for Enanium.",
e8db3e017691 First revision.
Dan
parents:
diff changeset
     7
  "Author"       : "Dan Fuhry",
e8db3e017691 First revision.
Dan
parents:
diff changeset
     8
  "Version"      : "1.1.6",
e8db3e017691 First revision.
Dan
parents:
diff changeset
     9
  "Author URI"   : "http://enanocms.org/"
e8db3e017691 First revision.
Dan
parents:
diff changeset
    10
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
    11
**!*/
e8db3e017691 First revision.
Dan
parents:
diff changeset
    12
e8db3e017691 First revision.
Dan
parents:
diff changeset
    13
// $plugins->attachHook('enanium_search_form', 'enanium_paint_bg_controls();');
e8db3e017691 First revision.
Dan
parents:
diff changeset
    14
$plugins->attachHook('enanium_main_header', 'enanium_paint_bg_controls();');
e8db3e017691 First revision.
Dan
parents:
diff changeset
    15
$plugins->attachHook('compile_template', 'enanium_add_headers();');
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    16
$plugins->attachHook('acl_rule_init', '$this->addAdminNode("adm_cat_appearance", "enaniumbg_acppage", "EnaniumConfig", scriptPath . "/plugins/enaniumbg/icons/garden.png");');
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    17
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    18
$ebg_system_images = array('default', 'aqua', 'blinds', 'dune', 'freshflower', 'garden', 'greenmeadow', 'ladybird', 'raindrops', 'storm', 'twowings', 'wood', 'yellowflower');
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    19
$ebg_images = array();
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    20
e8db3e017691 First revision.
Dan
parents:
diff changeset
    21
$ebg_outsiders = array();
e8db3e017691 First revision.
Dan
parents:
diff changeset
    22
if ( $dr = @opendir(ENANO_ROOT . '/plugins/enaniumbg') )
e8db3e017691 First revision.
Dan
parents:
diff changeset
    23
{
e8db3e017691 First revision.
Dan
parents:
diff changeset
    24
  while ( $dh = @readdir($dr) )
e8db3e017691 First revision.
Dan
parents:
diff changeset
    25
  {
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    26
    if ( $dh == '.' || $dh == '..' || is_dir(ENANO_ROOT . "/plugins/enaniumbg/$dh") )
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    27
      continue;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    28
    
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    29
    if ( !preg_match('/\.jpg$/', $dh) )
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    30
      continue;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    31
    
e8db3e017691 First revision.
Dan
parents:
diff changeset
    32
    $dh = preg_replace('/\.jpg$/', '', $dh);
e8db3e017691 First revision.
Dan
parents:
diff changeset
    33
    
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    34
    if ( in_array($dh, $ebg_system_images) )
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    35
    {
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    36
      $ebg_images[] = $dh;
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    37
      continue;
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    38
    }
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    39
    
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    40
    if ( !file_exists(ENANO_ROOT . "/plugins/enaniumbg/icons/$dh.png") )
e8db3e017691 First revision.
Dan
parents:
diff changeset
    41
      continue;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    42
    
e8db3e017691 First revision.
Dan
parents:
diff changeset
    43
    $ebg_outsiders[] = $dh;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    44
  }
e8db3e017691 First revision.
Dan
parents:
diff changeset
    45
  closedir($dr);
e8db3e017691 First revision.
Dan
parents:
diff changeset
    46
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
    47
unset($dh, $dr);
e8db3e017691 First revision.
Dan
parents:
diff changeset
    48
e8db3e017691 First revision.
Dan
parents:
diff changeset
    49
function enanium_paint_bg_controls()
e8db3e017691 First revision.
Dan
parents:
diff changeset
    50
{
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    51
  global $ebg_system_images, $ebg_images, $ebg_outsiders;
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    52
  global $lang;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    53
  
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    54
  if ( !getConfig('enanium_show_switcher', 1) )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    55
    return;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    56
  
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    57
  ?>
e8db3e017691 First revision.
Dan
parents:
diff changeset
    58
  <div id="enanium_bg_list">
e8db3e017691 First revision.
Dan
parents:
diff changeset
    59
    <?php
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    60
    foreach ( $ebg_system_images as $i => $image )
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    61
    {
2
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    62
      if ( !in_array($image, $ebg_images) )
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    63
        continue;
178d22e361d6 Now skips any of the included/localized backgrounds if they don't exist.
Dan
parents: 1
diff changeset
    64
      
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    65
      $sel = ( $image == getConfig('enanium_bg', 'default') ) ? ' class="selected"' : '';
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    66
      echo '<a' . $sel . ' href="#bg:' . $image . '" id="ebg_' . $image . '" onclick="enanium_change_bg(\'' . $image . '\', this); return false;" title="' . $lang->get('enaniumbg_' . $image) . '">';
e8db3e017691 First revision.
Dan
parents:
diff changeset
    67
      echo enanium_generate_sprite(scriptPath . '/plugins/enaniumbg/icons/sprite.png', 16, 16, 0, $i * 16);
e8db3e017691 First revision.
Dan
parents:
diff changeset
    68
      echo '</a>';
e8db3e017691 First revision.
Dan
parents:
diff changeset
    69
    }
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    70
    foreach ( $ebg_outsiders as $image )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    71
    {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    72
      $sel = ( $image == getConfig('enanium_bg', 'default') ) ? ' class="selected"' : '';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    73
      echo '<a' . $sel . ' href="#bg:' . $image . '" id="ebg_' . $image . '" onclick="enanium_change_bg(\'' . $image . '\', this); return false;" title="' . htmlspecialchars(ucwords(str_replace('_', ' ', $image))) . '">';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    74
      echo '<img alt=" " src="' . scriptPath . '/plugins/enaniumbg/icons/' . $image . '.png" />';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    75
      echo '</a>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    76
    }
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    77
    ?>
e8db3e017691 First revision.
Dan
parents:
diff changeset
    78
  </div>
e8db3e017691 First revision.
Dan
parents:
diff changeset
    79
  <?php
e8db3e017691 First revision.
Dan
parents:
diff changeset
    80
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
    81
e8db3e017691 First revision.
Dan
parents:
diff changeset
    82
function enanium_add_headers()
e8db3e017691 First revision.
Dan
parents:
diff changeset
    83
{
e8db3e017691 First revision.
Dan
parents:
diff changeset
    84
  global $db, $session, $paths, $template, $plugins; // Common objects
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    85
  global $ebg_images, $ebg_outsiders;
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
    86
  global $lang;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    87
  
e8db3e017691 First revision.
Dan
parents:
diff changeset
    88
  if ( $template->theme != 'enanium' )
e8db3e017691 First revision.
Dan
parents:
diff changeset
    89
    return;
e8db3e017691 First revision.
Dan
parents:
diff changeset
    90
  
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    91
  $repeat = getConfig('enanium_background_repeat', 'no-repeat');
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    92
  $attachment = getConfig('enanium_background_attachment', 'fixed');
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    93
  $position = getConfig('enanium_background_position', 'center top');
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    94
  
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    95
  if ( getConfig('enanium_show_switcher', 1) )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    96
  {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    97
    $template->add_header('<link rel="stylesheet" type="text/css" href="' . scriptPath . '/plugins/enaniumbg/enaniumbg.css" />');
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    98
    
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
    99
    $addheader = <<<EOF
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   100
    <script type="text/javascript">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   101
      var enanium_bg_repeat = '$repeat';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   102
      var enanium_bg_attachment = '$attachment';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   103
      var enanium_bg_position = '$position';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   104
    </script>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   105
EOF;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   106
    $template->add_header($addheader);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   107
    $template->add_header('<script type="text/javascript" src="' . scriptPath . '/plugins/enaniumbg/enaniumbg.js"></script>');
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   108
  }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   109
  
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   110
  if ( ($img = getConfig('enanium_bg', 'default')) !== 'default' )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   111
  {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   112
    if ( !file_exists(ENANO_ROOT . "/plugins/enaniumbg/$img.jpg") )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   113
      return;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   114
    
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   115
    $scriptpath = scriptPath;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   116
    $addheader = <<<EOF
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   117
    <style type="text/css">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   118
      body {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   119
        background-image: url({$scriptpath}/plugins/enaniumbg/{$img}.jpg);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   120
        background-color: #000000;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   121
        background-repeat: $repeat;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   122
        background-attachment: $attachment;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   123
        background-position: $position;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   124
      }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   125
      td#cell-content {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   126
        background-color: transparent;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   127
        background-image: url({$scriptpath}/plugins/enaniumbg/transw70.png);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   128
      }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   129
    </style>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   130
EOF;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   131
    $template->add_header($addheader);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   132
  }
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
   133
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
   134
e8db3e017691 First revision.
Dan
parents:
diff changeset
   135
function enanium_generate_sprite($sprite, $width, $height, $start_x, $start_y)
e8db3e017691 First revision.
Dan
parents:
diff changeset
   136
{
e8db3e017691 First revision.
Dan
parents:
diff changeset
   137
  $start_x = 0 - $start_x;
e8db3e017691 First revision.
Dan
parents:
diff changeset
   138
  $start_y = 0 - $start_y;
e8db3e017691 First revision.
Dan
parents:
diff changeset
   139
  return '<img alt=" " src="' . cdnPath . '/images/spacer.gif" width="' . $width . '" height="' . $height . '" style="background-image: url(\'' . $sprite . '\'); background-repeat: no-repeat; background-position: ' . $start_x . 'px ' . $start_y . 'px;" />';
e8db3e017691 First revision.
Dan
parents:
diff changeset
   140
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
   141
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   142
function page_Admin_EnaniumConfig()
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   143
{
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   144
  global $db, $session, $paths, $template, $plugins; // Common objects
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   145
  global $lang;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   146
  
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   147
  if ( isset($_POST['enanium_bg']) )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   148
  {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   149
    $bg = $_POST['enanium_bg'];
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   150
    if ( file_exists(ENANO_ROOT . "/plugins/enaniumbg/$bg.jpg") )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   151
      setConfig('enanium_bg', $bg);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   152
    
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   153
    $val = isset($_POST['show_switcher']) ? '1' : '0';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   154
    setConfig('enanium_show_switcher', $val);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   155
    
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   156
    setConfig('enanium_background_repeat', $_POST['background_repeat']);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   157
    setConfig('enanium_background_attachment', $_POST['background_attachment']);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   158
    setConfig('enanium_background_position', $_POST['background_position']);
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   159
    
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   160
    echo '<div class="info-box">' . $lang->get('enaniumbg_acp_msg_changes_saved') . '</div>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   161
  }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   162
  
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   163
  acp_start_form();
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   164
  ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   165
  <div class="tblholder">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   166
    <table border="0" cellspacing="1" cellpadding="4">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   167
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   168
        <th colspan="2"><?php echo $lang->get('enaniumbg_acp_th'); ?></th>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   169
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   170
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   171
        <td class="row2" style="width: 50%;">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   172
          <?php echo $lang->get('enaniumbg_acp_field_default_bg'); ?><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   173
          <small><?php echo $lang->get('enaniumbg_acp_field_default_bg_hint'); ?></small>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   174
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   175
        <td class="row1" style="width: 50%;">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   176
          <select name="enanium_bg">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   177
            <?php
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   178
            global $ebg_images, $ebg_outsiders;
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   179
            if ( !empty($ebg_outsiders) )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   180
            {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   181
              foreach ( $ebg_outsiders as $image )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   182
              {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   183
                $sel = $image == getConfig('enanium_bg', 'default') ? 'selected="selected" ' : '';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   184
                echo '<option ' . $sel . 'value="' . $image . '">' . ucwords(str_replace('_', ' ', $image)) . '</option>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   185
              }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   186
              echo '<option disabled="disabled" value="">--------------------</option>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   187
            }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   188
            foreach ( $ebg_images as $image )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   189
            {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   190
              $sel = $image == getConfig('enanium_bg', 'default') ? 'selected="selected" ' : '';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   191
              echo '<option ' . $sel . 'value="' . $image . '">' . $lang->get("enaniumbg_$image") . '</option>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   192
            }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   193
            ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   194
          </select>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   195
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   196
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   197
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   198
        <td class="row2">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   199
          <label for="ebg_chk_show_switcher"><?php echo $lang->get('enaniumbg_acp_field_show_switcher'); ?></label><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   200
          <small><?php echo $lang->get('enaniumbg_acp_field_show_switcher_hint'); ?></small>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   201
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   202
        <td class="row1">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   203
          <input id="ebg_chk_show_switcher" type="checkbox" name="show_switcher" <?php echo getConfig('enanium_show_switcher', 1) == '1' ? 'checked="checked" ' : ''; ?>/>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   204
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   205
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   206
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   207
        <td class="row2">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   208
          <?php echo $lang->get('enaniumbg_acp_field_tile'); ?><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   209
          <small><?php echo $lang->get('enaniumbg_acp_field_tile_hint'); ?></small>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   210
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   211
        <td class="row1">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   212
          <label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   213
            <input type="radio" name="background_repeat" value="repeat" <?php echo getConfig('enanium_background_repeat', 'no-repeat') == 'repeat' ? 'checked="checked" ' : ''; ?>/>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   214
            <?php echo $lang->get('enaniumbg_acp_field_tile_tile'); ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   215
          </label><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   216
          <label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   217
            <input type="radio" name="background_repeat" value="no-repeat" <?php echo getConfig('enanium_background_repeat', 'no-repeat') == 'no-repeat' ? 'checked="checked" ' : ''; ?>/>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   218
            <?php echo $lang->get('enaniumbg_acp_field_tile_norepeat'); ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   219
          </label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   220
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   221
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   222
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   223
        <td class="row2">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   224
          <?php echo $lang->get('enaniumbg_acp_field_scroll'); ?><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   225
          <small><?php echo $lang->get('enaniumbg_acp_field_scroll_hint'); ?></small>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   226
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   227
        <td class="row1">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   228
          <label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   229
            <input type="radio" name="background_attachment" value="fixed" <?php echo getConfig('enanium_background_attachment', 'fixed') == 'fixed' ? 'checked="checked" ' : ''; ?>/>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   230
            <?php echo $lang->get('enaniumbg_acp_field_scroll_fixed'); ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   231
          </label><br />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   232
          <label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   233
            <input type="radio" name="background_attachment" value="scroll" <?php echo getConfig('enanium_background_attachment', 'fixed') == 'scroll' ? 'checked="checked" ' : ''; ?>/>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   234
            <?php echo $lang->get('enaniumbg_acp_field_scroll_scroll'); ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   235
          </label>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   236
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   237
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   238
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   239
        <td class="row2">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   240
          <?php echo $lang->get('enaniumbg_acp_field_anchor'); ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   241
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   242
        <td class="row1">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   243
        <table border="0" style="background-color: transparent; width: 120px; padding: 5px; border: 1px solid #404040;">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   244
            <?php
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   245
            foreach ( array('top', 'center', 'bottom') as $ypos )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   246
            {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   247
              echo '<tr>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   248
              foreach ( array('left', 'center', 'right') as $xpos )
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   249
              {
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   250
                ?><td style="width: 40px; line-height: 30px; text-align: center;"><input type="radio" name="background_position" value="<?php echo "$xpos $ypos"; ?>" <?php echo getConfig('enanium_background_position', 'center top') == "$xpos $ypos" ? 'checked="checked" ' : ''; ?>/><?php
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   251
              }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   252
              echo '</tr>';
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   253
            }
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   254
            ?>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   255
          </table>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   256
        </td>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   257
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   258
      <tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   259
        <th class="subhead" colspan="2">
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   260
          <input type="submit" value="<?php echo $lang->get('etc_save_changes'); ?>" />
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   261
        </th>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   262
      </tr>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   263
    </table>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   264
  </div>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   265
  </form>
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   266
  <?php
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   267
}
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   268
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
   269
/**!language**
e8db3e017691 First revision.
Dan
parents:
diff changeset
   270
<code>
e8db3e017691 First revision.
Dan
parents:
diff changeset
   271
{
e8db3e017691 First revision.
Dan
parents:
diff changeset
   272
  eng: {
e8db3e017691 First revision.
Dan
parents:
diff changeset
   273
    categories: ['meta', 'enaniumbg'],
e8db3e017691 First revision.
Dan
parents:
diff changeset
   274
    strings: {
e8db3e017691 First revision.
Dan
parents:
diff changeset
   275
      meta: {
e8db3e017691 First revision.
Dan
parents:
diff changeset
   276
        enaniumbg: 'Enanium backgrounds',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   277
      },
e8db3e017691 First revision.
Dan
parents:
diff changeset
   278
      enaniumbg: {
e8db3e017691 First revision.
Dan
parents:
diff changeset
   279
        default: 'Default',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   280
        aqua: 'Aqua',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   281
        blinds: 'Blinds',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   282
        dune: 'Dune',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   283
        freshflower: 'Fresh flower',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   284
        garden: 'Garden',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   285
        greenmeadow: 'Greenmeadow',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   286
        ladybird: 'Ladybird',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   287
        raindrops: 'Raindrops',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   288
        storm: 'Storm',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   289
        twowings: 'Two Wings',
e8db3e017691 First revision.
Dan
parents:
diff changeset
   290
        wood: 'Wood',
1
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   291
        yellowflower: 'Yellow flower',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   292
        
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   293
        acp_th: 'Enanium background configuration',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   294
        acp_field_default_bg: 'Default background:',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   295
        acp_field_default_bg_hint: '<b>Tip:</b> You can add more backgrounds to Enanium! Upload a JPEG image to plugins/enaniumbg/. Then, upload a 16x16 icon of the image, with the same filename, to plugins/enaniumbg/icons/. The plugin will automatically add the image to the list here and to the switcher, if enabled.',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   296
        acp_field_show_switcher: 'Show background switcher:',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   297
        acp_field_show_switcher_hint: 'If the switcher is turned off, the background selected above will always be used.',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   298
        
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   299
        acp_field_tile: 'Allow background to be tiled:',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   300
        acp_field_tile_hint: 'If this is off, the background will be letterboxed and/or pillarboxed if the screen is too small.',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   301
        acp_field_tile_tile: 'Tile',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   302
        acp_field_tile_norepeat: 'Don\'t tile',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   303
        
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   304
        acp_field_scroll: 'Scroll background image with page:',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   305
        acp_field_scroll_hint: 'This may produce undesired results if "%this.enaniumbg_acp_field_tile_norepeat%" is selected.',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   306
        acp_field_scroll_fixed: 'Background fixed and always in view',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   307
        acp_field_scroll_scroll: 'Scroll background',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   308
        
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   309
        acp_field_anchor: 'Background position anchor:',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   310
        
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   311
        acp_msg_changes_saved: 'Your changes have been saved.',
b69d36dc637e Added several configurability features.
Dan
parents: 0
diff changeset
   312
        acppage: 'Enanium configuration',
0
e8db3e017691 First revision.
Dan
parents:
diff changeset
   313
      }
e8db3e017691 First revision.
Dan
parents:
diff changeset
   314
    }
e8db3e017691 First revision.
Dan
parents:
diff changeset
   315
  }
e8db3e017691 First revision.
Dan
parents:
diff changeset
   316
}
e8db3e017691 First revision.
Dan
parents:
diff changeset
   317
</code>
e8db3e017691 First revision.
Dan
parents:
diff changeset
   318
**!*/
e8db3e017691 First revision.
Dan
parents:
diff changeset
   319