Page 1 of 3

Disable Front-end edit functionality?

Posted: Thu Feb 21, 2008 3:38 pm
by meisenheimer
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

Re: Disable Front-end edit functionality?

Posted: Thu Feb 21, 2008 6:26 pm
by leahcim_dach
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

Re: Disable Front-end edit functionality?

Posted: Thu Feb 21, 2008 10:32 pm
by meisenheimer
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

Re: Disable Front-end edit functionality?

Posted: Tue Mar 11, 2008 10:06 pm
by pages
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' );

Re: Disable Front-end edit functionality?

Posted: Fri Apr 04, 2008 2:43 pm
by kimberlee
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.

Re: Disable Front-end edit functionality?

Posted: Mon Aug 04, 2008 6:54 am
by carsten888
is there a way to do this without a hack?

Re: Disable Front-end edit functionality?

Posted: Sun Aug 17, 2008 12:08 am
by brianbush
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.

Re: Disable Front-end edit functionality?

Posted: Sun Aug 17, 2008 7:38 am
by carsten888
thats sweet.

thanks.

Re: Disable Front-end edit functionality?

Posted: Fri Oct 03, 2008 12:08 pm
by BYGino
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!

Re: Disable Front-end edit functionality?

Posted: Tue Nov 18, 2008 6:14 pm
by tarik916
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.

Re: Disable Front-end edit functionality?

Posted: Fri Jan 09, 2009 5:10 pm
by lemur1
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;
} 
:)

Re: Disable Front-end edit functionality?

Posted: Fri Jan 30, 2009 8:39 am
by onesmus
Wow,asante sana! Thanks.

Re: Disable Front-end edit functionality?

Posted: Wed Feb 04, 2009 4:40 am
by mherron
For the new guy, where in the template.css file does this code get pasted?

Thanks

Re: Disable Front-end edit functionality?

Posted: Sun Mar 29, 2009 5:44 am
by kwoolf
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

Re: Disable Front-end edit functionality?

Posted: Tue Apr 21, 2009 1:41 am
by gosa7
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:

Re: Disable Front-end edit functionality?

Posted: Sun May 10, 2009 9:37 am
by campbellmack
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.

Re: Disable Front-end edit functionality?

Posted: Tue May 12, 2009 3:11 pm
by pvkyle
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;}

Re: Disable Front-end edit functionality?

Posted: Mon May 18, 2009 8:05 am
by lemur1
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ß. :)

Re: Disable Front-end edit functionality?

Posted: Thu May 21, 2009 10:04 am
by ahmedsheeraz
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 ;)

Re: Disable Front-end edit functionality?

Posted: Wed Jun 03, 2009 5:08 pm
by silentmercy
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') ); ;)

Re: Disable Front-end edit functionality?

Posted: Sun Jul 12, 2009 9:50 am
by deejay4angels
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') );

Re: Disable Front-end edit functionality?

Posted: Fri Aug 21, 2009 12:33 pm
by emmitt2299
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'));
}

Re: Disable Front-end edit functionality?

Posted: Fri Sep 04, 2009 7:21 pm
by Forumspod
\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.

Re: Disable Front-end edit functionality?

Posted: Sat Sep 12, 2009 7:53 pm
by croland
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

Re: Disable Front-end edit functionality?

Posted: Fri Oct 23, 2009 10:28 am
by bendraper
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

Re: Disable Front-end edit functionality?

Posted: Sat Apr 17, 2010 3:46 pm
by bodrushka
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.

Re: Disable Front-end edit functionality?

Posted: Mon Jun 21, 2010 9:16 pm
by djacouma
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!

Re: Disable Front-end edit functionality?

Posted: Tue Jun 22, 2010 9:00 am
by apolloj
Ok works too for Joomla 1.5.15

Re: Disable Front-end edit functionality?

Posted: Fri Jun 25, 2010 4:27 pm
by C0nw0nk
thanks works great :D <3

Re: Disable Front-end edit functionality?

Posted: Wed Jun 30, 2010 7:01 pm
by steveLarkin
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?