Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

hookRenderMenuBar Pawtucket 1.7.6

Hi,

has there anything been changed in the way plugins for pawtucket create a menu item?

I wrote a plugin displaying wordpress items that works if I call the URL directly:

/pawtucket/index.php/CaWordpress/CaWordpress/show

but there is not menu item created.
Looks like the method hookRenderMenuBar() is not called at all.

My code for hookRenderMenuBar is:

public function hookRenderMenuBar($pa_menu_bar) {
if ($o_req = $this->getRequest()) {
$va_menu = array(
'displayName' => _t('News'),
'default' => array(
'module' => 'CaWordpress',
'controller' => 'CaWordpress',
'action' => 'show'
),
'requires' => array()
);

                    if (! isset($pa_menu_bar[$vs_put_before_menu_code])) {
                            $pa_menu_bar['CaWordpress'] = $va_menu;
                    } else {
                            $va_new_menu_bar = array();
                            foreach($pa_menu_bar as $vs_menu_code=>$va_menu_info) {
                                    if ($vs_menu_code === $vs_put_before_menu_code) {
                                            $va_new_menu_bar['CaWordpress'] = $va_menu;
                                    }
                                    $va_new_menu_bar[$vs_menu_code] = $va_menu_info;
                            }
                            return $va_new_menu_bar;
                    }
            }
            return $pa_menu_bar;
    }

Thanks,
Christoph

Comments

  • edited July 2019

    I just added a

    file_put_contents('/tmp/ca.log', "hookRenderMenu\n", FILE_APPEND);

    as first line of the method hookRenderMenuBar($pa_menu_bar) inside my plugin, so I can see this method is never called.

    The methods "__construct()" and "checkStatus()" in contrast are called, 'available' in checkStatus is 1 (TRUE).

    Christoph

Sign In or Register to comment.