Changeset 31466


Ignore:
Timestamp:
Mar 19, 2016, 9:52:31 PM (8 years ago)
Author:
ddtddt
Message:

[extensions] - PersoFavicon - 2.8

Location:
extensions/PersoFavicon
Files:
3 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/PersoFavicon/index.php

    r7701 r31466  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    242// Recursive call
    253$url = '../';
  • extensions/PersoFavicon/language/en_UK/index.php

    r7754 r31466  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    242// Recursive call
    253$url = '../';
  • extensions/PersoFavicon/language/en_UK/plugin.lang.php

    r24550 r31466  
    11<?php
     2// +-----------------------------------------------------------------------+
     3// | Personal Favicon by plugin for Piwigo                                 |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2010-2016 ddtddt               http://temmii.com/piwigo/ |
     6// +-----------------------------------------------------------------------+
     7// | This program is free software; you can redistribute it and/or modify  |
     8// | it under the terms of the GNU General Public License as published by  |
     9// | the Free Software Foundation                                          |
     10// |                                                                       |
     11// | This program is distributed in the hope that it will be useful, but   |
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     14// | General Public License for more details.                              |
     15// |                                                                       |
     16// | You should have received a copy of the GNU General Public License     |
     17// | along with this program; if not, write to the Free Software           |
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     19// | USA.                                                                  |
     20// +-----------------------------------------------------------------------+
    221
    322$lang['This section is reserved for the webmaster'] = 'This section is reserved for the webmaster';
     
    1837$lang['pfi_ok'] = 'The file has been uploaded';
    1938$lang['pfi_erreur_mouve'] = 'Unable to copy file in the "local" directory';
     39$lang['PersoFavicon'] = 'PersoFavicon';
    2040
    2141//tab help
  • extensions/PersoFavicon/language/fr_FR/index.php

    r7754 r31466  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based picture gallery                                  |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    242// Recursive call
    253$url = '../';
  • extensions/PersoFavicon/language/fr_FR/plugin.lang.php

    r24550 r31466  
    11<?php
    2 
     2// +-----------------------------------------------------------------------+
     3// | Personal Favicon by plugin for Piwigo                                 |
     4// +-----------------------------------------------------------------------+
     5// | Copyright(C) 2010-2016 ddtddt               http://temmii.com/piwigo/ |
     6// +-----------------------------------------------------------------------+
     7// | This program is free software; you can redistribute it and/or modify  |
     8// | it under the terms of the GNU General Public License as published by  |
     9// | the Free Software Foundation                                          |
     10// |                                                                       |
     11// | This program is distributed in the hope that it will be useful, but   |
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     14// | General Public License for more details.                              |
     15// |                                                                       |
     16// | You should have received a copy of the GNU General Public License     |
     17// | along with this program; if not, write to the Free Software           |
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     19// | USA.                                                                  |
     20// +-----------------------------------------------------------------------+
    321$lang['This section is reserved for the webmaster'] = 'Cette section est réservée au webmaster';
    422
     
    1836$lang['pfi_ok'] = 'Le fichier a bien été transféré';
    1937$lang['pfi_erreur_mouve'] = 'Impossible de copier le fichier dans le répertoire "local"';
     38$lang['PersoFavicon'] = 'Favicon personel';
    2039
    2140//tab help
  • extensions/PersoFavicon/main.inc.php

    r10632 r31466  
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=462
    77Author: ddtddt
    8 Author URI: http://piwigo.org/
     8Author URI: http://temmii.com/piwigo/
    99*/
    1010
     11// +-----------------------------------------------------------------------+
     12// | Personal Favicon by plugin for Piwigo                                 |
     13// +-----------------------------------------------------------------------+
     14// | Copyright(C) 2010-2016 ddtddt               http://temmii.com/piwigo/ |
     15// +-----------------------------------------------------------------------+
     16// | This program is free software; you can redistribute it and/or modify  |
     17// | it under the terms of the GNU General Public License as published by  |
     18// | the Free Software Foundation                                          |
     19// |                                                                       |
     20// | This program is distributed in the hope that it will be useful, but   |
     21// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
     22// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
     23// | General Public License for more details.                              |
     24// |                                                                       |
     25// | You should have received a copy of the GNU General Public License     |
     26// | along with this program; if not, write to the Free Software           |
     27// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
     28// | USA.                                                                  |
     29// +-----------------------------------------------------------------------+
    1130define('PFI_DIR' , basename(dirname(__FILE__)));
    1231define('PFI_PATH' , PHPWG_PLUGINS_PATH . PFI_DIR . '/');
     32define('PFI_ADMIN',get_root_url().'admin.php?page=plugin-'.PFI_DIR);
     33
     34add_event_handler('loading_lang', 'PersoFavicon_loading_lang');   
     35function PersoFavicon_loading_lang(){
     36  load_language('plugin.lang', PFI_PATH);
     37}
    1338
    1439//Ajout du menu admin
    1540add_event_handler('get_admin_plugin_menu_links', 'PersoFavicon_admin_menu');
    16 function PersoFavicon_admin_menu($menu)
    17 {
    18   array_push($menu, array(
    19         'NAME' => 'PersoFavicon',
    20     'URL' => get_admin_plugin_menu_link(PFI_PATH . 'admin/admin.php')));
     41function PersoFavicon_admin_menu($menu){
     42  $menu[] = array(
     43    'NAME' => l10n('PersoFavicon'),
     44    'URL' => PFI_ADMIN,
     45  );
    2146  return $menu;
    2247}
     
    2550// Remplace le code dans le header
    2651add_event_handler('loc_begin_page_header', 'Change_Favicon', 55 );
    27 
    28 function Change_Favicon()
    29  {
     52function Change_Favicon(){
    3053        global $template;
    3154        $template->set_prefilter('header', 'Favicon');
    32  }
     55}
    3356
    34 function Favicon($content, &$smarty)
    35  {
     57function Favicon($content, &$smarty){
    3658  $search = '#<link rel="shortcut icon".*?favicon.ico">#';
     59  global $conf;
     60  $favicon_name = & $conf['PersoFavicon'];
    3761
    38         global $conf;
    39  
    40 $favicon_name = & $conf['PersoFavicon'];
    41 
    42         if (!empty($favicon_name))
    43                 {
    44   $replacement = '<link rel="shortcut icon" type="image/x-icon" href="'.PHPWG_ROOT_PATH.PWG_LOCAL_DIR.$favicon_name.'.ico">';
    45                 }
    46         else
    47                 {
    48   $replacement = '<link rel="shortcut icon" type="image/x-icon" href="'.PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'favicon.ico">';
    49                 }
     62  if (!empty($favicon_name)){
     63    $replacement = '<link rel="shortcut icon" type="image/x-icon" href="'.PHPWG_ROOT_PATH.PWG_LOCAL_DIR.$favicon_name.'.ico">';
     64  }else{
     65    $replacement = '<link rel="shortcut icon" type="image/x-icon" href="'.PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'favicon.ico">';
     66  }
    5067  return preg_replace($search, $replacement, $content);
    51  }
     68}
    5269 
    5370?>
Note: See TracChangeset for help on using the changeset viewer.