Changeset 13234
- Timestamp:
- Feb 18, 2012, 9:26:52 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_default.inc.php
r13115 r13234 35 35 $page['nb_image_page'] 36 36 ); 37 38 $selection = trigger_event('loc_index_thumbnails_selection', $selection); 37 39 38 40 if (count($selection) > 0) -
trunk/include/common.inc.php
r13172 r13234 193 193 else 194 194 { // Classic template 195 $theme = $user['theme']; 196 197 if (!isset($_SESSION['is_mobile'])) 198 { 199 include_once(PHPWG_ROOT_PATH.'include/mdetect.php'); 200 $uagent_obj = new uagent_info(); 201 if ($_SESSION['is_mobile'] = $uagent_obj->DetectMobileLong()) 202 { 203 $_SESSION['use_mobile_theme'] = !empty($conf['mobile_theme']); 204 } 205 } 206 if ($_SESSION['is_mobile']) 207 { 208 if (isset($_REQUEST['mobile'])) 209 { 210 $_SESSION['use_mobile_theme'] = get_boolean($_REQUEST['mobile']); 211 } 212 if ($_SESSION['use_mobile_theme']) 213 { 214 $theme = $conf['mobile_theme']; 215 } 216 } 195 $theme = mobile_theme() ? $conf['mobile_theme'] : $user['theme']; 217 196 $template = new Template(PHPWG_ROOT_PATH.'themes', $theme ); 218 197 } -
trunk/include/functions.inc.php
r13086 r13234 1679 1679 return implode('.', array_slice(explode('.', $version), 0, 2)); 1680 1680 } 1681 1682 /** 1683 * return the device type: mobile, tablet or desktop 1684 */ 1685 function get_device() 1686 { 1687 $device = pwg_get_session_var('device'); 1688 1689 if (is_null($device)) 1690 { 1691 include_once(PHPWG_ROOT_PATH.'include/mdetect.php'); 1692 $uagent_obj = new uagent_info(); 1693 if ($uagent_obj->DetectTierIphone()) 1694 { 1695 $device = 'mobile'; 1696 } 1697 elseif ($uagent_obj->DetectTierTablet()) 1698 { 1699 $device = 'tablet'; 1700 } 1701 else 1702 { 1703 $device = 'desktop'; 1704 } 1705 pwg_set_session_var('device', $device); 1706 } 1707 1708 return $device; 1709 } 1710 1711 /** 1712 * return true if mobile theme should be loaded 1713 */ 1714 function mobile_theme() 1715 { 1716 global $conf; 1717 1718 if (empty($conf['mobile_theme'])) 1719 { 1720 return false; 1721 } 1722 1723 if (isset($_GET['mobile'])) 1724 { 1725 $is_mobile_theme = get_boolean($_GET['mobile']); 1726 pwg_set_session_var('mobile_theme', $is_mobile_theme); 1727 unset($_GET['mobile']); 1728 } 1729 else 1730 { 1731 $is_mobile_theme = pwg_get_session_var('mobile_theme'); 1732 } 1733 1734 if (is_null($is_mobile_theme)) 1735 { 1736 $is_mobile_theme = (get_device() == 'mobile'); 1737 pwg_set_session_var('mobile_theme', $is_mobile_theme); 1738 } 1739 1740 return $is_mobile_theme; 1741 } 1681 1742 ?> -
trunk/include/page_tail.php
r12922 r13234 66 66 $template->assign('debug', $debug_vars ); 67 67 68 //------------------------------------------------------------- mobile version 69 if (get_device() != 'desktop') 70 { 71 $template->assign('TOGGLE_MOBILE_THEME_URL', 72 add_url_params( 73 make_index_url(), 74 array('mobile' => mobile_theme() ? 'false' : 'true') 75 ) 76 ); 77 } 78 68 79 trigger_action('loc_end_page_tail'); 69 80 // -
trunk/language/en_UK/admin.lang.php
r13172 r13234 847 847 $lang['Move to album'] = 'Move to album'; 848 848 $lang['You can activate only one mobile theme.'] = 'You can activate only one mobile theme.'; 849 $lang['mobile'] = 'mobile';850 849 ?> -
trunk/language/en_UK/common.lang.php
r13225 r13234 384 384 $lang['If you think you\'ve received this email in error, please contact us at %s'] = 'If you think you\'ve received this email in error, please contact us at %s'; 385 385 $lang['Photo sizes'] = 'Photo sizes'; 386 $lang['View in'] = 'View in'; 387 $lang['Mobile'] = 'Mobile'; 388 $lang['Desktop'] = 'Desktop'; 386 389 ?> -
trunk/language/fr_FR/admin.lang.php
r13229 r13234 845 845 $lang['Move to album'] = 'Déplacer vers l\'album'; 846 846 $lang['You can activate only one mobile theme.'] = 'Vous ne pouvez activer qu\'un seul thème mobile.'; 847 $lang['mobile'] = 'mobile';848 847 $lang['Center of interest'] = 'Centre d\'interêt'; 849 848 $lang['Not cropped correctly?'] = 'La photo n\'est pas recadrée corectement ?'; -
trunk/language/fr_FR/common.lang.php
r13231 r13234 384 384 $lang['Show latest comments first'] = 'Montrer les commentaires les plus récents en premier'; 385 385 $lang['Show oldest comments first'] = 'Montrer les commentaires les plus anciens en premier'; 386 $lang['View in'] = 'Affichage'; 387 $lang['Mobile'] = 'Mobile'; 388 $lang['Desktop'] = 'Classique'; 386 389 ?> -
trunk/themes/default/template/footer.tpl
r8492 r13234 13 13 - {'Contact'|@translate} 14 14 <a href="mailto:{$CONTACT_MAIL}?subject={'A comment on your site'|@translate|@escape:url}">{'Webmaster'|@translate}</a> 15 {/if} 16 {if isset($TOGGLE_MOBILE_THEME_URL)} 17 - {'Display'|@translate} : <a href="{$TOGGLE_MOBILE_THEME_URL}">{'Mobile'|@translate}</a> | <b>{'Classic'|@translate}</b> 15 18 {/if} 16 19 -
trunk/themes/smartpocket/template/footer.tpl
r13182 r13234 1 1 {if !empty($navbar)} 2 {include file='navigation_bar.tpl'|@get_extent:'navbar'} 3 {else} 4 <div class="pwg_footer ui-bar-a"> 5 <h6> 6 {'Powered by'|@translate} <a href="{$PHPWG_URL}" class="Piwigo">Piwigo</a> 7 {$VERSION} 8 {if isset($CONTACT_MAIL)} 9 - {'Contact'|@translate} 10 <a href="mailto:{$CONTACT_MAIL}?subject={'A comment on your site'|@translate|@escape:url}">{'Webmaster'|@translate}</a> 11 {/if} 12 <br>{'Display'|@translate} : 13 <b>{'Mobile'|@translate}</b> | <a href="{$TOGGLE_MOBILE_THEME_URL}">{'Classic'|@translate}</a> 14 </h6> 15 </div> 16 {/if} 2 17 {get_combined_scripts load='footer'} 3 18 </div><!-- /page --> -
trunk/themes/smartpocket/template/header.tpl
r13182 r13234 47 47 48 48 <body> 49 <div data-role="page" >49 <div data-role="page" data-theme="a"> 50 50 51 <div data-role="header" data-theme="c">51 <div data-role="header"> 52 52 <div class="title"> 53 53 <a href="{$U_HOME}" class="home_button" data-icon="home" data-iconpos="notext" data-role="button"></a> -
trunk/themes/smartpocket/template/index.tpl
r13182 r13234 1 <div data-role="content" >1 <div data-role="content" data-theme="a"> 2 2 {if !empty($CATEGORIES)}{$CATEGORIES}{/if} 3 3 {if !empty($THUMBNAILS)}{$THUMBNAILS}{/if} -
trunk/themes/smartpocket/template/infos_errors.tpl
r13182 r13234 1 {if isset($errors) } 2 <div class="errors"> 3 <ul> 4 {foreach from=$errors item=error} 5 <li>{$error}</li> 6 {/foreach} 7 </ul> 1 {if isset($errors)} 2 <div class="ui-bar ui-bar-e errors"> 3 <h3>{'Error'|@translate}</h3> 4 <div><a href="#" data-role="button" data-icon="delete" data-iconpos="notext" class="close-button">Button</a></div> 5 <p>{'<br>'|@implode:$errors}</p> 8 6 </div> 9 7 {/if} 10 8 11 9 {if not empty($infos)} 12 <div class="infos"> 13 <ul> 14 {foreach from=$infos item=info} 15 <li>{$info}</li> 16 {/foreach} 17 </ul> 10 <div class="ui-bar ui-bar-b infos"> 11 <h3>{'Info'|@translate}</h3> 12 <div><a href="#" data-role="button" data-icon="delete" data-iconpos="notext" class="close-button">Button</a></div> 13 <p>{'<br>'|@implode:$infos}</p> 18 14 </div> 19 15 {/if} 16 17 {footer_script}{literal} 18 $(document).ready(function () { 19 $('.close-button').click(function() { 20 $(this).parents('.ui-bar').remove(); 21 }); 22 }); 23 {/literal}{/footer_script} -
trunk/themes/smartpocket/template/menubar.tpl
r13182 r13234 1 1 <select name="identification" id="identification" data-icon="grid" data-iconpos="notext" data-native-menu="false"> 2 2 3 <option value="" data-placeholder="true">{'Identification'|@translate}</option> 3 <option></option> 4 <optgroup label="{'Identification'|@translate}"> 4 5 5 6 {if isset($U_REGISTER)} … … 19 20 {/if} 20 21 22 </optgroup> 23 21 24 </select> 22 25 -
trunk/themes/smartpocket/template/profile.tpl
r13182 r13234 1 {include file='infos_errors.tpl'} 1 2 <div data-role="content"> 2 {include file='infos_errors.tpl'}3 3 {$PROFILE_CONTENT} 4 4 </div> -
trunk/themes/smartpocket/template/profile_content.tpl
r13182 r13234 1 2 1 <form method="post" name="profile" action="{$F_ACTION}" id="profile" class="properties"> 3 2 … … 31 30 {if $ALLOW_USER_CUSTOMIZATION} 32 31 <div data-role="fieldcontain"> 32 <label for="nb_image_page">{'Number of photos per page'|@translate}</label> 33 <input type="range" name="nb_image_page" id="nb_image_page" value="{$NB_IMAGE_PAGE}" min="1" max="100" /> 34 </div> 35 36 <div data-role="fieldcontain"> 33 37 <label for="language">{'Language'|@translate}</label> 34 38 {html_options name=language options=$language_options selected=$language_selection} … … 39 43 <div data-role="fieldcontain"> 40 44 {if $ALLOW_USER_CUSTOMIZATION} 41 <input type="hidden" name="nb_image_page" value="{$NB_IMAGE_PAGE}">42 45 <input type="hidden" name="theme" value="{$template_selection}"> 43 46 <input type="hidden" name="recent_period" value="{$RECENT_PERIOD}"> -
trunk/themes/smartpocket/template/thumbnails.tpl
r13182 r13234 3 3 {combine_script id='photoswipe' path='themes/smartpocket/js/code.photoswipe.jquery.min.js' require='klass,jquery.mobile'} 4 4 5 {define_derivative name='derivative_params_thumb' width=1 50 height=150 crop=true}5 {define_derivative name='derivative_params_thumb' width=120 height=120 crop=true} 6 6 {define_derivative name='derivative_params_full' type='large'} 7 7 … … 11 11 var options = { 12 12 jQueryMobile: true, 13 //allowUserZoom: false,14 13 imageScaleMethod: "fitNoUpscale" 15 14 }; 16 15 $(".thumbnails a").photoSwipe(options); 17 $(".thumbnails img").load(function() { $(this).css('border', '1px solid #3c3c3c') }); 16 $(document).bind('orientationchange', set_thumbnails_width); 17 set_thumbnails_width(); 18 18 }); 19 19 }(window, window.jQuery, window.Code.PhotoSwipe)); 20 21 function set_thumbnails_width() { 22 nb_thumbs = Math.max(3, Math.ceil($('.thumbnails').width() / 130)); 23 width = Math.floor(1000000 / nb_thumbs) / 10000; 24 $('.thumbnails li').css('width', width+'%'); 25 } 26 20 27 {/literal}{/footer_script} 21 <div data-role="content">22 28 <ul class="thumbnails"> 23 {foreach from=$thumbnails item=thumbnail} 29 {foreach from=$thumbnails item=thumbnail}{strip} 30 {if isset($page_selection[$thumbnail.id])} 24 31 <li> 25 32 <a href="{$pwg->derivative_url($derivative_params_full, $thumbnail.src_image)}" rel="external"> … … 27 34 </a> 28 35 </li> 29 {/foreach} 36 {else} 37 <li style="display:none;"> 38 <a href="{$pwg->derivative_url($derivative_params_full, $thumbnail.src_image)}" rel="external"></a> 39 </li> 40 {/if} 41 {/strip}{/foreach} 30 42 </ul> 31 </div>32 43 {/if} -
trunk/themes/smartpocket/theme.css
r13182 r13234 3 3 4 4 .title { margin: 10px; text-align: center; } 5 .title .ui-btn { margin-top: -5px; } 5 6 .menubar { float: right; } 6 7 .home_button { float: left; } 8 .pwg_footer h6 { margin: 8px; text-align:right;} 9 10 .errors h3, .infos h3{ float:left; margin-top:8px; } 11 .errors div, .infos div { float:right; margin-top:4px; } 12 .errors p, .infos p { clear:both; font-size:85%; margin-bottom:8px; } 7 13 8 14 .ui-icon-profil { background-image: url("images/profil.png"); background-color: transparent; } 9 15 10 16 .ui-content { overflow: hidden; } 11 .ui-field-contain { padding: 5px; border: 0; }17 .ui-field-contain, .ui-br { padding: 5px; border: 0 !important; } 12 18 13 19 .thumbnails { list-style: none; padding: 0; margin: 0; } 14 20 .thumbnails:after { clear: both; content: "."; display: block; height: 0; visibility: hidden; } 15 .thumbnails li { float: left; width: 33.33333333%;}21 .thumbnails li { float: left; } 16 22 .thumbnails li a { display: block; margin: 5px; } 17 23 .thumbnails li img { display: block; width: 100%; height: auto; } -
trunk/themes/smartpocket/themeconf.inc.php
r13182 r13234 12 12 'mobile' => true, 13 13 ); 14 15 //Retrive all pictures on thumbnails page 16 add_event_handler('loc_index_thumbnails_selection', 'sp_select_all_thumbnails'); 17 18 function sp_select_all_thumbnails($selection) 19 { 20 global $page, $template; 21 22 $template->assign('page_selection', array_flip($selection)); 23 24 return $page['items']; 25 } 26 14 27 ?>
Note: See TracChangeset
for help on using the changeset viewer.