<commit_before><?php
/**
 * Thunderbird Labels Plugin for Roundcube Webmail
 *
 * Plugin to show the 5 Message Labels Thunderbird Email-Client provides for IMAP
 *
 * @version $Revision$
 * @author <NAME>
 * @url http://code.google.com/p/rcmail-thunderbird-labels/
 */
class thunderbird_labels extends rcube_plugin
{
	public $task = 'mail';
	private $map;
	
	function init()
	{
		$this->include_script('tb_label.js');
		$this->add_texts('localization/', true);
		$this->add_hook('messages_list', array($this, 'read_flags'));
		$this->add_hook('message_load', array($this, 'read_single_flags'));
		$this->add_hook('template_object_messageheaders', array($this, 'color_headers'));
		$this->add_hook('render_page', array($this, 'tb_label_popup'));
		$this->include_stylesheet($this->local_skin_path() . '/tb_label.css');
		
		$this->name = get_class($this);
		$this->prefs = array('show_labels' => true);
		# -- additional TB flags
		$this->add_tb_flags = array(
			'LABEL1' => '$Label1',
			'LABEL2' => '$Label2',
			'LABEL3' => '$Label3',
			'LABEL4' => '$Label4',
			'LABEL5' => '$Label5',
			);
		$this->message_tb_labels = array();
		
		$this->add_button(
			array(
				'command' => 'plugin.thunderbird_labels.rcm_tb_label_submenu',
				'id' => 'tb_label_popuplink',
				'title' => 'label', # gets translated
				'domain' => $this->ID,
				'type' => 'link',
				'content' => ' '
			),
			'toolbar'
		);
		
		$this->register_action('plugin.thunderbird_labels.set_flags', array($this, 'set_flags'));
		
		if (method_exists($this, 'require_plugin')
			&& $this->require_plugin('contextmenu'))
		{
			$rcmail = rcmail::get_instance();
			if ($rcmail->action == '')
				$this->add_hook('render_mailboxlist', array($this, 'show_tb_label_contextmenu'));
		}
	}
	
	public function show_tb_label_contextmenu($args)
	{<commit_msg>disabled plugin for print message mode<commit_after><?php
/**
 * Thunderbird Labels Plugin for Roundcube Webmail
 *
 * Plugin to show the 5 Message Labels Thunderbird Email-Client provides for IMAP
 *
 * @version $Revision$
 * @author <NAME>
 * @url http://code.google.com/p/rcmail-thunderbird-labels/
 */
class thunderbird_labels extends rcube_plugin
{
	public $task = 'mail';
	private $map;
	
	function init()
	{
		$rcmail = rcmail::get_instance();
		# -- disable plugin when printing message
		if ($rcmail->action == 'print')
			return;
		
		$this->include_script('tb_label.js');
		$this->add_texts('localization/', true);
		$this->add_hook('messages_list', array($this, 'read_flags'));
		$this->add_hook('message_load', array($this, 'read_single_flags'));
		$this->add_hook('template_object_messageheaders', array($this, 'color_headers'));
		$this->add_hook('render_page', array($this, 'tb_label_popup'));
		$this->include_stylesheet($this->local_skin_path() . '/tb_label.css');
		
		$this->name = get_class($this);
		$this->prefs = array('show_labels' => true);
		# -- additional TB flags
		$this->add_tb_flags = array(
			'LABEL1' => '$Label1',
			'LABEL2' => '$Label2',
			'LABEL3' => '$Label3',
			'LABEL4' => '$Label4',
			'LABEL5' => '$Label5',
			);
		$this->message_tb_labels = array();
		
		$this->add_button(
			array(
				'command' => 'plugin.thunderbird_labels.rcm_tb_label_submenu',
				'id' => 'tb_label_popuplink',
				'title' => 'label', # gets translated
				'domain' => $this->ID,
				'type' => 'link',
				'content' => ' '
			),
			'toolbar'
		);
		
		$this->register_action('plugin.thunderbird_labels.set_flags', array($this, 'set_flags'));
		
		if (method_exists($this, 'require_plugin')
			&& $this->require_plugin('contextmenu'))
		{
			if ($rcmail->action == '')
				$this->add_hook('render_mailboxlist', array($this, 'show_tb_label_contextmenu'));
		}
	}
	
	public function show_tb_label_contextmenu($args)
	{
{'fraction_non_alphanumeric': 0.186968085106383, 'fraction_numerical': 0.005851063829787234, 'mean_word_length': 4.547197640117994, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 66, 'https://': 0, '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': '1742793', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1320, 'n_words': 230}