Owerride base class for custom theme only

Good day!
Can I owerride some buttons for "bx_persons_snippet_meta" - [add/remove friend] button & [subscribe/unsubscribe person] button?
I find needed code in 'modules/base/profile/classes/BxBaseModProfileMenuSnippetMeta.php -> _getMenuItemConnection()
But I have no idea how to do this only for my custom theme ( I create custom module in modules/boonex/... and module works fine)
Is this posible in my module or I can owerride base class?

Thanks!

  • 1772
  • More
Replies (4)
    • Hello zaytseff !

      May you please specify your task? Maybe it's possible to do it without actions with PHP code. But you may redeclare the necessary class in modules\[your vendor name]\[your module name]\classes\[your module prefix]ModProfileMenuSnippetMeta.php

      Of course, this class and class should extend the BxBaseModProfileMenuSnippetMeta.

      • Hello LeonidS !
        I tried the way you suggestet before ask my question here. It's not work (((
        Ofcourse I can specify my task.
        I create own theme module for customizing UNA. On persons-home page I want customize buttons for Add friend/Follow actions - button with icon and label text in title attribute - like a tooltip.
        I can do this if override _getMenuItemConnection() from BxBaseModProfileMenuSnippetMeta in
        modules/boonex/persons/classes/BxPersonsMenuSnippetMeta.php But it 'global' action for all themes and it not what I want.
        Also I fiind this class in DB in sys_object_menu in override_class_name and override_class_file.
        I have a some crazy idea how to realize this.
        1 - create class in my theme extended from BxPersonsMenuSnippetMeta.
        2 - in enable/disable scripts update row in sys_object_menu for override_class_name and override_class_file - change class name & class file.

        3 - in overriding method check current theme name and call needed function depends theme name.

        Maybe I'm wrong and there is an easier way to do it

        • It's not work ((( 

          Then you plan with your own class file / class name in sys_object_menu is fine.

          • Yes, I doing this variant and it work properly.
            I'll can write my result when I'll complete my task.

            Login or Join to comment.