roundcubemail/program/lib/Roundcube/rcube_imap.php
public function mod_folder($folder, $mode = 'out')
    {
        $prefix = $this->namespace['prefix_' . $mode]; // see set_env()

        if ($prefix === null || $prefix === ''
            || !($prefix_len = strlen($prefix)) || !strlen($folder)
        ) {
            return $folder;
        }

        // remove prefix for output
        if ($mode == 'out') {
            if (substr($folder, 0, $prefix_len) === $prefix) {
                return substr($folder, $prefix_len);
            }

            return $folder;
        }

        // add prefix for input (e.g. folder creation)
        return $prefix . $folder;
    }
public function mod_folder($folder, $mode = 'out')
    {
        $prefix = $this->namespace['prefix_' . $mode]; // see set_env()

        if ($prefix === null || $prefix === ''
            || !($prefix_len = strlen($prefix)) || !strlen($folder)
        ) {
            return $folder;
        }

        // remove prefix for output
        if ($mode == 'out') {
            if (substr($folder, 0, $prefix_len) === $prefix) {
                return substr($folder, $prefix_len);
            }

            return $folder;
        }

        // add prefix for input (e.g. folder creation)
        return $prefix . $folder;
    }
public function mod_folder ( $ folder , $ mode = 'out' ) { $ prefix = $ this -> namespace [ 'prefix_' . $ mode ] ; // see set_env() if ( $ prefix === null || $ prefix === '' || ! ( $ prefix_len = strlen ( $ prefix ) ) || ! strlen ( $ folder ) ) { return $ folder ; } // remove prefix for output if ( $ mode == 'out' ) { if ( substr ( $ folder , 0 , $ prefix_len ) === $ prefix ) { return substr ( $ folder , $ prefix_len ) ; } return $ folder ; } // add prefix for input (e.g. folder creation) return $ prefix . $ folder ; }
Modify folder name according to personal namespace prefix.
For output it removes prefix of the personal namespace if it's possible.
For input it adds the prefix. Use it before creating a folder in root
of the folders tree.

@param string $folder Folder name
@param string $mode   Mode name (out/in)

@return string Folder name
Modify folder name according to personal namespace prefix . For output it removes prefix of the personal namespace if it s possible . For input it adds the prefix . Use it before creating a folder in root of the folders tree .