Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2008-06-22 13:48:00

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,926
Website GitHub

Re: customise the interface for certain admin users

if you’re interested in giving this a shot, let me know

Sven, yes, I would be interested.

Uli, I stand corrected. I hadn’t checked to see what your changes did and assumed they restricted rather than simply preset the select item. Thanks!

Last edited by jakob (2008-06-22 13:51:22)


TXP Builders – finely-crafted code, design and txp

Offline

#14 2008-11-11 00:53:21

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: customise the interface for certain admin users

sthmtc
Hello, I know I’m a little to late but I hope you will read this. Is it still possible to have a look or download your plugin?
It would be a real time saver for me now (probably I could write it myself but my php skills are limited and I haven’t got so much time to experiment at the moment).
Thank you

edit ok solved, it was easier than I thought

Last edited by redbot (2008-11-14 01:39:57)

Offline

#15 2009-08-19 08:00:04

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: customise the interface for certain admin users

Is there a plugin/method to show only certain forms in the override forms menu?

The great Yura Linnyk’s ied_hide_in_admin can exclude all the Write: Override form and does not allow to choose between them.

I’d like to show the other authors only the forms they need (gallery_form, article_with_video_form, review_form…) and not the others created for the site only (search-results_form, faq_form…)

Offline

#16 2009-08-19 08:06:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,808
Website GitHub

Re: customise the interface for certain admin users

candyman wrote:

Is there a plugin/method to show only certain forms in the override forms menu?

Not as far as I know. Couple of ideas:

  1. Can you just set the unwanted forms to be of any type other than ‘article’ so they won’t appear in the list?
  2. Can you wait a tiny bit for 4.2.0 to be released (or run an SVN copy right now) because this will be a lot easier to write as a plugin under the new TXP version

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2009-08-19 09:10:19

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: customise the interface for certain admin users

  1. I can’t…
  2. I can wait for 4.2.0

Offline

#18 2009-08-19 09:50:08

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: customise the interface for certain admin users

Bloke wrote:

Couple of ideas:

3. Give your forms a prefix like three undserscores so they line up below the necessary article forms and noticeably shifted to the right.
Furthermore you can create an empty divider menu item (form) named something like _DONT USE MENU ITEMS BELOW_____

Last edited by uli (2009-08-19 09:50:57)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#19 2009-08-19 10:35:16

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: customise the interface for certain admin users

candyman wrote:

Is there a plugin/method to show only certain forms in the override forms menu?

Hope I’m not missing something obvious but I think it can be doable with some jquery called form within a plugin. I do it regularly to hide some sections in the “section” select in the “article” tab.
If you don’t want to write a plugin I think there is already one (I can’t recall the name) which let’s you insert js code for the admin.

Offline

#20 2009-08-19 11:02:51

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: customise the interface for certain admin users

For the moment I’ll use Uli’s tip.

Offline

#21 2009-08-30 17:41:29

Gerich
Member
Registered: 2009-08-30
Posts: 35

Re: customise the interface for certain admin users

redbot wrote:

sthmtc
Hello, I know I’m a little to late but I hope you will read this. Is it still possible to have a look or download your plugin?
It would be a real time saver for me now (probably I could write it myself but my php skills are limited and I haven’t got so much time to experiment at the moment).
Thank you
ok solved, it was easier than I thought

I have the same question: Is it still possible to have a look or download this plugin? I need to hide a few sections in dropdown list from some users group.

Offline

#22 2009-08-30 18:20:58

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: customise the interface for certain admin users

Gerich wrote:

I need to hide a few sections in dropdown list from some users group.

If I understood correctly you want to hide sections only for certain users.
This could be done with a plugin but if you are in a hurry you could use sed_section_fields and modify this line in the code:

add_privs('sed_sf.static_sections', '1,2' );	# which users always see all sections in the write-tab select box 

(modify the numbers – in the above example sections are hidden for levels 3,4,5,6)

If sed_sections doesen’t work with txp 4.2.0 you can use my raw plugin bot_hide_per_section (is a sed_sections clone). In this case you’ll have to add a line under register_callback('bot_hide_per_section','article');
so it reads:

register_callback('bot_hide_per_section','article');
add_privs('bot_hide_per_section', '1,2,3,4,5,6');

(you have to modify the numbers according to your needs).

Hope this helps

Last edited by redbot (2009-08-30 18:35:53)

Offline

#23 2009-08-31 11:41:18

Gerich
Member
Registered: 2009-08-30
Posts: 35

Re: customise the interface for certain admin users

I have installed the plugin bot_hide_per_section, but it not work. This is my code:
register_callback(‘bot_hide_per_section’,‘article’);
add_privs(‘bot_hide_per_section’, ’1,2,3,4,6’);
and under:
// hidden sections in section list. Uncomment and replace.
$bot_hidden_sections=“sitemap,tools”;

But user “freelancer (5)” still can see in the sections dropdown list this sections:sitemap,tools. More precisely he can see all sections.
Maybe I did some wrong? Any idea?

Last edited by Gerich (2009-08-31 11:42:38)

Offline

#24 2009-08-31 12:14:18

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: customise the interface for certain admin users

Gerich wrote:

Maybe I did some wrong? Any idea?

Yes sorry you’re totally right. I forgot to tell you the important part :p

so, other than the mods you have already done you have to replace this piece of code:

function bot_hide_per_section(){ //  builds the script
	echo
		'<script language="javascript" type="text/javascript">'.n.
		'	$(document).ready(function() {'.n.
		'		$("#advanced").show();'.n.
		'		var value = $("select#section.list option:selected").val();';
				bot_fields_rows();
				bot_hide_sections();		
	echo
		'		$("select#section.list").change(function(){'.n;
					bot_fields_restore_rows();
	echo				
		'			var value = $("select#section.list").val();';
					bot_fields_rows();
	echo				
		'			}'.n.
		'		);'.n.				
		'	});'.n.
		'</script>'; 
}

with this:

function bot_hide_per_section(){ //  builds the script
if( has_privs('bot_hide_per_section') ){
	echo
		'<script language="javascript" type="text/javascript">'.n.
		'	$(document).ready(function() {'.n.
		'		$("#advanced").show();'.n.
		'		var value = $("select#section.list option:selected").val();';
				bot_fields_rows();
				bot_hide_sections();

echo ‘ $(“select#section.list”).change(function(){‘.n; bot_fields_restore_rows(); echo ‘ var value = $(“select#section.list”).val();’; bot_fields_rows(); echo ‘ }’.n. ‘ );’.n. ‘ });’.n. ‘</script>’;
}
}

Offline

Board footer

Powered by FluxBB