Ignore:
Timestamp:
08/26/10 19:57:55 (10 years ago)
Author:
nikrou
Message:

Add permissions on add tags widget
Use default theme jquery library
Add help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/user_tags/admin.php

    r6798 r6806  
    2424} 
    2525 
     26load_language('plugin.lang', T4U_PLUGIN_LANG); 
     27 
     28$me = get_plugin_data($plugin_id); 
     29$save_config = false; 
     30 
     31$status_options[null] = '----------'; 
     32foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) { 
     33  $status_options[$status] = l10n('user_status_'.$status); 
     34} 
     35 
     36if (!empty($_POST['submit'])) { 
     37  if (isset($_POST['permission_add']) && isset($status_options[$_POST['permission_add']])  
     38      && $_POST['permission_add']!=$me->getPermission('add')) { 
     39    $me->setPermission('add', $_POST['permission_add']); 
     40    array_push($GLOBALS['page']['infos'], l10n('Add permission updated')); 
     41    $save_config = true; 
     42  } 
     43  if (isset($_POST['permission_delete']) && isset($status_options[$_POST['permission_delete']])  
     44      && $_POST['permission_delete']!=$me->getPermission('delete')) { 
     45    $me->setPermission('delete', $_POST['permission_delete']); 
     46    array_push($GLOBALS['page']['infos'], l10n('Delete permission updated')); 
     47    $save_config = true; 
     48  } 
     49 
     50  if ($save_config) { 
     51    $me->save_config(); 
     52  } 
     53} 
     54 
     55$GLOBALS['template']->set_filenames(array('plugin_admin_content' => T4U_TEMPLATE . '/admin.tpl')); 
     56$GLOBALS['template']->assign('T4U_CSS', T4U_CSS); 
     57 
     58$GLOBALS['template']->assign('T4U_PERMISSION_ADD', $me->getPermission('add'));  
     59$GLOBALS['template']->assign('T4U_PERMISSION_DELETE', $me->getPermission('delete'));  
     60$GLOBALS['template']->assign('STATUS_OPTIONS', $status_options); 
     61$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
     62 
     63$GLOBALS['template']->assign('U_HELP', get_root_url().'admin/popuphelp.php?page=readme'); 
    2664?> 
Note: See TracChangeset for help on using the changeset viewer.