Alpha version of Privacy Policy plugin available

17 years 10 months ago #14443 by mikko
I spent a couple of hours yesterday and coded a plugin to implement privacy policy on CB tabs.

The plugin works roughly like this:
-administrator defines one or several privacy policies in the database
-user chooses which privacy policy should apply to his profile
-based on the privacy policy tabs will be hidden when the profile is viewed by someone else than the owner

Demo: hondchan.dy.fi/joomla
Dev builds: hondchan.dy.fi/downloads

Discuss this here: www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,13/id,14367

mikko

Please Log in to join the conversation.

17 years 10 months ago #14492 by nant
Mikko,

this sounds awesome!
Can't wait to look at your code!
Thanks for sharing!

Please Log in to join the conversation.

17 years 10 months ago #14493 by nant
Just installed it locally ..

I guess you have PHP5 on your end because I get

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in W:\www\CB10_J108\components\com_comprofiler\plugin\user\plug_privacypolicy\privacypolicy.php on line 14

on
private $tab_plugins=null;

Please Log in to join the conversation.

17 years 10 months ago #14769 by geeffland
mikko,

Looks very intersting... had a few questions...

From a high level... how does this plugin prevent items from being shown... noticed the return null; stuf and not sure if that keeps CB from showing its normal stuff or how you supress it... assume it will work similar for getEditTab as it does for getDisplaytab??

Thanks,
Greg

CB3PD Developer - CB Connector (formerly phpBB Connector) plugin

Please Log in to join the conversation.

17 years 10 months ago #14770 by mikko
When I was writign listtab, I noticed that if tab has fields set to false and plugin return null or empty string, CB will not draw a tab. (You might need to se description to null as well)

The plugin provides encapsulation for other plugins. This is an alpha version, and not everything is implemented.

When the plugin is installed, it creates a new table and copies all plugin data from tabs table to that back-up table. After this is done, it replaces all other plugins by itself in that table.

When the function getEditTab is called, the plugin will activate and check wether this tab should be drawn. If so, it will fetch the name of the appropriate plugin from the back-up table and then call the getEditTab of that tab and return what ever the other plugin returned.

If the tab is not to be displayed, the real plugin is not called and the fiels attribute of the tab is set to false, so that CB will not draw the fields. Since there is nothing to display in the tab now, it will not be drawn.

The same function needs to be implemented to all other html-generating plugin functions as well to make this universal.

The other tables that the plugin creates are for configuring different kinds of privacy policies.

mikko

Please Log in to join the conversation.

17 years 10 months ago #14772 by geeffland
Does this also work for individual fields within a tab or just on a tab as a whole?

CB3PD Developer - CB Connector (formerly phpBB Connector) plugin

Please Log in to join the conversation.

Moderators: beatnantgeefflandkrileon
Time to create page: 0.275 seconds

Facebook Twitter LinkedIn