small upgrade for Admin Module Manager

All discussions for Modules

small upgrade for Admin Module Manager

Postby illusions » Tue Aug 29, 2017 2:55 pm

this is a very small upgrade for the Admin Module Manager which lets you view the Freebies and the paid Mods Seperately also added an up/down option for viewing.
ive added 2 images for you to view so heres how it works first to make the sections retract..

find your TableHeader statements and change them so from

Code: Select all
 TableHeader("Modules to upgrade");


To

Code: Select all
TableHeader(Translate("Modules To Upgrade"), true, true);


do that to each TableHeader and you can now Retract between closed and open options..

Now to add the Freebie section..

Code: Select all
    if (count($availableModules) > 0)
        {
            TableHeader(Translate("Free Modules Available"), true, true);
            if (count($availableModules) > 5)
                echo "<div style='height: 150px; overflow: auto;'>";
            echo "<table class='plainTable'>";
            echo "<tr class='titleLine'>";
            echo "<td colspan='2'>&nbsp;</td>";
            echo "<td>" . Translate('Name') . "</td>";
            echo "<td>" . Translate('Author') . "</td>";
            echo "<td>" . Translate('Type') . "</td>";
            echo "<td>" . Translate('Price') . "</td>";
            echo "</tr>";
            $row = 0;
            foreach ($availableModules as $m)
            {
                if ($row % 2 == 0)
                    echo "<tr class='evenLine' valign='top'>";
                else
                    echo "<tr class='oddLine' valign='top'>";
                if ($m[3] == 0) {
                echo "<td width='1%'>";
                LinkButton("Ignore", "index.php?p=admin_module_manager&ignore=" . urlencode($m[1]), "return confirm(unescape('" . rawurlencode(Translate("Are you sure you don't want to see this module in this list anymore?")) . "'));");
                echo "</td>";
         }
               
                if ($m[3] == 0)
                {
                    echo "<td width='1%'>";
                    LinkButton("Install", "index.php?p=admin_module_manager&install=" . urlencode($m[1]));
                    echo "</td>";
                }
                elseif ($m[3] < 0)
                {
                    echo "<td width='1%'>";
                    LinkButton("Check", "http://nwe.funmayhem.com/index.php?c=modules&m=" . $m[0], null, "NW-SHOP");
                    echo "</td>";
                }
            if ($m[3] == 0) {
                echo "<td><a href='http://nwe.funmayhem.com/index.php?c=modules&m={$m[0]}' target='NW-SHOP'>{$m[1]}</a></td>";
            }
            if ($m[3] == 0) {
                echo "<td>{$m[5]}</td>";
            }
            if ($m[3] == 0)
                echo "<td>{$m[2]}</td>";
                if ($m[3] == 0)
                    echo "<td align='right'><b>" . Translate("free") . "</b>&nbsp;</td>";
                elseif ($m[3] < 0)
                    echo "<td align='right'>{$m[3]}&nbsp; TEST</td>";
                echo "</tr>";
                $row ++;
            }
            echo "</table>";
            if (count($availableModules) > 5)
                echo "</div>";
            TableFooter();
        }


you will need to Ammend the Available Modules section so it removes the Free Items so i'll do that for you here

Code: Select all
   if (count($availableModules) > 0)
        {
         
             TableHeader(Translate("Available Paid Modules"), true, true);
         
            if (count($availableModules) > 5)
                echo "<div style='height: 150px; overflow: auto;'>";
            echo "<table class='plainTable'>";
            echo "<tr class='titleLine'>";
            echo "<td colspan='2'>&nbsp;</td>";
            echo "<td>" . Translate('Name') . "</td>";
            echo "<td>" . Translate('Author') . "</td>";
            echo "<td>" . Translate('Type') . "</td>";
            echo "<td>" . Translate('Price') . "</td>";
            echo "</tr>";
            $row = 0;
            foreach ($availableModules as $m)
            {
                if ($row % 2 == 0)
                    echo "<tr class='evenLine' valign='top'>";
                else
                    echo "<tr class='oddLine' valign='top'>";
            
            
                if ($m[3] > 1) {
                echo "<td width='1%'>";
                LinkButton("Ignore", "index.php?p=admin_module_manager&ignore=" . urlencode($m[1]), "return confirm(unescape('" . rawurlencode(Translate("Are you sure you don't want to see this module in this list anymore?")) . "'));");
                echo "</td>";
         }
               
                if ($m[3] > 1)
                {
                    echo "<td width='1%'>";
                    LinkButton("Install", "index.php?p=admin_module_manager&install=" . urlencode($m[1]));
                    echo "</td>";
                }
                elseif ($m[3] < 0)
                {
                    echo "<td width='1%'>";
                    LinkButton("Check", "http://nwe.funmayhem.com/index.php?c=modules&m=" . $m[0], null, "NW-SHOP");
                    echo "</td>";
                }
            if ($m[3] > 1) {
                echo "<td><a href='http://nwe.funmayhem.com/index.php?c=modules&m={$m[0]}' target='NW-SHOP'>{$m[1]}</a></td>";
            }
            if ($m[3] > 1) {
                echo "<td>{$m[5]}</td>";
            }
            if ($m[3] > 1)
                echo "<td>{$m[2]}</td>";
                if ($m[3] > 1)
                    echo "<td align='right'>{$m[3]}&nbsp;</td>";
            //echo "<td>" . GetModuleVersion($m) . "</td>";
               
                echo "</tr>";
                $row ++;
            }
            echo "</table>";
            if (count($availableModules) > 5)
                echo "</div>";
            TableFooter();
        }


and your good to go
Attachments
openbox.JPG
showing open option
openbox.JPG (125.67 KiB) Viewed 63 times
dropbox.JPG
showing all options closed
dropbox.JPG (55.17 KiB) Viewed 63 times
illusions
 
Posts: 27
Joined: Thu Mar 06, 2014 7:46 am
Has thanked: 1 time
Been thanked: 5 times

Return to Modules

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x