Skip to Content Skip to Menu

[SOLVED] How to remove the 'Remove Image' link on the Menu

  • itstaff
  • itstaff
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
13 years 6 months ago - 13 years 6 months ago #162336 by itstaff
Hi,

I'm trying to remove the 'Remove Image' link on the mainmenu as we do not want our users to be able to remove their profile image.

Thankyou
Attachments:
Last edit: 13 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
13 years 6 months ago #162353 by krileon
Don't believe you can, users can still remove their image from profile edit for instance or from image upload page. You can try hiding with CSS, but you're likely going to need to make core edits to cb.menu.php (which I can not suggest, sorry).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • itstaff
  • itstaff
  • OFFLINE
  • Posts: 9
  • Thanks: 0
  • Karma: 0
13 years 6 months ago - 13 years 6 months ago #162443 by itstaff
Hi Krileon,

Thanks for taking the time to respond. You have helped me with some of your past posts. I managed to work this one out. I wanted to do this because I use CB on an internal intranet and I have made avatars a required field where employees either need to upload their own avatar or choose from an employee gallery. Once they have an avatar I do want them to be able to remove it, only update it if necessary. To do this I commented out some lines of code in the cb.menu.php file located at components\com_comprofiler\plugin\user\plug_cbmenu

Below is a list of the lines I commented out.

LINE 1029 //'_UE_DELETE_AVATAR' => _UE_DELETE_AVATAR,
LINE 1030 //'_UE_MENU_DELETE_AVATAR_DESC' => _UE_MENU_DELETE_AVATAR_DESC

LINE 1037 //'_UE_DELETE_AVATAR' =>_UE_MOD_MENU_DELETE_AVATAR,
LINE 1038 //'_UE_MENU_DELETE_AVATAR_DESC' => _UE_MOD_MENU_DELETE_AVATAR_DESC


LINE 1051 //if($user->avatar!='' && $user->avatar!=null) {
LINE 1052 //$mi = array(); $mi["_UE_MENU_EDIT"]["_UE_DELETE_AVATAR"]=null;
LINE 1053 //$this->_addMenuItem( $mi, $menuTexts,cbSef($ue_deleteavatar_url), "",
LINE 1054 //"<img src=\"".$adminimagesdir."delavatar.gif\" alt='' />","", $menuTexts,"" );
LINE 1055 //}

Lastly comment out the following lines of components\com_comprofiler\plugin\user\plug_cbcore\cb.core.php

This will remove the delete image option from the dropdown list of the Edit Your Details/Portrait Tab.

//if ( $existingAvatar && ( $required == 0 ) ) {
//$choices[] = moscomprofilerHTML::makeOption( 'delete', _UE_DELETE_AVATAR );
//}
Attachments:
Last edit: 13 years 6 months ago by itstaff.

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

Moderators: beatnantkrileon
Powered by Kunena Forum