Changeset 8436


Ignore:
Timestamp:
01/02/11 02:24:22 (9 years ago)
Author:
rub
Message:

Add share icon on picture and album page

Rename footer.lang.php to common.lang.php
Remove use of target to open a new window

Location:
extensions/FacebookPlug/Plugin
Files:
4 added
11 edited
3 moved

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Plugin/admin.config.php

    r8425 r8436  
    2828 
    2929// Lingua 
    30 load_language('footer.lang', FBP_DIR.'/'); 
    3130load_language('admin.config.lang', FBP_DIR.'/'); 
    3231 
     
    5150               l10n('Social plugins'), 
    5251               add_url_params($base_url, array('tab' => 'social_plugin'))); 
     52$tabsheet->add('share', 
     53               l10n('Share'), 
     54               add_url_params($base_url, array('tab' => 'share'))); 
    5355$tabsheet->add('advanced', 
    5456               l10n('Advanced'), 
     
    120122    } 
    121123 
     124    case 'share' : 
     125    { 
     126      $conf['fbp']['share_picture'] = ! empty($_POST['FBP_SHARE_PICTURE']); 
     127      $conf['fbp']['share_album'] = ! empty($_POST['FBP_SHARE_ALBUM']); 
     128      break; 
     129    } 
     130 
    122131    case 'advanced' : 
    123132    { 
     
    215224    break; 
    216225  } 
     226  case 'share' : 
     227  { 
     228    $template->assign( 
     229      $page['tab'], 
     230      array( 
     231        'FBP_SHARE_PICTURE' => fbp_checked($conf['fbp']['share_picture']), 
     232        'FBP_SHARE_ALBUM' => fbp_checked($conf['fbp']['share_album']), 
     233        )); 
     234    break; 
     235  } 
    217236  case 'advanced' : 
    218237  { 
     
    243262 
    244263// Global value 
    245 $template->assign('FBP_PATH', FBP_PATH); 
    246264$template->assign('FBP_ACTION', add_url_params($base_url, array('tab' => $page['tab']))); 
    247265//~ $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/admin.config.css">', $smarty, $repeat); 
     
    252270 
    253271//Apply tpl 
    254 $template->set_filename('plugin_admin_content', FBP_DIR.'/tpl/admin.config.tpl'); 
    255 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
     272$template->set_filename('fbp_plugin_admin_content', FBP_DIR.'/tpl/admin.config.tpl'); 
     273$template->assign_var_from_handle('ADMIN_CONTENT', 'fbp_plugin_admin_content'); 
    256274 
    257275?> 
  • extensions/FacebookPlug/Plugin/include/conf.inc.php

    r8425 r8436  
    3737    'add_application_footer' => true, 
    3838    'picture_url_type' => 'page', 
     39    'share_picture' => true, 
     40    'share_album' => true, 
    3941    'allow_fb_access_private_page' => true, 
    4042    'social_plugin_like_button' => array(), 
  • extensions/FacebookPlug/Plugin/include/footer.inc.php

    r8425 r8436  
    3131  if ((script_basename() != 'admin') and ($conf['fbp']['add_group_footer'] or $conf['fbp']['add_application_footer'])) 
    3232  { 
    33  
    34     // Lingua 
    35     load_language('footer.lang', FBP_DIR.'/'); 
    36  
    3733    $template->assign('FACEBOOK_PIWIGO_GROUP_URL', FACEBOOK_PIWIGO_GROUP_URL); 
    3834    $template->assign('FACEBOOK_PIWIGO_APPLICATION_URL', FACEBOOK_PIWIGO_APPLICATION_URL); 
  • extensions/FacebookPlug/Plugin/include/header.inc.php

    r8435 r8436  
    7474  global $template, $conf, $user, $page; 
    7575 
     76  // Lingua 
     77  load_language('common.lang', FBP_DIR.'/'); 
     78 
    7679  // Get init facebook 
    7780  $page['fbp']['do_facebook_init'] = trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init']); 
     
    8285    // define language 
    8386    $template->assign('FACEBOOK_LANGUAGE', fbp_get_fb_language()); 
     87    $template->assign('FBP_PATH', FBP_PATH); 
    8488    $template->assign('fbp', $conf['fbp']); 
    8589    //~ $template->smarty->register_modifier('boolean_to_string', 'boolean_to_string'); 
     
    132136        (script_basename() == 'picture') 
    133137        and 
    134         ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled']) 
     138        ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled'] or $conf['fbp']['share_picture']) 
    135139      ) 
    136140      or 
     
    138142        (script_basename() == 'index') 
    139143        and 
    140         ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled']) 
     144        ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled'] or $conf['fbp']['share_album']) 
    141145      ) 
    142146      or 
  • extensions/FacebookPlug/Plugin/include/index.inc.php

    r8425 r8436  
    6565  $page['fbp']['url'] = duplicate_index_url(array(''), array('start', 'flat', 'chronology_date', 'chronology_field', 'chronology_style', 'chronology_view')); 
    6666  unset_make_full_url(); 
    67  
    68 /*global $template; 
    69 //$link_url = '<a name="fb_share" type="icon" share_url="{$fbp_page.url}"></a> 
    70 $link_url = '<a name="fb_share" type="icon" share_url="'.$page['fbp']['url'].'" title="test"></a> 
    71 <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"  
    72         type="text/javascript"> 
    73 </script> 
    74 '; 
    75 $template->concat( 
    76         'PLUGIN_INDEX_ACTIONS', 
    77         '<li>'.$link_url.'</li>');*/ 
    7867} 
    7968 
     
    129118} 
    130119 
     120function fbp_loc_end_index() 
     121{ 
     122  global $template; 
     123 
     124  $template->assign('FBP_SHARE_LI', true); 
     125 
     126  $tpl = 'share'; 
     127  $template->set_filename('fbp_'.$tpl, FBP_DIR.'/tpl/'.$tpl.'.tpl'); 
     128  $template->concat( 
     129        'PLUGIN_INDEX_ACTIONS', 
     130        $template->parse('fbp_'.$tpl, true) 
     131        ); 
     132} 
     133 
    131134if ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled']) 
    132135{ 
     
    139142add_event_handler('loc_begin_index_thumbnails', 'fbp_loc_begin_index_thumbnails', EVENT_HANDLER_PRIORITY_NEUTRAL, 1); 
    140143 
     144if ($conf['fbp']['share_album']) 
     145{ 
     146  add_event_handler('loc_end_index', 'fbp_loc_end_index', EVENT_HANDLER_PRIORITY_NEUTRAL+999 /* In order to be last*/); 
     147} 
     148 
    141149?> 
  • extensions/FacebookPlug/Plugin/include/picture.inc.php

    r8425 r8436  
    7272    { 
    7373      // XFBML implementation 
    74       $template->set_filename($tpl, FBP_DIR.'/tpl/'.$tpl.'.tpl'); 
    75       $content .= $template->parse($tpl, true); 
     74      $template->set_filename('fbp_'.$tpl, FBP_DIR.'/tpl/'.$tpl.'.tpl'); 
     75      $content .= $template->parse('fbp_'.$tpl, true); 
    7676    } 
    7777  } 
    78  
    79 /*global $template; 
    80 $link_url = '<a name="fb_share" type="icon" share_url="'.$page['fbp']['url'].'"></a> 
    81 <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"  
    82         type="text/javascript"> 
    83 </script> 
    84 '; 
    85 $template->concat( 
    86         'PLUGIN_PICTURE_ACTIONS', 
    87         $link_url);*/ 
    8878 
    8979  return $content; 
    9080} 
    9181 
     82function fbp_loc_end_picture() 
     83{ 
     84  global $template; 
     85 
     86  $template->assign('FBP_SHARE_LI', false); 
     87 
     88  $tpl = 'share'; 
     89  $template->set_filename('fbp_'.$tpl, FBP_DIR.'/tpl/'.$tpl.'.tpl'); 
     90  $template->concat( 
     91        'PLUGIN_PICTURE_ACTIONS', 
     92        $template->parse('fbp_'.$tpl, true) 
     93        ); 
     94} 
     95 
    9296add_event_handler('render_element_content', 'fbp_render_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+1 /*in order to have picture content*/, 2); 
    9397 
     98if ($conf['fbp']['share_picture']) 
     99{ 
     100  add_event_handler('loc_end_picture', 'fbp_loc_end_picture');//, EVENT_HANDLER_PRIORITY_NEUTRAL+999 /* In order to be last*/); 
     101} 
     102 
    94103?> 
  • extensions/FacebookPlug/Plugin/language/en_UK/admin.config.lang.php

    r8425 r8436  
    8686$lang['Other options are available by programming'] = 'Other options are available by programming'; 
    8787$lang['Activity'] = 'Activity'; 
    88 //~ $lang[''] = ''; 
    89 //~ $lang[''] = ''; 
    90 //~ $lang[''] = ''; 
    91 //~ $lang[''] = ''; 
    92 //~ $lang[''] = ''; 
     88$lang['Share'] = 'Share'; 
     89$lang['Share picture page'] = 'Share picture page'; 
     90$lang['Add a icon link on each picture page to share on Facebook'] = 'Add a icon link on each picture page to share on Facebook'; 
     91$lang['Share album page'] = 'Share album page'; 
     92$lang['Add a icon link on each album page to share on Facebook'] = 'Add a icon link on each album page to share on Facebook'; 
    9393//~ $lang[''] = ''; 
    9494//~ $lang[''] = ''; 
  • extensions/FacebookPlug/Plugin/language/en_UK/common.lang.php

    r8432 r8436  
    2727$lang['Join Facebook Piwigo group'] = 'Join Facebook Piwigo group'; 
    2828$lang['Via Facebook Piwigo application'] = 'Via Facebook Piwigo application'; 
     29$lang['Share on Facebook'] = 'Share on Facebook'; 
    2930 
    3031?> 
  • extensions/FacebookPlug/Plugin/language/fr_FR/admin.config.lang.php

    r8425 r8436  
    8686$lang['Other options are available by programming'] = 'D\'autres options sont disponibles par programmation'; 
    8787$lang['Activity'] = 'Activité'; 
     88$lang['Share'] = 'Partager'; 
     89$lang['Share picture page'] = 'Partager la page "image"'; 
     90$lang['Add a icon link on each picture page to share on Facebook'] = 'Ajout d\'une icone contenant un lien afin de partager sur Facebook chaque page \'image\''; 
     91$lang['Share album page'] = 'Partager la page "album"'; 
     92$lang['Add a icon link on each album page to share on Facebook'] = 'Ajout d\'une icone contenant un lien afin de partager sur Facebook chaque page \'album\''; 
    8893 
    8994 
  • extensions/FacebookPlug/Plugin/language/fr_FR/common.lang.php

    r8432 r8436  
    2727$lang['Join Facebook Piwigo group'] = 'Rejoindre le groupe Piwigo sur Facebook'; 
    2828$lang['Via Facebook Piwigo application'] = 'Via l\'application Piwigo sur Facebook'; 
     29$lang['Share on Facebook'] = 'Partager sur Facebook'; 
    2930 
    3031?> 
  • extensions/FacebookPlug/Plugin/tpl/about.tpl

    r8375 r8436  
    11<p>{'Visit Piwigo on Facebook website:'|@translate}</p> 
    2 <p id="linkToPiwigo"><a href="{$FACEBOOK_PIWIGO_GROUP_URL}" target="_bank">{'Piwigo group'|@translate}</a> 
    3 <p id="linkToPiwigo"><a href="{$FACEBOOK_PIWIGO_APPLICATION_URL}" target="_bank">{'Piwigo application'|@translate}</a></p> 
     2<p id="linkToPiwigo"><a href="{$FACEBOOK_PIWIGO_GROUP_URL}" onclick="window.open(this.href); return false;">{'Piwigo group'|@translate}</a> 
     3<p id="linkToPiwigo"><a href="{$FACEBOOK_PIWIGO_APPLICATION_URL}" onclick="window.open(this.href); return false;">{'Piwigo application'|@translate}</a></p> 
  • extensions/FacebookPlug/Plugin/tpl/admin.config.tpl

    r8386 r8436  
    223223<p><i>{'Other options are available by programming'|@translate}</i></p> 
    224224{/if}{* isset $social_plugin*} 
     225 
     226{if isset($share)} 
     227<fieldset> 
     228  <legend>{'Options'|@translate}</legend> 
     229  <ul> 
     230    <li> 
     231      <label> 
     232        <span class="property">{'Share picture page'|@translate}</span> 
     233        <a class="HelptipTip" href="#" title="{'Add a icon link on each picture page to share on Facebook'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
     234        <input type="checkbox" name="FBP_SHARE_PICTURE" {$share.FBP_SHARE_PICTURE} /> 
     235      </label> 
     236    </li> 
     237    <li> 
     238      <label> 
     239        <span class="property">{'Share album page'|@translate}</span> 
     240        <a class="HelptipTip" href="#" title="{'Add a icon link on each album page to share on Facebook'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
     241        <input type="checkbox" name="FBP_SHARE_ALBUM" {$share.FBP_SHARE_ALBUM} /> 
     242      </label> 
     243    </li> 
     244  </ul> 
     245</fieldset> 
     246{/if}{* isset $share*} 
    225247 
    226248{if isset($advanced)} 
  • extensions/FacebookPlug/Plugin/tpl/footer.tpl

    r8375 r8436  
    11{if $fbp.add_group_footer} 
    2  - <a href="{$FACEBOOK_PIWIGO_GROUP_URL}" target="_bank" class="Piwigo">{'Join Facebook Piwigo group'|@translate}</a> 
     2 - <a href="{$FACEBOOK_PIWIGO_GROUP_URL}" onclick="window.open(this.href); return false;" class="Piwigo">{'Join Facebook Piwigo group'|@translate}</a> 
    33{/if} 
    44{if $fbp.add_application_footer} 
    5  - <a href="{$FACEBOOK_PIWIGO_APPLICATION_URL}" target="_bank" {*class="Piwigo"*}>{'Via Facebook Piwigo application'|@translate}</a> 
     5 - <a href="{$FACEBOOK_PIWIGO_APPLICATION_URL}" onclick="window.open(this.href); return false;" {*class="Piwigo"*}>{'Via Facebook Piwigo application'|@translate}</a> 
    66{/if} 
Note: See TracChangeset for help on using the changeset viewer.