<commit_before><?php

/**
 * Roundcube Archiving plugin - Backend
 *
 * Archiving plugin, that enables roundcube users to archive messages
 *
 *  - based on date (by years, by months)
 *  - based on sender
 *
 * Based on Archive plugin by <NAME>, <NAME>
 * Button and skin-settings taken from the Archivefolder plugin by Andre
 * Rodier, <NAME> and Roland 'rosali' Liebl
 *
 * @version 1.0b
 * @author <NAME> <<EMAIL>>
 * @url https://github.com/dploeger/de_dieploegers_archive
 */

class de_dieploegers_archive extends rcube_plugin {

    public $task = 'mail|settings';
    public $account = "";

    function init()
    {
        $rcmail = rcmail::get_instance();

        $this->account = $_SESSION['account_dn'];

        // Register folder query
        $this->register_action(
            'plugin.de_dieploegers_archive_queryFolder',
            array($this, "queryFolder")
        );

        // There is no "Archived flags"
        // $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive';
        if (
            $rcmail->task == 'mail' && (
                $rcmail->action == '' ||
                $rcmail->action == 'show'
            ) && (
                $archive_folder = $rcmail->config->get('archive_mbox')
            )
        ) {

            $skin_path = $this->local_skin_path();

            if (is_file($this->home . "/$skin_path/archive.css")) {

                $this->include_stylesheet("$skin_path/archive.css");

            }

            $this->include_script('de_dieploegers_archive.js');
            $this->add_texts('localization', true);<commit_msg>fixes that a configured archive folder by the Roundcube archive plugin is required for this plugin to be enabled in the mail-view.<commit_after><?php

/**
 * Roundcube Archiving plugin - Backend
 *
 * Archiving plugin, that enables roundcube users to archive messages
 *
 *  - based on date (by years, by months)
 *  - based on sender
 *
 * Based on Archive plugin by <NAME>, <NAME>
 * Button and skin-settings taken from the Archivefolder plugin by Andre
 * Rodier, <NAME> and Roland 'rosali' Liebl
 *
 * @version 1.0b
 * @author <NAME> <<EMAIL>>
 * @url https://github.com/dploeger/de_dieploegers_archive
 */

class de_dieploegers_archive extends rcube_plugin {

    public $task = 'mail|settings';
    public $account = "";

    function init()
    {
        $rcmail = rcmail::get_instance();

        $this->account = $_SESSION['account_dn'];

        // Register folder query
        $this->register_action(
            'plugin.de_dieploegers_archive_queryFolder',
            array($this, "queryFolder")
        );

        // There is no "Archived flags"
        // $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive';
        if (
            $rcmail->task == 'mail' && (
                $rcmail->action == '' ||
                $rcmail->action == 'show'
            ) && (
                $archive_folder = $rcmail->config->get(
                    'archive_mbox_' . $this->account)
            )
        ) {

            $skin_path = $this->local_skin_path();

            if (is_file($this->home . "/$skin_path/archive.css")) {

                $this->include_stylesheet("$skin_path/archive.css");

            }

            $this->include_script('de_dieploegers_archive.js');
            $this->add_texts('localization', true);
{'fraction_non_alphanumeric': 0.1375980687990344, 'fraction_numerical': 0.0012070006035003018, 'mean_word_length': 2.234146341463415, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 40, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '128494', 'n_tokens_mistral': 1006, 'n_tokens_neox': 978, 'n_words': 222}