Changeset 21232


Ignore:
Timestamp:
03/06/13 00:51:44 (6 years ago)
Author:
mistic100
Message:

use Piwigo 2.5 template methods, share complete link, option to disable on albums

Location:
extensions/SocialButtons
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/SocialButtons/admin.php

    r20374 r21232  
    1111  $conf['SocialButtons'] = array( 
    1212    'position' => $_POST['position'], 
     13    'on_index' => get_boolean($_POST['on_index']), 
    1314    'twitter' => array( 
    1415      'enabled' => isset($_POST['twitter']['enabled']), 
  • extensions/SocialButtons/include/install.inc.php

    r20374 r21232  
    1010    $default_config = array( 
    1111      'position' => 'toolbar', 
     12      'on_index' => true, 
    1213      'twitter' => array( 
    1314        'enabled' => true, 
     
    6465  { 
    6566    $new_conf = unserialize($conf['SocialButtons']); 
     67     
    6668    if (empty($new_conf['pinterest'])) 
    6769    { 
     
    7173        'img_size' => 'Original', 
    7274        ); 
    73       $conf['SocialButtons'] = serialize($new_conf); 
    74       conf_update_param('SocialButtons', $conf['SocialButtons']); 
    7575    } 
     76    if (!isset($new_conf['on_index'])) 
     77    { 
     78      $new_conf['on_index'] = true; 
     79    } 
     80     
     81    $conf['SocialButtons'] = serialize($new_conf); 
     82    conf_update_param('SocialButtons', $conf['SocialButtons']); 
    7683  } 
    7784} 
  • extensions/SocialButtons/language/en_UK/plugin.lang.php

    r20358 r21232  
    1010$lang['Right bubble'] = 'Right bubble'; 
    1111$lang['Top bubble'] = 'Top bubble'; 
     12$lang['Display buttons'] = 'Display buttons'; 
     13$lang['on photo and album pages'] = 'on photo and album pages'; 
     14$lang['only on photo pages'] = 'only on photo pages'; 
    1215?> 
  • extensions/SocialButtons/language/fr_FR/plugin.lang.php

    r20358 r21232  
    1212$lang['Right bubble'] = 'Bulle à droite'; 
    1313$lang['Top bubble'] = 'Bulle en haut'; 
     14$lang['Display buttons'] = 'Afficher les boutons'; 
     15$lang['on photo and album'] = 'sur les photos et les albums'; 
     16$lang['only on photo'] = 'uniquement sur les photos'; 
    1417?> 
  • extensions/SocialButtons/main.inc.php

    r20406 r21232  
    103103    $share_url = $root_url.ltrim(duplicate_picture_url(), './'); 
    104104  } 
    105   else if ($basename == 'index') 
     105  else if ($basename == 'index' and $conf['SocialButtons']['on_index']) 
    106106  { 
    107107    $conf['SocialButtons']['position'] = 'index'; 
     
    118118    'share_url' => $share_url, 
    119119    'position' => $conf['SocialButtons']['position'], 
    120     'copyright' => ' (from <a href="'.$root_url.'">'.$conf['gallery_title'].'</a>)', 
     120    'copyright' => ' (from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)', 
    121121    ); 
    122122  $buttons = array(); 
     
    171171    case 'index': 
    172172      foreach ($buttons as $button) { 
    173         // $template->add_index_button('<li>'.$button.'</li>', 100); 
    174         $template->concat('PLUGIN_INDEX_ACTIONS', "\n<li>".$button."</li>"); 
     173        $template->add_index_button('<li>'.$button.'</li>', 100); 
    175174      } 
    176175      break; 
    177176    case 'toolbar': 
    178177      foreach ($buttons as $button) { 
    179         // $template->add_picture_button($button, 100); 
    180         $template->concat('PLUGIN_PICTURE_ACTIONS', "\n".$button); 
     178        $template->add_picture_button($button, 100); 
    181179      } 
    182180      break; 
     
    193191    case 'top': 
    194192      $search = '<div id="theImage">'; 
    195       $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON}{/foreach}</div>'; 
     193      $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>'; 
    196194      break; 
    197195       
    198196    case 'bottom': 
    199197      $search = '{$ELEMENT_CONTENT}'; 
    200       $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON}{/foreach}</div>'; 
     198      $add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>'; 
    201199      break; 
    202200  } 
  • extensions/SocialButtons/template/admin.tpl

    r20403 r21232  
    4545    </td> 
    4646  </tr> 
     47  <tr class="property"> 
     48    <td> 
     49      {'Display buttons'|@translate} 
     50    </td> 
     51    <td> 
     52      <label><input type="radio" name="on_index" value="true" {if $on_index}checked="checked"{/if}/> {'on photo and album'|@translate}</label><br> 
     53      <label><input type="radio" name="on_index" value="false" {if not $on_index}checked="checked"{/if}/> {'only on photo'|@translate}</label> 
     54    </td> 
     55  </tr> 
    4756</table> 
    4857</div> 
  • extensions/SocialButtons/template/facebook.tpl

    r20406 r21232  
    55{if $SOCIALBUTT.FACEBOOK.layout=='none'} 
    66{html_style}{literal} 
    7 .fb-like span { height: 22px !important; overflow: hidden !important; margin-right:10px; } 
     7.fb-like span { height: 22px !important; overflow: hidden !important; } 
    88.fb-like iframe { top: -41px; } 
    99{/literal}{/html_style} 
Note: See TracChangeset for help on using the changeset viewer.