Changeset 1490
- Timestamp:
- 09/24/09 13:57:07 (14 years ago)
- Location:
- plugins/mkcompat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/mkcompat/class.dc.mkcompat216.php
r1489 r1490 45 45 return false; 46 46 } 47 47 48 48 public static function themeUpgrade ($theme_path) 49 49 { … … 71 71 if ($count > 0) files::putContent($filename,$newcontents); 72 72 } 73 74 public static function pluginNeedUpgrade ($theme_path) 75 { 76 $dir_contents = files::getDirList($theme_path); 77 foreach ($dir_contents['files'] as $file) 78 { 79 if (files::getExtension($file) == 'js') 80 if (strpos(file_get_contents($file),'[@') != false) 81 return true; 82 if (files::getExtension($file) == 'php') 83 if (strpos($contents = file_get_contents($file),'[@') != false) 84 if (preg_match_all('/<script(.*?)<\/script>/s',$contents,$scripts)) 85 { 86 foreach ($scripts[0] as $script) 87 if (strpos($script,'[@') != false) 88 return true; 89 } 90 } 91 return false; 92 } 73 93 } 74 94 ?> -
plugins/mkcompat/index.php
r1489 r1490 65 65 if ($v['root_writable']) 66 66 { 67 echo "\n".'<td><form action="'.$p_url.'" method="post">'.68 form::hidden('root',$v['root']). "\n".69 form::hidden('type','theme'). "\n".70 form::hidden('name',$v['name']). "\n".71 $core->formNonce(). "\n".72 '<input type="submit" name="action" value="'.__('Upgrade').'"></input>'. "\n".73 '</form></td>' ."\n";67 echo '<td><form action="'.$p_url.'" method="post">'. 68 form::hidden('root',$v['root']). 69 form::hidden('type','theme'). 70 form::hidden('name',$v['name']). 71 $core->formNonce(). 72 '<input type="submit" name="action" value="'.__('Upgrade').'"></input>'. 73 '</form></td>'; 74 74 } else { 75 75 echo '<td>'.__('You do not have sufficient rights to upgrade this theme.').'</td>'; … … 85 85 } 86 86 ?> 87 <h2><?php echo __('Plugins requiring an upgrade'); ?></h2> 88 <?php 89 $plugins = $core->plugins->getModules(); 90 91 foreach ($plugins as $k => $v) 92 { 93 if (!mkcompat::pluginNeedUpgrade($v['root'])) unset($plugins[$k]); 94 } 95 96 if (count($plugins) > 0) 97 { 98 echo '<table>'; 99 foreach ($plugins as $k => $v) 100 { 101 echo '<tr><th title="'.$v['desc'].'">'.$v['name'].'</th>'. 102 '<td>'.$v['author'].'</td>'. 103 '<td>'.$v['version'].'</td>'; 104 105 if ($v['root_writable']) 106 { 107 echo '<td><form action="'.$p_url.'" method="post">'. 108 form::hidden('root',$v['root']). 109 form::hidden('type','plugin'). 110 form::hidden('name',$v['name']). 111 $core->formNonce(). 112 '<input type="submit" name="action" value="'.__('Upgrade').'"></input>'. 113 '</form></td>'; 114 } else { 115 echo '<td>'.__('You do not have sufficient rights to upgrade this plugin.').'</td>'; 116 } 117 118 echo '</tr>'; 119 } 120 echo '</table>'; 121 } 122 else 123 { 124 echo '<p>'.__('Upgrade does not seem to be required for any plugin.').'</p>'; 125 } 126 ?> 87 127 </body> 88 128 </html>
Note: See TracChangeset
for help on using the changeset viewer.