+#######
+# Configuration variables
+#######
+
+### General ###
+ static public $profile = Array( 'signature' => '',
+ 'headers' => array('From' => 'Anonymous <anonymouse@example.com>'),
+ 'display' => 0,
+ 'lastnews' => 0,
+ 'locale' => 'fr_FR.UTF-8',
+ 'subscribe' => array(),
+ 'autoup' => 1);
+ static public $boxpattern;
+ static public $withtabs = true;
+ static public $mimeparts = array();
+
+### Spool ###
+ static public $spool_root = '/var/spool/banana';
+ static public $spool_max = 3000;
+ static public $spool_tbefore = 5;
+ static public $spool_tafter = 5;
+ static public $spool_tmax = 50;
+ static public $spool_boxlist = true;
+
+### Message processing ###
+ static public $msgparse_headers = array('content-disposition', 'content-transfer-encoding',
+ 'content-type', 'content-id', 'date', 'followup-to',
+ 'from', 'message-id', 'newsgroups', 'organization',
+ 'references', 'subject', 'x-face', 'in-reply-to',
+ 'to', 'cc', 'reply-to');
+
+### Message display ###
+ static public $msgshow_headers = array('from', 'newsgroups', 'followup-to', 'to', 'cc', 'reply-to',
+ 'organization', 'date', 'references', 'in-reply-to');
+ static public $msgshow_mimeparts = array('multipart/report', 'multipart/mixed',
+ 'text/html', 'text/plain', 'text/enriched', 'text', 'message');
+ static public $msgshow_xface = true;
+ static public $msgshow_wrap = 80;
+ static public $msgshow_externalimages = false;
+ static public $msgshow_hasextimages = false;
+ static public $msgshow_withthread = true;
+
+ /** Match an url
+ * Should be included in a regexp delimited using /, !, , or @ (eg: "/$url_regexp/ui")
+ * If it matches, return 3 main parts :
+ * \\1 and \\3 are delimiters
+ * \\2 is the url
+ *
+ * eg : preg_match("!$url_regexp!i", "[http://www.polytechnique.org]", $matches);
+ * $matches[1] = "["
+ * $matches[2] = "http://www.polytechnique.org"
+ * $matches[3] = "]"
+ */
+ static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!\:]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?';
+
+### Message edition ###
+ static public $msgedit_canattach = true;
+ static public $msgedit_maxfilesize = 100000;
+ /** Global headers to use for messages
+ */
+ static public $msgedit_headers = array('Mime-Version' => '1.0', 'User-Agent' => 'Banana @VERSION@');
+ /** Mime type order for quoting
+ */
+ static public $msgedit_mimeparts = array('multipart/report', 'multipart/mixed', 'text/plain', 'text/enriched', 'text/html', 'text', 'message');
+
+### Feed configuration ###
+ static public $feed_active = true;
+ static public $feed_format = 'rss2';
+ static public $feed_updateOnDemand = false; // Update the feed each time sbd check it
+ static public $feed_copyright = null;
+ static public $feed_namePrefix = 'Banana :: ';
+ static public $feed_size = 15; // Number of messages in the feed
+
+### Protocole ###
+ /** News serveur to use
+ */
+ static public $nntp_host = 'news://localhost:119/';
+
+ static public $mbox_path = '/var/mail';
+ static public $mbox_helper = './mbox-helper';
+
+### Debug ###
+ static public $debug_nntp = false;
+ static public $debug_mbox = false;
+ static public $debug_smarty = false;
+
+
+#######
+# Constants
+#######
+
+ // Actions
+ const ACTION_BOX_NEEDED = 1; // mask
+ const ACTION_BOX_LIST = 2;
+ const ACTION_BOX_SUBS = 4;
+ const ACTION_BOX_FEED = 8;
+ const ACTION_MSG_LIST = 3;
+ const ACTION_MSG_READ = 5;
+ const ACTION_MSG_NEW = 9;
+ const ACTION_MSG_CANCEL = 17;
+ const ACTION_MSG_IMAGES = 33;
+
+ // Box list view
+ const BOXES_ALL = 0;
+ const BOXES_SUB = 1;
+ const BOXES_NEW = 2;
+
+ // Spool view mode
+ const SPOOL_ALL = 0;
+ const SPOOL_UNREAD = 1;
+
+
+#######
+# Runtime variables
+#######
+
+ static public $protocole = null;
+ static public $spool = null;
+ static public $message = null;
+ static public $page = null;
+
+ static public $group = null;
+ static public $artid = null;
+ static public $action = null;
+ static public $part = null;
+ static public $first = null;
+
+ /** Class parameters storage
+ */
+ public $params;
+
+
+#######
+# Banana Implementation
+#######
+
+ /** Build the instance of Banana
+ * This constructor only call \ref loadParams, connect to the server, and build the Smarty page
+ * @param protocole Protocole to use
+ */
+ public function __construct($params = null, $protocole = 'NNTP', $pageclass = 'BananaPage')