CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to create a standalone CiviCRM extension
Pages: [1]

Author Topic: How to create a standalone CiviCRM extension  (Read 3014 times)

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
How to create a standalone CiviCRM extension
January 09, 2012, 06:31:07 am
All the advice I've heard for implementing hooks has been to write a custom Drupal module. But that's not very portable since it's tied to one CMS (and also one version of one CMS).

I'm wondering if there is a way to create a standalone CiviCRM extension that
- Works under Joomla, Drupal, and Wordpress
- Implements CiviCRM hooks (and doesn't interfere with other hook implementations - I understand that Joomla only allows 1 instance of each hook)
- Can add civicrm pages and admin menu items (akin to Drupal's hook_menu) i.e. /civicrm/mypage?reset=1
- Can store its own settings in the CiviCRM db (preferably in the same place civi settings are kept)
Try asking your question on the new CiviCRM help site.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to create a standalone CiviCRM extension
January 09, 2012, 06:43:00 am
Seems to recall something jammie tried when in the sprint in bourne. Ping him on IRC, I don't know the details of what he found (or didn't)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to create a standalone CiviCRM extension
January 09, 2012, 08:40:50 am
colemanw,

If I am not wrong lobo already added some support for "civicrm modules", you might want to check with him on irc

Kurund
Found this reply helpful? Support CiviCRM

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to create a standalone CiviCRM extension
January 09, 2012, 09:12:44 am

We experimented with this at the london sprint and determined it was feasible with the current extension system (i.e. we modified the extension system to allow a new type called module)

there are a few more things that remain to be done to make it complete:

1. Add a hook_civicrm_install and hook_civicrm_uninstall - so a module can install tables / add tables to the schema etc
2. Add API functions to the settings functionality. This came about in 4.1 (so pre-london) but would be nice to expose get/set via the API
3. We already expose a hook to add items to the menu table. We'll need to ensure we rebuild the menus when we do an install/uninstall

let me know if u want to work on this and we can get it going for 4.2. The event discount and giftaid module would be great candidates to make CMS agnostic

lobo



A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to create a standalone CiviCRM extension
January 09, 2012, 02:05:01 pm
Good stuff. So is the "module" type extension currently implemented in 4.1? Is there any documentation on how to create one?
What is the naming convention for calling hooks from within an extension?
What about creating a page? (or is that the same as a menu item like it is in Drupal?)
Try asking your question on the new CiviCRM help site.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to create a standalone CiviCRM extension
January 14, 2012, 02:32:37 pm
Also, and probably most importantly, if people start writing modules for CiviCRM then we need a repository for them. It looks like someone made a start on this at http://directory.civicrm.org/ but it doesn't seem to be maintained and lacks basic things like issue tracking and version control. Any chance the website redesign is addressing this?
Try asking your question on the new CiviCRM help site.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: How to create a standalone CiviCRM extension
January 14, 2012, 02:36:46 pm
Quote from: colemanw on January 14, 2012, 02:32:37 pm
It looks like someone made a start on this at http://directory.civicrm.org/ but it doesn't seem to be maintained

Yes, it hasn't been updated since CiviCRM 3.3 it appears. I was just thinking today that we need such a thing--perhaps just a wiki page....
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to create a standalone CiviCRM extension
January 14, 2012, 03:40:18 pm

What we have is a good start and we should build on that rather than a wiki page. A lot more dynamic and we can extend it based on our needs / requirements

Anyone want to take the lead on this?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to create a standalone CiviCRM extension

This forum was archived on 2017-11-26.