Changeset 5153
- Timestamp:
- Mar 17, 2010, 1:48:38 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin.php
r5143 r5153 124 124 'U_CONFIG_EXTENTS'=> $link_start.'extend_for_templates', 125 125 'U_CONFIG_MENUBAR'=> $link_start.'menubar', 126 'U_CONFIG_THEMES'=> $link_start.'themes_ new',126 'U_CONFIG_THEMES'=> $link_start.'themes_installed', 127 127 'U_CATEGORIES'=> $link_start.'cat_list', 128 128 'U_MOVE'=> $link_start.'cat_move', -
trunk/admin/include/plugins.class.php
r5143 r5153 269 269 * Retrieve PEM server datas to $server_plugins 270 270 */ 271 function get_server_plugins($new=false , $ext_type='plugin')271 function get_server_plugins($new=false) 272 272 { 273 273 global $user; 274 275 $pem_category_id = 12;276 if ('theme' == $ext_type)277 {278 $pem_category_id = 10;279 }280 274 281 275 // Retrieve PEM versions 282 276 $version = PHPWG_VERSION; 283 277 $versions_to_check = array(); 284 $url = PEM_URL . '/api/get_version_list.php?category_id= '.$pem_category_id.'&format=php';278 $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php'; 285 279 if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) 286 280 { … … 314 308 315 309 // Retrieve PEM plugins infos 316 $url = PEM_URL . '/api/get_revision_list.php?category_id= '.$pem_category_id.'&format=php&last_revision_only=true';310 $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true'; 317 311 $url .= '&version=' . implode(',', $versions_to_check); 318 312 $url .= '&lang=' . substr($user['language'], 0, 2); … … 371 365 * @param string - plugin id or extension id 372 366 */ 373 function extract_plugin_files($action, $revision, $dest, $ext_type = 'plugin') 374 { 375 if ('plugin' == $ext_type) 376 { 377 $install_basedir = PHPWG_PLUGINS_PATH; 378 $main_filename = 'main.inc.php'; 379 } 380 elseif ('theme' == $ext_type) 381 { 382 $install_basedir = PHPWG_ROOT_PATH.'themes/'; 383 $main_filename = 'themeconf.inc.php'; 384 } 385 else 386 { 387 fatal_error('unknown extension type "'.$ext_type.'"'); 388 } 389 390 if ($archive = tempnam( $install_basedir, 'zip')) 367 function extract_plugin_files($action, $revision, $dest) 368 { 369 if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip')) 391 370 { 392 371 $url = PEM_URL . '/download.php?rid=' . $revision; … … 403 382 { 404 383 // we search main.inc.php in archive 405 if (basename($file['filename']) == $main_filename384 if (basename($file['filename']) == 'main.inc.php' 406 385 and (!isset($main_filepath) 407 386 or strlen($file['filename']) < strlen($main_filepath))) … … 415 394 if ($action == 'upgrade') 416 395 { 417 $extract_path = $install_basedir. $dest;396 $extract_path = PHPWG_PLUGINS_PATH . $dest; 418 397 } 419 398 else 420 399 { 421 $extract_path = $install_basedir400 $extract_path = PHPWG_PLUGINS_PATH 422 401 . ($root == '.' ? 'extension_' . $dest : basename($root)); 423 402 } -
trunk/admin/themes/default/default-layout.css
r5145 r5153 738 738 } 739 739 740 .themeBox {float:left; text-align:center; height:1 70px; background-color:#eee; margin:5px; -moz-border-radius:5px;}740 .themeBox {float:left; text-align:center; height:180px; background-color:#eee; margin:5px; -moz-border-radius:5px;} 741 741 .themeBox IMG {border:1px solid white; margin:0 15px;} 742 742 .themeName {font-size:1.1em; margin:5px 0;} 743 .themeActions {margin:5px 0;} 744 .themeActions A {display:block;} 743 .themeActions {margin:5px 0; font-size:12px;} 744 .themeActions A {} 745 746 #themesContent .themeBox IMG {width:150px; height:120px;} 747 #themesContent H3 {font-size:16px; text-align:left; border-bottom:1px solid #444; letter-spacing:1px; margin:5px;} 748 749 .themeBoxes {min-height:300px;} -
trunk/admin/themes/default/template/footer.tpl
r5123 r5153 46 46 <script type='text/javascript'> 47 47 $(function() { 48 $('#pwgHead A, #footer A ').tipTip({48 $('#pwgHead A, #footer A, .themeActions A').tipTip({ 49 49 'delay' : 0, 50 50 'fadeIn' : 200, -
trunk/admin/themes/default/template/themes_new.tpl
r5145 r5153 1 1 <div class="titrePage"> 2 <h2>{' InstallNew Theme'|@translate}</h2>2 <h2>{'Add New Theme'|@translate}</h2> 3 3 </div> 4 4 5 5 {if isset($themes)} 6 <div id="theme sBox">6 <div id="themeBoxes"> 7 7 {foreach from=$new_themes item=theme name=themes_loop} 8 8 <div class="themeBox"> 9 9 <div class="themeName">{$theme.name}</div> 10 <div class="themeShot"><img src="{$theme.s rc}"></div>11 <div class="themeActions"><a href="{$theme.install_url}"> Install</a></div>10 <div class="themeShot"><img src="{$theme.screenshot}"></div> 11 <div class="themeActions"><a href="{$theme.install_url}">{'Install'|@translate}</a></div> 12 12 </div> 13 13 {/foreach} 14 </div> <!-- theme sBox-->14 </div> <!-- themeBoxes --> 15 15 {/if} -
trunk/admin/themes/roma/theme.css
r5145 r5153 223 223 .themeName {color:white;} 224 224 .themeActions A {border-bottom:none;} 225 226 .themeDefault {background-color:#555;} -
trunk/admin/themes_new.php
r5143 r5153 3 3 // | Piwigo - a PHP based picture gallery | 4 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-20 09Piwigo Team http://piwigo.org |5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | … … 27 27 } 28 28 29 include_once(PHPWG_ROOT_PATH.'admin/include/ plugins.class.php');29 include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 30 30 31 31 $base_url = get_root_url().'admin.php?page='.$page['page']; 32 32 33 $themes = new plugins(); 33 $themes = new themes(); 34 $themes->set_tabsheet('themes_new'); 34 35 35 36 // +-----------------------------------------------------------------------+ … … 55 56 if (isset($_GET['revision']) and isset($_GET['extension']) and !is_adviser()) 56 57 { 57 $install_status = $themes->extract_ plugin_files(58 $install_status = $themes->extract_theme_files( 58 59 'install', 59 60 $_GET['revision'], 60 $_GET['extension'], 61 'theme' 61 $_GET['extension'] 62 62 ); 63 63 … … 106 106 $template->set_filenames(array('themes' => 'themes_new.tpl')); 107 107 108 if ($themes->get_server_ plugins(true, 'theme'))108 if ($themes->get_server_themes(true)) // only new themes 109 109 { 110 foreach($themes->server_ plugins as $theme)110 foreach($themes->server_themes as $theme) 111 111 { 112 112 $url_auto_install = htmlentities($base_url) … … 119 119 array( 120 120 'name' => $theme['extension_name'], 121 's rc' => PEM_URL.'/upload/extension-'.$theme['extension_id'].'/thumbnail.jpg',121 'screenshot' => PEM_URL.'/upload/extension-'.$theme['extension_id'].'/thumbnail.jpg', 122 122 'install_url' => $url_auto_install, 123 123 ) -
trunk/include/config_default.inc.php
r5138 r5153 769 769 // where should the user be guided when there is no photo in his gallery yet? 770 770 $conf['no_photo_yet_url'] = 'admin.php?page=photos_add'; 771 772 // directory with themes inside 773 $conf['themes_dir'] = PHPWG_ROOT_PATH.'themes'; 771 774 ?> -
trunk/include/constants.php
r5014 r5153 25 25 define('PHPWG_VERSION', 'Colibri'); 26 26 define('PHPWG_DEFAULT_LANGUAGE', 'en_UK'); 27 define('PHPWG_DEFAULT_TEMPLATE', 'yoga/Sylvia'); 27 define('PHPWG_DEFAULT_TEMPLATE', 'Sylvia'); 28 29 define('PHPWG_THEMES_PATH', $conf['themes_dir'].'/'); 28 30 29 31 // Required versions … … 98 100 if (!defined('OLD_PERMALINKS_TABLE')) 99 101 define('OLD_PERMALINKS_TABLE', $prefixeTable.'old_permalinks'); 102 if (!defined('THEMES_TABLE')) 103 define('THEMES_TABLE', $prefixeTable.'themes'); 100 104 101 105 ?> -
trunk/include/functions.inc.php
r5138 r5153 714 714 function get_pwg_themes() 715 715 { 716 global $conf;717 716 $themes = array(); 718 717 719 $template_dir = PHPWG_ROOT_PATH.'themes'; 720 721 foreach (get_dirs($template_dir) as $theme) 722 { 723 if ( $theme != 'default' ) 724 { 725 array_push($themes, $theme); 726 } 718 $query = ' 719 SELECT 720 id, 721 name 722 FROM '.THEMES_TABLE.' 723 ORDER BY name ASC 724 ;'; 725 $result = pwg_query($query); 726 while ($row = pwg_db_fetch_assoc($result)) 727 { 728 $themes[ $row['id'] ] = $row['name']; 727 729 } 728 730 729 731 // plugins want remove some themes based on user status maybe? 730 732 $themes = trigger_event('get_pwg_themes', $themes); 733 731 734 return $themes; 732 735 } -
trunk/install/piwigo_structure-mysql.sql
r5123 r5153 294 294 295 295 -- 296 -- Table structure for table `piwigo_themes` 297 -- 298 299 DROP TABLE IF EXISTS `piwigo_themes`; 300 CREATE TABLE `piwigo_themes` ( 301 `id` varchar(64) NOT NULL default '', 302 `version` varchar(64) NOT NULL default '0', 303 `name` varchar(64) default NULL, 304 PRIMARY KEY (`id`) 305 ) TYPE=MyISAM; 306 307 -- 296 308 -- Table structure for table `piwigo_upgrade` 297 309 -- -
trunk/profile.php
r5123 r5153 258 258 )); 259 259 260 foreach (get_pwg_themes() as $pwg_theme) 261 { 262 if (isset($_POST['submit']) or $userdata['theme'] == $pwg_theme) 263 { 264 $template->assign('template_selection', $pwg_theme); 265 } 266 $template_options[$pwg_theme] = $pwg_theme; 267 } 268 $template->assign('template_options', $template_options); 260 $template->assign('template_selection', $userdata['theme']); 261 $template->assign('template_options', get_pwg_themes()); 269 262 270 263 foreach (get_languages() as $language_code => $language_name)
Note: See TracChangeset
for help on using the changeset viewer.