Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 4 5 6 7 Next > End >>
Re:CB Helloworld Plugin (part 2)
Date: 2007/06/25 14:22 By: fcarroll Status: User  
Karma: 1  
Fresh Joomlapolitan

Posts: 16
graphgraph
Hello!

Kudos to nant for these articles!!

I've authored a plugin which displays a tab with an editor text area which users can write biographical info into in freeform. What I'm trying to do now is to have this tab only available to people in a certain group. The code below does this for getDisplayTab - the tab only shows for the usergroup 'biogroup' (created with JACL-hence the non-standard group) when being viewed normally, however if someone not in 'biogroup' clicks to update their profile, it appears as a tab with editable fields. I don't know how to stop this from happening because I can't figure out much about the getEditTab and saveEditTab classes.

Code:

  if ($my->usertype == 'biogroup')      {         class getBioTab extends cbTabHandler          {             function getBioTab()              {                     $this->cbTabHandler();             }             function getDisplayTab($tab,$user,$ui)              {                 global $my;                 $params $this->params;                 $return "";                 if ($user->cb_bio != '')                  {                     $return .= "<strong>Biography:</strong> <br /> <div>"$user->cb_bio ."</div>";                 }                 return $return;             }         }     }//else user not in biogroup

Click here to see the profile of this user The administrator has disabled public write access.

<< Start < Prev 1 2 3 4 5 6 7 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login