View Issue Details

IDProjectCategoryView StatusLast Update
0015457phpList 3 applicationPlugin APIpublic12-05-11 01:52
Reporteradrian15 Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product VersionFuture developments 
Summary0015457: Display Header function added to plugins functionality
DescriptionWith this patch plugins can add text to phplist admin pages header.

This way you can extend phplist header messages on the fly.
Additional Information* This patch was designed with svn revision 1703 in mind. I suppose it will work in any 2.11 version (aka current svn) but it will fail in 2.10 version because I have read somewhere that there were many changes from the 2.10 to the 2.11 plugin management, but you are free to try it.

* This patch is needed for the wizard so you might want to relate it to issue: #15444.
TagsNo tags attached.

Relationships

related to 0015444 new Wizard plugin (draft) 
related to 0015459 new Wizard plugin 

Activities

27-04-10 11:41

 

wizard_D02_plugins_display_header.patch (1,550 bytes)   
diff -urN wizard_D01_empty/lists/admin/defaultplugin.php wizard_D02_add_header/lists/admin/defaultplugin.php
--- wizard_D01_empty/lists/admin/defaultplugin.php	2010-04-12 18:15:15.000000000 +0200
+++ wizard_D02_add_header/lists/admin/defaultplugin.php	2010-04-12 18:29:19.000000000 +0200
@@ -49,6 +49,11 @@
     return null;
   }
 
+  function displayHeader($info) {
+    # Return html snippet to add at header
+    return null;
+  }
+
   function writeConfig($name, $value) {
     #  write a value to the general config to be retrieved at a later stage
     # parameters: name -> name of the variable
diff -urN wizard_D01_empty/lists/admin/header.inc wizard_D02_add_header/lists/admin/header.inc
--- wizard_D01_empty/lists/admin/header.inc	2010-04-12 18:15:14.000000000 +0200
+++ wizard_D02_add_header/lists/admin/header.inc	2010-04-27 12:30:57.000000000 +0200
@@ -8,7 +8,18 @@
 <table cellspacing=0 cellpadding=0 width=710 border=0>
 <tr>
 <td bgcolor="#000000" rowspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td>
-<td bgcolor="#000000"><img height=1 alt="" src="images/transparent.png" width=708 border=0></td>
+<td bgcolor="#F0D1A3"><img height=1 alt="" src="images/transparent.png" width=708 border=0>
+<?php
+
+foreach ($GLOBALS['plugins'] as $pluginName=>$plugin) {
+  if ( $plugin->displayHeader($page) ){
+    echo '</br>' . $plugin->displayHeader($page);echo '</br>';
+  }
+  
+}
+
+?> 
+</td>
 <td bgcolor="#000000" rowspan=3><img height=1 alt="" src="images/transparent.png" width=1 border=0></td>
 </tr>