Changeset 5446
- Timestamp:
- Mar 29, 2010, 3:30:02 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/about.php
r5208 r5446 39 39 include(PHPWG_ROOT_PATH.'include/page_header.php'); 40 40 41 /** 42 * set in ./local/language/en_UK.lang.php (maybe to create) 43 * for example for clear theme: 44 $lang['Theme: clear'] = 'This is the clear theme based on yoga template. '. 45 ' A standard template/theme of PhpWebgallery.'; 46 * 47 * Don't forget php tags !!! 48 * 49 * Another way is to code it thru the theme itself in ./themeconf.inc.php 50 */ 51 @include(PHPWG_ROOT_PATH.'template/'.$user['template']. 52 '/theme/'.$user['theme'].'/themeconf.inc.php'); 53 54 $template->set_filenames( 55 array( 56 'about'=>'about.tpl', 57 ) 58 ); 59 if ( isset($lang['Theme: '.$user['theme']]) ) 60 { 61 $template->assign( 62 'THEME_ABOUT',l10n('Theme: '.$user['theme']) 63 ); 64 } 41 $template->set_filename('about', 'about.tpl'); 65 42 66 43 $template->assign('ABOUT_MESSAGE', load_language('about.html','', array('return'=>true)) ); 44 45 $theme_about = load_language('about.html', PHPWG_THEMES_PATH.$user['theme'].'/', array('return' => true)); 46 if ( $theme_about !== false ) 47 { 48 $template->assign('THEME_ABOUT', $theme_about); 49 } 67 50 68 51 $template->pparse('about'); -
trunk/admin/include/themes.class.php
r5382 r5446 71 71 } 72 72 73 $file_to_include = PHPWG_THEMES_PATH.'/'.$theme_id.'/admin/maintain.inc.php'; 74 73 75 $errors = array(); 74 76 … … 101 103 break; 102 104 } 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 = " 105 118 INSERT INTO ".THEMES_TABLE." 106 119 SET id = '".$theme_id."' … … 108 121 , name = '".$this->fs_themes[$theme_id]['name']."' 109 122 ;"; 110 pwg_query($query); 123 pwg_query($query); 124 } 111 125 break; 112 126 … … 151 165 $this->set_default_theme($new_theme); 152 166 } 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 154 177 $query = " 155 178 DELETE … … 375 398 ; 376 399 } 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 378 407 // IMPORTANT SECURITY ! 379 408 $theme = array_map('htmlspecialchars', $theme); -
trunk/admin/themes/default/default-layout.css
r5383 r5446 750 750 } 751 751 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; } 753 753 754 754 .themeBox IMG {border:1px solid white; margin:0 15px;} 755 755 .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; } 757 758 .themeActions A {} 758 759 -
trunk/admin/themes/default/template/themes_installed.tpl
r5382 r5446 14 14 <div class="themeShot"><img src="{$theme.screenshot}"></div> 15 15 <div class="themeActions"> 16 16 <div> 17 17 {if $theme.deactivable} 18 18 <a href="{$deactivate_baseurl}{$theme.id}" title="{'Forbid this theme to users'|@translate}">{'Deactivate'|@translate}</a> … … 24 24 | <a href="{$set_default_baseurl}{$theme.id}" title="{'Set as default theme for unregistered and new users'|@translate}">{'Default'|@translate}</a> 25 25 {/if} 26 {if isset($theme.admin_uri)} 27 <br><a href="{$theme.admin_uri}" title="{'Configuration'|@translate}">{'Configuration'|@translate}</a> 28 {/if} 29 </div> 26 30 </div> <!-- themeActions --> 27 31 </div> … … 40 44 <div class="themeShot"><img src="{$theme.screenshot}"></div> 41 45 <div class="themeActions"> 42 46 <div> 43 47 {if $theme.activable} 44 48 <a href="{$activate_baseurl}{$theme.id}" title="{'Make this theme available to users'|@translate}">{'Activate'|@translate}</a> … … 54 58 <span title="{$theme.delete_tooltip}">{'Delete'|@translate}</span> 55 59 {/if} 56 60 </div> 57 61 </div> 58 62 -
trunk/include/template.class.php
r5434 r5446 95 95 $this->set_template_dir($root.'/'.$theme.'/'.$path); 96 96 97 include($root.'/'.$theme.'/themeconf.inc.php');97 $themeconf = $this->load_themeconf($root.'/'.$theme); 98 98 99 99 if (isset($themeconf['parent']) and $themeconf['parent'] != $theme) … … 574 574 return $source; 575 575 } 576 577 function load_themeconf($dir) 578 { 579 global $themeconfs, $conf, $page; 580 581 $dir = realpath($dir); 582 if (!isset($themeconfs[$dir])) 583 { 584 $themeconf = array(); 585 include($dir.'/themeconf.inc.php'); 586 // Put themeconf in cache 587 $themeconfs[$dir] = $themeconf; 588 } 589 return $themeconfs[$dir]; 590 } 576 591 } 577 592
Note: See TracChangeset
for help on using the changeset viewer.