The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 54 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Feb 21, 2008 3:38 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Oct 26, 2007 1:26 pm
Posts: 23
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.

Top
 Profile  
 
PostPosted: Thu Feb 21, 2008 6:26 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Oct 14, 2006 9:37 am
Posts: 1148
Location: Washington
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

_________________
-Chad
JTS- Post Assistant: http://forum.joomla.org/viewtopic.php?f=428&t=272481
Joomla! Documentation: http://docs.joomla.org/Main_Page


Top
 Profile  
 
PostPosted: Thu Feb 21, 2008 10:32 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Oct 26, 2007 1:26 pm
Posts: 23
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


Top
 Profile  
 
PostPosted: Tue Mar 11, 2008 10:06 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri Aug 19, 2005 5:13 pm
Posts: 92
just wondering whether commenting out the following lines in includes/gacl.class.php would do the trick?


Code:
// 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' );


Top
 Profile  
 
PostPosted: Fri Apr 04, 2008 2:43 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Mar 18, 2008 7:35 pm
Posts: 6
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.


Top
 Profile  
 
PostPosted: Mon Aug 04, 2008 6:54 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Feb 11, 2006 8:32 am
Posts: 1070
Location: Tilburg, Holland
is there a way to do this without a hack?

_________________
http://www.pages-and-items.com
Admin-Menu-Manager, Access-Manager, Redirect-on-Login, Frontend-User-Access, Admin-User-Access, Pages-and-Items, module Admin-Messages, module Logged-in-Users, plugin load module in article, plugin pure css tooltip


Top
 Profile  
 
PostPosted: Sun Aug 17, 2008 12:08 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sun Aug 17, 2008 12:04 am
Posts: 1
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.


Top
 Profile  
 
PostPosted: Sun Aug 17, 2008 7:38 am 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sat Feb 11, 2006 8:32 am
Posts: 1070
Location: Tilburg, Holland
thats sweet.

thanks.

_________________
http://www.pages-and-items.com
Admin-Menu-Manager, Access-Manager, Redirect-on-Login, Frontend-User-Access, Admin-User-Access, Pages-and-Items, module Admin-Messages, module Logged-in-Users, plugin load module in article, plugin pure css tooltip


Top
 Profile  
 
PostPosted: Fri Oct 03, 2008 12:08 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Apr 20, 2007 9:41 pm
Posts: 178
Location: Scotland
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!


Top
 Profile  
 
PostPosted: Tue Nov 18, 2008 6:14 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 04, 2007 5:30 pm
Posts: 23
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:
<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>


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


---

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

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


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


Change to
Code:
<?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/165-understanding-output-overrides-in-joomla.html. This would be the best way because you will not lose these mods when upgrading Joomla.


Top
 Profile  
 
PostPosted: Fri Jan 09, 2009 5:10 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri May 09, 2008 8:22 pm
Posts: 55
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:
div.contentpaneopen_edit span.hasTip a img {
     display: none;
}


:)


Top
 Profile  
 
PostPosted: Fri Jan 30, 2009 8:39 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Jan 19, 2009 9:56 am
Posts: 3
Wow,asante sana! Thanks.


Top
 Profile  
 
PostPosted: Wed Feb 04, 2009 4:40 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Feb 04, 2009 4:30 am
Posts: 1
For the new guy, where in the template.css file does this code get pasted?

Thanks


Top
 Profile  
 
PostPosted: Sun Mar 29, 2009 5:44 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Oct 24, 2007 8:49 pm
Posts: 43
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


Top
 Profile  
 
PostPosted: Tue Apr 21, 2009 1:41 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Mar 16, 2009 11:26 pm
Posts: 17
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:
div.contentpaneopen_edit span.hasTip a img {
     display: none;
}


:)



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

_________________
Impossible is nothing
http://island.manukau.ac.nz/mitlive


Top
 Profile  
 
PostPosted: Sun May 10, 2009 9:37 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Nov 24, 2008 10:52 pm
Posts: 11
Location: Adelaide
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.


Top
 Profile  
 
PostPosted: Tue May 12, 2009 3:11 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Dec 29, 2008 7:41 pm
Posts: 2
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;}


Top
 Profile  
 
PostPosted: Mon May 18, 2009 8:05 am 
Joomla! Intern
Joomla! Intern

Joined: Fri May 09, 2008 8:22 pm
Posts: 55
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:
[Joomla base path]/components/com_content/helpers/icon.php


After the lines:
Code:
   if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) {
         return;
      }
add these lines:
Code:
if ($article->created_by != $user->get('id') && ($user->usertype == "Editor")) {
         return;
      }
Gruß. :)


Top
 Profile  
 
PostPosted: Thu May 21, 2009 10:04 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 18, 2008 7:48 pm
Posts: 11
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 ;)


Top
 Profile  
 
PostPosted: Wed Jun 03, 2009 5:08 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Mar 03, 2009 1:44 am
Posts: 45
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') ); ;)


Top
 Profile  
 
PostPosted: Sun Jul 12, 2009 9:50 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jun 13, 2009 2:43 pm
Posts: 11
Location: Romania
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') );


Top
 Profile  
 
PostPosted: Fri Aug 21, 2009 12:33 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sat Aug 08, 2009 10:51 pm
Posts: 4
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'));
}


Top
 Profile  
 
PostPosted: Fri Sep 04, 2009 7:21 pm 
Joomla! Intern
Joomla! Intern

Joined: Sat Jul 04, 2009 10:45 am
Posts: 56
\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.


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 7:53 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sat Sep 12, 2009 7:48 pm
Posts: 1
To disable editing on the Frontpage in Joomla 1.5.11, all I had to do was change:

Code:
$access->canEdit   = $user->authorize('com_content', 'edit', 'content', 'all');
$access->canEditOwn   = $user->authorize('com_content', 'edit', 'content', 'own');

(Lines 64-65)

To:
Code:
$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:
<joomla install>\components\com_content\views\frontpage\view.html.php


Top
 Profile  
 
PostPosted: Fri Oct 23, 2009 10:28 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Aug 10, 2009 10:04 pm
Posts: 9
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

_________________
Do you like rabbits? http://www.bunniesgoglobal.co.uk
Daftveggie.com Webdesign http://www.daftveggie.com


Top
 Profile  
 
PostPosted: Sat Apr 17, 2010 3:46 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sat Apr 17, 2010 3:39 pm
Posts: 1
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.


Top
 Profile  
 
PostPosted: Mon Jun 21, 2010 9:16 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Jun 17, 2010 1:49 pm
Posts: 44
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!


Top
 Profile  
 
PostPosted: Tue Jun 22, 2010 9:00 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Fri Nov 06, 2009 1:31 pm
Posts: 3
Ok works too for Joomla 1.5.15


Top
 Profile  
 
PostPosted: Fri Jun 25, 2010 4:27 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Jun 15, 2010 1:12 am
Posts: 208
Location: United Kingdom, London
thanks works great :D <3


Top
 Profile  
 
PostPosted: Wed Jun 30, 2010 7:01 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Feb 17, 2010 10:24 pm
Posts: 17
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page 1, 2  Next



Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group