*
 * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. http://www.fsf.org/
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
 * @package email
 * @subpackage hooks
 * @version $Id$
 */
list(, $acctnum) = explode('/', $_GET['prefix']);
if ($acctnum) {
    create_check_box('enable this email account', 'ex_account_enabled', 'Have this account available');
}
create_input_box('Account Name', 'account_name', 'This is the name that appears in the account combobox. If for leave this blank, your accounts will be given a standard name like Account[1]: Jane Doe, where Jane Doe is the name you give below as "Your full name". If you want to give an account a special name you can fill this in. No matter what, this is for your use, your emails will still use "Your full name" as your FROM name for email messages. Note that "Your full name" for your email account 0 is the name you gave in the phpgroupware setup.');
if ($acctnum) {
    create_input_box('Your full name', 'fullname', 'This is the name that appears in the users FROM address. The default mail account gets this value automatically from the phpgwapi. Additional accounts are created with the phpgwapi supplied fullname you can specify a different fullname for each extra email account.');
}
create_text_area('email signature', 'email_sig', 5, 64, 'This text will be appended to the bottom of the users emails for this email account. Currently, html tags are not supported. Also, forwarded email will NOT get this email sig appended to it for reasons such as it clutters the email, the forwarded part probably has its own email sig from the original author, which is really the information that matters the most.');
$lang_oldest = lang('oldest');
$lang_newest = lang('newest');
$options = array('old_new' => $lang_oldest . ' -> ' . $lang_newest, 'new_old' => $lang_newest . ' -> ' . $lang_oldest);
create_select_box('Default sorting order', 'default_sorting', $options, 'In the email index page, the page which lists all the mails in a folder, mail may be sorted by date, author, size, or subject, HOWEVER all of these need to be ordered from first to last, this options controlls what is first and last. For example, if sorting by date, the newest to oldest displays the most recent emails first, in decending order down to the oldest emails last.');
$options = array('1' => lang('Layout 1'), '2' => lang('Layout 2'));
create_select_box('Message List Layout', 'layout', $options, 'The email application offers 2 different layouts for the index page, that is the page that lists the emails in a folder. This page may be the page the user looks at the most and so different layouts, or looks, are offered.');
$options = array('evo' => lang('Evolution Style'), 'moz' => lang('Mozilla Modern Style'), 'noia' => lang('Noia @ Carlitus Style'));
create_select_box('Icon Theme', 'icon_theme', $options, 'The email application offers different icon image themes, groups of images of a similar style which are used in this email application. Currently the available themes are images based on Evolution by Ximian and the Netscape6 / Mozilla browser buttons. Additional themes are anticipated and welcome.');
$options = array('16' => lang('Small'), '24' => lang('Big'));
create_select_box('Icon Size', 'icon_size', $options, 'The email application offers different icon image themes, these icons can be big or small.');
$options = array('text' => lang('Text'), 'image' => lang('Image'), 'both' => lang('Both'));
create_select_box('Button Type', 'button_type', $options, 'The email application offers different button displays, these buttons can be text, images, or both.');
if (!$acctnum) {
    $options = array('none' => lang('none'), 'From' => lang('From'), 'ReplyTo' => lang('ReplyTo'));
    create_select_box('Show sender\'s email address with name', 'show_addresses', $options, 'This confusing and often misunderstood option is left over from this email apps origins as Aeromail by Mark Cushman. When viewing a list of emails in a folder, the FROM column may show you<br />a) the senders name only, if a name was provided,<br />b) the senders From email address, in addition to the senders name, or<br />c) the senders reply to address if it is different from the senders<br />from address, in addition to the senders name if it was provided. Typically users set this to none, which will show only the senders name. If no name was supplied by the sender, then the senders FROM email address will be shown, whether a seperate reply to address is provided has no effect on this, the FROM address is always used if the senders name is not provided.');
$this->bofelamimail = CreateObject('felamimail.bofelamimail', 'utf-8');
if ($this->bofelamimail->openConnection()) {
    $folderObjects = $this->bofelamimail->getFolderObjects();
    foreach ($folderObjects as $folderName => $folderInfo) {
        #_debug_array($folderData);
        $folderList[$folderName] = $folderInfo->displayName;
    }
    $this->bofelamimail->closeConnection();
}
$config = CreateObject('phpgwapi.config', 'felamimail');
$config->read();
$felamimailConfig = $config->config_data;
unset($config);
$refreshTime = array('0' => lang('disabled'), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '15' => '15', '20' => '20', '30' => '30');
create_select_box('Refresh time in minutes', 'refreshTime', $refreshTime);
create_text_area('email signature', 'email_sig', 3, 50);
$prefAskForMove = array('0' => lang('no'), '1' => lang('yes'));
create_select_box('Do you want to be asked for confirmation before moving selected messages to another folder?', 'prefaskformove', $prefAskForMove);
$forwardOptions = array('asmail' => lang('forward as attachment'), 'inline' => lang('forward inline'));
create_select_box('how to forward messages', 'message_forwarding', $forwardOptions);
$sortOrder = array('0' => lang('date(newest first)'), '1' => lang('date(oldest first)'), '3' => lang('from(A->Z)'), '2' => lang('from(Z->A)'), '5' => lang('subject(A->Z)'), '4' => lang('subject(Z->A)'), '7' => lang('size(0->...)'), '6' => lang('size(...->0)'));
create_select_box('Default sorting order', 'sortOrder', $sortOrder);
$selectOptions = array('0' => lang('no'), '1' => lang('yes'), '2' => lang('yes') . ' - ' . lang('small view'));
create_select_box('show new messages on main screen', 'mainscreen_showmail', $selectOptions);
$newWindowOptions = array('1' => lang('only one window'), '2' => lang('allways a new window'));
create_select_box('display messages in multiple windows', 'message_newwindow', $newWindowOptions);
$deleteOptions = array('move_to_trash' => lang('move to trash'), 'mark_as_deleted' => lang('mark as deleted'), 'remove_immediately' => lang('remove immediately'));
create_select_box('when deleting messages', 'deleteOptions', $deleteOptions);
$composeOptions = array('html' => lang('html'), 'text' => lang('text/plain'));
create_select_box('start new messages with mime type plain/text or html?', 'composeOptions', $composeOptions);
$htmlOptions = array('never_display' => lang('never display html emails'), 'only_if_no_text' => lang('display only when no plain text is available'), 'always_display' => lang('always show html emails'));
create_select_box('Default vendor type', 'default_vendor_category', $_categories_vendor, 'which agreement');
create_input_box('With of textarea', 'textareacols', 'With of textarea in forms');
create_input_box('Height of textarea', 'textarearows', 'Height of textarea in forms');
create_select_box('show horisontal menues', 'horisontal_menus', array('no' => 'No', 'yes' => 'Yes'), 'Horisontal menues are shown in top of page');
create_select_box('remove navbar', 'nonavbar', array('no' => 'No', 'yes' => 'Yes'), 'Navigation bar is removed');
create_select_box('Tabel export format', 'export_format', array('excel' => 'Excel', 'csv' => 'CSV', 'ods' => 'ODS'), 'Choose which format to export from the system for tables');
$default = 'Til: __vendor_name__';
$default .= "\n";
$default .= "\n" . 'Fra: __organisation__';
$default .= "\n" . 'Saksbehandler: __user_name__, ressursnr: __ressursnr__';
$default .= "\n";
$default .= "\n" . '__location__';
$default .= "\n";
$default .= "\n" . '[b]Beskrivelse av oppdraget:[/b]';
$default .= "\n" . '__order_description__';
$default .= "\n";
$default .= "\n" . '[b]Kontakt på bygget:[/b]';
$default .= "\n";
$default .= "\n" . '__contact_name__';
$default .= "\n" . '__contact_email__';
$default .= "\n" . '__contact_phone__';
$default .= "\n";
$default .= "\n" . '[b]Faktura må merkes med ordrenummer: __order_id__ og ressursnr.: __ressursnr__[/b]';
$default .= "\n";
$default .= "\n" . 'Med hilsen';
$default .= "\n" . '__user_name__';
$default .= "\n" . '__user_phone__';
$default .= "\n" . '__user_email__';
$default .= "\n" . '__organisation__';
create_text_area('order email', 'order_email_template', 10, 60, '', $default);
Example #4
0
/**
 * Create text-area or inputfield with subtitution-variables
 *
 * @param string $label Untranslated label
 * @param string $name Name of the preference 
 * @param $rows Row of the textarea or input-box ($rows==1)
 * @param $cols Column of the textarea or input-box
 * @param string $help Untranslated help-text
 * @param string $default Default-value
 * @param $vars2 array with extra substitution-variables of the form key => help-text
 * @param boolean $subst_help
 */
function create_notify($label, $name, $rows, $cols, $help = '', $default = '', $vars2 = '', $subst_help = True)
{
    global $t, $prefs, $notifys;
    $vars = $GLOBALS['phpgw']->preferences->vars;
    if (is_array($vars2)) {
        $vars = array_merge($vars, $vars2);
    }
    $prefs[$name] = $GLOBALS['phpgw']->preferences->lang_notify($prefs[$name], $vars);
    $notifys[$name] = $vars;
    // this gets saved in the app_session for re-translation
    $help = $help ? lang($help) : '';
    if ($subst_help) {
        $help .= '<p><b>' . lang('Substitutions and their meanings:') . '</b>';
        foreach ($vars as $var => $var_help) {
            $lname = ($lname = lang($var)) == $var . '*' ? $var : $lname;
            $help .= "<br />\n" . '<b>$$' . $lname . '$$</b>: ' . $var_help;
        }
        $help .= "</p>\n";
    }
    if ($rows == 1) {
        create_input_box($label, $name, $help, $default, $cols, '', '', False);
    } else {
        create_text_area($label, $name, $rows, $cols, $help, $default, False);
    }
}