Changeset 8366


Ignore:
Timestamp:
Dec 29, 2010, 12:53:42 AM (10 years ago)
Author:
rub
Message:

Add an option to force Facebook initialization (new way to load include file)
Add help tips on config admin page

Location:
extensions/FacebookPlug/Plugin
Files:
10 edited

Legend:

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

    r8331 r8366  
    106106      $conf['fbp']['facebook_app_id'] = $_POST['FBP_FACEBOOK_APP_ID'];
    107107      $conf['fbp']['async_script'] = empty($_POST['FBP_ASYNC_SCRIPT']) ? false : true;
     108      $conf['fbp']['force_facebook_init'] = empty($_POST['FBP_FORCE_FACEBOOK_INIT']) ? false : true;
    108109      $conf['fbp']['picture_url_type'] = $picture_url_type[$_POST['FBP_PICTURE_URL_TYPE']];
    109110      $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true;
     
    186187        'FBP_FACEBOOK_APP_ID' => $conf['fbp']['facebook_app_id'],
    187188        'FBP_ASYNC_SCRIPT' => ($conf['fbp']['async_script'] ? 'checked="checked"' : ''),
     189        'FBP_FORCE_FACEBOOK_INIT' => ($conf['fbp']['force_facebook_init'] ? 'checked="checked"' : ''),
    188190        'FBP_PICTURE_URL_TYPE_OPTIONS' => $picture_url_type_l10n,
    189191        'FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['picture_url_type'], $picture_url_type),
     
    195197
    196198// Global value
    197 //~ $template->assign('FBP_PATH', FBP_PATH);
     199$template->assign('FBP_PATH', FBP_PATH);
    198200$template->assign('FBP_ACTION', add_url_params($base_url, array('tab' => $page['tab'])));
    199 $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/admin.config.css">', $smarty, $repeat);
     201//~ $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.FBP_PATH.'/css/admin.config.css">', $smarty, $repeat);
    200202
    201203//Apply tpl
  • extensions/FacebookPlug/Plugin/include/common.inc.php

    r8241 r8366  
    2626include_once(dirname(__FILE__).'/constants.inc.php');
    2727include_once(FBP_DIR.'/include/conf.inc.php');
     28include_once(FBP_DIR.'/include/header.inc.php');
     29
     30$fbp_include_file = FBP_DIR.'/include/'.script_basename().'.inc.php';
     31if (file_exists($fbp_include_file))
     32{
     33  include_once($fbp_include_file);
     34}
    2835
    2936?>
  • extensions/FacebookPlug/Plugin/include/conf.inc.php

    r8298 r8366  
    3232    'facebook_app_id' => null,
    3333    'async_script' => false,
     34    'force_facebook_init' => false,
     35    //~ 'add_about_informations' => true,
     36    //~ 'add_groupe_footer' => true,
     37    //~ 'add_application_footer' => true,
    3438    'picture_url_type' => 'page',
    3539    'allow_fb_access_private_page' => true,
  • extensions/FacebookPlug/Plugin/include/header.inc.php

    r8302 r8366  
    5757}
    5858
     59function fbp_do_facebook_init($do_it)
     60{
     61  global $conf;
    5962
    60 if (
    61       $conf['fbp']['social_plugin_like_button']['enabled']
     63  //~ return $do_it or (script_basename() == 'about');
     64  return
     65    $do_it
     66  or
     67    (
     68      (
     69        (script_basename() == 'picture')
     70        and
     71        ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled'])
     72      )
    6273      or
    63       $conf['fbp']['social_plugin_facepile']['enabled']
    64       or
    65       $conf['fbp']['social_plugin_comments']['enabled']
    66       or
    67       $conf['fbp']['social_plugin_like_box']['enabled']
     74      (
     75        (script_basename() == 'index')
     76        and
     77        ($conf['fbp']['social_plugin_like_box']['enabled'] /*or $conf['fbp']['']['enabled'] or $conf['fbp']['']['enabled']*/)
     78      )
    6879    )
     80  ;
     81}
     82add_event_handler('fbp_do_facebook_init', 'fbp_do_facebook_init');
     83
     84if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init']))
    6985{
    7086  add_event_handler('init', 'fbp_init');
  • extensions/FacebookPlug/Plugin/include/index.inc.php

    r8275 r8366  
    2323  die('Hacking attempt!');
    2424}
    25 
    26 include_once(FBP_DIR.'/include/common.inc.php');
    27 include_once(FBP_DIR.'/include/header.inc.php');
    2825
    2926/*function fbp_loc_begin_index()
  • extensions/FacebookPlug/Plugin/include/picture.inc.php

    r8307 r8366  
    2323  die('Hacking attempt!');
    2424}
    25 
    26 include_once(FBP_DIR.'/include/common.inc.php');
    27 include_once(FBP_DIR.'/include/header.inc.php');
    2825
    2926function fbp_render_element_content($content, $current_picture)
  • extensions/FacebookPlug/Plugin/language/en_UK/plugin.lang.php

    r8331 r8366  
    3737$lang['Advanced'] = 'Advanced';
    3838$lang['Asynchronous Facebook access'] = 'Asynchronous Facebook access';
    39 $lang['Allow Facebook to see private page (recommended)'] = 'Allow Facebook to see private page (recommended)';
    4039$lang['Like button'] = 'Like button';
    4140$lang['Enabled'] = 'Enabled';
     
    6867$lang['Informations'] = 'Informations';
    6968$lang['Continue'] = 'Continue';
     69$lang['Always initialize Facebook'] = 'Always initialize Facebook';
     70$lang[' (?)'] = ' (?)';
     71$lang['Useful for personal templates, plugins. A event if also defined for plugins.'] = 'Useful for personal templates, plugins. A event if also defined for plugins.';
     72$lang['Allow Facebook to see private page'] = 'Allow Facebook to see private page';
     73$lang['Recommended in order to Facebook get title, ... of your pages for wall display'] = 'Recommended in order to Facebook get title, ... of your pages';
     74$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.';
     75$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[''] = '';
    7079//~ $lang[''] = '';
    7180//~ $lang[''] = '';
  • extensions/FacebookPlug/Plugin/language/fr_FR/plugin.lang.php

    r8331 r8366  
    3737$lang['Advanced'] = 'Avancé';
    3838$lang['Asynchronous Facebook access'] = 'Accès asynchrone à Facebook';
    39 $lang['Allow Facebook to see private page (recommended)'] = 'Permettre à Facebook de voir les pages privées (recommandé)';
    4039$lang['Like button'] = 'Bouton "J\'aime"';
    4140$lang['Enabled'] = 'Activé';
     
    6867$lang['Informations'] = 'Informations';
    6968$lang['Continue'] = 'Continuer';
     69$lang['Always initialize Facebook'] = 'Toujours initialiser Facebook';
     70$lang[' (?)'] = ' (?)';
     71$lang['Useful for personal templates, plugins. A event if also defined for plugins.'] = 'Utile pour les templates (modéles) personnels, plugin. Un événement a été aussi défini pour les plugins.';
     72$lang['Allow Facebook to see private page'] = 'Permettre à Facebook de voir les pages privées';
     73$lang['Recommended in order to Facebook get title, ... of your pages for wall display'] = 'Recommandé afin que Facebook puisse obtenir le titre, ... de vos pages pour les affichages sur les murs.';
     74$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.';
     75$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.';
    7076
    7177
  • extensions/FacebookPlug/Plugin/main.inc.php

    r8275 r8366  
    3333}
    3434
    35 if (script_basename() == 'picture')
    36 {
    37   include_once(dirname(__FILE__).'/include/common.inc.php');
    38   include_once(FBP_DIR.'/include/picture.inc.php');
    39 }
    40 else if (script_basename() == 'index')
    41 {
    42   include_once(dirname(__FILE__).'/include/common.inc.php');
    43   include_once(FBP_DIR.'/include/index.inc.php');
    44 }
    45 else
    46 if (script_basename() == 'admin')
    47 {
    48   include_once(dirname(__FILE__).'/include/common.inc.php');
    49   include_once(FBP_DIR.'/include/admin.inc.php');
    50 }
     35include_once(dirname(__FILE__).'/include/common.inc.php');
    5136
    5237?>
  • extensions/FacebookPlug/Plugin/tpl/admin.config.tpl

    r8331 r8366  
    22{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
    33{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
    4 
    5 {*
     4{known_script id="jquery.tipTip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.tipTip.minified.js" }
     5
    66{html_head}
    77<link rel="stylesheet" type="text/css" href="{$FBP_PATH|@cat:'/css/admin.config.css'}">
    88{/html_head}
    9 *}
    10 
    11 {*html_head}
    12 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css">
    13 {/html_head*}
    149
    1510<div class="titrePage">
     
    188183      <label>
    189184        <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>
    190186        <input type="text" size="15" name="FBP_FACEBOOK_APP_ID" value="{$advanced.FBP_FACEBOOK_APP_ID}" />
    191187      </label>
     
    194190      <label>
    195191        <span class="property">{'Asynchronous Facebook access'|@translate}</span>
     192        <a class="HelptipTip" href="#" title="{'Todo'|@translate}">{' (?)'|@translate}</a>
    196193        <input type="checkbox" name="FBP_ASYNC_SCRIPT" {$advanced.FBP_ASYNC_SCRIPT} />
    197194      </label>
     
    199196    <li>
    200197      <label>
     198        <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>
     200        <input type="checkbox" name="FBP_FORCE_FACEBOOK_INIT" {$advanced.FBP_FORCE_FACEBOOK_INIT} />
     201      </label>
     202    </li>
     203    <li>
     204      <label>
    201205        <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>
    202207        <select name="FBP_PICTURE_URL_TYPE" size="1">
    203208          {html_options options=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS selected=$advanced.FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED}
     
    207212    <li>
    208213      <label>
    209         <span class="property">{'Allow Facebook to see private page (recommended)'|@translate}</span>
     214        <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>
    210216        <input type="checkbox" name="FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE" {$advanced.FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE} />
    211217      </label>
     
    213219  </ul>
    214220</fieldset>
     221{*<fieldset>
     222  <legend>{'Promote'|@translate}</legend>
     223  <ul>
     224    <li>
     225      <label>
     226        <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} />
     229      </label>
     230    </li>
     231  </ul>
     232  <ul>
     233    <li>
     234      <label>
     235        <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} />
     238      </label>
     239    </li>
     240  </ul>
     241  <ul>
     242    <li>
     243      <label>
     244        <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
    215252{/if}{* isset $advanced*}
    216253
     
    293330        autoOpen: false, modal: true, dialogClass: 'admin_config', // necessary to have a specific class because there are conflic with main menu accordeon
    294331        buttons: { "Cancel": function() { $(this).dialog("close"); }, "{/literal}{'Submit'|@translate}{literal}": function() { IsDataChanged = false; $(this).dialog("close"); } },
     332      });
     333      // Init help tips
     334      $('.HelptipTip').tipTip({
     335        'delay' : 0,
     336        'fadeIn' : 200,
     337        'fadeOut' : 200,
    295338      });
    296339      // Detect data change
     
    316359        });*/
    317360    });
    318 
    319361</script>
    320362{/literal}
     363
Note: See TracChangeset for help on using the changeset viewer.