Changeset 19735


Ignore:
Timestamp:
01/03/13 00:32:07 (7 years ago)
Author:
julien1311
Message:

admin link modification

Location:
extensions/File_Uploader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/File_Uploader/admin.php

    r19472 r19735  
    1515check_status(ACCESS_ADMINISTRATOR); 
    1616 
    17 //Initialization 
    18 $my_base_url = get_admin_plugin_menu_link(__FILE__); 
     17//Tab management 
     18if (empty($conf['File_Uploader_tabs'])) { 
     19  $conf['File_Uploader_tabs'] = array('upload', 'configuration', 'help'); 
     20} 
    1921 
    20 //Tab management 
    21 if (!isset($_GET['tab'])) 
    22     $page['tab'] = 'upload'; 
    23 else 
    24     $page['tab'] = $_GET['tab']; 
     22$page['tab'] = isset($_GET['tab']) ? $_GET['tab'] : $conf['File_Uploader_tabs'][0]; 
     23 
     24if (!in_array($page['tab'], $conf['File_Uploader_tabs'])) die('Hacking attempt!');       
    2525 
    2626$tabsheet = new tabsheet(); 
    27 $tabsheet->add('upload', 
    28                l10n('Upload'), 
    29                $my_base_url.'&tab=upload'); 
    30 $tabsheet->add('configuration', 
    31                l10n('Configuration'), 
    32                $my_base_url.'&tab=configuration'); 
    33 $tabsheet->add('help', 
    34                l10n('Help'), 
    35                $my_base_url.'&tab=help'); 
     27foreach ($conf['File_Uploader_tabs'] as $tab) { 
     28  $tabsheet->add($tab, l10n(ucfirst($tab)), FILE_UPLOADER_ADMIN.'-'.$tab); 
     29} 
    3630$tabsheet->select($page['tab']); 
    3731$tabsheet->assign(); 
    3832 
    39 switch ($page['tab']) { 
    40         case 'configuration': 
    41                 include_once(dirname(__FILE__).'/admin/admin_configuration.php'); 
    42                 break; 
    43         case 'help': 
    44                 include_once(dirname(__FILE__).'/admin/admin_help.php'); 
    45                 break; 
    46         default: 
    47                 include_once(dirname(__FILE__).'/admin/admin_upload.php'); 
    48                 break; 
    49 } 
     33include_once(FILE_UPLOADER_PATH.'/admin/admin_'.$page['tab'].'.php'); 
    5034?> 
  • extensions/File_Uploader/admin/admin_upload.php

    r19681 r19735  
    190190                $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE path = "'.$file_path.'";'; 
    191191                $image_id = pwg_db_fetch_assoc(pwg_query($query)); 
    192                  
    193192                single_update(IMAGES_TABLE, $insert, array('id' => $image_id['id'])); 
    194193        } else { 
Note: See TracChangeset for help on using the changeset viewer.