'Quick edit' toolbar (with multiple groups patch installed)

Basically place this in your template where you'd like the toolbar (usually just above the content).

The code checks the permissions to determine whether the user logged in has access based on what groups they're in and so requires the multiple groups patch to be installed.

You'll also need a some icons for edit page (edit.png), view page tree (folder.png) and browse media (media.png). This go into the template's directory (template/my_template/). We use these

 

                // ###### Quick Edit Toolbar #######

                $admin_groups = explode(',', $wb->page['admin_groups']);
                $admin_users = explode(',', $wb->page['admin_users']);

                $in_group = FALSE;
                foreach($wb->get_groups_id() as $cur_gid){
                    if (in_array($cur_gid, $admin_groups)) {
                        $in_group = TRUE;
                    }
                }

                if ($wb->is_authenticated() AND
                        ( $in_group OR
                         is_numeric(array_search($wb->get_user_id(), $admin_users)))){
                ?>

                <div id="toolbox">

                        <a href="javascript:;" onclick="popup('pages/modify.php?page_id=<?php echo $wb->page['page_id']; ?>');">
                        <img border="0" alt='Edit Page' title='Edit Page' src="<?php echo TEMPLATE_DIR; ?>/edit.png" />
                        </a>
                        <a href="javascript:;" onclick="popup('pages/');">
                        <img border="0" alt='Browse Tree' title='Browse Tree' src="<?php echo TEMPLATE_DIR; ?>/folder.png" />
                        </a>
                        <a href="javascript:;" onclick="popup('/media/');">
                        <img border="0" alt='Upload Media' title='Upload Media' src="<?php echo TEMPLATE_DIR; ?>/media.png" />
                        </a>

                </div>

                <?php
                }
                // ###### End Quick Edit Toolbar #######