18 require_once SQ_LIB_PATH.
'/config/prefs.inc';
34 var $pref_vars = Array (
35 'SQ_INBOX_MAIL_PER_PAGE' => Array(
36 'name' =>
'inbox_pref_backend_mail_per_page',
37 'description' =>
'You can specify the number of emails per page',
50 $this->
Prefs($pref_file);
67 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
68 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
70 if (is_null($pref) || $pref ==
'SQ_INBOX_MAIL_PER_PAGE') {
72 $o->openField(translate($this->pref_vars[
'SQ_INBOX_MAIL_PER_PAGE'][
'name']));
75 if ($have_lock && $is_admin) {
76 text_box(
'prefs[SQ_INBOX_MAIL_PER_PAGE]', $this->pref_vars[
'SQ_INBOX_MAIL_PER_PAGE'][
'default'], 5);
78 echo array_get_index($this->pref_vars[
'SQ_INBOX_MAIL_PER_PAGE'],
'default', 5);
81 if (is_null($pref)) $o->closeField();
102 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
103 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
104 if (!$is_admin)
return FALSE;
109 if (isset($_POST[
'prefs'][
'SQ_INBOX_MAIL_PER_PAGE'])) {
112 if (!is_numeric($_POST[
'prefs'][
'SQ_INBOX_MAIL_PER_PAGE'])) {
113 trigger_localised_error(
'IBOX0001', E_USER_WARNING);
116 $mail_number = (int)$_POST[
'prefs'][
'SQ_INBOX_MAIL_PER_PAGE'];
119 if ($mail_number <= 0) {
120 trigger_localised_error(
'IBOX0001', E_USER_WARNING);
124 $this->pref_vars[
'SQ_INBOX_MAIL_PER_PAGE'][
'default'] = $mail_number;