Changeset 5446 for trunk/admin


Ignore:
Timestamp:
Mar 29, 2010, 3:30:02 PM (14 years ago)
Author:
patdenice
Message:

feature 1502: Allow to have configuration page for each theme.css.
About string for theme has to be saved in language theme directory (about.html)

Location:
trunk/admin
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/themes.class.php

    r5382 r5446  
    7171    }
    7272
     73    $file_to_include = PHPWG_THEMES_PATH.'/'.$theme_id.'/admin/maintain.inc.php';
     74
    7375    $errors = array();
    7476
     
    101103          break;
    102104        }
    103        
    104         $query = "
     105
     106        if (file_exists($file_to_include))
     107        {
     108          include($file_to_include);
     109          if (function_exists('theme_activate'))
     110          {
     111            theme_activate($theme_id, $this->fs_themes[$theme_id]['version'], $errors);
     112          }
     113        }
     114
     115        if (empty($errors))
     116        {
     117          $query = "
    105118INSERT INTO ".THEMES_TABLE."
    106119  SET id = '".$theme_id."'
     
    108121    , name = '".$this->fs_themes[$theme_id]['name']."'
    109122;";
    110         pwg_query($query);
     123          pwg_query($query);
     124        }
    111125        break;
    112126
     
    151165          $this->set_default_theme($new_theme);
    152166        }
    153        
     167
     168        if (file_exists($file_to_include))
     169        {
     170          include($file_to_include);
     171          if (function_exists('theme_deactivate'))
     172          {
     173            theme_deactivate($theme_id);
     174          }
     175        }
     176
    154177        $query = "
    155178DELETE
     
    375398              ;
    376399          }
    377          
     400
     401          $admin_file = $path.'/admin/admin.inc.php';
     402          if (file_exists($admin_file))
     403          {
     404            $theme['admin_uri'] = get_root_url().'admin.php?page=theme&theme='.$file;
     405          }
     406
    378407          // IMPORTANT SECURITY !
    379408          $theme = array_map('htmlspecialchars', $theme);
  • trunk/admin/themes/default/default-layout.css

    r5383 r5446  
    750750}
    751751
    752 .themeBox {display:inline-block; text-align:center; height:180px; background-color:#eee; margin:5px; -moz-border-radius:5px;}
     752.themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; -moz-border-radius:5px; overflow:hidden; }
    753753
    754754.themeBox IMG {border:1px solid white; margin:0 15px;}
    755755.themeName {font-size:1.1em; margin:5px 0;}
    756 .themeActions {margin:5px 0; font-size:12px;}
     756.themeActions {display: table-row; font-size:12px; height: 43px; }
     757.themeActions DIV {display: table-cell; vertical-align: middle; line-height:18px; }
    757758.themeActions A {}
    758759
  • trunk/admin/themes/default/template/themes_installed.tpl

    r5382 r5446  
    1414    <div class="themeShot"><img src="{$theme.screenshot}"></div>
    1515    <div class="themeActions">
    16 
     16      <div>
    1717{if $theme.deactivable}
    1818      <a href="{$deactivate_baseurl}{$theme.id}" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a>
     
    2424      | <a href="{$set_default_baseurl}{$theme.id}" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a>
    2525{/if}
     26{if isset($theme.admin_uri)}
     27      <br><a href="{$theme.admin_uri}" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a>
     28{/if}
     29      </div>
    2630    </div> <!-- themeActions -->
    2731  </div>
     
    4044    <div class="themeShot"><img src="{$theme.screenshot}"></div>
    4145    <div class="themeActions">
    42 
     46      <div>
    4347  {if $theme.activable}
    4448      <a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}">{'Activate'|@translate}</a>
     
    5458      <span title="{$theme.delete_tooltip}">{'Delete'|@translate}</span>
    5559  {/if}
    56 
     60      </div>
    5761    </div>
    5862   
Note: See TracChangeset for help on using the changeset viewer.