Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hello KK,

How to prevent my client from accidentally change the folder name in couch gallery.

In the post about "couchCMS v2.0"you explained how to exclude from listing.
(<cms:config_list_view exclude='examplepage' /> )

This could be the way to do....
But its necessary for the user to see and access the folder for uploading images.
I want to prevent him to go to the "manage folders" area and edit the folder name, because the folders are linked by their name to different areas of the website to display the images in lightboxes e.g.

Is there a way
1)to disable the access to the "manage folders" area for the client but leave it open to the superadmin ,
2)or not to show the folders in this area(after I do the setup for the client), but show the folders in the list view,
3)or to make the folder name only editable for the superadmin (ist me ;) )

Thank you very much
Angie
Hi Angie,

While all the three solutions you mentioned are implementable, I think simply hiding the 'Manage Folders' button in gallery templates should be the most straightforward.

Please paste the following in your 'addons/kfunctions.php' file (if the file is not present, rename the kfunctions.example.php to kfunctions.php) -
Code: Select all
/*
    Remove 'Manage Folders' button from gallery for everyone except super-admins
*/
$FUNCS->add_event_listener( 'alter_pages_list_toolbar_actions',
    function( &$arr_actions ){
        global $AUTH, $FUNCS, $PAGE;

        $route = $FUNCS->current_route;
        if( is_object($route) && $route->module=='pages' && $PAGE->tpl_gallery ){
            if( $AUTH->user->access_level < '10' ){ // if not a super-admin
                // remove 'Manage Folders' button from toolbar
                if( array_key_exists('view_folders', $arr_actions) ){
                    unset( $arr_actions['view_folders'] )  ;
                }
            }
        }
    }
);

Hope this helps. Do let me know.
Hello KK,

Thank you so much!
It works great.

;)
Here in the very south of Germany de will say:
"nicht verzagen KK fragen!"

:) angie
You are welcome :)
4 posts Page 1 of 1