aljawaid / PluginManager

Replace the Installed Plugins section with a whole new interface. Plugin Manager provides both users and developers with an improved layout displaying a new section for troubleshooting plugins with a new plugin structure breakdown for each plugin. Install plugins directly or explore new upcoming or untested features from manual plugins.
MIT License
17 stars 3 forks source link

Show 'Other' Icon on Plugin Info Page if >0 #22

Closed aljawaid closed 2 years ago

aljawaid commented 2 years ago

Based on this commit https://github.com/aljawaid/PluginManager/commit/abe9a9f0f7b9318a66e26abd784816ac11301294 which is for the Plugin Directory Page.

The same icon should only show if there is greater than 0 (soon there should always be zero as all plugins will be part of a type)

I think the use Kanboard\Core\Plugin\Directory; is correct in the controller and also the 'available_plugins' => Directory::getInstance($this->container)->getAvailablePlugins(); ?>

but something is wrong in this:

<?php $totalOthers = isset($countTypes) ? ((count($available_plugins)) - (array_sum($countTypes)) ) : '0' ?>
        <?php if ($totalOthers > 0): ?>
<?php endif ?>

as the icon doesn't show, when it should currently (there are 86 others for now)

creecros commented 2 years ago

im so confused. what do you want?

image

aljawaid commented 2 years ago

im so confused. what do you want?

image

the pic is for the directory page... that works fine (tell me your screen size as the connector field needs resizing)

my problem, or what i want is on the info/plugin-info.php page which is where i have pushed the code but it needs fixing as it is not showing the icon... but it should as the count so far is 86 (like in your pic)

creecros commented 2 years ago

oh, well that's easy.

take a look again at that template, and ask yourself this question. What is $count Types?

https://github.com/aljawaid/PluginManager/blob/1957c905fd5d4572d1c9dc9aa124bb0402fe93d9/Template/info/plugin-info.php#L105

did you define it?

and if you didn't define it, is it set?

and if it's not set, what did you specify is the value? 0.

it's doing exactly what you told it to do.

now define it, like you did in directory.php

https://github.com/aljawaid/PluginManager/blob/1957c905fd5d4572d1c9dc9aa124bb0402fe93d9/Template/plugin/directory.php#L65

see if it works now.

aljawaid commented 2 years ago

thanks for that, it made sense and also it worked