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 should a native extension check which CMS is in use?
Pages: [1]

Author Topic: How should a native extension check which CMS is in use?  (Read 294 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
How should a native extension check which CMS is in use?
September 02, 2014, 05:10:29 am
I have a native CiviCRM extension that is working well. (You can try it out at: https://civicrm.org/extensions/fancy-tokens)   I would like to enhance it to produce tokens with hyperlinks to Drupal WebForms with the checksum, but only if CiviCRM is running under Drupal.   

What is the recommended way to determine the CMS in use, from inside my extension?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How should a native extension check which CMS is in use?
September 02, 2014, 05:15:24 am
Code: [Select]
$config = CRM_Core_Config::singleton();
if ($config->userSystem->is_drupal) ...
Try asking your question on the new CiviCRM help site.

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: How should a native extension check which CMS is in use?
September 03, 2014, 07:08:01 am
That works perfectly. Thanks.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How should a native extension check which CMS is in use?

This forum was archived on 2017-11-26.