1 | <?php |
---|
2 | function modus_css_gradient($gradient) { |
---|
3 | if (!empty($gradient)) |
---|
4 | { |
---|
5 | $std = implode(',',$gradient); |
---|
6 | $gs=trim($gradient[0],'#'); $ge=trim($gradient[1],'#'); |
---|
7 | return "filter: progid:DXImageTransform.Microsoft.gradient(startColorStr=#FF$gs,endColorStr=#FF$ge); /* IE to 9*/ |
---|
8 | background-image: -moz-linear-gradient(top,$std); /* FF 3.16 to 15 */ |
---|
9 | background-image: -webkit-linear-gradient(top,$std); /* Chrome, Safari */ |
---|
10 | background-image: -ms-linear-gradient(top,$std); /* IE ? to 9 */ |
---|
11 | background-image: -o-linear-gradient(top,$std); /* Opera 11 to 12 */ |
---|
12 | background-image: linear-gradient(to bottom,$std); /* Standard must be last */"; |
---|
13 | } |
---|
14 | } |
---|
15 | |
---|
16 | function modus_get_default_config() |
---|
17 | { |
---|
18 | return array( |
---|
19 | 'skin' => 'dark', |
---|
20 | 'album_thumb_size' => 250, |
---|
21 | 'index_photo_deriv'=>'2small', |
---|
22 | 'index_photo_deriv_hdpi'=>'xsmall', |
---|
23 | ); |
---|
24 | } |
---|
25 | |
---|
26 | function modus_smarty_prefilter($source) |
---|
27 | { |
---|
28 | global $lang, $conf; |
---|
29 | |
---|
30 | $source = str_replace('<div id="imageHeaderBar">', '<div class=titrePage id=imageHeaderBar>', $source ); |
---|
31 | $source = str_replace('<div id=imageHeaderBar>', '<div class=titrePage id=imageHeaderBar>', $source ); |
---|
32 | |
---|
33 | if (!isset($lang['modus_theme'])) |
---|
34 | load_language('theme.lang', dirname(__FILE__).'/'); |
---|
35 | |
---|
36 | // picture page actionButtons wrap for mobile |
---|
37 | if (strpos($source, '<div id="imageToolBar">')!==false || strpos($source, '<div id=imageToolBar>')!==false){ |
---|
38 | if ( !($pos=strpos($source,'<div class="actionButtons">') ) ) |
---|
39 | $pos = strpos($source,'<div class=actionButtons>'); |
---|
40 | if ($pos !== false) |
---|
41 | { |
---|
42 | $source = substr_replace($source, '<div class=actionButtonsWrapper><a id=imageActionsSwitch class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0); |
---|
43 | $pos = strpos($source,'caddie', $pos+1); |
---|
44 | $pos = strpos($source,'</div>', $pos+1); |
---|
45 | $source = substr_replace($source, '</div>', $pos, 0); |
---|
46 | } |
---|
47 | } |
---|
48 | |
---|
49 | if ( ($pos=strpos($source, '<ul class="categoryActions">'))!==false || ($pos=strpos($source, '<ul class=categoryActions>'))!==false){ |
---|
50 | if ( ($pos2=strpos($source, '</ul>', $pos))!==false |
---|
51 | && (substr_count($source, '<li>', $pos, $pos2-$pos) > 2) ) |
---|
52 | $source = substr_replace($source, '<a id=albumActionsSwitcher class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0); |
---|
53 | } |
---|
54 | |
---|
55 | $re = preg_quote('<img title="{$cat.icon_ts.TITLE}" src="', '/') |
---|
56 | .'[^>]+' |
---|
57 | .preg_quote('/recent{if $cat.icon_ts.IS_CHILD_DATE}_by_child{/if}.png"', '/') |
---|
58 | .'[^>]+' |
---|
59 | .preg_quote('alt="(!)">', '/'); |
---|
60 | $source = preg_replace('/'.$re.'/', |
---|
61 | '<span class=albSymbol title="{$cat.icon_ts.TITLE}">{if $cat.icon_ts.IS_CHILD_DATE}'.MODUS_STR_RECENT_CHILD.'{else}'.MODUS_STR_RECENT.'{/if}</span>', |
---|
62 | $source); |
---|
63 | |
---|
64 | $re = preg_quote('<img title="{$thumbnail.icon_ts.TITLE}" src="', '/') |
---|
65 | .'[^>]+' |
---|
66 | .preg_quote('/recent.png" alt="(!)">', '/'); |
---|
67 | $source = preg_replace('/'.$re.'/', |
---|
68 | '<span class=albSymbol title="{$thumbnail.icon_ts.TITLE}">'.MODUS_STR_RECENT.'</span>', |
---|
69 | $source); |
---|
70 | |
---|
71 | return $source; |
---|
72 | } |
---|
73 | |
---|
74 | ?> |
---|