Skip to Content Skip to Menu

[SOLVED] CB Tabs - Private or Visible only to User

  • kiaridil
  • kiaridil
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 7 months ago - 11 years 7 months ago #223090 by kiaridil
Hello,

I am trying to figure out how to make some tabs visible only to the User and not to the rest Community.

Is it possible?

Thanks
Last edit: 11 years 7 months ago by kiaridil.

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

  • kiaridil
  • kiaridil
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
11 years 7 months ago #223690 by kiaridil
We need to add the option for the private or public tab, at the back end.
So we edit the .xml file of the plugin that creates the tab.
We can find it at: components/com_comprofiler/plugin/user/<the plugin>
we edit the .xml and add this code just before the: </params>
Code:
<param name="menu_prv" type="radio" default="0" label="Private Tab" description="The tab will be private or public."> <option value="0">Public</option> <option value="1">Private</option> </param>
[Make sure that from the back end you chose the state of the tab(public/private)].
Then from the same location open the main plaugin .php file and find: function getDisplayTab.
Make sure you have the global $_CB_framework;
After the: $params = $this->params; add this code
Code:
if ($params->get('menu_prv') == '1'){ if ($_CB_framework->myId() != $user->id) return null; }

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

  • nant
  • nant
  • ONLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 6 months ago #223749 by nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum