[15448] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Psli-BingMaps |
---|
| 4 | Author: psli |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | // Chech whether we are indeed included by Piwigo. |
---|
| 8 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 9 | |
---|
| 10 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
| 11 | |
---|
| 12 | //******* Fetch global data ******* |
---|
| 13 | global $template, $conf, $page, $debug; |
---|
| 14 | |
---|
| 15 | //******* Create tabs ******* |
---|
| 16 | $tabs = array( |
---|
| 17 | array( |
---|
| 18 | 'code' => 'configuration', |
---|
| 19 | 'label' => l10n('Configuration mode'), |
---|
| 20 | ), |
---|
| 21 | array( |
---|
| 22 | 'code' => 'map', |
---|
| 23 | 'label' => '1-'.l10n('Map mode'), |
---|
| 24 | ), |
---|
| 25 | array( |
---|
| 26 | 'code' => 'exif', |
---|
| 27 | 'label' => '2-'.l10n('Exif import'), |
---|
| 28 | ), |
---|
| 29 | array( |
---|
| 30 | 'code' => 'pin', |
---|
| 31 | 'label' => '3-'.l10n('Pin mode'), |
---|
| 32 | ), |
---|
| 33 | array( |
---|
| 34 | 'code' => 'zone', |
---|
| 35 | 'label' => '3-'.l10n('Zone mode'), |
---|
| 36 | ), |
---|
| 37 | array( |
---|
| 38 | 'code' => 'picture', |
---|
| 39 | 'label' => '4-'.l10n('Picture mode'), |
---|
| 40 | ), |
---|
| 41 | array( |
---|
| 42 | 'code' => 'batch', |
---|
| 43 | 'label' => '5-'.l10n('Batch association'), |
---|
| 44 | ), |
---|
| 45 | ); |
---|
| 46 | |
---|
| 47 | //******* Select mode ******* |
---|
| 48 | if (isset($_GET['mode'])) |
---|
| 49 | $page['tab'] = $_GET['mode']; |
---|
| 50 | else |
---|
| 51 | $page['tab'] = $tabs[0]['code']; |
---|
| 52 | |
---|
| 53 | //******* Add tabs to page ******* |
---|
| 54 | $tabsheet = new tabsheet(); |
---|
| 55 | foreach ($tabs as $tab) |
---|
| 56 | { |
---|
| 57 | $tabsheet->add( |
---|
| 58 | $tab['code'], |
---|
| 59 | $tab['label'], |
---|
| 60 | get_root_url().'admin.php?page=plugin&section='.str_replace("/","%2F",$_GET['section']).'&mode='.$tab['code'] |
---|
| 61 | ); |
---|
| 62 | } |
---|
| 63 | $tabsheet->select($page['tab']); |
---|
| 64 | $tabsheet->assign(); |
---|
| 65 | |
---|
| 66 | // Go to selected tab |
---|
| 67 | switch ($page['tab']) |
---|
| 68 | { |
---|
| 69 | case 'configuration': |
---|
| 70 | include(PSLI_BINGMAPS_ADMIN_CONF_PHP); |
---|
| 71 | break; |
---|
| 72 | case 'map': |
---|
| 73 | include(PSLI_BINGMAPS_ADMIN_MAP_PHP); |
---|
| 74 | break; |
---|
| 75 | case 'pin': |
---|
| 76 | include(PSLI_BINGMAPS_ADMIN_PIN_PHP); |
---|
| 77 | break; |
---|
| 78 | case 'zone': |
---|
| 79 | include(PSLI_BINGMAPS_ADMIN_ZONE_PHP); |
---|
| 80 | break; |
---|
| 81 | case 'picture': |
---|
| 82 | include(PSLI_BINGMAPS_ADMIN_PICTURE_PHP); |
---|
| 83 | break; |
---|
| 84 | case 'exif': |
---|
| 85 | include(PSLI_BINGMAPS_ADMIN_EXIF_PHP); |
---|
| 86 | break; |
---|
| 87 | case 'batch': |
---|
| 88 | include(PSLI_BINGMAPS_ADMIN_BATCH_PHP); |
---|
| 89 | break; |
---|
| 90 | } |
---|
| 91 | ?> |
---|