This edit button

5 months 3 weeks ago #1 by klarabraun
Hi,

I am sorry to bother with such a trivial question, however, on the profile there is an EDIT button that I want only the Site Admin to be able to see (in this case, the super-user ID number is 85 and all users are 900+).
I know there must be a line that I can add to the PHP code that to make that button invisible to all users except the user with the ID 85, however I am not a programmer and I would need a bit of guidance as to what exactly to modify. Here is the code that instructs who can see this, please advise how to have it modified.

<!-- DETAILS START -->
<!– <div id="f90pro-detail" class="f90pro-detail row-fluid clearfix">
<!-- Tabs Left : <li> "href = fieldgroup container ID" will be with prefix 'f90pro-fgtab-XXX' -->
<div class="f90pro-left clearfix span2 col-lg-5 col-md-5 col-sm-2 col-xs-12 ">
<!- <ul id="f90pro-fieldgroup-tab" class="f90pro-stack-nav">
<?php $counter = 0;?>
<?php if(!empty($data->fieldgroups)):?>
<?php foreach($data->fieldgroups as $group):?>
<?php $group = $group->toObject();?>

<?php $counter++;?>
<?php endforeach;?>
<?php else:?>
<br/>
<h3><?php echo JText::_('There are no fieldgroups configured for you.');?></h3>
<?php endif;?>
</ul>
</div>


<!-- All Fields Content : cantains fieldgroup in tab-->
<div class="f90pro-right clearfix span12 col-lg-12 col-md-9 col-sm-8 col-xs-12 ">
<div class="f90pro-fgtab-content tab-content">
<?php if(!empty($data->fieldgroups)):?>
<?php $counter = 0;?>
<?php foreach($data->fieldgroups as $group):?>
<?php list($fields, $mapping) = $group->getFieldsAndMappings();?>
<?php $group = $group->toObject();?>
<div id="f90pro-fgtab-<?php echo $group->id;?>" class="tab-pane <?php echo (!$data->fieldgroup_id && $counter === 0) || ($data->fieldgroup_id == $group->id) ? 'active' : '';?>" >
<div id="joomprofile-fieldgroup-<?php echo $group->id;?>">
<?php if(count($fields) > 0):?>
<?php
ob_start();
$showEditButton = false;
?>

<?php foreach($fields as $field_fieldgroup_id => $field):?>
<?php if(!$field->getPublished() || (isset($mapping[$field_fieldgroup_id]) && !$mapping[$field_fieldgroup_id]->visible && !$data->can_edit)):?>
<?php continue;?>
<?php endif;?>

<?php $fieldObj =$field->toObject();?>
<?php $field_instance = JoomprofileLibField::get($fieldObj->type);?>

<?php if (!$showEditButton && $field_instance->showEditButton($fieldObj, $data->user->id)) : ?>
<?php $showEditButton = true; ?>
<?php endif;?>

<?php $fieldValue = $field_instance->getViewHtml($fieldObj, isset($data->field_values[$fieldObj->id]) ? $data->field_values[$fieldObj->id] : '', $data->user->id);?>
<?php if((isset($data->can_edit) && $data->can_edit) || (!$data->isAdmin && $data->isProfileEditor) || !isset($data->config) || $data->config || ($fieldValue !== null && $fieldValue !== '') ):?>





I also attached a print screen of the Inspect Element in the browser.
Thank you very much ,

Regards,
Klara
Attachments:
5 months 3 weeks ago #2 by Function90
Hello Klara,

Hope you are doing well.

If you make all the field non-editable then user will not be able to edit his profile, though Edit button will be displayed to him. Will that work or you want to hide the edit button for that logged in user (non super user).

Thank you
Team Function90
You can share your views regarding our extension at JED ( extensions.joomla.org/profile/profile/details/225115#extensions )

Hire Professional Joomla Developers. ( www.function90.com/contact-us.html )
Powered by Kunena Forum
Cron Job Starts