Wouldn't it be cool, if custom modules could hook in, and add another privacyStatus, so there are more then the three basic options. There you could also implement some more custom logic etc.

Let's see how to do it.

Comments

markus_petrux’s picture

I also thought about it, but was kind of lazy, and I had to finish this module for the particular needs of the project I'm working on (and turn the page to work on more stuff related to this project).

It shouldn't be too difficult however. It's just a matter to abstract a bit more the code around the "Private" option, which is in fact something optional that depends on external module.

Now, I do not have time, honestly. But I would be glad to review patches as far as current features are untouched, and new features are optional.

dawehner’s picture

I think we should remove Integer from privacy_status and make it a string modulname_key.

Therefore we have to update the db field, and update all existing values.

dawehner’s picture

So here is a initial patch.

TODO:

  • documentation
  • Update existing privacy_status values in the database.
  • Minor cleanup etc.

Additional i don't like the name of the hook: hook_private_fields_options

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new0 bytes

ha here is the patch.

dawehner’s picture

StatusFileSize
new8.36 KB

Now, the patch has also content :)

dawehner’s picture

StatusFileSize
new8.41 KB

Added alter hook.

markus_petrux’s picture

Just wanted to mention that I'm busy trying to finish the project I'm working on. I'll try to come back to review this as soon as possible. It may take me a month or so.

rbl’s picture

Could this be used to add something like a locked state thus preventing the user from editing the field?

dawehner’s picture

no.

markus_petrux’s picture

@dereine: Honestly, I'm afraid I won't have the time to review/work on this. And sorry for not getting back earlier. Too busy.

Do you think it would be possible to start a new branch that implements this feature without breaking current functionality? Would you like access to this project to work on it?

dawehner’s picture

@markus_petrux

I guess a new branch is a definitive better idea. I could work a bit, but really just a bit, my other d.o. projects is killing my time, damn.

adam_c’s picture

In my post

http://drupal.org/node/755138

I requested the ability to expand the 'privacy' option to include a checkbox list of the different relationship types that are implemented on the site (Im using UR), are the changes that you are making here a step in that direction?

dawehner’s picture

Its currently not possible with only this patch, but its a step towards your need.

adam_c’s picture

ok very good.

Do we share the same aim? If so can you give a rough estimate on completion? I will help out as much as I can.

If not, will your efforts just get a bit further to my aim? And if so, what extra development will be needed to take it that little extra further?

dawehner’s picture

No.

The patch is a step forward to what you need.