- Timestamp:
- May 25, 2011, 12:54:59 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/plugins.class.php
r10594 r11047 535 535 function get_merged_extensions($version=PHPWG_VERSION) 536 536 { 537 if (isset($_SESSION['merged_extensions']) and $_SESSION['merged_extensions']['~~expire~~'] > time()) 538 { 539 return $_SESSION['merged_extensions']; 540 } 541 542 $_SESSION['merged_extensions'] = array('~~expire~~' => time() + 600); 543 544 if (fetchRemote(PHPWG_URL.'/download/merged_extensions.txt', $result)) 545 { 546 $rows = explode("\n", $result); 547 foreach ($rows as $row) 548 { 549 if (preg_match('/^(\d+\.\d+): *(.*)$/', $row, $match)) 550 { 551 if (version_compare($version, $match[1], '>=')) 552 { 553 $extensions = explode(',', trim($match[2])); 554 $_SESSION['merged_extensions'] = array_merge($_SESSION['merged_extensions'], $extensions); 555 } 556 } 557 } 558 } 559 560 return $_SESSION['merged_extensions']; 537 $file = PHPWG_ROOT_PATH.'install/obsolete_extensions.list'; 538 $merged_extensions = array(); 539 540 if (file_exists($file) and $obsolete_ext = file($file, FILE_IGNORE_NEW_LINES) and !empty($obsolete_ext)) 541 { 542 foreach ($obsolete_ext as $ext) 543 { 544 if (preg_match('/^(\d+) ?: ?(.*?)$/', $ext, $matches)) 545 { 546 $merged_extensions[$matches[1]] = $matches[2]; 547 } 548 } 549 } 550 return $merged_extensions; 561 551 } 562 552 -
trunk/admin/plugins_installed.php
r11010 r11047 65 65 } 66 66 67 //--------------------------------------------------------Incompatible Plugins 68 if (isset($_GET['incompatible_plugins'])) 69 { 70 $incompatible_plugins = array(); 71 foreach ($plugins->get_incompatible_plugins() as $plugin => $version) 72 { 73 if ($plugin == '~~expire~~') continue; 74 array_push($incompatible_plugins, $plugin); 75 76 } 77 echo json_encode($incompatible_plugins); 78 exit; 79 } 80 67 81 // +-----------------------------------------------------------------------+ 68 82 // | start template output | … … 70 84 71 85 $plugins->sort_fs_plugins('name'); 72 $plugins->get_merged_extensions(); 73 $plugins->get_incompatible_plugins(); 86 $merged_extensions = $plugins->get_merged_extensions(); 74 87 $merged_plugins = false; 75 88 $tpl_plugins = array(); … … 81 94 { 82 95 // Incompatible plugins must be reinitilized 83 $plugins->get_incompatible_plugins(true);96 unset($_SESSION['incompatible_plugins']); 84 97 } 85 98 … … 93 106 'AUTHOR_URL' => @$fs_plugin['author uri'], 94 107 'U_ACTION' => sprintf($action_url, $plugin_id), 95 'INCOMPATIBLE' => isset($_SESSION['incompatible_plugins'][$plugin_id]),96 108 ); 97 109 … … 105 117 } 106 118 107 if (isset($fs_plugin['extension']) and i n_array($fs_plugin['extension'], $_SESSION['merged_extensions']))119 if (isset($fs_plugin['extension']) and isset($merged_extensions[$fs_plugin['extension']])) 108 120 { 109 121 $plugins->perform_action('uninstall', $plugin_id); -
trunk/admin/themes/default/template/plugins_list.tpl
r11012 r11047 4 4 /* incompatible message */ 5 5 var incompatible_msg = '{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'javascript'}'; 6 incompatible_msg += '\n'; 7 incompatible_msg += '{'Do you want to activate anyway?'|@translate|@escape:'javascript'}'; 6 var activate_msg = '\n{'Do you want to activate anyway?'|@translate|@escape:'javascript'}'; 8 7 9 8 /* group action */ … … 40 39 }; 41 40 42 /* incompatible message */ 43 jQuery('.incompatible a.incompatible').click(function() { 44 return confirm(incompatible_msg); 41 /* incompatible plugins */ 42 jQuery(document).ready(function() { 43 jQuery.ajax({ 44 method: 'GET', 45 url: 'admin.php', 46 data: { page: 'plugins_installed', incompatible_plugins: true }, 47 dataType: 'json', 48 success: function(data) { 49 for (i=0;i<data.length;i++) { 50 {/literal} 51 {if $plugin_display == 'complete'} 52 jQuery('#'+data[i]+' .pluginBoxNameCell').prepend('<a class="warning" title="'+incompatible_msg+'"></a>') 53 {else} 54 jQuery('#'+data[i]+' .pluginMiniBoxNameCell').prepend('<span class="warning" title="'+incompatible_msg+'"></span>') 55 {/if} 56 {literal} 57 jQuery('#'+data[i]).addClass('incompatible'); 58 jQuery('#'+data[i]+' .activate').attr('onClick', 'return confirm(incompatible_msg + activate_msg);'); 59 } 60 jQuery('.warning').tipTip({ 61 'delay' : 0, 62 'fadeIn' : 200, 63 'fadeOut' : 200, 64 'maxWidth':'250px' 65 }); 66 } 67 }); 45 68 }); 46 69 47 70 /* TipTips */ 48 jQuery('.warning').tipTip({49 'delay' : 0,50 'fadeIn' : 200,51 'fadeOut' : 200,52 'maxWidth':'250px'53 });54 71 jQuery('.plugin-restore').tipTip({ 55 72 'delay' : 0, … … 118 135 119 136 {if $plugin_display == 'complete'} 120 <div id="{$plugin.ID}" class="pluginBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">137 <div id="{$plugin.ID}" class="pluginBox"> 121 138 <table> 122 139 <tr> 123 140 <td class="pluginBoxNameCell"> 124 {if $plugin.INCOMPATIBLE}<a class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></a>{/if}125 141 {$plugin.NAME} 126 142 </td> … … 134 150 135 151 {elseif $plugin.STATE == 'inactive'} 136 <a href="{$plugin.U_ACTION}&action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>152 <a href="{$plugin.U_ACTION}&action=activate" class="activate">{'Activate'|@translate}</a> 137 153 | <a href="{$plugin.U_ACTION}&action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a> 138 154 … … 166 182 {/if} 167 183 168 <div id="{$plugin.ID}" class="pluginMiniBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">184 <div id="{$plugin.ID}" class="pluginMiniBox"> 169 185 <div class="pluginMiniBoxNameCell"> 170 {if $plugin.INCOMPATIBLE}<span class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></span>{/if}171 186 {$plugin.NAME} 172 187 <a class="showInfo" title="{if !empty($author)}{'By %s'|@translate|@sprintf:$author} | {/if}{'Version'|@translate} {$version}<br/>{$plugin.DESC|@escape:'html'}">i</a> … … 179 194 180 195 {elseif $plugin.STATE == 'inactive'} 181 <a href="{$plugin.U_ACTION}&action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>196 <a href="{$plugin.U_ACTION}&action=activate" class="activate">{'Activate'|@translate}</a> 182 197 | <a href="{$plugin.U_ACTION}&action=delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a> 183 198
Note: See TracChangeset
for help on using the changeset viewer.