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