Changeset 7171 for extensions/theme_switch
- Timestamp:
- Oct 13, 2010, 1:05:53 PM (14 years ago)
- Location:
- extensions/theme_switch/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/theme_switch/trunk/flags.tpl
r7093 r7171 1 1 </ul> 2 2 <ul class="categoryActions"> 3 <li class=" menuf">3 <li class="theme_menuf"> 4 4 <div> 5 5 <ul> 6 6 <li> 7 7 <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}"/> 9 9 </a> 10 10 <!--[if lte IE 6]> 11 11 <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}"/> 13 13 <table> 14 14 <tr> 15 15 <td> 16 16 <![endif]--> 17 <ul class=" flag-pan">17 <ul class="theme_flag-pan"> 18 18 {foreach from=$theme_switch.flags key=code item=flag name=f} 19 19 <li> 20 20 <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}"/> 22 22 </a> 23 23 </li> -
extensions/theme_switch/trunk/main.inc.php
r7093 r7171 37 37 // Only themes which have screenshot.png icon provided will be provided to users. 38 38 39 // add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 95 );39 add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 85 ); 40 40 41 41 // If you want user to choose using select control then use following handler. 42 42 // All available themes will be provided to users. 43 43 44 add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 95 );44 add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 15 ); 45 45 46 46 // 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 1 1 @import "theme_switch-default.css"; 2 2 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; } 5 5 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 22 22 if (!defined('THEME_SWITCH_PATH')) 23 23 define('THEME_SWITCH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/'); 24 25 include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 24 26 25 27 class theme_controler { … … 61 63 } // function _switch() 62 64 65 static 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(); 72 foreach ($db_themes as $db_theme) 73 { 74 array_push($db_theme_ids, $db_theme['id']); 75 } 76 77 $active_themes = array(); 78 79 80 foreach ($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 86 return $active_themes; 87 } // function _installed_themes() 88 89 63 90 static public function _flags() 64 91 // Lets user choose from icons … … 71 98 72 99 $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'; 76 103 77 104 if (file_exists($qlc_img)) { 78 105 79 106 $qlc_url = str_replace(array('=&','?&'),array('&','?'), 80 add_url_params( $url_starting, array( 'theme' => $theme _id)));107 add_url_params( $url_starting, array( 'theme' => $theme['id'] ))); 81 108 if (isset($lang['theme'])) 82 $qlc_alt = $lang['theme'].' : '.ucwords( $theme);109 $qlc_alt = $lang['theme'].' '.ucwords( $theme['name'] ); 83 110 else 84 $qlc_alt = ucwords( $theme );111 $qlc_alt = ucwords( $theme['name'] ); 85 112 $qlc_title = $qlc_alt; 86 113 $qlc = array ( … … 89 116 'img' => $qlc_img, 90 117 ); 91 if ( $theme _id!== $user['theme'])92 $lsw['flags'][$theme _id] = $qlc ;118 if ( $theme['id'] !== $user['theme']) 119 $lsw['flags'][$theme['id']] = $qlc ; 93 120 else $lsw['Active'] = $qlc; 94 121 } … … 106 133 } // function _flags() 107 134 135 108 136 static public function _select() 109 137 // Lets user choose using select control … … 114 142 $available_theme = get_pwg_themes(); 115 143 $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 ' <select onchange="javasript:window.location=this.value">'; 147 foreach ( theme_controler::_installed_themes() as $theme ) 121 148 { 122 149 $qlc_url = str_replace(array('=&','?&'),array('&','?'), 123 add_url_params( $url_starting, array( 'theme' => $theme _id) ));150 add_url_params( $url_starting, array( 'theme' => $theme['id'] ) )); 124 151 125 if ( $theme _id== $user['theme'] )152 if ( $theme['id'] == $user['theme'] ) 126 153 $tmp='" selected="selected">'; 127 154 else 128 155 $tmp='">'; 129 156 $options=$options.' 130 <option label="'.$theme .'" value="'.$qlc_url.$tmp.$theme.'</option>';157 <option label="'.$theme['name'].'" value="'.$qlc_url.$tmp.$theme['name'].'</option>'; 131 158 } 132 159 $options=$options.'
Note: See TracChangeset
for help on using the changeset viewer.