roundcubemail/plugins/acl/acl.php
function folder_form($args)
    {
        $mbox_imap = $args['options']['name'];
        $myrights  = $args['options']['rights'];

        // Edited folder name (empty in create-folder mode)
        if (!strlen($mbox_imap)) {
            return $args;
        }
/*
        // Do nothing on protected folders (?)
        if ($args['options']['protected']) {
            return $args;
        }
*/
        // Get MYRIGHTS
        if (empty($myrights)) {
            return $args;
        }

        // Load localization and include scripts
        $this->load_config();
        $this->specials = $this->rc->config->get('acl_specials', $this->specials);
        $this->add_texts('localization/', array('deleteconfirm', 'norights',
            'nouser', 'deleting', 'saving', 'newuser', 'editperms'));
        $this->rc->output->add_label('save', 'cancel');
        $this->include_script('acl.js');
        $this->rc->output->include_script('list.js');
        $this->include_stylesheet($this->local_skin_path().'/acl.css');

        // add Info fieldset if it doesn't exist
        if (!isset($args['form']['props']['fieldsets']['info']))
            $args['form']['props']['fieldsets']['info'] = array(
                'name'  => $this->rc->gettext('info'),
                'content' => array());

        // Display folder rights to 'Info' fieldset
        $args['form']['props']['fieldsets']['info']['content']['myrights'] = array(
            'label' => rcube::Q($this->gettext('myrights')),
            'value' => $this->acl2text($myrights)
        );

        // Return if not folder admin
        if (!in_array('a', $myrights)) {
            return $args;
        }

        // The 'Sharing' tab
        $this->mbox = $mbox_imap;
        $this->rc->output->set_env('acl_users_source', (bool) $this->rc->config->get('acl_users_source'));
        $this->rc->output->set_env('mailbox', $mbox_imap);
        $this->rc->output->add_handlers(array(
            'acltable'  => array($this, 'templ_table'),
            'acluser'   => array($this, 'templ_user'),
            'aclrights' => array($this, 'templ_rights'),
        ));

        $this->rc->output->set_env('autocomplete_max', (int)$this->rc->config->get('autocomplete_max', 15));
        $this->rc->output->set_env('autocomplete_min_length', $this->rc->config->get('autocomplete_min_length'));
        $this->rc->output->add_label('autocompletechars', 'autocompletemore');

        $args['form']['sharing'] = array(
            'name'    => rcube::Q($this->gettext('sharing')),
            'content' => $this->rc->output->parse('acl.table', false, false),
        );

        return $args;
    }
function folder_form($args)
    {
        $mbox_imap = $args['options']['name'];
        $myrights  = $args['options']['rights'];

        // Edited folder name (empty in create-folder mode)
        if (!strlen($mbox_imap)) {
            return $args;
        }
/*
        // Do nothing on protected folders (?)
        if ($args['options']['protected']) {
            return $args;
        }
*/
        // Get MYRIGHTS
        if (empty($myrights)) {
            return $args;
        }

        // Load localization and include scripts
        $this->load_config();
        $this->specials = $this->rc->config->get('acl_specials', $this->specials);
        $this->add_texts('localization/', array('deleteconfirm', 'norights',
            'nouser', 'deleting', 'saving', 'newuser', 'editperms'));
        $this->rc->output->add_label('save', 'cancel');
        $this->include_script('acl.js');
        $this->rc->output->include_script('list.js');
        $this->include_stylesheet($this->local_skin_path().'/acl.css');

        // add Info fieldset if it doesn't exist
        if (!isset($args['form']['props']['fieldsets']['info']))
            $args['form']['props']['fieldsets']['info'] = array(
                'name'  => $this->rc->gettext('info'),
                'content' => array());

        // Display folder rights to 'Info' fieldset
        $args['form']['props']['fieldsets']['info']['content']['myrights'] = array(
            'label' => rcube::Q($this->gettext('myrights')),
            'value' => $this->acl2text($myrights)
        );

        // Return if not folder admin
        if (!in_array('a', $myrights)) {
            return $args;
        }

        // The 'Sharing' tab
        $this->mbox = $mbox_imap;
        $this->rc->output->set_env('acl_users_source', (bool) $this->rc->config->get('acl_users_source'));
        $this->rc->output->set_env('mailbox', $mbox_imap);
        $this->rc->output->add_handlers(array(
            'acltable'  => array($this, 'templ_table'),
            'acluser'   => array($this, 'templ_user'),
            'aclrights' => array($this, 'templ_rights'),
        ));

        $this->rc->output->set_env('autocomplete_max', (int)$this->rc->config->get('autocomplete_max', 15));
        $this->rc->output->set_env('autocomplete_min_length', $this->rc->config->get('autocomplete_min_length'));
        $this->rc->output->add_label('autocompletechars', 'autocompletemore');

        $args['form']['sharing'] = array(
            'name'    => rcube::Q($this->gettext('sharing')),
            'content' => $this->rc->output->parse('acl.table', false, false),
        );

        return $args;
    }
