Changeset 11249
- Timestamp:
- Jun 6, 2011, 2:08:27 PM (13 years ago)
- Location:
- extensions/set_plugins
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/set_plugins/admin.php
r11102 r11249 5 5 // Fetch the template. 6 6 global $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'; 8 13 redirect($redirect_url); 9 include_once(SET_PLUGINS_PATH."include/constants.php");10 include_once(SET_PLUGINS_PATH.'include/affiche.php');11 14 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.'&tab=set_plugins_admin'21 );22 /*23 $tabsheet->add( 'set_plugins_help',24 l10n('help'),25 $my_base_url.'&tab=set_plugins_help'26 );27 28 */29 30 if (!isset($_GET['tab']))31 $page['tab'] = 'set_plugins_admin';32 else33 $page['tab'] = $_GET['tab'];34 35 36 $tabsheet->select($page['tab']);37 $tabsheet->assign();38 //======================================================================39 // Add our template to the global template40 $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' => $activate50 )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_CONTENT61 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin');62 15 63 16 -
extensions/set_plugins/admin.tpl
r11100 r11249 1 {footer_script } 1 2 <!-- 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"} 12 4 5 {/footer_script} 13 6 14 7 <script type="text/javascript"> 15 8 {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)} 17 16 {foreach from=$plugin_states item=plugin_state} 18 17 {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} 19 24 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}25 25 </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> 26 33 {foreach from=$liste_plugins item=plugin name=plugins_loop} 27 34 {if $plugin.STATE == $plugin_state} 35 28 36 <div class="pluginBox"> 29 37 <table> 30 38 <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}"> 32 40 {$plugin.NAME} 33 41 </td> … … 43 51 | <a href="{$plugin.U_ACTION}&action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a> 44 52 45 {elseif $plugin_state == 'uninstalled'}46 <a href="{$plugin.U_ACTION}&action=install">{'Install'|@translate}</a>47 | <a href="{$plugin.U_ACTION}&action=delete" onclick="return confirm('{'Are you sure you want to delete this plugin?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>48 53 49 {elseif $plugin_state == 'missing'}50 <a href="{$plugin.U_ACTION}&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}&action=delete">{'Delete'|@translate}</a>54 54 {/if} 55 55 </td> … … 72 72 </table> 73 73 </div> 74 74 75 {/if} 75 76 {/foreach} … … 80 81 {/if} 81 82 82 </fieldset> -
extensions/set_plugins/include/affiche.php
r11100 r11249 18 18 19 19 $set=isset($_POST['set'])?$_POST['set']:"true"; 20 $list="test1,test2,test2"; 20 21 21 22 $template->assign( array( 22 $template->assign( array( 'list'=>$list, 23 23 'nb' => isset($_POST['nb'])?$_POST['nb']:$nb, 24 24 'state' => $state , … … 27 27 'cl_version' => $cl_set_plugins_plugin['version'] , 28 28 'name' => $cl_set_plugins_plugin['name'] , 29 'Version_pwg' => PHPWG_VERSION 29 'Version_pwg' => PHPWG_VERSION, 30 'SET_PLUGINS_PATH' => SET_PLUGINS_PATH 30 31 ) 31 32 ); … … 41 42 $action_url = $base_url.'&plugin='.'%s'.'&pwg_token='.get_pwg_token(); 42 43 //======================================================= 44 $liste_plugins = array(); 43 45 44 45 46 $liste_plugins = array();47 46 foreach($liste as $liste_id => $liste_plugin) { 48 47 $liste_plugins[]= $liste_plugin['plugin'] ; 49 48 } 50 49 50 51 51 52 $liste_tpl=array(); 52 53 //========================================================== 53 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) { 54 54 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) { 55 //==== test si $plugin_id fait partie de $liste_plugins ============== 55 56 $key = array_search($plugin_id, $liste_plugins,false); 56 57 … … 77 78 $tpl_plugin['STATE'] = 'uninstalled'; 78 79 } 79 80 81 if(isset($_SESSION['merged_extensions'])) 80 82 if (isset($fs_plugin['extension']) and in_array($fs_plugin['extension'], $_SESSION['merged_extensions'])) 81 83 { -
extensions/set_plugins/main.inc.php
r11101 r11249 33 33 global $user, $template, $val,$page,$conf; 34 34 if (!isset($page['body_id'])) return; 35 if (!isset($page['body_id'])) return; 35 36 37 38 39 36 40 switch($page['body_id']){ 37 41 case 'theAdminPage': … … 43 47 break; 44 48 45 case 'plugin': 46 49 case 'plugins': 50 if (!isset($page['tab'])) return; 51 if ($page['tab']!="installed") return ; 52 Affiche_set_plugins(); 47 53 48 54 break; … … 140 146 141 147 //=========================================================== 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 143 154 $template-> assign('ADMIN_CONTENT',$bpplus); 144 155 … … 146 157 $template-> concat('ADMIN_CONTENT',$bpplus); 147 158 159 148 160 } 149 161 ?>
Note: See TracChangeset
for help on using the changeset viewer.