Disable Front-end edit functionality?

Need help with the Administration of your Joomla! site? Pop your questions in here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
meisenheimer
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri Oct 26, 2007 1:26 pm

Disable Front-end edit functionality?

Post by meisenheimer » Thu Feb 21, 2008 3:38 pm

Is there a way to disable the ability to edit content through the front-end interface? I only want the admin's to be able to edit content through the back-end.

Thanks,
Shannon
Last edited by meisenheimer on Fri Feb 22, 2008 10:46 pm, edited 1 time in total.

User avatar
leahcim_dach
Joomla! Ace
Joomla! Ace
Posts: 1148
Joined: Sat Oct 14, 2006 9:37 am
Location: Washington

Re: Disable Front-end edit functionality?

Post by leahcim_dach » Thu Feb 21, 2008 6:26 pm

About the only way I know of is a hack to the content.html.php file. There maybe a component, such as JACL-plus that may give you the control you're looking for. I haven't used it myself, so not sure if it has the capability you're after.

My quick hack is If you go to line 631 of content.html.php and remove the following, the edit icon will no longer appear in the Front-end. After removing the link, no one should get the edit icon in the front-end. Thus not allowing them to edit any content items. It's a dirty hack, but works. Was tested at all group levels, Author, Editor, Publisher...so on and so forth. HTH!

*- As always...make sure you backup your copy, just in case something should go south on you.

joomla_root/components/com_content/content.html.php

<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
<?php echo $row->title;?>
<?php HTML_content::EditIcon( $row, $params, $access ); ?> <-- remove this line
</td>


Chad

meisenheimer
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Fri Oct 26, 2007 1:26 pm

Re: Disable Front-end edit functionality?

Post by meisenheimer » Thu Feb 21, 2008 10:32 pm

I ended up editing lines 88-90, 293-295, 490-493, 627, 634, and 641.

That removed all edit icons and new items icons from the front-end.

Thanks,
Shannon

pages
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Fri Aug 19, 2005 5:13 pm

Re: Disable Front-end edit functionality?

Post by pages » Tue Mar 11, 2008 10:06 pm

just wondering whether commenting out the following lines in includes/gacl.class.php would do the trick?

Code: Select all

// actions
#
$this->_mos_add_acl( 'action', 'add', 'users', 'author', 'content', 'all' );
#
$this->_mos_add_acl( 'action', 'add', 'users', 'editor', 'content', 'all' );
#
$this->_mos_add_acl( 'action', 'add', 'users', 'publisher', 'content', 'all' );
#
$this->_mos_add_acl( 'action', 'edit', 'users', 'author', 'content', 'own' );
#
$this->_mos_add_acl( 'action', 'edit', 'users', 'editor', 'content', 'all' );
#
$this->_mos_add_acl( 'action', 'edit', 'users', 'publisher', 'content', 'all' );
#
$this->_mos_add_acl( 'action', 'publish', 'users', 'publisher', 'content', 'all' );

User avatar
kimberlee
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Mar 18, 2008 7:35 pm

Re: Disable Front-end edit functionality?

Post by kimberlee » Fri Apr 04, 2008 2:43 pm

leahcim_dach wrote:About the only way I know of is a hack to the content.html.php file. There maybe a component, such as JACL-plus that may give you the control you're looking for. I haven't used it myself, so not sure if it has the capability you're after.

My quick hack is If you go to line 631 of content.html.php and remove the following, the edit icon will no longer appear in the Front-end. After removing the link, no one should get the edit icon in the front-end. Thus not allowing them to edit any content items. It's a dirty hack, but works. Was tested at all group levels, Author, Editor, Publisher...so on and so forth. HTH!

*- As always...make sure you backup your copy, just in case something should go south on you.

joomla_root/components/com_content/content.html.php

<td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
<?php echo $row->title;?>
<?php HTML_content::EditIcon( $row, $params, $access ); ?> <-- remove this line
</td>


Chad


:pop Thnaks that worked for my registered users.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: Disable Front-end edit functionality?

