Hello:
What I would like is for the privacy drop menu for content to only display 3 options: Site Members, Friends, and Only Me. I was able to find solutions addressing this issue in the forums
here
and
here
, but so far I haven't had any success.
I've edited the /components/com_community/libraries/privacy.php so that it looks like this:
// Initialize default options to show
if( empty( $access) )
{
$access[ 'public' ] = false; //change here
$access[ 'members' ] = true;
$access[ 'friends' ] = true;
$access[ 'self' ] = true;
}
.creator-privacy ul.js_dropDownParent li:first-child {
display: none;
}
Hi Adrienne,
This is actually controlled in a compressed JS assets file which is re compiled during each release, once that file is edited you would need to re apply and re compile the file again at every bugfix or release. Because this is a core file running the product this would be a very risky thing to modify.
I'm afraid a change like that is outside the scope of our support
Hi!
Thanks for the reply.
It's very important that we disable the "Public" option in this pull down menu because we need our JomSocial instance to be completely private. We can't give our users the option to set content as public. We have enough technical know how on our end to track our custom changes and make sure that new JomSocial updates are applied correctly. So can you please point to the javascript file and line no. where I can make this css change? When you say that this is a compilied js file, do you mean that it is compressed and minified? If so, is there an uncompressed js file I can access?
Also, what exactly does this change below do as it relates to disabling the public option in the privacy drop down menu. I ask because I made this change and I can still see the public option in the privacy drop down.
// Initialize default options to show
if( empty( $access) )
{
$access[ 'public' ] = false; //change here
$access[ 'members' ] = true;
$access[ 'friends' ] = true;
$access[ 'self' ] = true;
}
Hi Adrienne,
I am sorry for the delay in replying, i actually remembered i have one of my own sites with this hack so i am trying to find all the places that were changed and then i can give you all the changes i made.
I will reply ASAP
HI Adrienne,
Sorry this took a bit to get done but hopefully it will be worth the wait. :)
EnJoy
www.youtube.com/watch?v=D2DiDJCQcDs&inde...pxsDtudAxcsQ_JD-flYg
www.youtube.com/watch?v=CO-UgIdeV_c&inde...pxsDtudAxcsQ_JD-flYg
Hello!
Thanks a lot for the videos. They were very informative and for the most part everything worked as intended. There was one issue that popped up once I made these changes:
In the activity stream on the JomSocial home page, users have the option to "share" group activities. For instance, if User 1 creates a group, that gets published to the global activity stream and other users have the option to "share" that activity post. When I click share I get the following pop up:
Hi Adrienne,
I will need to ask our java developer when he starts his shift in the morning then i will reply with the answer, im sure he will find where it is set in a few minutes.
Hi Adrienne,
I have left another message for the developer but i am not able to interrupt them during there development times. Once i hear back i will let you know, i think if you search for that privacy string in the code your developer will find the one that has been missed. it is the same string that hides the others
Hi!
I wanted to follow up and see if the dev was able to locate where I should make these changes.
I also wanted to point out that I've found another case where the default privacy setting is "public". For custom and predefined messages, the default privacy setting is "public". Also, the "public" privacy setting is a selectable privacy option from the drop down menu. Can you also provide the file location and line numbers needed to make these changes. I've attached screen shots below.
This is what I see for the "custom message":
Hi Adrienne,
The custom messages and predefined messages should work ok with the following changes in com_community/assets/js/_release/bundle.js im not sure if my inital instructions were for 2 changes or 3 as listed here
FInd this (there are 2 of them)
defaultPrivacy:e||"public"}
and change to this
defaultPrivacy: e || "friends", privacylist: ["friends", "me"]
privacylist:["public","site_members"]}),this.subviews.privacy.setPrivacy("public"))
and change to this
privacylist:["public","site_members"]}),this.subviews.privacy.setPrivacy("site_members"))
static public function getStreamPermissionHTML($privacy, $actorId = NULL) {
$my = CFactory::getUser();
if (($my->id != $actorId && !is_null($actorId) ) && !COwnerHelper::isCommunityAdmin()) {
return;
}
$permissions = self::$_permission;
unset($permissions[0]);
unset($permissions[10]);
if ( !isset($permissions[$privacy]) ) {
reset($permissions);
$privacy = key($permissions);
}
$html = '<span class="joms-share-meta joms-share-privacy">' . JText::_($permissions[$privacy]) . '</span>';
$html .= '<div class="joms-privacy-dropdown joms-stream-privacy">';
$html .= '<button type="button" class="dropdown-toggle" data-value="" data-toggle="dropdown"><span class="dropdown-value"><i class="' . self::$_icons[$privacy] . '"></i></span><span class="dropdown-caret joms-icon-caret-down"></span></button>';
$html .= '<ul class="dropdown-menu">';
foreach ($permissions as $value => $permission) {
$html .= '<li><a href="javascript:" data-option-value="' . $value . '"><i class="' . self::$_icons[$value] . '"></i><span>' . JText::_($permission) . '</span></a></li>';
}
$html .= '</ul></div>';
return $html;
}
<input type="hidden" name="joms-postbox-privacy" value="<?php echo PRIVACY_MEMBERS?>">