function folder_form ( $ args ) { $ mbox_imap = $ args [ 'options' ] [ 'name' ] ; $ myrights = $ args [ 'options' ] [ 'rights' ] ; // Edited folder name (empty in create-folder mode) if ( ! strlen ( $ mbox_imap ) ) { return $ args ; } /*
        // Do nothing on protected folders (?)
        if ($args['options']['protected']) {
            return $args;
        }
*/ // Get MYRIGHTS if ( empty ( $ myrights ) ) { return $ args ; } // Load localization and include scripts $ this -> load_config ( ) ; $ this -> specials = $ this -> rc -> config -> get ( 'acl_specials' , $ this -> specials ) ; $ this -> add_texts ( 'localization/' , array ( 'deleteconfirm' , 'norights' , 'nouser' , 'deleting' , 'saving' , 'newuser' , 'editperms' ) ) ; $ this -> rc -> output -> add_label ( 'save' , 'cancel' ) ; $ this -> include_script ( 'acl.js' ) ; $ this -> rc -> output -> include_script ( 'list.js' ) ; $ this -> include_stylesheet ( $ this -> local_skin_path ( ) . '/acl.css' ) ; // add Info fieldset if it doesn't exist if ( ! isset ( $ args [ 'form' ] [ 'props' ] [ 'fieldsets' ] [ 'info' ] ) ) $ args [ 'form' ] [ 'props' ] [ 'fieldsets' ] [ 'info' ] = array ( 'name' => $ this -> rc -> gettext ( 'info' ) , 'content' => array ( ) ) ; // Display folder rights to 'Info' fieldset $ args [ 'form' ] [ 'props' ] [ 'fieldsets' ] [ 'info' ] [ 'content' ] [ 'myrights' ] = array ( 'label' => rcube :: Q ( $ this -> gettext ( 'myrights' ) ) , 'value' => $ this -> acl2text ( $ myrights ) ) ; // Return if not folder admin if ( ! in_array ( 'a' , $ myrights ) ) { return $ args ; } // The 'Sharing' tab $ this -> mbox = $ mbox_imap ; $ this -> rc -> output -> set_env ( 'acl_users_source' , ( bool ) $ this -> rc -> config -> get ( 'acl_users_source' ) ) ; $ this -> rc -> output -> set_env ( 'mailbox' , $ mbox_imap ) ; $ this -> rc -> output -> add_handlers ( array ( 'acltable' => array ( $ this , 'templ_table' ) , 'acluser' => array ( $ this , 'templ_user' ) , 'aclrights' => array ( $ this , 'templ_rights' ) , ) ) ; $ this -> rc -> output -> set_env ( 'autocomplete_max' , ( int ) $ this -> rc -> config -> get ( 'autocomplete_max' , 15 ) ) ; $ this -> rc -> output -> set_env ( 'autocomplete_min_length' , $ this -> rc -> config -> get ( 'autocomplete_min_length' ) ) ; $ this -> rc -> output -> add_label ( 'autocompletechars' , 'autocompletemore' ) ; $ args [ 'form' ] [ 'sharing' ] = array ( 'name' => rcube :: Q ( $ this -> gettext ( 'sharing' ) ) , 'content' => $ this -> rc -> output -> parse ( 'acl.table' , false , false ) , ) ; return $ args ; }
Handler for 'folder_form' hook

@param array $args Hook arguments array (form data)

@return array Hook arguments array
Handler for folder_form hook