Post by carsten888 » Mon Aug 04, 2008 6:54 am

is there a way to do this without a hack?
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

brianbush
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Aug 17, 2008 12:04 am

Re: Disable Front-end edit functionality?

Post by brianbush » Sun Aug 17, 2008 12:08 am

The hack above doesn't work for me. I think the file structure may have changed in 1.5. I still can't find any config option to handle this, but there is a CSS hack I use. So far, it seems to work fine. Open the template.css file for your template and add this:

table.contentpaneopen tr td span.hasTip a img {
display: none;
}

That effectively hides the Article Edit icon. It might inadvertently hide something important, but the tag chain seems to be pretty unique.

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: Disable Front-end edit functionality?

Post by carsten888 » Sun Aug 17, 2008 7:38 am

thats sweet.

thanks.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

BYGino
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 178
Joined: Fri Apr 20, 2007 9:41 pm
Location: Scotland
Contact:

Re: Disable Front-end edit functionality?

Post by BYGino » Fri Oct 03, 2008 12:08 pm

Sometimes you don't see the wood for the trees! I was looking for a way to do this myself and the head was in coding mode so I started to hack... never even thought about a simple CSS display:none!!!

Great idea, thanks, saved me hours of heartache!

tarik916
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Fri May 04, 2007 5:30 pm

Re: Disable Front-end edit functionality?

Post by tarik916 » Tue Nov 18, 2008 6:14 pm

To make this change in Joomla 1.5, you can comment out the icon code in the view files. Find and edit the following files.

joomla_root/components/com_content/views/article/tmp/default.php
joomla_root/components/com_content/views/category/tmp/default.php


Find

Code: Select all

<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
Change to

Code: Select all

<?php //echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
---

joomla_root/components/com_content/views/category/tmp/default_items.php

Find

Code: Select all

<?php $this->item = $item; echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
Change to

Code: Select all

<?php $this->item = $item; //echo JHTML::_('icon.edit', $item, $this->params, $this->access) ?>
---

joomla_root/components/com_content/views/frontpage/tmp/default_item.php
joomla_root/components/com_content/views/section/tmp/blog_item.php

Find

Code: Select all

<?php echo JHTML::_('icon.edit', $this->item, $this->item->params, $this->access); ?>
Change to

Code: Select all

<?php //echo JHTML::_('icon.edit', $this->item, $this->item->params, $this->access); ?>
This can also be done using template overrides http://developer.joomla.org/tutorials/1 ... oomla.html. This would be the best way because you will not lose these mods when upgrading Joomla.

lemur1
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Fri May 09, 2008 8:22 pm

Re: Disable Front-end edit functionality?

Post by lemur1 » Fri Jan 09, 2009 5:10 pm

brianbush wrote:So far, it seems to work fine. Open the template.css file for your template and add this:

table.contentpaneopen tr td span.hasTip a img {
display: none;
}
That above doesn't work for me in J1.5.8.1.

But this works:

Code: Select all

div.contentpaneopen_edit span.hasTip a img {
     display: none;
} 
:)

onesmus
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Jan 19, 2009 9:56 am

Re: Disable Front-end edit functionality?

Post by onesmus » Fri Jan 30, 2009 8:39 am

Wow,asante sana! Thanks.

mherron
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Feb 04, 2009 4:30 am

Re: Disable Front-end edit functionality?

Post by mherron » Wed Feb 04, 2009 4:40 am

For the new guy, where in the template.css file does this code get pasted?

Thanks

kwoolf
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Wed Oct 24, 2007 8:49 pm

Re: Disable Front-end edit functionality?

Post by kwoolf » Sun Mar 29, 2009 5:44 am

I know this is quite an old thread but I had the same issue with J 1.5.10 on IE 7. The problem was a Twitter script I put in a module that allows my threads there to show. I unpublished this and everything works fine. FYI

User avatar
gosa7
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Mon Mar 16, 2009 11:26 pm
Contact:

