Changeset 8375


Ignore:
Timestamp:
12/29/10 15:28:08 (9 years ago)
Author:
rub
Message:

Rename language files: plugin.lang.php => admin.config.lang.php
Add constants for Facebook URL
Add promote on footer
Add promote on about page (available for Piwigo 2.2)
Add promote on admin config page
Superscripted help tips on admin config page

Location:
extensions/FacebookPlug/Plugin
Files:
8 added
8 edited
4 moved

Legend:

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

    r8366 r8375  
    2828 
    2929// Lingua 
    30 load_language('plugin.lang', FBP_DIR.'/'); 
    31  
    32 // Delete compiled templates 
    33 $template->delete_compiled_templates(); 
     30load_language('footer.lang', FBP_DIR.'/'); 
     31load_language('admin.config.lang', FBP_DIR.'/'); 
    3432 
    3533// Arguments 
     
    109107      $conf['fbp']['picture_url_type'] = $picture_url_type[$_POST['FBP_PICTURE_URL_TYPE']]; 
    110108      $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true; 
     109      $conf['fbp']['add_about_informations'] = empty($_POST['FBP_ADD_ABOUT_INFORMATIONS']) ? false : true; 
     110      $conf['fbp']['add_group_footer'] = empty($_POST['FBP_ADD_GROUP_FOOTER']) ? false : true; 
     111      $conf['fbp']['add_application_footer'] = empty($_POST['FBP_ADD_APPLICATION_FOOTER']) ? false : true; 
    111112      break; 
    112113    } 
     
    128129    array_push($page['errors'], l10n('Data updated with error')); 
    129130  } 
     131 
     132  // Delete compiled templates 
     133  $template->delete_compiled_templates(); 
    130134} 
    131135 
     
    140144        'like_button' => array 
    141145          ( 
    142             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like/', 
     146            'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/like/', 
    143147            'ENABLED' => ($conf['fbp']['social_plugin_like_button']['enabled'] ? 'checked="checked"' : ''), 
    144148            'LAYOUT_OPTIONS' => $layout_l10n, 
     
    152156       'facepile' => array 
    153157          ( 
    154             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/facepile/', 
     158            'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/facepile/', 
    155159            'ENABLED' => ($conf['fbp']['social_plugin_facepile']['enabled'] ? 'checked="checked"' : ''), 
    156160            'MAX_ROWS' => $conf['fbp']['social_plugin_facepile']['max_rows'], 
     
    158162       'comments' => array 
    159163          ( 
    160             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/comments/', 
     164            'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/comments/', 
    161165            'ENABLED' => ($conf['fbp']['social_plugin_comments']['enabled'] ? 'checked="checked"' : ''), 
    162166            'NUMPOSTS' => $conf['fbp']['social_plugin_comments']['numposts'], 
     
    168172       'like_box' => array 
    169173          ( 
    170             'FB_PAGE' => 'http://developers.facebook.com/docs/reference/plugins/like-box/', 
     174            'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/like-box/', 
    171175            'ENABLED' => ($conf['fbp']['social_plugin_like_box']['enabled'] ? 'checked="checked"' : ''), 
    172176            'URL' => $conf['fbp']['social_plugin_like_box']['url'], 
     
    191195        'FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['picture_url_type'], $picture_url_type), 
    192196        'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> ($conf['fbp']['allow_fb_access_private_page'] ? 'checked="checked"' : ''), 
     197        'FBP_ADD_ABOUT_INFORMATIONS' => ($conf['fbp']['add_about_informations'] ? 'checked="checked"' : ''), 
     198        'FBP_ADD_GROUP_FOOTER' => ($conf['fbp']['add_group_footer'] ? 'checked="checked"' : ''), 
     199        'FBP_ADD_APPLICATION_FOOTER' => ($conf['fbp']['add_application_footer'] ? 'checked="checked"' : ''), 
    193200        )); 
    194201    break; 
     
    200207$template->assign('FBP_ACTION', add_url_params($base_url, array('tab' => $page['tab']))); 
    201208//~ $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/admin.config.css">', $smarty, $repeat); 
     209$template->assign('FACEBOOK_PIWIGO_RUB_URL', FACEBOOK_PIWIGO_RUB_URL); 
     210$template->assign('FACEBOOK_PIWIGO_GROUP_URL', FACEBOOK_PIWIGO_GROUP_URL); 
     211$template->assign('FACEBOOK_PIWIGO_APPLICATION_URL', FACEBOOK_PIWIGO_APPLICATION_URL); 
     212$template->assign('FBP_OLD_VERSION', version_compare(PHPWG_VERSION, '2.2', '<')); 
    202213 
    203214//Apply tpl 
  • extensions/FacebookPlug/Plugin/css/admin.config.css

    r8331 r8375  
    1 /* Adaptation of jquery-ui-1.7.3.custom.css generated by jQuery UI CSS Framework */ 
     1/*---------------------------------- 
     2  Adaptation of jquery-ui-1.7.3.custom.css generated by jQuery UI CSS Framework 
     3----------------------------------*/ 
    24 
    35/* Layout helpers 
  • extensions/FacebookPlug/Plugin/include/common.inc.php

    r8366 r8375  
    3434} 
    3535 
     36include_once(FBP_DIR.'/include/footer.inc.php'); 
     37 
    3638?> 
  • extensions/FacebookPlug/Plugin/include/conf.inc.php

    r8366 r8375  
    3333    'async_script' => false, 
    3434    'force_facebook_init' => false, 
    35     //~ 'add_about_informations' => true, 
    36     //~ 'add_groupe_footer' => true, 
    37     //~ 'add_application_footer' => true, 
     35    'add_about_informations' => true, 
     36    'add_group_footer' => true, 
     37    'add_application_footer' => true, 
    3838    'picture_url_type' => 'page', 
    3939    'allow_fb_access_private_page' => true, 
  • extensions/FacebookPlug/Plugin/include/constants.inc.php

    r8275 r8375  
    2525 
    2626define('FACEBOOK_APP_ID', '111499825588662'); 
     27define('FACEBOOK_URL', 'http://www.facebook.com'); 
     28define('FACEBOOK_PIWIGO_GROUP_URL', FACEBOOK_URL.'/Piwigo'); 
     29define('FACEBOOK_PIWIGO_RUB_URL', FACEBOOK_URL.'/ruben.arnaud'); 
     30define('FACEBOOK_PIWIGO_APPLICATION_URL', FACEBOOK_URL.'/apps/application.php?id='.FACEBOOK_APP_ID); 
     31define('FACEBOOK_DEV_URL', 'http://developers.facebook.com'); 
     32define('FACEBOOK_DOC_PLUGINS_URL', FACEBOOK_DEV_URL.'/docs/reference/plugins'); 
     33 
    2734define('FBP_DIR', dirname(dirname(__FILE__))); 
    2835define('FBP_PATH' , PHPWG_PLUGINS_PATH.basename(FBP_DIR)); 
  • extensions/FacebookPlug/Plugin/include/header.inc.php

    r8366 r8375  
    4242  global $template, $conf, $user; 
    4343 
    44   // set prefilter 
    45   $template->set_prefilter('header', 'fbp_header'); 
    46  
     44  // define ID 
    4745  $template->assign('FACEBOOK_APP_ID', (is_numeric($conf['fbp']['facebook_app_id']) ? $conf['fbp']['facebook_app_id'] : FACEBOOK_APP_ID)); 
    4846  // define language 
     
    5149  $template->smarty->register_modifier('boolean_to_string', 'boolean_to_string'); 
    5250 
    53   $template->set_filename('init.fb', FBP_DIR.'/tpl/init.fb.tpl'); 
    54   $template->append('head_elements', $template->parse('init.fb', true)); 
     51  if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init'])) 
     52  { 
     53    // set prefilter 
     54    $template->set_prefilter('header', 'fbp_header'); 
    5555 
    56   $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/fbp.css">', $smarty, $repeat); 
     56    $template->set_filename('fbp_init.fb', FBP_DIR.'/tpl/init.fb.tpl'); 
     57    $template->append('head_elements', $template->parse('fbp_init.fb', true)); 
     58  } 
     59 
     60  if ( 
     61      (script_basename() == 'index') 
     62      and 
     63      ($conf['fbp']['social_plugin_like_box']['enabled']) 
     64      ) 
     65  { 
     66    $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/fbp.css">', $smarty, $repeat); 
     67  } 
    5768} 
    5869 
     
    8293add_event_handler('fbp_do_facebook_init', 'fbp_do_facebook_init'); 
    8394 
    84 if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init'])) 
    85 { 
     95//~ if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init'])) 
     96//~ { 
    8697  add_event_handler('init', 'fbp_init'); 
    87 } 
     98//~ } 
    8899 
    89100?> 
  • extensions/FacebookPlug/Plugin/include/index.inc.php

    r8366 r8375  
    4444  if ($menu->get_id() != 'menubar') 
    4545    return; 
    46   $menu->register_block( new RegisteredBlock( 'mbFBP', 'social.plugin.like.box', 'FacebookPlug')); 
     46  $menu->register_block(new RegisteredBlock( 'mbFBP', 'social.plugin.like.box', 'FacebookPlug')); 
    4747} 
    4848 
  • extensions/FacebookPlug/Plugin/language/en_UK/admin.config.lang.php

    r8371 r8375  
    7474$lang['To fill only if you want to use a specific Facebook application. It\'s recommended to leave blank.'] = 'To fill only if you want to use a specific Facebook application. It\'s recommended to leave blank.'; 
    7575$lang['Page type allows to reference the page and Facebook can get informations (title, ...). Image type allows to reference image url and Facebook cannot get informations but works always with private albums.'] = 'Page type allows to reference the page and Facebook can get informations (title, ...). Image type allows to reference image url and Facebook cannot get informations but works always with private albums.'; 
    76 //~ $lang[''] = ''; 
    77 //~ $lang[''] = ''; 
    78 //~ $lang[''] = ''; 
    79 //~ $lang[''] = ''; 
    80 //~ $lang[''] = ''; 
    81 //~ $lang[''] = ''; 
    82 //~ $lang[''] = ''; 
     76$lang['Promote'] = 'Promote'; 
     77$lang['Add informations on about page'] = 'Add informations on about page'; 
     78$lang['Add a paragraph with Facebook link on about page'] = 'Add a paragraph with Facebook link on about page'; 
     79$lang['Add Facebook Piwigo group on footer'] = 'Add Facebook Piwigo group on footer'; 
     80$lang['Add a link on each page footer'] = 'Add a link on each page footer'; 
     81$lang['Add Facebook Piwigo application on footer'] = 'Add Facebook Piwigo application on footer'; 
     82$lang['Develop by'] = 'Develop by'; 
    8383//~ $lang[''] = ''; 
    8484//~ $lang[''] = ''; 
  • extensions/FacebookPlug/Plugin/language/fr_FR/admin.config.lang.php

    r8371 r8375  
    7474$lang['To fill only if you want to use a specific Facebook application. It\'s recommended to leave blank.'] = 'A remplir uniquement si vous voulez utiliser une application Facebook spécifique. Il est recommandé de laisser la valeur à blanc.'; 
    7575$lang['Page type allows to reference the page and Facebook can get informations (title, ...). Image type allows to reference image url and Facebook cannot get informations but works always with private albums.'] = 'Le type page permet de reférencer la page et Facebook peut récupérer les informations (titre, ...). Le type image permet de référencer l\'url de l\'image et Facebook ne peut plus obtenir les informations mais fonctionne toujours avec les albums privés.'; 
     76$lang['Promote'] = 'Promouvoir'; 
     77$lang['Add informations on about page'] = 'Ajout d\'informations sur la page "À propos"'; 
     78$lang['Add a paragraph with Facebook link on about page'] = 'Ajout d\'un paragraphe avec les liens Facebook sur la page "À propos"'; 
     79$lang['Add Facebook Piwigo group on footer'] = 'Ajout du groupe Piwigo de Facebook en bas de page'; 
     80$lang['Add a link on each page footer'] = 'Ajout d\'un lien sur chaque bas de page'; 
     81$lang['Add Facebook Piwigo application on footer'] = 'Ajout de l\'application Piwigo de Facebook en bas de page'; 
     82$lang['Develop by'] = 'Développer par'; 
    7683 
    7784 
  • extensions/FacebookPlug/Plugin/tpl/admin.config.tpl

    r8366 r8375  
    183183      <label> 
    184184        <span class="property">{'Facebook application identifient'|@translate}</span> 
    185         <a class="HelptipTip" href="#" title="{'To fill only if you want to use a specific Facebook application. It\'s recommended to leave blank.'|@translate}">{' (?)'|@translate}</a> 
     185        <a class="HelptipTip" href="#" title="{'To fill only if you want to use a specific Facebook application. It\'s recommended to leave blank.'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
    186186        <input type="text" size="15" name="FBP_FACEBOOK_APP_ID" value="{$advanced.FBP_FACEBOOK_APP_ID}" /> 
    187187      </label> 
     
    190190      <label> 
    191191        <span class="property">{'Asynchronous Facebook access'|@translate}</span> 
    192         <a class="HelptipTip" href="#" title="{'Todo'|@translate}">{' (?)'|@translate}</a> 
     192        <a class="HelptipTip" href="#" title="{'Todo'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
    193193        <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} /> 
    194194      </label> 
     
    197197      <label> 
    198198        <span class="property">{'Always initialize Facebook'|@translate}</span> 
    199         <a class="HelptipTip" href="#" title="{'Useful for personal templates, plugins. A event if also defined for plugins.'|@translate}">{' (?)'|@translate}</a> 
     199        <a class="HelptipTip" href="#" title="{'Useful for personal templates, plugins. A event if also defined for plugins.'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
    200200        <input type="checkbox" name="FBP_FORCE_FACEBOOK_INIT" {$advanced.FBP_FORCE_FACEBOOK_INIT} /> 
    201201      </label> 
     
    204204      <label> 
    205205        <span class="property">{'Picture URL type'|@translate}</span> 
    206         <a class="HelptipTip" href="#" title="{'Page type allows to reference the page and Facebook can get informations (title, ...). Image type allows to reference image url and Facebook cannot get informations but works always with private albums.'|@translate}">{' (?)'|@translate}</a> 
     206        <a class="HelptipTip" href="#" title="{'Page type allows to reference the page and Facebook can get informations (title, ...). Image type allows to reference image url and Facebook cannot get informations but works always with private albums.'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
    207207        <select name="FBP_PICTURE_URL_TYPE" size="1"> 
    208208          {html_options options=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS selected=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED} 
     
    213213      <label> 
    214214        <span class="property">{'Allow Facebook to see private page'|@translate}</span> 
    215         <a class="HelptipTip" href="#" title="{'Recommended in order to Facebook get title, ... of your pages for wall display'|@translate}">{' (?)'|@translate}</a> 
     215        <a class="HelptipTip" href="#" title="{'Recommended in order to Facebook get title, ... of your pages for wall display'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
    216216        <input type="checkbox" name="FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE" {$advanced.FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE} /> 
    217217      </label> 
     
    219219  </ul> 
    220220</fieldset> 
    221 {*<fieldset> 
     221<fieldset> 
    222222  <legend>{'Promote'|@translate}</legend> 
    223   <ul> 
     223  <ul class="OldVersion"> 
    224224    <li> 
    225225      <label> 
    226226        <span class="property">{'Add informations on about page'|@translate}</span> 
    227         <a class="HelptipTip" href="#" title="{'Todo'|@translate}">{' (?)'|@translate}</a> 
    228         <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} /> 
     227        <a class="HelptipTip" href="#" title="{'Add a paragraph with Facebook link on about page'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
     228        <input type="checkbox" name="FBP_ADD_ABOUT_INFORMATIONS" {$advanced.FBP_ADD_ABOUT_INFORMATIONS} /> 
    229229      </label> 
    230230    </li> 
     
    234234      <label> 
    235235        <span class="property">{'Add Facebook Piwigo group on footer'|@translate}</span> 
    236         <a class="HelptipTip" href="#" title="{'Todo'|@translate}">{' (?)'|@translate}</a> 
    237         <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} /> 
     236        <a class="HelptipTip" href="#" title="{'Add a link on each page footer'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
     237        <input type="checkbox" name="FBP_ADD_GROUP_FOOTER" {$advanced.FBP_ADD_GROUP_FOOTER} /> 
    238238      </label> 
    239239    </li> 
     
    243243      <label> 
    244244        <span class="property">{'Add Facebook Piwigo application on footer'|@translate}</span> 
    245         <a class="HelptipTip" href="#" title="{'Todo'|@translate}">{' (?)'|@translate}</a> 
    246         <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} /> 
    247       </label> 
    248     </li> 
    249   </ul>*} 
    250 </fieldset> 
    251  
     245        <a class="HelptipTip" href="#" title="{'Add a link on each page footer'|@translate}"><sup>{' (?)'|@translate}</sup></a> 
     246        <input type="checkbox" name="FBP_ADD_APPLICATION_FOOTER" {$advanced.FBP_ADD_APPLICATION_FOOTER} /> 
     247      </label> 
     248    </li> 
     249  </ul> 
     250</fieldset> 
    252251{/if}{* isset $advanced*} 
    253252 
     
    257256    <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}"> 
    258257  </p> 
     258 
     259  <p> 
     260{'Develop by'|@translate} <a href="{$FACEBOOK_PIWIGO_RUB_URL}" target="_bank">Ruben ARNAUD</a> 
     261 - <a href="{$FACEBOOK_PIWIGO_GROUP_URL}" target="_bank">{'Join Facebook Piwigo group'|@translate}</a> 
     262 - <a href="{$FACEBOOK_PIWIGO_APPLICATION_URL}" target="_bank">{'Via Facebook Piwigo application'|@translate}</a> 
     263  <p> 
    259264 
    260265</form> 
     
    337342        'fadeOut' : 200, 
    338343      }); 
    339       // Detect data change 
    340       /*IsDataChanged = false; 
     344{/literal} 
     345{if $FBP_OLD_VERSION} 
     346      // Hide non compatible option 
     347      $('.OldVersion').hide(); 
     348{/if} 
     349{*      // Detect data change 
     350      IsDataChanged = false; 
    341351      $("input, select").change(function() { IsDataChanged = true; }); 
    342352      //~ $(".tabsheet").click(function() 
     
    357367          } 
    358368          //return ! IsDataChanged; 
    359         });*/ 
     369        }); 
     370*} 
     371{literal} 
    360372    }); 
    361373</script> 
Note: See TracChangeset for help on using the changeset viewer.