logo       

SF.net SVN: mantisbt: [4794] trunk/mantisbt/manage_plugin_page.php: msg#00099

Subject: SF.net SVN: mantisbt: [4794] trunk/mantisbt/manage_plugin_page.php
Revision: 4794
          http://mantisbt.svn.sourceforge.net/mantisbt/?rev=4794&view=rev
Author:   nuclear_eclipse
Date:     2007-11-26 11:01:04 -0800 (Mon, 26 Nov 2007)

Log Message:
-----------
Fix display errors and optimize plugin management page to account for 
assurances made by plugin API for plugin info contents.

Modified Paths:
--------------
    trunk/mantisbt/manage_plugin_page.php

Modified: trunk/mantisbt/manage_plugin_page.php
===================================================================
--- trunk/mantisbt/manage_plugin_page.php       2007-11-26 18:39:48 UTC (rev 
4793)
+++ trunk/mantisbt/manage_plugin_page.php       2007-11-26 19:01:04 UTC (rev 
4794)
@@ -74,15 +74,15 @@
        $t_depends = array();
 
        $t_name = string_display( $t_plugins[$t_basename]['name'].' 
'.$t_plugins[$t_basename]['version'] );
-       if ( !is_null( $t_page ) && !is_blank( $t_page ) ) {
+       if ( !is_blank( $t_page ) ) {
                $t_name = '<a href="' . string_attribute( plugin_page( $t_page, 
$t_basename ) ) . '">' . $t_name . '</a>';
        }
 
-       if ( !is_null( $t_author ) && !is_blank( $t_author ) ) {
+       if ( !is_blank( $t_author ) ) {
                if ( is_array( $t_author ) ) {
                        $t_author = implode( $t_author, ', ' );
                }
-               if ( !is_null( $t_contact ) && !is_blank( $t_contact ) ) {
+               if ( !is_blank( $t_contact ) ) {
                        $t_author = '<br/>' . sprintf( lang_get( 
'plugin_author' ), 
                                '<a href="mailto:' . string_attribute( 
$t_contact ) . '">' . string_display( $t_author ) . '</a>' );
                } else {
@@ -90,7 +90,7 @@
                }
        }
 
-       if ( !is_null( $t_url ) && !is_blank( $t_url ) ) {
+       if ( !is_blank( $t_url ) ) {
                $t_url = '<br/>' . string_display_links( sprintf( lang_get( 
'plugin_url' ), $t_url ) );
        }
 
@@ -106,21 +106,19 @@
                        '<input type="submit" value="'.lang_get( 
'plugin_uninstall' ).'"></form>';
        }
 
-       if ( !is_null( $t_requires ) ) {
-               if ( is_array( $t_requires ) ) {
-                       foreach( $t_requires as $t_plugin => $t_version ) {
-                               $t_dependency = plugin_dependency( $t_plugin, 
$t_version );
-                               if ( 1 == $t_dependency ) {
-                                       if ( is_blank( $t_upgrade ) ) {
-                                               $t_depends[] = '<span 
class="dependency_met">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
-                                       } else {
-                                               $t_depends[] = '<span 
class="dependency_upgrade">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
-                                       }
-                               } elseif ( -1 == $t_dependency ) {
-                                       $t_depends[] = '<span 
class="dependency_dated">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
+       if ( is_array( $t_requires ) ) {
+               foreach( $t_requires as $t_plugin => $t_version ) {
+                       $t_dependency = plugin_dependency( $t_plugin, 
$t_version );
+                       if ( 1 == $t_dependency ) {
+                               if ( is_blank( $t_upgrade ) ) {
+                                       $t_depends[] = '<span 
class="dependency_met">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
                                } else {
-                                       $t_depends[] = '<span 
class="dependency_unmet">'.string_display( $t_plugin.' '.$t_version ).'</span>';
+                                       $t_depends[] = '<span 
class="dependency_upgrade">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
                                }
+                       } elseif ( -1 == $t_dependency ) {
+                               $t_depends[] = '<span 
class="dependency_dated">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</span>';
+                       } else {
+                               $t_depends[] = '<span 
class="dependency_unmet">'.string_display( $t_plugin.' '.$t_version ).'</span>';
                        }
                }
        }
@@ -173,11 +171,11 @@
 
        $t_name = string_display( $t_info['name'].' '.$t_info['version'] );
 
-       if ( !is_null( $t_author ) ) {
+       if ( !is_blank( $t_author ) ) {
                if ( is_array( $t_author ) ) {
                        $t_author = implode( $t_author, ', ' );
                }
-               if ( !is_null( $t_contact ) && !is_blank( $t_contact ) ) {
+               if ( !is_blank( $t_contact ) ) {
                        $t_author = '<br/>' . sprintf( lang_get( 
'plugin_author' ), 
                                '<a href="mailto:' . string_display( $t_contact 
) . '">' . string_display( $t_author ) . '</a>' );
                } else {
@@ -185,24 +183,22 @@
                }
        }
 
-       if ( !is_null( $t_url ) && !is_blank( $t_url ) ) {
+       if ( !is_blank( $t_url ) ) {
                $t_url = '<br/>' . string_display_links( sprintf( lang_get( 
'plugin_url' ), $t_url ) );
        }
 
        $t_ready = true;
-       if ( !is_null( $t_requires ) ) {
-               if ( is_array( $t_requires ) ) {
-                       foreach( $t_requires as $t_plugin => $t_version ) {
-                               $t_dependency = plugin_dependency( $t_plugin, 
$t_version );
-                               if ( 1 == $t_dependency ) {
-                                       $t_depends[] = '<span 
class="dependency_met">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</font>';
-                               } elseif ( -1 == $t_dependency ) {
-                                       $t_ready = false;
-                                       $t_depends[] = '<span 
class="dependency_dated">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</font>';
-                               } else {
-                                       $t_ready = false;
-                                       $t_depends[] = '<span 
class="dependency_unmet">'.string_display( $t_plugin.' '.$t_version ).'</font>';
-                               }
+       if ( is_array( $t_requires ) ) {
+               foreach( $t_requires as $t_plugin => $t_version ) {
+                       $t_dependency = plugin_dependency( $t_plugin, 
$t_version );
+                       if ( 1 == $t_dependency ) {
+                               $t_depends[] = '<span 
class="dependency_met">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</font>';
+                       } elseif ( -1 == $t_dependency ) {
+                               $t_ready = false;
+                               $t_depends[] = '<span 
class="dependency_dated">'.string_display( $t_plugins[$t_plugin]['name'].' 
'.$t_version ).'</font>';
+                       } else {
+                               $t_ready = false;
+                               $t_depends[] = '<span 
class="dependency_unmet">'.string_display( $t_plugin.' '.$t_version ).'</font>';
                        }
                }
        }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe