define('SMOPT_TYPE_HIDDEN', 6);
define('SMOPT_TYPE_COMMENT', 7);
define('SMOPT_TYPE_FLDRLIST', 8);
+define('SMOPT_TYPE_FLDRLIST_MULTI', 9);
/* Define constants for the options refresh levels. */
define('SMOPT_REFRESH_NONE', 0);
*/
var $htmlencoded=false;
/**
- * Controls folder list limits in SMOPT_TYPE_FLDRLIST widget.
+ * Controls folder list limits in SMOPT_TYPE_FLDRLIST and
+ * SMOPT_TYPE_FLDRLIST_MULTI widgets.
* See $flag argument in sqimap_mailbox_option_list() function.
* @var string
* @since 1.5.1
case SMOPT_TYPE_FLDRLIST:
$result = $this->createWidget_FolderList();
break;
+ case SMOPT_TYPE_FLDRLIST_MULTI:
+ $result = $this->createWidget_FolderList(TRUE);
+ break;
default:
-//FIXME: can we throw an error here instead? either way, we don't want HTML here!
- $result = '<font color="' . $color[2] . '">'
- . sprintf(_("Option Type '%s' Not Found"), $this->type)
- . '</font>';
+ error_box (
+ sprintf(_("Option Type '%s' Not Found"), $this->type)
+ );
}
/* Add the "post script" for this option. */
/**
* Create folder selection box
+ *
+ * @param boolean $multiple_select When TRUE, the select widget
+ * will allow multiple selections
+ * (OPTIONAL; default is FALSE
+ * (single select list))
+ *
* @return string html formated selection box
+ *
*/
- function createWidget_FolderList() {
+ function createWidget_FolderList($multiple_select=FALSE) {
// possible values might include a nested array of
// possible values (list of folders)
// list of folders (boxes array)
//
if (is_array($text)) {
- $option_list = array_merge($option_list, sqimap_mailbox_option_array(0, array(strtolower($this->value)), 0, $text, $this->folder_filter));
+ $option_list = array_merge($option_list, sqimap_mailbox_option_array(0, 0, $text, $this->folder_filter));
// just one option here
//
$option_list = array('ignore' => _("unavailable"));
- return addSelect('new_' . $this->name, $option_list, $this->value, TRUE, $this->aExtraAttribs) . htmlspecialchars($this->trailing_text);
+ // OK to use sq_htmlspecialchars() below because addSelect() already does
+ return addSelect('new_' . $this->name, $option_list, $this->value, TRUE, $this->aExtraAttribs, $multiple_select) . sq_htmlspecialchars($this->trailing_text);
}
return ($result);
}
-// vim: et ts=4