Re: Disable Front-end edit functionality?

Post by gosa7 » Tue Apr 21, 2009 1:41 am

lemur1 wrote:
brianbush wrote:So far, it seems to work fine. Open the template.css file for your template and add this:

table.contentpaneopen tr td span.hasTip a img {
display: none;
}
That above doesn't work for me in J1.5.8.1.

But this works:

Code: Select all

div.contentpaneopen_edit span.hasTip a img {
     display: none;
} 
:)

Please help. Where exactly to paste this code :eek:

campbellmack
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Nov 24, 2008 10:52 pm
Location: Adelaide

Re: Disable Front-end edit functionality?

Post by campbellmack » Sun May 10, 2009 9:37 am

I've just come across this same problem with the Author permission. Surely this is a bug that needs to be fixed? What's the point in requiring approval for Author articles if Authors can simply edit their articles after they have been approved and type in anything they want?! There is no logic to this setup in my opinion.

I know there are hacks to get around this, but this shouldn't be required for such a basic thing. Until this gets fixed, I think the best (but awkward) thing to do is for admins to change the author of the article before publishing.

pvkyle
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Dec 29, 2008 7:41 pm

Re: Disable Front-end edit functionality?

Post by pvkyle » Tue May 12, 2009 3:11 pm

brianbush wrote:The hack above doesn't work for me. I think the file structure may have changed in 1.5. I still can't find any config option to handle this, but there is a CSS hack I use. So far, it seems to work fine. Open the template.css file for your template and add this:

table.contentpaneopen tr td span.hasTip a img {
display: none;
}

That effectively hides the Article Edit icon. It might inadvertently hide something important, but the tag chain seems to be pretty unique.
Since this may hide something important, I suggest using the following. It will only hide the edit image that matched the other criteria.

table.contentpaneopen td.buttonheading span.hasTip a img[src="/images/M_images/edit.png"] { display:none;}

lemur1
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Fri May 09, 2008 8:22 pm

Re: Disable Front-end edit functionality?

Post by lemur1 » Mon May 18, 2009 8:05 am

Hi,
FOR J1.5 ONLY!!
I have completed the mission: you can don't delete the edit button, but only
restrict rights of "non-author" for editing (for example, of "editors").
So, only author of an article and >= Publisher see the button.

Here is the change of codes in file:

Code: Select all

[Joomla base path]/components/com_content/helpers/icon.php
After the lines:

Code: Select all

	if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) {
			return;
		}
add these lines:

Code: Select all

if ($article->created_by != $user->get('id') && ($user->usertype == "Editor")) {
			return;
		}
Gruß. :)

ahmedsheeraz
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Wed Jun 18, 2008 7:48 pm

Re: Disable Front-end edit functionality?

Post by ahmedsheeraz » Thu May 21, 2009 10:04 am

J 1.5.10 onward...it is in

\components\com_content\helpers\icon.php

$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));

just comment out these two culprits ;)

silentmercy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Tue Mar 03, 2009 1:44 am

Re: Disable Front-end edit functionality?

Post by silentmercy » Wed Jun 03, 2009 5:08 pm

ahmedsheeraz wrote:J 1.5.10 onward...it is in

\components\com_content\helpers\icon.php

$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));

just comment out these two culprits ;)
Also comment out this to eliminate the add new icon:

$text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') ); ;)

deejay4angels
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Sat Jun 13, 2009 2:43 pm
Location: Romania
Contact:

Re: Disable Front-end edit functionality?

Post by deejay4angels » Sun Jul 12, 2009 9:50 am

silentmercy wrote:
ahmedsheeraz wrote:J 1.5.10 onward...it is in

\components\com_content\helpers\icon.php

$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));

just comment out these two culprits ;)
Also comment out this to eliminate the add new icon:

$text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') ); ;)
i'm using joomla 1.5.10 and i have found what "ahmedsheeraz" have wrote, it's working just fine. thanks! :D

but i cannot found this... it should be on the same icon.php? ???
$text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') );

