Skip to Content Skip to Menu

How to install cb plugin during ext. installation?

  • THE_AI
  • THE_AI
  • OFFLINE
  • Posts: 25
  • Thanks: 2
  • Karma: 2
11 years 8 months ago #210357 by THE_AI
For our hotspots component: demo.compojoom.com/hotspots we have a cb plugin that displays the last locations that a user has entered. I want to distribute this plugin together with our main component package and install it in cb while we install our component. If it was a normal plugin one could do
Code:
$installer = new JInstaller; $isntaller->install('path_to_package');
but since it is not a normal joomla plugin, but a cb plugin I'm a little lost how to use the cb framework for this.
I tried this:
Code:
if(JFile::exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php')) { require_once(JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php'); $cbInstaller = new cbInstallerPlugin(); $cbInstaller->install($parent->getParent()->getPath('source').'/components/com_comprofiler/plugin/user/plug_hotspots'); }

but then I have fatal errors from missing functions etc...

Any advise on this would be much appreciated!
Thank you!
Daniel

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 25532
  • Thanks: 1834
  • Karma: 877
11 years 8 months ago #210368 by nant

Please Log in or Create an account to join the conversation.

  • THE_AI
  • THE_AI
  • OFFLINE
  • Posts: 25
  • Thanks: 2
  • Karma: 2
11 years 8 months ago #210370 by THE_AI
I managed to do the trick. Here is the code in case anyone wants to do something similar:
Code:
if(JFile::exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php')) { global $_CB_framework; require_once(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php'); require_once(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.class.php'); require_once(JPATH_ADMINISTRATOR . '/components/com_comprofiler/comprofiler.class.php'); require_once(JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php'); $cbInstaller = new cbInstallerPlugin(); if($cbInstaller->install($parent->getParent()->getPath('source').'/components/com_comprofiler/plugin/user/plug_hotspots/')) { // do something } }
The following user(s) said Thank You: beat, pelloq1

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 8176
  • Thanks: 528
  • Karma: 352
11 years 8 months ago #210377 by beat
Thanks for sharing :)

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn