We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

add widget to groups? | Forum

Joseph
Joseph Mar 26 '13
so I was wondering how I can edit several of my plugins I have (for example the radio plugin) and ad it to groups? I have several plugins i want to alter to work on my groups page so this would be super helpful
Michael I.
Michael I. Mar 27 '13
Consider about creating a specific widget for groups, that might work for you.
Joseph
Joseph Mar 27 '13
ok I still need to know how to do that
Michael I.
Michael I. Apr 3 '13
Sorry, I cannot provide you with specific information on how to create a widget for groups.
Hannah
Hannah Feb 7 '14
How do I add widgets to groups? please help!!
Joseph
Joseph Feb 7 '14
well without the help of staff who you would think know more than me lol (no offense guys) I was able to finally solve this issue for most plugins but be warned this may not work for every single plugin.



go to your plugin folder and find the activate.php and add this line 


$event = new BASE_CLASS_EventCollector('feed.collect_widgets');OW::getEventManager()->trigger($event);
foreach( $event->getData() as $widgetInfo ){    if ($widgetInfo['place'] == 'group')    {        try         {            $placeWidget = BOL_ComponentAdminService::getInstance()->addWidgetToPlace($widget, $widgetInfo['place']);            BOL_ComponentAdminService::getInstance()->addWidgetToPosition($placeWidget, $widgetInfo['section'], $widgetInfo['order']);        }        catch ( Exception $e )        {
        }    }}



please note so far this method has only been tested on the radio plugin and cbox plugin 

The Forum post is edited by Joseph Feb 7 '14
Kobe White
Kobe White Feb 8 '14
Joseph, after you added the code how did you activate/ mod the group page?
I also assume you edited the activate.php which was in the plugin>group folder?
Also what line did you start your code below?

Btw, thanks for figuring this out.
Quote from Joseph well without the help of staff who you would think know more than me lol (no offense guys) I was able to finally solve this issue for most plugins but be warned this may not work for every single plugin.



go to your plugin folder and find the activate.php and add this line 


$event = new BASE_CLASS_EventCollector('feed.collect_widgets');OW::getEventManager()->trigger($event);
foreach( $event->getData() as $widgetInfo ){    if ($widgetInfo['place'] == 'group')    {        try         {            $placeWidget = BOL_ComponentAdminService::getInstance()->addWidgetToPlace($widget, $widgetInfo['place']);            BOL_ComponentAdminService::getInstance()->addWidgetToPosition($placeWidget, $widgetInfo['section'], $widgetInfo['order']);        }        catch ( Exception $e )        {
        }    }}



please note so far this method has only been tested on the radio plugin and cbox plugin 


The Forum post is edited by Kobe White Feb 8 '14
Joseph
Joseph Feb 8 '14
no you want to edit the plugin for the widget you wish to add to groups and after doing so deactivate your plugin and then reactivate it
Joseph
Joseph Feb 8 '14
you should not need to edit the groups plugin at all
Kobe White
Kobe White Feb 9 '14
Ah, I see what you mean.
Now I got it sort of working. I am using this option in my groups to showcase the video plus plug in. I noticed it only works in one group (group1). As for my other groups videos are not showing, but the box is there but its not pulling videos like in the group 1.  When I go to view all, in the ones that are not pulling, I get "INVALID_URL".

Other then these minor issues it nice to have the option for a widget.
Joseph
Joseph Feb 9 '14
yeah that could be an issue with that specific plugin I used this on the cbox plugin and was able to use the cbox in every group
Kobe White
Kobe White Feb 9 '14
I will look over the code and test a few more plugins. I just need to figure out another issue I am having; which I stated above 'INVALID_URI". I think its (video plus plugin)conflicting with the code you posted, as well as some parts of my site.
Like I said I will try a few more plugins with your code.

Maybe we will be lucky to have more options, like yours,  with the next update :)

