plugins/admin/PluginManager.php
changeset 555 ac4c6a7f01d8
parent 536 218a627eb53e
child 582 a38876c0793c
equal deleted inserted replaced
554:e87390b1f9b0 555:ac4c6a7f01d8
   165                 break;
   165                 break;
   166               }
   166               }
   167               
   167               
   168               $return = $plugins->upgrade_plugin($request['plugin'], $plugin_list);
   168               $return = $plugins->upgrade_plugin($request['plugin'], $plugin_list);
   169               break;
   169               break;
       
   170             case 'reimport':
       
   171               // did they specify a plugin to operate on?
       
   172               if ( !isset($request['plugin']) )
       
   173               {
       
   174                 $return = array(
       
   175                   'mode' => 'error',
       
   176                   'error' => 'No plugin specified.',
       
   177                 );
       
   178                 break;
       
   179               }
       
   180               
       
   181               $return = $plugins->reimport_plugin_strings($request['plugin'], $plugin_list);
       
   182               break;
   170             case 'uninstall':
   183             case 'uninstall':
   171               // did they specify a plugin to operate on?
   184               // did they specify a plugin to operate on?
   172               if ( !isset($request['plugin']) )
   185               if ( !isset($request['plugin']) )
   173               {
   186               {
   174                 $return = array(
   187                 $return = array(
   338         else if ( $data['installed'] && !( $data['status'] & PLUGIN_DISABLED ) && !( $data['status'] & PLUGIN_OUTOFDATE ) )
   351         else if ( $data['installed'] && !( $data['status'] & PLUGIN_DISABLED ) && !( $data['status'] & PLUGIN_OUTOFDATE ) )
   339         {
   352         {
   340           // this plugin is all good
   353           // this plugin is all good
   341           $color = '_green';
   354           $color = '_green';
   342           $status = $lang->get('acppl_lbl_status_installed');
   355           $status = $lang->get('acppl_lbl_status_installed');
   343           $buttons = 'uninstall|disable';
   356           $buttons = 'reimport|uninstall|disable';
   344         }
   357         }
   345         else if ( $data['installed'] && $data['status'] & PLUGIN_OUTOFDATE )
   358         else if ( $data['installed'] && $data['status'] & PLUGIN_OUTOFDATE )
   346         {
   359         {
   347           $color = '_red';
   360           $color = '_red';
   348           $status = $lang->get('acppl_lbl_status_need_upgrade');
   361           $status = $lang->get('acppl_lbl_status_need_upgrade');
   395           $colors = array(
   408           $colors = array(
   396               'install' => 'green',
   409               'install' => 'green',
   397               'disable' => 'blue',
   410               'disable' => 'blue',
   398               'enable' => 'blue',
   411               'enable' => 'blue',
   399               'upgrade' => 'green',
   412               'upgrade' => 'green',
   400               'uninstall' => 'red'
   413               'uninstall' => 'red',
       
   414               'reimport' => 'green'
   401             );
   415             );
   402           foreach ( $buttons as $button )
   416           foreach ( $buttons as $button )
   403           {
   417           {
   404             $btnface = $lang->get("acppl_btn_$button");
   418             $btnface = $lang->get("acppl_btn_$button");
   405             $buttons_html .= "<a href=\"#\" onclick=\"ajaxPluginAction('$button', '$filename_js', this); return false;\" class=\"abutton_{$colors[$button]} abutton\">$btnface</a>\n";
   419             $buttons_html .= "<a href=\"#\" onclick=\"ajaxPluginAction('$button', '$filename_js', this); return false;\" class=\"abutton_{$colors[$button]} abutton\">$btnface</a>\n";