philsturgeon / ee2-widgets

Widgets is a ExpressionEngine 2.1 module that allows even your least experienced client or to manage chunks of intelligent content on there site without needing to learn loads of tags, HTML or call you in to help.
http://devot-ee.com/add-ons/widgets
18 stars 13 forks source link

Better way to enumerate widget directories? #7

Closed kruncher closed 11 years ago

kruncher commented 11 years ago

Would the following be better for enumerating widget directories?

// Map where all widgets are
foreach (glob(APPPATH . 'third_party/*/widget/*') as $widget_path)
{
    $slug = basename($widget_path);

    // Set this so we know where it is later
    $this->_widget_locations[$slug] = $widget_path . '/';
}

Without this approach my custom widget package does not get detected.

Edit: Are custom widget plugins supposed to remove widgets when they are uninstalled? If so then there would need to be a way to prevent inactive extensions from being included in the above.

philsturgeon commented 11 years ago

If you have code change suggestions to make please do them in the form of a pull request.