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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Has hook civicrm_tabs changed for new feature in 4.4.x?
Pages: [1]

Author Topic: Has hook civicrm_tabs changed for new feature in 4.4.x?  (Read 459 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
Has hook civicrm_tabs changed for new feature in 4.4.x?
January 17, 2014, 08:30:05 pm
I am using the hook "civicrm_tabs" to add a new tab to all contact records. This is functioning fine in version 4.4.3. However there is a wierd UI issue: my custom tab appears to be inactive ( ie it has the same appearance as the built in tab for "Events" when the "Events" tab has 0 records)

If the user clicks on the custom tab, it does work as expected.  The different appearance of tabs with 0 records as compared to tabs with 1+ records seems to be a new feature of version 4.4.x.   Is there something new I have to do in my hook so that the tab appears active?


Code: [Select]
function civitest_civicrm_tabs( &$tabs, $contactID ) {
 
    $url = CRM_Utils_System::url( 'civicrm/contact/view/contribution',
                                  "reset=1&snippet=1&force=1&cid=$contactID" );
    $tabs[] = array( 'id'    => 'mySupercoolTab',
                     'url'   => $url,
                     'title' => 'Something Cool',
                     'weight' => 300 );
}


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: Has hook civicrm_tabs changed for new feature in 4.4.x?
January 17, 2014, 08:37:24 pm
I think you need to supply a 'count' param. This should be an integer if that makes any sense for your tab (eg if it is possible to count the number of things your tab shows) or if not pass FALSE and that should trigger it to show up without a count but not faded-out.
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: Has hook civicrm_tabs changed for new feature in 4.4.x?
January 17, 2014, 09:24:18 pm
Your suggestion of adding a 'count' parm did the trick!  I got my tab working the way I want now.    I noticed I can pass a string as the count parm, so I am passing a monetary amount,  ie $1,250.00

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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Has hook civicrm_tabs changed for new feature in 4.4.x?

This forum was archived on 2017-11-26.