Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deactivated widget still apear on webside #160

Open
kal60 opened this issue May 3, 2016 · 0 comments
Open

deactivated widget still apear on webside #160

kal60 opened this issue May 3, 2016 · 0 comments

Comments

@kal60
Copy link

kal60 commented May 3, 2016

When I deactivate a widget via menu: cms-management => widget, it still appears when it's contained within the theme-layout-view (e.g. default-one-column.php) (e.g. calendar).
So first question: if a widget is inactive is it supposed to disapear from the website no matter where it's referenced ? If yes: I changed the application/core/CMS-Model.php to hide the inactive widgets:
in function cms_widgets():

       foreach (self::$__cms_model_properties['widget'] as $row) {
            if (isset($slug) && $slug != '') {
                if ($row->active != 1 || stripos($row->slug === null ? '' : $row->slug, $slug) === false) {
                    continue;
                }
            }

            # added code:
            if ($row->active != 1) { 
                    continue; # skip deactivated widgets
            }
            # end added code

            if (isset($widget_name)) {
                if (strtolower($row->widget_name) != strtolower($widget_name)) {
                    continue;
                }
            }
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant