Changeset 11249


Ignore:
Timestamp:
Jun 6, 2011, 2:08:27 PM (13 years ago)
Author:
cljosse
Message:

[extensions] set_plugins compatiblity with 2.3

Location:
extensions/set_plugins
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/set_plugins/admin.php

    r11102 r11249  
    55// Fetch the template.
    66global $template;
    7  $redirect_url = get_root_url().'admin.php?page='.'plugins_list';
     7//
     8
     9    if (PHPWG_VERSION < 2.3 )
     10$redirect_url = get_root_url().'admin.php?page='.'plugins_list';
     11    else
     12 $redirect_url = get_root_url().'admin.php?page='.'plugins';
    813  redirect($redirect_url);       
    9 include_once(SET_PLUGINS_PATH."include/constants.php");           
    10 include_once(SET_PLUGINS_PATH.'include/affiche.php');
    1114
    12 
    13 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    14 include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    15 $my_base_url = get_admin_plugin_menu_link(__FILE__);
    16 
    17 $tabsheet = new tabsheet();
    18 $tabsheet->add( 'set_plugins_admin',
    19                 l10n('admin'),
    20                 $my_base_url.'&amp;tab=set_plugins_admin'
    21                            );
    22  /*     
    23 $tabsheet->add( 'set_plugins_help',
    24                 l10n('help'),
    25                 $my_base_url.'&amp;tab=set_plugins_help'
    26                            );
    27                            
    28         */         
    29                            
    30         if (!isset($_GET['tab']))
    31            $page['tab'] = 'set_plugins_admin';
    32 else
    33        $page['tab'] = $_GET['tab'];     
    34            
    35                    
    36 $tabsheet->select($page['tab']);
    37 $tabsheet->assign();
    38 //======================================================================
    39 // Add our template to the global template
    40 $template->set_filenames(
    41   array(
    42     'plugin' => dirname(__FILE__).'/admin.tpl'
    43   )         
    44 );
    45 
    46 //===============================================================================
    47  if(isset($activate)){
    48                     $template->assign( array( 
    49                         'U_ACTION' => $activate
    50                                                                                         )
    51                                                                         );     
    52 
    53                   }
    54 
    55                     $page['tab'] = 'plugins_list';
    56 
    57            //       "admin.php?page=plugins_list"
    58 
    59 
    60 // Assign the template contents to ADMIN_CONTENT
    61 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin');   
    6215
    6316
  • extensions/set_plugins/admin.tpl

    r11100 r11249  
     1 {footer_script }
    12<!-- Show the title of the plugin -->
    2 <div class="titlePage">
    3   <h2>{'set_plugins'|@translate} {'Version'|@translate} {$cl_version}</h2>
    4 </div>
    5 <fieldset>
    6   <legend>{'command'|@translate}</legend>
    7   <form action="{$action}" method="post" name="form_set_plugins" id="form_set_plugins">
    8 <input name="unset_plugins" type="submit" value="{'Deactivate'|@translate}" />
    9 <input name="set_plugins" type="submit" value="{'Activate'|@translate}" />
    10 <input name="nb" type="text" value="{$nb}" />
    11   </form>
     3{combine_script id="field_set" load="footer" path=$SET_PLUGINS_PATH|@cat:"js/field_set.js" require="jquery"}
    124
     5  {/footer_script}
    136
    14 
     7<script type="text/javascript">
    158{if isset($liste_plugins)}
    16 
     9 var no_affiche = true;
     10{else}
     11 var no_affiche = false;
     12 {/if}
     13</script>
     14<div>   
     15{if isset($liste_plugins)}
    1716{foreach from=$plugin_states item=plugin_state}
    1817{if $plugin_state==$state}
     18</div>
     19<fieldset >
     20    <legend>   
     21    {if $plugin_state == 'active'} {'Last '|@translate} {'Active Plugins'|@translate}
     22    {elseif $plugin_state == 'inactive'} {'Last '|@translate} {'Inactive Plugins'|@translate}
     23    {/if}
    1924
    20   <fieldset>
    21     <legend>
    22       {if $plugin_state == 'active'} {'Last '|@translate} {'Active Plugins'|@translate}
    23       {elseif $plugin_state == 'inactive'} {'Last '|@translate} {'Inactive Plugins'|@translate}
    24       {/if}
    2525    </legend>
     26  <form action="{$action}" method="post" name="form_set_plugins" id="form_set_plugins">
     27    <input name="unset_plugins" type="submit" value="{'Deactivate'|@translate}" />
     28    <input name="set_plugins" type="submit" value="{'Activate'|@translate}" />
     29    <input name="nb" type="text" value="{$nb}" />
     30    </form>
     31  <p>
     32</p>
    2633    {foreach from=$liste_plugins item=plugin name=plugins_loop}
    2734      {if $plugin.STATE == $plugin_state}
     35
    2836    <div class="pluginBox">
    2937      <table>
    3038        <tr>
    31           <td class="pluginBoxNameCell{if $plugin.INCOMPATIBLE} warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}{/if}">
     39          <td name="plugins_name" class="pluginBoxNameCell{if $plugin.INCOMPATIBLE} warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}{/if}">
    3240            {$plugin.NAME}
    3341          </td>
     
    4351            | <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
    4452
    45       {elseif $plugin_state == 'uninstalled'}
    46             <a href="{$plugin.U_ACTION}&amp;action=install">{'Install'|@translate}</a>
    47             | <a href="{$plugin.U_ACTION}&amp;action=delete" onclick="return confirm('{'Are you sure you want to delete this plugin?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
    4853
    49       {elseif $plugin_state == 'missing'}
    50             <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
    51 
    52       {elseif $plugin_state == 'merged'}
    53             <a href="{$plugin.U_ACTION}&amp;action=delete">{'Delete'|@translate}</a>
    5454      {/if}
    5555          </td>
     
    7272      </table>
    7373    </div>
     74   
    7475      {/if}
    7576    {/foreach}
     
    8081{/if}
    8182
    82 </fieldset>
  • extensions/set_plugins/include/affiche.php

    r11100 r11249  
    1818
    1919$set=isset($_POST['set'])?$_POST['set']:"true";
     20 $list="test1,test2,test2";
    2021
    21 
    22   $template->assign( array(
     22  $template->assign( array( 'list'=>$list,
    2323                   'nb' => isset($_POST['nb'])?$_POST['nb']:$nb,
    2424                   'state' => $state ,
     
    2727                        'cl_version' => $cl_set_plugins_plugin['version'] ,
    2828                        'name' => $cl_set_plugins_plugin['name'] ,
    29                         'Version_pwg' => PHPWG_VERSION
     29                        'Version_pwg' => PHPWG_VERSION,
     30                        'SET_PLUGINS_PATH' => SET_PLUGINS_PATH
    3031                                                                                        )
    3132                                                                        );               
     
    4142            $action_url = $base_url.'&amp;plugin='.'%s'.'&amp;pwg_token='.get_pwg_token();
    4243 //=======================================================
     44$liste_plugins = array();
    4345
    44 
    45 
    46 $liste_plugins = array();
    4746foreach($liste as $liste_id => $liste_plugin) {
    4847    $liste_plugins[]=   $liste_plugin['plugin'] ;
    4948}
    5049
     50
     51
    5152$liste_tpl=array();
    5253//==========================================================
    53 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) {
    54     
     54foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) {   
     55//==== test si $plugin_id fait partie de $liste_plugins ============== 
    5556    $key = array_search($plugin_id, $liste_plugins,false);
    5657
     
    7778        $tpl_plugin['STATE'] = 'uninstalled';
    7879      }
    79 
     80   
     81     if(isset($_SESSION['merged_extensions']))
    8082      if (isset($fs_plugin['extension']) and in_array($fs_plugin['extension'], $_SESSION['merged_extensions']))
    8183      {
  • extensions/set_plugins/main.inc.php

    r11101 r11249  
    3333  global $user, $template, $val,$page,$conf;
    3434  if (!isset($page['body_id'])) return;
     35   if (!isset($page['body_id'])) return;
    3536
     37 
     38
     39 
    3640  switch($page['body_id']){
    3741          case  'theAdminPage':     
     
    4347                break;
    4448
    45  case 'plugin':
    46 
     49 case 'plugins':         
     50 if (!isset($page['tab'])) return;
     51 if ($page['tab']!="installed") return ;
     52  Affiche_set_plugins();
    4753
    4854        break;
     
    140146 
    141147 //===========================================================
    142               $bpplus=$template->parse('cl_plugin', true);
     148 $header_1='<div class="titlePage">
     149  <h2>'.l10n("set_plugins").l10n("Version").": ".$cl_set_plugins_plugin['version'] .'</h2>
     150';
     151
     152              $bpplus=$header_1.$template->parse('cl_plugin', true);
     153             
    143154              $template-> assign('ADMIN_CONTENT',$bpplus);
    144155             
     
    146157              $template-> concat('ADMIN_CONTENT',$bpplus);
    147158
     159
    148160}
    149161?>
Note: See TracChangeset for help on using the changeset viewer.