if someone is running into this:

/*
 * Lock draggableviews form if user is not the nodes author
 */

function customforms_views_pre_execute(&$view) {
    // Richtigen View auswählen
    if (($view->name == 'lessons_of_a_collection') && ($view->current_display == 'node_content_1')) {
        global $user;
        // checken ob user überhaupt die permission hat
        if (user_access('Allow Reordering')) {
            //wenn ja checken ob auch autor
            if ($view->current_node->uid == $user->uid) {
                return;
            } else {
                $view->draggableviews_info['locked'] = TRUE;
            }
        }
    }
}


Comments

fourmi4x’s picture

Hi, thanks for this snippet, I didn't know where to start to do this.

However, it doesn't work for me with _views_pre_execute, I had to do it with _views_pre_render, which work great. Maybe this is because I use views 3.

istryker’s picture

Category: Support request » Feature request
Issue summary: View changes
Status: Active » Closed (won't fix)

Drupal 6.x is no longer supported. Closing issue.