Changeset 855:990bdbb122aa
- Timestamp:
- 08/01/12 11:36:53 (13 years ago)
- Branch:
- sexy
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/plugins.php
r854 r855 227 227 echo 228 228 '<h3>'.__('Activated plugins').'</h3>'. 229 '<table class="clear plugins"><tr>'. 230 '<th>'.__('Plugin').'</th>'. 231 '<th class="nowrap">'.__('Version').'</th>'. 232 '<th class="nowrap">'.__('Details').'</th>'. 233 '<th class="nowrap">'.__('Action').'</th>'. 234 '</tr>'; 229 '<table class="clear plugins">'. 230 '<caption>'.__('Activated plugin list').'</caption>'. 231 '<thead><tr>'. 232 '<th scope="col">'.__('Plugin').'</th>'. 233 '<th scope="col" class="nowrap">'.__('Version').'</th>'. 234 '<th scope="col" class="nowrap">'.__('Details').'</th>'. 235 '<th scope="col" class="nowrap">'.__('Action').'</th>'. 236 '</tr></thead>'. 237 '<tbody>'; 235 238 236 239 foreach ($p_available as $k => $v) 237 240 { 238 239 241 $is_deletable = $is_writable && preg_match('!^'.$p_path_pat.'!',$v['root']); 240 242 $is_deactivable = $v['root_writable']; … … 242 244 echo 243 245 '<tr class="line wide">'. 244 '<t d class="minimal nowrap"><strong>'.html::escapeHTML($k).'</strong></td>'.246 '<th scope="row" class="minimal nowrap"><strong>'.html::escapeHTML($k).'</strong></th>'. 245 247 '<td class="minimal">'.html::escapeHTML($v['version']).'</td>'. 246 248 '<td class="maximal"><strong>'.html::escapeHTML($v['name']).'</strong> '. 247 '<br />'.html::escapeHTML($v['desc']); 248 echo '</td>'. 249 '<br />'.html::escapeHTML($v['desc']).'</td>'. 249 250 '<td class="nowrap action">'; 250 251 … … 267 268 } 268 269 echo 270 '</tbody>'. 269 271 '</table>'; 270 272 } … … 276 278 echo 277 279 '<h3>'.__('Deactivated plugins').'</h3>'. 278 '<table class="clear plugins"><tr>'. 279 '<th>'.__('Plugin').'</th>'. 280 '<th class="nowrap">'.__('Action').'</th>'. 281 '</tr>'; 280 '<table class="clear plugins">'. 281 '<caption>'.__('Deactivated plugin list').'</caption>'. 282 '<thead><tr>'. 283 '<th scope="col">'.__('Plugin').'</th>'. 284 '<th scope="col" class="nowrap">'.__('Action').'</th>'. 285 '</tr></thead>'. 286 '<tbody>'; 282 287 283 288 foreach ($p_disabled as $k => $v) 284 289 { 285 $dep = $core->plugins->getUnmatchedDependencies($k); print_r($dep);286 $invalid=(count($dep) > 0);287 288 290 $is_deletable = $is_writable && preg_match('!^'.$p_path_pat.'!',$v['root']); 289 $is_activable = !$invalid &&$v['root_writable'];291 $is_activable = $v['root_writable']; 290 292 291 293 echo 292 '<tr class="line wide'.($invalid ? " error" : "").'">'. 293 '<td class="maximal nowrap"><strong>'.html::escapeHTML($k).'</strong>'; 294 if ($invalid) { 295 echo '<br /><span style="color:#c00"><strong>'.__('Unmet dependencies: ').'</strong>'. 296 join(', ',$dep).'</span>'; 297 } 298 echo '</td>'; 299 294 '<tr class="line wide">'. 295 '<th scope="row" class="maximal nowrap"><strong>'.html::escapeHTML($k).'</strong></th>'. 300 296 '<td class="nowrap action">'; 301 297 … … 319 315 } 320 316 echo 317 '</tbody>'. 321 318 '</table>'; 322 319 } -
inc/core/class.dc.modules.php
r854 r855 323 323 } 324 324 325 public function getUnmatchedDependencies($id) {326 if (isset($this->modules[$id])){327 $mod = $this->modules[$id];328 } elseif (isset($this->disabled[$id])) {329 $mod = $this->disabled[$id];330 } else {331 return array();332 }333 if (!isset($mod['depends'])) {334 return array();335 }336 $failures=array();337 $deps = $mod['depends'];338 foreach ($deps as $n => $v) {339 if (is_array($v)) {340 $min_ver = $v[0];341 $max_ver = $v[1];342 $ver_txt = sprintf(__('%s<=%s<=%s'),$min_ver,$n,$max_ver);343 } else {344 $min_ver = $v;345 $max_ver = '';346 $ver_txt = sprintf(__('%s>=%s'),$n,$min_ver);347 }348 if (!isset($this->modules[$n])) {349 $failures[$n] = sprintf(__('%s (missing)'),$ver_txt);350 } else {351 $modver = $mod['version'];352 if ((($min_ver != '' ) && version_compare($modver, $minver,'<'))353 || (($max_ver != '' ) && version_compare($modver, $maxver,'>'))){354 $failures[$n] = sprintf(__('%s (current : %s)'),$ver_txt,$modver);355 }356 }357 }358 return $failures;359 }360 361 325 /** 362 326 This method installs module with ID <var>$id</var> and having a _install -
plugins/antispam/_define.php
r854 r855 19 19 array( 20 20 'permissions' => 'usage,contentadmin', 21 'depends' => array (22 'comments' => '1.0'23 ),24 21 'priority' => 10 25 22 )
Note: See TracChangeset
for help on using the changeset viewer.