Different Editor Pages for Different Users

37 posts by 12 authors in: Forums > CMS Builder
Last Post: September 22, 2011   (RSS)

By Toledoh - February 6, 2011

Hi Chris,

Not a huge concern, but it seems that separators are not hidden as other fields are.

I have the following code in v0.03;
// Fields will start hidden if they appear in any "fields to show" list
$GLOBALS['SHOWHIDE_DEPENDANT_FIELDS_CONFIG']['tabs']['columns'] = array(
// list option => fields to show
'' => array(), // show these fields when the topmost '<select>' option is selected
'1' => array('__separator001__','heading_1','content_1'),
'2' => array('__separator001__','heading_1','content_1','__separator002__','heading_2','content_2'),
'3' => array('__separator001__','heading_1','content_1','__separator002__','heading_2','content_2','__separator003__','heading_3','content_3'),
'4' => array('__separator001__','heading_1','content_1','__separator002__','heading_2','content_2','__separator003__','heading_3','content_3','__separator004__','heading_4','content_4'),
);


and the heading and content fields hide/show, but the separators are always visable.
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Different Editor Pages for Different Users

By Chris - February 10, 2011 - edited: February 10, 2011

Hi Tim,

Good catch! You can make this work by using the "HTML" Separator Type and adding a "name" attribute to an element within the <TR>. For example:

<tr>
<td colspan="2">
<div class="content-box content-box-divider" name="__separator001__">
<div class="content-box-header"><h3>My Separator Text</h3></div>
</div>
</td>
</tr>


I hope this helps!
All the best,
Chris

By Toledoh - February 10, 2011

That does the job! Thanks Chris
Cheers,

Tim (toledoh.com.au)

By concrete - March 30, 2011

Hi Chris,

Not sure if any one posted this. but i found a quick fix to the oversized upload iframe issue.

I simple edited the style.css file in the 3rdparty/SimplaAdmin/css folder.

I changed .uploadIframe to:

.uploadIframe { border-width: 1px; border-color: #AAA; border-style: solid none; background-color: #EEE; width:100%; height:200px;
}

By wcd - June 24, 2011

For a future release, would it be possible to add the option to hide an editor on the menu bar to a Single Record editor as there is for MultiRecord editors? Or the ability to restrict a field only to Admin users as opposed to both Editor and Admin users? It would be nice to have this flexibility without needing to add some custom programming. Thanks!

Re: [multimedia_nj] Different Editor Pages for Different Users

By Damon - June 27, 2011

Hi,

If I understand the requirements correctly, you could set a Single Record editor to not be visible in the left navigation by unchecking the Access box for that editor under each user account. This would be on a per user basis and setting.

Or....

You could add menuHidden = 1 to the Single Record schema file directly.

This currently isn't a feature to hide Single Records as there isn't UI to allow the record to be hidden and unhidden by checkbox but you could set this directly in the file.

Download the the single record schema from the /data/schema/ folder and edit it menuHidden = 1 like this:
menuType = "single"
menuHidden = 1


Hope that helps!
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Damon] Different Editor Pages for Different Users

By wcd - June 28, 2011

Thanks Damon. In this case the client will have access to the user account manager, but we wanted to hide one of the editors in order to protect them from themselves. :-)

I'd still find the ability to restrict a field to Admin only more useful than Admin and Editor only, but the second option is a good workaround. Thanks for the tip!

By gkornbluth - July 18, 2011

Hi Chris,

I’m stuck again.

I’m trying to use your “showHideFieldsForUsers” plugin (my code is below) to implement a multi level membership scheme and I’ve come up against a bit of a snag.

Here’s the issue:

UPGRADE WORKS FINE
A member upgrades their membership level, and thanks to your plugin they are allowed to access additional fields in the database and they get added functionality.

They create some records with this additional functionality and all records that they have authored appear with all of the information fields available for them to modify.

PROBLEM ON DOWNGRADE
The problem comes in if that member decides to downgrade their membership and they lose access to those additional fields, even for records that already have data in those fields.

QUESTION
Can you think of a way to allow the now downgraded member to access (and modify) the now hidden fields in their records where fields already have data entered in them? Just not to be able to create any new records using those fields?

ALTERNATIVE
I guess that the alternative is that they’d have to delete the existing record and when recreating it, they just won’t be able to enter data into the now hidden fields.

THIS CREATES A DIFFERENT PROBLEM
Since they can’t see the data in the hidden fields, they won’t have any easy way to know when the record needs to be deleted and updated.

Thanks,

Jerry Kornbluth

<?php


// CAVEATS:
// - it is not currently possible to hide Separator fields.

// UPDATE THESE VALUES

$GLOBALS['BETA_USER_SKILL_FIELDS_SKILL_FIELD_NAME'] = 'allowedFolders';

// For each section, copy this block
$GLOBALS['BETA_USER_SKILL_FIELDS_CONFIG']['master_subscription_pages'] = array(

// user's skill values and lists of fields to hide
'entry_level' => array('__separator001__','__separator002__','paypal_payment_address', 'paypal_invoice_description', 'price_of_work','tm_offer_description','short_code','key_word'),
'silver' => array('__separator002__','tm_offer_description','short_code', 'key_word'),
'gold' => array('__separator002__','tm_offer_description','short_code', 'key_word'),
'platinum' => array()

);

// DON'T UPDATE ANYTHING BELOW THIS LINE

// register hooks
addFilter('edit_buttonsRight', 'beta_user_skill_fields_edit_filter', null, 3);

// add javascript to edit pages
function beta_user_skill_fields_edit_filter($html, $tablename, $record) {
global $CURRENT_USER;
$hiddenFields = @$GLOBALS['BETA_USER_SKILL_FIELDS_CONFIG'][$tablename][@$CURRENT_USER[$GLOBALS['BETA_USER_SKILL_FIELDS_SKILL_FIELD_NAME']]];
if (!$hiddenFields) { return $html; }

?>
<script>
$(function(){
<?php foreach($hiddenFields as $hiddenField): ?>
$('*[name="<?php echo $hiddenField; ?>"]').closest('TR').hide();
$('*[name^="<?php echo $hiddenField; ?>:"]').closest('TR').hide();
$('#<?php echo $hiddenField; ?>_iframe').closest('TR').hide();
<?php endforeach; ?>
});
</script>
<?php

return $html;
}

?>

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - July 18, 2011 - edited: July 19, 2011

Hi Chris,

I think we've solved the issues above for now.

One other question.

Would it be feasible to grey out fields that were not accessible instead of hiding them as with the current plugin?
Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php