Ignore:
Timestamp:
May 30, 2012, 7:57:34 AM (12 years ago)
Author:
psli
Message:

Pre-Version 2.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Psli_BingMaps/main.inc.php

    r14913 r15432  
    66Author: psli
    77Description: Extension to piwigo for use of bing maps to navigate in geolocalized album
    8 
    9 -----------------------------------------------------------------------------------------
    10 1.1             2012-05-08      Ajout de l'internationalisation et de l'anglais
    11 -----------------------------------------------------------------------------------------
    12 1.0             2012-05-07      Verison initiale
    13 -----------------------------------------------------------------------------------------
    148*/
    159// Chech whether we are indeed included by Piwigo.
    1610if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1711
    18 // define Path for PHP and JS file
     12// define generic Path
    1913define ('PSLI_BINGMAPS_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    20 //define ('PSLI_BINGMAPS_JS', PSLI_BINGMAPS_PATH.'JS/Psli-BingMaps.js');
     14define('PSLI_BINGMAPS_TEMPLATE_PATH', dirname(__FILE__).'/');
    2115define ('PSLI_BINGMAPS_VERSION_INC_PHP', PSLI_BINGMAPS_PATH.'include/version.inc.php');
    22 define ('PSLI_BINGMAPS_ADMIN_INC_PHP', PSLI_BINGMAPS_PATH.'include/admin.inc.php');
    23 define ('PSLI_BINGMAPS_GUEST_INC_PHP', PSLI_BINGMAPS_PATH.'include/guest.inc.php');
    24 define ('PSLI_BINGMAPS_ADMIN_PHP', PSLI_BINGMAPS_PATH.'include/admin.php');
    2516
    26 // define Path for template file
    27 define('PSLI_BINGMAPS_TEMPLATE_PATH', dirname(__FILE__).'/');
    28 define ('PSLI_BINGMAPS_ADMIN_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'template/admin.tpl');
    29 
    30 // Include define data
     17// Include define data and global function
    3118include_once(dirname(__FILE__).'/include/const.inc.php');
     19include_once(dirname(__FILE__).'/include/function.inc.php');
    3220
    3321// Check plugin update
    3422include_once(PSLI_BINGMAPS_VERSION_INC_PHP);
     23
     24//******* Language data *******
     25load_language('plugin.lang', PSLI_BINGMAPS_TEMPLATE_PATH);
    3526
    3627// Plugin for admin
     
    5546                $root = $row['value'];
    5647        }
    57         define ('PSLI_BINGMAPS_JS', $root.'plugins/Psli-BingMaps/JS/Psli-BingMaps.js');
    58         include_once(PSLI_BINGMAPS_ADMIN_INC_PHP);
     48       
     49        // define Path for admin file
     50        define ('PSLI_BINGMAPS_ADMIN_PHP', PSLI_BINGMAPS_PATH.'admin/admin.php');
     51        define ('PSLI_BINGMAPS_CLASS_ENTITY_PHP', PSLI_BINGMAPS_PATH.'admin/class/psli_entity.class.php');
     52       
     53        // Define path for configuration tab
     54        define ('PSLI_BINGMAPS_ADMIN_CONF_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_conf.inc.php');
     55        define ('PSLI_BINGMAPS_ADMIN_CONF_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_conf.tpl');
     56       
     57        // Define path for map tab
     58        define ('PSLI_BINGMAPS_ADMIN_MAP_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_map.inc.php');
     59        define ('PSLI_BINGMAPS_CLASS_MAP_PHP', PSLI_BINGMAPS_PATH.'admin/class/psli_map.class.php');
     60        define ('PSLI_BINGMAPS_ADMIN_MAP_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_map.tpl');
     61        define ('PSLI_BINGMAPS_JS_MAP', $root.'plugins/Psli-BingMaps/admin/JS/Psli-BingMaps-Map.js');
     62       
     63        // Define path for pin tab
     64        define ('PSLI_BINGMAPS_ADMIN_PIN_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_pin.inc.php');
     65        define ('PSLI_BINGMAPS_CLASS_PIN_PHP', PSLI_BINGMAPS_PATH.'admin/class/psli_pin.class.php');
     66        define ('PSLI_BINGMAPS_ADMIN_PIN_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_pin.tpl');
     67        define ('PSLI_BINGMAPS_JS_PIN', $root.'plugins/Psli-BingMaps/admin/JS/Psli-BingMaps-Pin.js');
     68       
     69        // Define path for zone tab
     70        define ('PSLI_BINGMAPS_ADMIN_ZONE_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_zone.inc.php');
     71        define ('PSLI_BINGMAPS_CLASS_ZONE_PHP', PSLI_BINGMAPS_PATH.'admin/class/psli_zone.class.php');
     72        define ('PSLI_BINGMAPS_ADMIN_ZONE_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_zone.tpl');
     73        define ('PSLI_BINGMAPS_JS_ZONE', $root.'plugins/Psli-BingMaps/admin/JS/Psli-BingMaps-Zone.js');
     74       
     75        // Define path for picture tab
     76        define ('PSLI_BINGMAPS_ADMIN_PICTURE_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_picture.inc.php');
     77        define ('PSLI_BINGMAPS_CLASS_PICTURE_PHP', PSLI_BINGMAPS_PATH.'admin/class/psli_picture.class.php');
     78        define ('PSLI_BINGMAPS_ADMIN_PICTURE_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_picture.tpl');
     79       
     80        // Define path for exif tab
     81        define ('PSLI_BINGMAPS_ADMIN_EXIF_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_exif.inc.php');
     82        define ('PSLI_BINGMAPS_ADMIN_EXIF_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_exif.tpl');
     83       
     84        // Define path for batch tab
     85        define ('PSLI_BINGMAPS_ADMIN_BATCH_PHP', PSLI_BINGMAPS_PATH.'admin/include/admin_batch.inc.php');
     86        define ('PSLI_BINGMAPS_ADMIN_BATCH_TPL', PSLI_BINGMAPS_TEMPLATE_PATH.'admin/template/admin_batch.tpl');
     87        define ('PSLI_BINGMAPS_ADMIN_BATCH_CSS', PSLI_BINGMAPS_PATH.'admin/css/admin_batch.css');
     88       
     89       
     90        // Hook on to event on administration page.
     91        add_event_handler('get_admin_plugin_menu_links', 'PSLIBINGMAPS_admin_menu');
    5992}
    6093else
     
    67100        $result = pwg_query($query);
    68101        $row = pwg_db_fetch_assoc($result);
     102       
     103        define ('PSLI_BINGMAPS_GUEST_INC_PHP', PSLI_BINGMAPS_PATH.'include/guest.inc.php');
    69104        define ('PSLI_BINGMAPS_JS', $row['value'].'plugins/Psli-BingMaps/JS/Psli-BingMaps.js');
    70105       
     
    72107}
    73108
     109/********************************************************************************************/
     110// Add an entry to the 'Plugins' menu.
     111/********************************************************************************************/
     112function PSLIBINGMAPS_admin_menu($menu) {
     113 array_push(
     114   $menu,
     115   array(
     116     'NAME'  => 'PSLI-BingMaps',
     117     'URL'   => get_admin_plugin_menu_link(PSLI_BINGMAPS_ADMIN_PHP)
     118   )
     119 );
     120 return $menu;
     121}
     122
    74123?>
Note: See TracChangeset for help on using the changeset viewer.