Once again for taking the time to figure this out.
Oxwall Accessories
Oxwall Accessories Mar 2 '14
Good Job Joe! 
himanshu chauhan
himanshu chauhan Jul 15 '15
hey friends plz help me.. i want to show my widget on the dashboard. when i refresh my site following fatal error and warning came. plz help me


OW Debug - Warning Message: include(/home/krunch/public_html/ow_system_plugins/base/components/add_new.php) [function.include]: failed to open stream: No such file or directory File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: include() [function.include]: Failed opening '/home/krunch/public_html/ow_system_plugins/base/components/add_new.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: include(/home/krunch/public_html/ow_system_plugins/base/components/add_new.php) [function.include]: failed to open stream: No such file or directory File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: include() [function.include]: Failed opening '/home/krunch/public_html/ow_system_plugins/base/components/add_new.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: include(/home/krunch/public_html/ow_system_plugins/base/components/add_new.php) [function.include]: failed to open stream: No such file or directory File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: include() [function.include]: Failed opening '/home/krunch/public_html/ow_system_plugins/base/components/add_new.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') File: /home/krunch/public_html/ow_core/autoload.php Line: 110

OW Debug - Warning Message: call_user_func() expects parameter 1 to be a valid callback, class 'BASE_CMP_AddNew' not found File: /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_panel.php Line: 67

OW Debug - Warning Message: call_user_func() expects parameter 1 to be a valid callback, class 'BASE_CMP_Add_New' not found File: /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_panel.php Line: 67

OW Debug - Exception

Message: Class BASE_CMP_Add_New does not exist File: /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_item.php Line: 208 Trace: #0 /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_item.php(208): ReflectionClass->__construct('BASE_CMP_Add_Ne...') #1 /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_item.php(92): BASE_CMP_DragAndDropItem->checkComponent('BASE_CMP_Add_Ne...') #2 /home/krunch/public_html/ow_system_plugins/base/components/drag_and_drop_entity_panel.php(200): BASE_CMP_DragAndDropItem->setContentComponentClass('BASE_CMP_Add_Ne...') #3 /home/krunch/public_html/ow_smarty/template_c/7042cced80abb84056f9257e6f3cb2e0b9e13038.file.drag_and_drop_entity_panel.html.php(100): BASE_CMP_DragAndDropEntityPanel->tplComponent(Array, Object(Smarty_Internal_Template)) #4 /home/krunch/public_html/ow_libraries/smarty3/sysplugins/smarty_internal_templatebase.php(180): content_557fa03ccd0874_50470742(Object(Smarty_Internal_Template)) #5 /home/krunch/public_html/ow_core/view_renderer.php(101): Smarty_Internal_TemplateBase->fetch('/home/krunch/pu...') #6 /home/krunch/public_html/ow_core/renderable.php(271): OW_ViewRenderer->renderTemplate('/home/krunch/pu...') #7 /home/krunch/public_html/ow_core/component.php(80): OW_Renderable->render() #8 /home/krunch/public_html/ow_system_plugins/base/controllers/component_panel.php(156): OW_Component->render() #9 /home/krunch/public_html/ow_system_plugins/base/controllers/component_panel.php(183): BASE_CTRL_ComponentPanel->action('dashboard', 1, false, Array, 'drag_and_drop_e...') #10 [internal function]: BASE_CTRL_ComponentPanel->dashboard(Array) #11 /home/krunch/public_html/ow_core/request_handler.php(266): call_user_func_array(Array, Array) #12 /home/krunch/public_html/ow_core/application.php(329): OW_RequestHandler->dispatch() #13 /home/krunch/public_html/index.php(73): OW_Application->handleRequest() #14 {main} Type: ReflectionException
himanshu chauhan
himanshu chauhan Jul 15 '15
is it we have to write our own code for these files or these files are automatically included by oxwall on installation of plugin
Michal Sekela
Michal Sekela Aug 24 '15
Hello,

After using the code, you get the widget settings group, but the events will not show. Do you know where is the problem?
  Thank you for your help.