Changeset 26909


Ignore:
Timestamp:
01/22/14 22:21:37 (5 years ago)
Author:
mistic100
Message:

Display "Activate it now" link when installing a new plugin

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/plugins.class.php

    r26461 r26909  
    510510    * @param string - plugin id or extension id 
    511511   */ 
    512   function extract_plugin_files($action, $revision, $dest) 
     512  function extract_plugin_files($action, $revision, $dest, &$plugin_id=null) 
    513513  { 
    514514    if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip')) 
     
    542542            if ($action == 'upgrade') 
    543543            { 
    544               $extract_path = PHPWG_PLUGINS_PATH . $dest; 
     544              $plugin_id = $dest; 
    545545            } 
    546546            else 
    547547            { 
    548               $extract_path = PHPWG_PLUGINS_PATH 
    549                   . ($root == '.' ? 'extension_' . $dest : basename($root)); 
     548              $plugin_id = ($root == '.' ? 'extension_' . $dest : basename($root)); 
    550549            } 
     550            $extract_path = PHPWG_PLUGINS_PATH . $plugin_id; 
     551 
    551552            if($result = $zip->extract(PCLZIP_OPT_PATH, $extract_path, 
    552553                                       PCLZIP_OPT_REMOVE_PATH, $root, 
  • trunk/admin/plugins_new.php

    r26461 r26909  
    4646    check_pwg_token(); 
    4747     
    48     $install_status = $plugins->extract_plugin_files('install', $_GET['revision'], $_GET['extension']); 
     48    $install_status = $plugins->extract_plugin_files('install', $_GET['revision'], $_GET['extension'], $plugin_id); 
    4949 
    50     redirect($base_url.'&installstatus='.$install_status); 
     50    redirect($base_url.'&installstatus='.$install_status.'&plugin_id='.$plugin_id); 
    5151  } 
    5252} 
     
    5858  { 
    5959    case 'ok': 
     60      $activate_url = get_root_url().'admin.php?page=plugins' 
     61        . '&plugin=' . $_GET['plugin_id'] 
     62        . '&pwg_token=' . get_pwg_token() 
     63        . '&action=activate'; 
     64 
    6065      $page['infos'][] = l10n('Plugin has been successfully copied'); 
    61       $page['infos'][] = l10n('You might go to plugin list to install and activate it.'); 
     66      $page['infos'][] = '<a href="'. $activate_url . '">' . l10n('Activate it now') . '</a>'; 
    6267      break; 
    6368 
  • trunk/language/en_UK/admin.lang.php

    r26461 r26909  
    120120$lang['Activate Navigation Thumbnails'] = 'Activate navigation thumbnails'; 
    121121$lang['Activate'] = "Activate"; 
     122$lang['Activate it now'] = 'Activate it now'; 
    122123$lang['Active Languages'] = 'Active Languages'; 
    123124$lang['Active Plugins'] = 'Active Plugins'; 
     
    945946$lang['You have subscribed to receiving notifications by mail.'] = "You have subscribed to receive notifications by mail."; 
    946947$lang['You have unsubscribed from receiving notifications by mail.'] = "You have unsubscribed from being notified by mail."; 
    947 $lang['You might go to plugin list to install and activate it.'] = "Go to the plugins list to install and activate it."; 
    948948$lang['You need to confirm deletion'] = "You must confirm deletion"; 
    949949$lang['You need to upgrade your system to take full advantage of the application else the application will not work correctly, or not at all'] = "You should upgrade your system to take full advantage of the application, otherwise the application could work improperly, or not at all"; 
  • trunk/language/fr_FR/admin.lang.php

    r26461 r26909  
    481481$lang['Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'] = "Etes-vous sur de vouloir installer cette mise à jour? Vous devez vérifiez que cette mise à jour ne nécessite pas de désinstallation préalable."; 
    482482$lang['Plugin has been successfully copied'] = "Le plugin a été copié avec succès."; 
    483 $lang['You might go to plugin list to install and activate it.'] = "Rendez-vous dans la liste des plugins pour l'installer et l'activer."; 
    484483$lang['Can\'t create temporary file.'] = "Impossible de créer un fichier temporaire."; 
    485484$lang['Can\'t download archive.'] = "Impossible de télécharger l'archive."; 
     
    977976$lang['Close user details'] = 'Fermer les détails de l\'utilisateur'; 
    978977$lang['close'] = 'fermer'; 
     978$lang['Activate it now'] = 'Activate it now'; 
    979979?> 
Note: See TracChangeset for help on using the changeset viewer.