r5085 new hook modifyEntitySummary. Allows to override any summary portlet
authorAlexey Andriyanov <alan@al-an.info>
Tue, 15 May 2012 17:13:43 +0000 (17:13 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Tue, 15 May 2012 17:13:43 +0000 (17:13 +0000)
renderEntitySummary: call new hook modifyEntitySummary.
renderFileSummary: removed old hook modifyFileSummary

wwwroot/inc/interface-lib.php
wwwroot/inc/interface.php

index 41102f7fb0b5a8a7dacb0ff6dcf5e6728ccc5458..63799ac117da5cef0557c87c924a67dc46334d9d 100644 (file)
@@ -819,6 +819,10 @@ function printTagTRs ($cell, $baseurl = '')
 function renderEntitySummary ($cell, $title, $values = array())
 {
        global $page_by_realm;
+       // allow plugins to override summary table
+       if ($new_values = callHook ('modifyEntitySummary', $cell, $values))
+               $values = $new_values;
+
        startPortlet ($title);
        echo "<table border=0 cellspacing=0 cellpadding=3 width='100%'>\n";
        foreach ($values as $name => $value)
index 73521922cc4851caa1d2bb11872ed70727072f1b..8156427afa43acc31b99142a7cab975e1e6bf49b 100644 (file)
@@ -5249,8 +5249,6 @@ function renderFileSummary ($file)
        $summary['tags'] = '';
        if (strlen ($file['comment']))
                $summary['Comment'] = '<div class="dashed slbconf">' . string_insert_hrefs (htmlspecialchars ($file['comment'])) . '</div>';
-       if ($new_summary = callHook ('modifyFileSummary', $file, $summary))
-               $summary = $new_summary;
        renderEntitySummary ($file, 'summary', $summary);
 }