Changeset 7171


Ignore:
Timestamp:
Oct 13, 2010, 1:05:53 PM (10 years ago)
Author:
pab
Message:
 
Location:
extensions/theme_switch/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/theme_switch/trunk/flags.tpl

    r7093 r7171  
    11</ul>
    22<ul class="categoryActions">
    3 <li class="menuf">
     3<li class="theme_menuf">
    44        <div>
    55                <ul>
    66                        <li>
    77                                <a rel="nofollow" href="#">
    8                                         <img class="flags" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
     8                                        <img class="theme_flag" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
    99                                </a>
    1010                                <!--[if lte IE 6]>
    1111                                        <a rel="nofollow" href="#">
    12                                                 <img class="flags" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
     12                                                <img class="theme_flag" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
    1313                                                <table>
    1414                                                        <tr>
    1515                                                                <td>
    1616                                <![endif]-->
    17                                                                         <ul class="flag-pan">
     17                                                                        <ul class="theme_flag-pan">
    1818                                                                        {foreach from=$theme_switch.flags key=code item=flag name=f}
    1919                                                                                <li>
    2020                                                                                        <a rel="nofollow" href="{$SCRIPT_NAME}{$flag.url}">
    21                                                                                                 <img class="flags" src="{$flag.img}" alt="{$flag.alt}" title="{$flag.alt}"/>
     21                                                                                                <img class="theme_flags" src="{$flag.img}" alt="{$flag.alt}" title="{$flag.alt}"/>
    2222                                                                                        </a>
    2323                                                                                </li>
  • extensions/theme_switch/trunk/main.inc.php

    r7093 r7171  
    3737// Only themes which have screenshot.png icon provided will be provided to users.
    3838
    39 // add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 95 );
     39add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 85 );
    4040
    4141// If you want user to choose using select control then use following handler.
    4242// All available themes will be provided to users.
    4343
    44 add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 95 );
     44add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 15 );
    4545
    4646// this is preparation for future version with configuration
  • extensions/theme_switch/trunk/theme_switch-default.css

    r7072 r7171  
    1 .flag-pan { width:132px; z-index:100; border-width:1px; border-style: solid; background-color: #999; padding: 2px 5px 10px 5px; }
    2 .content ul.categoryActions .flag-pan a img.flags { margin: 5px 2px 10px; }
    3 .content ul.categoryActions .flag-pan a { margin: 0; }
    4 .menuf { width:30px; height:24px; display: inline; }
    5 .menuf ul li a, .menuf ul li a:visited {display:block; text-decoration:none; width:44px; height:27px; text-align:center; line-height:27px; overflow:hidden;}
    6 .menuf ul {padding:0; margin:0; list-style: none;}
    7 .menuf ul li {float:left; position:relative; right: 0; top: 0;}
    8 .menuf ul li ul {display: none;}/* specific to non IE browsers */
    9 .menuf li a:hover { border:0 !important;}
    10 .menuf .flags {border-width:1px !important; ; border-style: solid !important; }
    11 .menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-96px; }
    12 .menuf ul li:hover ul li ul {display: none;}
    13 .menuf ul li:hover ul li {display: block;}
    14 .menuf ul li:hover ul li a {display:block;}
    15 .menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0px; top:0;}
     1.theme_flag-pan { width:530px; z-index:800; border-width:1px; border-style: solid; background-color: #999; padding: 2px 5px 10px 5px; }
     2.content ul.categoryActions .theme_flag-pan a img.theme_flags { margin: 5px 2px 10px; }
     3.content ul.categoryActions .theme_flag-pan a { margin: 0; }
     4.theme_menuf { width:40px; height:24px; display: inline; }
     5.theme_menuf ul li a, .theme_menuf ul li a:visited {display:block; text-decoration:none; overflow:hidden;}
     6.theme_menuf ul {padding:0; margin:0; list-style: none;}
     7.theme_menuf ul li {float:left; position:relative; right: 0; top: 0;}
     8.theme_menuf ul li ul {display: none;}/* specific to non IE browsers */
     9.theme_menuf li a:hover { border:0 !important;}
     10.theme_menuf .theme_flags {width:100px !important; ; height:60px; text-align:center; line-height:80px; border-width:1px !important; ; border-style: solid !important; }
     11.theme_menuf .theme_flag {width:44px; height:27px; line-height:27px; text-align:center; border-width:1px !important; ; border-style: solid !important; }
     12.theme_menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-420px; }
     13.theme_menuf ul li:hover ul li ul {display: none;}
     14.theme_menuf ul li:hover ul li {display: block;}
     15.theme_menuf ul li:hover ul li a {display:block;}
     16.theme_menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0; top:0;}
  • extensions/theme_switch/trunk/theme_switch-ie6.css

    r7072 r7171  
    1 .menuf ul li a.hide, .menuf ul li a:visited.hide {display:none;}
    2 .menuf ul li a:hover ul li a.hide {display:none;}
    3 .menuf ul li a:hover ul { display:block; position:absolute; top:-15%; left:-85%; }
    4 .menuf ul li a:hover ul li a {display:block; }
    5 .menuf ul li a:hover ul li a ul {visibility:hidden;}
    6 .menuf ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0;}
     1.theme_menuf ul li a.hide, .theme_menuf ul li a:visited.hide {display:none;}
     2.theme_menuf ul li a:hover ul li a.hide {display:none;}
     3.theme_menuf ul li a:hover ul { display:block; position:absolute; top:-15%; left:-85%; }
     4.theme_menuf ul li a:hover ul li a {display:block; }
     5.theme_menuf ul li a:hover ul li a ul {visibility:hidden;}
     6.theme_menuf ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0;}
  • extensions/theme_switch/trunk/theme_switch.css

    r7072 r7171  
    11@import "theme_switch-default.css";
    22
    3 .flag-pan { border:1px solid; background-color: #111; }
    4 .menuf .flags {border-color: #000 !important; }
     3.theme_flag-pan { border:1px solid; background-color: #111; }
     4.theme_menuf .theme_flags {border-color: #000 !important; }
    55
    6 .flag-pan {     border-radius: 8px; } /* round corners with CSS3 compliant browsers */
    7 .flag-pan { -moz-border-radius:8px; }
    8 .flag-pan { -webkit-border-radius: 8px; }
     6.theme_flag-pan {       border-radius: 8px; } /* round corners with CSS3 compliant browsers */
     7.theme_flag-pan { -moz-border-radius:8px; }
     8.theme_flag-pan { -webkit-border-radius: 8px; }
  • extensions/theme_switch/trunk/theme_switch.inc.php

    r7093 r7171  
    2222if (!defined('THEME_SWITCH_PATH'))
    2323define('THEME_SWITCH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
     24
     25include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
    2426
    2527class theme_controler {
     
    6163} // function _switch()
    6264
     65static public function _installed_themes()
     66// id, name, screenshot 
     67{
     68$themes = new themes();
     69$themes->sort_fs_themes();
     70$db_themes = $themes->get_db_themes();
     71$db_theme_ids = array();
     72foreach ($db_themes as $db_theme)
     73{
     74  array_push($db_theme_ids, $db_theme['id']);
     75}
     76
     77$active_themes = array();
     78
     79
     80foreach ($themes->fs_themes as $theme_id => $fs_theme)
     81{
     82  if (in_array($theme_id, $db_theme_ids))
     83      array_push($active_themes, $fs_theme);
     84}
     85
     86return $active_themes;
     87} // function  _installed_themes()
     88
     89
    6390static public function _flags()
    6491// Lets user choose from icons
     
    7198
    7299  $url_starting = get_query_string_diff(array('theme'));
    73 
    74   foreach ( $available_theme as $theme_id => $theme ) {
    75     $qlc_img =  $conf['themes_dir'].'/'.$theme_id.'/'.'screenshot.png';
     100 
     101  foreach ( theme_controler::_installed_themes() as $theme ) {
     102    $qlc_img =  $theme['screenshot']; // $conf['themes_dir'].'/'.$theme_id.'/'.'screenshot.png';
    76103         
    77104    if (file_exists($qlc_img)) {
    78105     
    79106      $qlc_url = str_replace(array('=&amp;','?&amp;'),array('&amp;','?'),
    80                  add_url_params( $url_starting, array( 'theme' => $theme_id )));
     107                 add_url_params( $url_starting, array( 'theme' => $theme['id'] )));
    81108      if (isset($lang['theme']))
    82         $qlc_alt = $lang['theme'].': '.ucwords( $theme );
     109        $qlc_alt = $lang['theme'].' '.ucwords( $theme['name'] );
    83110      else
    84         $qlc_alt = ucwords( $theme );
     111        $qlc_alt = ucwords( $theme['name'] );
    85112      $qlc_title =  $qlc_alt;
    86113      $qlc = array (
     
    89116        'img' => $qlc_img,
    90117        );
    91       if ( $theme_id !== $user['theme'])
    92         $lsw['flags'][$theme_id] = $qlc ;
     118      if ( $theme['id'] !== $user['theme'])
     119        $lsw['flags'][$theme['id']] = $qlc ;
    93120      else $lsw['Active'] = $qlc;
    94121      }
     
    106133} // function _flags()
    107134
     135
    108136static public function _select()
    109137// Lets user choose using select control
     
    114142  $available_theme = get_pwg_themes();
    115143  $url_starting = get_query_string_diff(array('theme'));
    116   $options='<li><span class="property">
    117    <label for="template">'.$lang['theme'].'</label>
    118   </span>
    119   <select name="template" onchange="javasript:window.location=this.value">';
    120   foreach ( $available_theme as $theme_id => $theme )
     144  $options='<li class="selector">'
     145   .$lang['theme'].
     146    '&nbsp;<select onchange="javasript:window.location=this.value">';
     147  foreach ( theme_controler::_installed_themes() as $theme )
    121148  {
    122149    $qlc_url = str_replace(array('=&amp;','?&amp;'),array('&amp;','?'),
    123       add_url_params( $url_starting, array( 'theme' => $theme_id  ) ));
     150      add_url_params( $url_starting, array( 'theme' => $theme['id']  ) ));
    124151   
    125     if ( $theme_id == $user['theme'] )
     152    if ( $theme['id'] == $user['theme'] )
    126153      $tmp='" selected="selected">';
    127154    else
    128155      $tmp='">';
    129156    $options=$options.'
    130     <option label="'.$theme.'" value="'.$qlc_url.$tmp.$theme.'</option>';
     157    <option label="'.$theme['name'].'" value="'.$qlc_url.$tmp.$theme['name'].'</option>';
    131158  }
    132159  $options=$options.'
Note: See TracChangeset for help on using the changeset viewer.