Changeset 15121
- Timestamp:
- May 19, 2012, 1:11:01 PM (12 years ago)
- Location:
- extensions/GooglePlusOne
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GooglePlusOne/admin.php
r11600 r15121 5 5 6 6 load_language('plugin.lang', GPLUS1_PATH); 7 $conf['GooglePlusOne'] = explode(',',$conf['GooglePlusOne']);7 $conf['GooglePlusOne'] = unserialize($conf['GooglePlusOne']); 8 8 9 9 if (isset($_POST['submit'])) 10 10 { 11 11 $conf['GooglePlusOne'] = array( 12 $_POST['button_size'], 13 $_POST['position'], 12 'size' => $_POST['button_size'], 13 'position' => $_POST['position'], 14 'annotation' => $_POST['annotation'], 14 15 ); 15 16 16 conf_update_param('GooglePlusOne', implode(',',$conf['GooglePlusOne']));17 conf_update_param('GooglePlusOne', serialize($conf['GooglePlusOne'])); 17 18 array_push($page['infos'], l10n('Information data registered in database')); 18 19 … … 22 23 23 24 $template->assign(array( 24 'button_size' => $conf['GooglePlusOne'][0], 25 'position' => $conf['GooglePlusOne'][1], 25 'button_size' => $conf['GooglePlusOne']['size'], 26 'position' => $conf['GooglePlusOne']['position'], 27 'annotation' => $conf['GooglePlusOne']['annotation'], 26 28 'GPLUS1_PATH' => GPLUS1_PATH, 27 29 )); -
extensions/GooglePlusOne/admin.tpl
r11600 r15121 8 8 9 9 <table class="gplus1_buttons"> 10 <tr class="property"> 11 <td> 12 {'Button size'|@translate} 13 </td> 14 <td></td> 15 </tr> 10 16 <tr> 11 17 <td><label> 18 15px 12 19 <img src="{$GPLUS1_PATH}images/small.png"/> 13 20 <input type="radio" name="button_size" value="small" {if $button_size == 'small'}checked="checked"{/if}/> 14 21 </label></td> 15 22 <td><label> 23 20px 16 24 <img src="{$GPLUS1_PATH}images/medium.png"/> 17 25 <input type="radio" name="button_size" value="medium" {if $button_size == 'medium'}checked="checked"{/if}/> … … 20 28 <tr> 21 29 <td><label> 30 24px 22 31 <img src="{$GPLUS1_PATH}images/standard.png"/> 23 32 <input type="radio" name="button_size" value="standard" {if $button_size == 'standard'}checked="checked"{/if}/> 24 33 </label></td> 25 34 <td><label> 35 60px 26 36 <img src="{$GPLUS1_PATH}images/tall.png"/> 27 37 <input type="radio" name="button_size" value="tall" {if $button_size == 'tall'}checked="checked"{/if}/> … … 39 49 </td> 40 50 </tr> 51 52 <tr class="property"> 53 <td> 54 {'Annotation'|@translate} 55 </td> 56 <td> 57 <label><input type="radio" name="annotation" value="none" {if $annotation == 'none'}checked="checked"{/if}/> {'None'|@translate}</label> 58 <label><input type="radio" name="annotation" value="bubble" {if $annotation == 'bubble'}checked="checked"{/if}/> {'Bubble'|@translate}</label> 59 <label><input type="radio" name="annotation" value="inline" {if $annotation == 'inline'}checked="checked"{/if}/> {'Inline text'|@translate}</label> 60 </td> 61 </tr> 41 62 <tr class="submit"> 42 63 <td colspan="2"> -
extensions/GooglePlusOne/images/index.php
r11600 r15121 3 3 // | Piwigo - a PHP based photo gallery | 4 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-201 1Piwigo Team http://piwigo.org |5 // | Copyright(C) 2008-2012 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 | -
extensions/GooglePlusOne/index.php
r11600 r15121 3 3 // | Piwigo - a PHP based photo gallery | 4 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2008-201 1Piwigo Team http://piwigo.org |5 // | Copyright(C) 2008-2012 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 | -
extensions/GooglePlusOne/language/en_UK/plugin.lang.php
r11600 r15121 5 5 $lang['Bottom'] = 'Bottom'; 6 6 $lang['Toolbar'] = 'Toolbar'; 7 $lang['Button size'] = 'Button size'; 8 $lang['Annotation'] = 'Annotation'; 9 $lang['Bubble'] = 'Bubble'; 10 $lang['Inline text'] = 'Inline text'; 7 11 8 12 ?> -
extensions/GooglePlusOne/language/fr_FR/plugin.lang.php
r11600 r15121 5 5 $lang['Bottom'] = 'Bas'; 6 6 $lang['Toolbar'] = 'Barre d\'outils'; 7 $lang['Button size'] = 'Taille du bouton'; 8 $lang['Annotation'] = 'Annotation'; 9 $lang['Bubble'] = 'Bulle'; 10 $lang['Inline text'] = 'Texte simple'; 7 11 8 12 ?> -
extensions/GooglePlusOne/main.inc.php
r11600 r15121 22 22 global $conf, $template, $user; 23 23 24 $conf['GooglePlusOne'] = explode(',',$conf['GooglePlusOne']);24 $conf['GooglePlusOne'] = unserialize($conf['GooglePlusOne']); 25 25 $conf['GooglePlusOne']['lang'] = array( 26 'ar','bg','ca',' hr','cs','da','nl','et','fi','fr','de','el','iw','hi',27 ' hu','id','it','ja','ko','lv','lt','ms','no','fa','pl','ro','ru','sr',28 ' sk','sl','es','sv','th','tr','uk','vi'26 'ar','bg','ca','zh-CN','zh-TW','hr','cs','da','nl','en-US','en-GB','et','fi','fr','de', 27 'el','iw','hi','hu','id','it','ja','ko','lv','lt','ms','no','fa','pl','pt-BR','pt-PT', 28 'ro','ru','sr','sk','sl','es','sv','th','tr','uk','vi', 29 29 ); 30 31 $template->assign(array( 32 'GPLUS1_SIZE' => $conf['GooglePlusOne']['size'], 33 'GPLUS1_ANNO' => $conf['GooglePlusOne']['annotation'], 34 )); 30 35 31 36 if (script_basename() == 'picture') 32 37 { 33 $template->assign(array( 34 'GPLUS1_SIZE' => $conf['GooglePlusOne'][0], 35 'GPLUS1_POSITON' => $conf['GooglePlusOne'][1], 36 )); 37 38 $template->assign('GPLUS1_POSITON', $conf['GooglePlusOne']['position']); 38 39 $template->set_prefilter('picture', 'gplus1_add_button_prefilter'); 39 40 } 40 41 else if (script_basename() == 'index') 41 42 { 42 $template->assign(array( 43 'GPLUS1_SIZE' => $conf['GooglePlusOne'][0], 44 'GPLUS1_POSITON' => 'index', 45 )); 46 43 $template->assign('GPLUS1_POSITON', 'index'); 47 44 $template->set_prefilter('index', 'gplus1_add_button_prefilter'); 48 45 } 49 46 50 47 // if the link is in the toolbar, we must use smallier buttons 51 if ( script_basename() == 'index' OR $conf['GooglePlusOne'][ 1] == 'toolbar')48 if ( script_basename() == 'index' OR $conf['GooglePlusOne']['position'] == 'toolbar') 52 49 { 53 if ($conf['GooglePlusOne'][ 0] == 'tall')50 if ($conf['GooglePlusOne']['size'] == 'tall' AND $conf['GooglePlusOne']['annotation'] == 'bubble') 54 51 { 55 52 $template->assign('GPLUS1_SIZE', 'standard'); … … 58 55 59 56 // button language 57 if ( in_array(str_replace('_','-',$user['language']), $conf['GooglePlusOne']['lang']) ) 58 { 59 $template->assign('GPLUS1_LANG', str_replace('_','-',$user['language'])); 60 } 60 61 if ( in_array(substr($user['language'],0,2), $conf['GooglePlusOne']['lang']) ) 61 62 { … … 72 73 global $template; 73 74 75 $replace = '{combine_script id=\'google_plusone\' path=\'https://apis.google.com/js/plusone.js\'} 76 <script type="text/javascript">window.___gcfg = {ldelim}lang: \'{$GPLUS1_LANG}\'};</script> 77 <g:plusone size="{$GPLUS1_SIZE}" annotation="{$GPLUS1_ANNO}"></g:plusone>'; 78 74 79 switch ($template->get_template_vars('GPLUS1_POSITON')) 75 80 { 76 81 case 'top': 77 82 $search = '<div id="theImage">'; 78 $replace = '<div> <g:plusone size="{$GPLUS1_SIZE}"></g:plusone></div>';83 $replace = '<div>'.$replace.'</div>'; 79 84 break; 80 85 81 86 case 'bottom': 82 87 $search = '{$ELEMENT_CONTENT}'; 83 $replace = '<g:plusone size="{$GPLUS1_SIZE}"></g:plusone>';84 88 break; 85 89 86 90 case 'toolbar': 87 $search = '{*caddie management END*}'; 88 $replace = '<g:plusone size="{$GPLUS1_SIZE}"></g:plusone>'; 91 $search = '<div class="actionButtons">'; 89 92 break; 90 93 91 94 case 'index': 92 95 $search = '<ul class="categoryActions">'; 93 $replace = '<li> <g:plusone size="{$GPLUS1_SIZE}"></g:plusone></li>';96 $replace = '<li>'.$replace.'</li>'; 94 97 break; 95 98 } 96 $replace = $search.$replace.'97 {combine_script id=\'google_plusone\' path=\'https://apis.google.com/js/plusone.js\'}98 <script type="text/javascript">{ldelim}lang: \'{$GPLUS1_LANG}\'}</script>';99 99 100 return str_replace($search, $ replace, $content);100 return str_replace($search, $search.$replace, $content); 101 101 } 102 102 … … 108 108 function gplus1_plugin_admin_menu($menu) 109 109 { 110 array_push( 111 $menu, 112 array( 113 'NAME' => 'Google+1', 114 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 115 ) 116 ); 117 110 array_push($menu, array( 111 'NAME' => 'Google+1', 112 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 113 )); 118 114 return $menu; 119 115 } -
extensions/GooglePlusOne/maintain.inc.php
r11600 r15121 1 1 <?php 2 2 function plugin_install() 3 { 4 pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("GooglePlusOne","medium,toolbar","GooglePlusOne config");'); 3 { 4 $conf = array( 5 'size' => 'medium', 6 'position' => 'toolbar', 7 'annotation' => 'inline', 8 ); 9 10 conf_update_param('GooglePlusOne', serialize($conf)); 11 } 12 13 function plugin_activate() 14 { 15 global $conf; 16 17 if (@unserialize($conf['GooglePlusOne']) === false) 18 { 19 $conf = explode(',', $conf['GooglePlusOne']); 20 $conf = array( 21 'size' => $conf[0], 22 'position' => $conf[1], 23 'annotation' => 'bubble', 24 ); 25 26 conf_update_param('GooglePlusOne', serialize($conf)); 27 } 5 28 } 6 29
Note: See TracChangeset
for help on using the changeset viewer.