emmitt2299
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Aug 08, 2009 10:51 pm

Re: Disable Front-end edit functionality?

Post by emmitt2299 » Fri Aug 21, 2009 12:33 pm

If you want to restrict the icon to only certain sections.... you could do something like this (which is what I did so editors could front-end edit one section, but not sections I created for different reasons):

if ($article->sectionid == 1) {
$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));
}

Forumspod
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Sat Jul 04, 2009 10:45 am

Re: Disable Front-end edit functionality?

Post by Forumspod » Fri Sep 04, 2009 7:21 pm

\components\com_content\helpers\icon.php

//$icon = $article->state ? 'edit.png' : 'edit_unpublished.png'; line 110
//$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit')); line 111

//$text = JHTML::_('image.site', 'new.png', '/images/M_images/', NULL, NULL, JText::_('New') ); line 36

works fine but the gap between where the icon used to appear is still there. is it the end of the world, I'm not sure.

Many thanks for your help.

croland
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Sep 12, 2009 7:48 pm

Re: Disable Front-end edit functionality?

Post by croland » Sat Sep 12, 2009 7:53 pm

To disable editing on the Frontpage in Joomla 1.5.11, all I had to do was change:

Code: Select all

$access->canEdit	= $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn	= $user->authorize('com_content', 'edit', 'content', 'own');
(Lines 64-65)

To:

Code: Select all

$access->canEdit	= $user->authorize('com_content', 'edit', 'content', 'none');
$access->canEditOwn	= $user->authorize('com_content', 'edit', 'content', 'none');
(Lines 64-65)

In the following file:

Code: Select all

<joomla install>\components\com_content\views\frontpage\view.html.php

bendraper
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Aug 10, 2009 10:04 pm

Re: Disable Front-end edit functionality?

Post by bendraper » Fri Oct 23, 2009 10:28 am

that also solved my problem although I had to do the same in the <joomla install>\components\com_content\views\article\view.html.php file as well

bodrushka
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Apr 17, 2010 3:39 pm

Re: Disable Front-end edit functionality?

Post by bodrushka » Sat Apr 17, 2010 3:46 pm

Hello!

It's not enough to add in css:
table.contentpaneopen tr td span.hasTip a img {
display: none;
}

It helpes to hide an "Edit" icon, but you are making a backdoor for edition.
If you are open the page source, you can find a link for editing your content.

Everybody can use it to edit your site illegally.

djacouma
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Thu Jun 17, 2010 1:49 pm

Re: Disable Front-end edit functionality?

Post by djacouma » Mon Jun 21, 2010 9:16 pm

ahmedsheeraz wrote:J 1.5.10 onward...it is in

\components\com_content\helpers\icon.php

$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));

just comment out these two culprits ;)
You rock! Using Joomla! 1.5.17 Stable and this totally did the job. In my particular case, I'm developing a brand new site which I very much want to keep offline, but when previewing, those edit article icons were everywhere, which would matter if they didn't affect the layout!

apolloj
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Nov 06, 2009 1:31 pm

Re: Disable Front-end edit functionality?

Post by apolloj » Tue Jun 22, 2010 9:00 am

Ok works too for Joomla 1.5.15

User avatar
C0nw0nk
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 248
Joined: Tue Jun 15, 2010 1:12 am
Location: United Kingdom, London
Contact:

Re: Disable Front-end edit functionality?

Post by C0nw0nk » Fri Jun 25, 2010 4:27 pm

thanks works great :D <3

steveLarkin
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Feb 17, 2010 10:24 pm

Re: Disable Front-end edit functionality?

Post by steveLarkin » Wed Jun 30, 2010 7:01 pm

I can't seem to get the front-end edit icons to show up!

Been scouring the net trying to find out how to enable this capability.

I have users in the publisher group, but no icons show up for them. I've turned on everything I could find in the back-end to try to enable the icons, but I must be missing a crucial click somewhere. Can anyone provide a clue to help me?


Locked

Return to “Administration - 1.0.x”