return array('label' => $desc, 'type' => 'raw', 'value' => $val, 'hint' => $hint, 'cssClass' => !$advanced ? '' : (is_string($advanced) ? $advanced : 'adv'));
function set_s($p, $id, $desc, $hint = '', $advanced = false)
    return array('label' => $desc, 'type' => 'raw', 'value' => CHtml::dropDownList('settings[' . $id . ']', @$p['config'][$id] ? 'sel_true' : 'sel_false', array('sel_true' => Yii::t('admin', 'True'), 'sel_false' => Yii::t('admin', 'False'))), 'hint' => $hint, 'cssClass' => !$advanced ? '' : (is_string($advanced) ? $advanced : 'adv'));
$attr[] = set_t($p, 'admin_name', Yii::t('admin', 'Administrator Name'), '');
$attr[] = set_t($p, 'admin_email', Yii::t('admin', 'Administrator contact Email'), Yii::t('admin', 'empty to hide the "Support" menu entry'));
$attr[] = set_t($p, 'admin_ips', Yii::t('admin', 'Restrict Administrator IPs'), Yii::t('admin', 'Only allow these IPs to login as a superuser, empty for no restriction.'));
$attr[] = set_t($p, 'api_ips', Yii::t('admin', 'Restrict API IPs'), Yii::t('admin', 'Only allow these IPs to use the API, empty for no restriction.'));
$attr[] = set_s($p, 'api_enabled', Yii::t('admin', 'Enable the Multicraft API'));
$attr[] = set_s($p, 'hide_userlist', Yii::t('admin', 'Hide the userlist from normal users'));
$attr[] = set_t($p, 'min_pw_length', Yii::t('admin', 'Minimum password length'));
$attr[] = set_t($p, 'theme', Yii::t('admin', 'Theme'), '', false, Controller::themeSelection());
$attr[] = set_t($p, 'language', Yii::t('admin', 'Language'), '', false, Controller::languageSelection());
$attr[] = set_s($p, 'status_banner', Yii::t('admin', 'Generate server status banners (requires GD)'), '');
$attr[] = set_s($p, 'mail_welcome', Yii::t('admin', 'Welcome Mail'), Yii::t('admin', 'Send a welcome email when a new user is created'));
$attr[] = set_s($p, 'mail_assign', Yii::t('admin', 'Assign Mail'), Yii::t('admin', 'Send a notification email when a server is assigned to a user'));
$attr[] = set_t($p, 'default_display_ip', Yii::t('admin', 'Default Display IP'), Yii::t('admin', 'Used when a new server is created'));
$attr[] = set_s($p, 'show_memory', Yii::t('admin', 'Show Server Memory'), Yii::t('admin', 'Display server memory to users in the advanced section'));
$attr[] = set_s($p, 'use_bukget', Yii::t('admin', 'Use BukGet plugin list'), Yii::t('admin', 'See the How-To section on the Multicraft website'));
$attr[] = set_s($p, 'user_mysql', Yii::t('admin', 'Allow Users to Create a MySQL Database'), '', 'mysql_main');
$attr[] = set_t($p, 'user_mysql_host', Yii::t('admin', 'User DB Host'), Yii::t('admin', 'Set to * to use the daemon IP'), 'mysql');
$attr[] = set_t($p, 'user_mysql_user', Yii::t('admin', 'User DB Username'), Yii::t('admin', 'Must have database create privileges'), 'mysql');
$attr[] = set_t($p, 'user_mysql_pass', Yii::t('admin', 'User DB Password'), '', 'mysql');
$attr[] = set_t($p, 'user_mysql_prefix', Yii::t('admin', 'User DB Prefix'), Yii::t('admin', 'The user database is named prefix + server ID'), 'mysql');
$attr[] = set_t($p, 'user_mysql_admin', Yii::t('admin', 'User DB Admin Link'), Yii::t('admin', 'For example a link to phpMyAdmin. "*" will be replaced with the daemon IP'), 'mysql');
$attr[] = array('label' => Theme::img('icons/closed.png', '', array('id' => 'advImg', 'onclick' => 'return checkAdv()')), 'type' => 'raw', 'value' => CHtml::link(Yii::t('admin', 'Show Advanced Options'), '#', array('id' => 'advTxt', 'onclick' => 'return checkAdv()')));
$attr[] = set_s($p, 'ftp_client_disabled', Yii::t('admin', 'Disable the integrated FTP client (net2ftp)'), '', true);
$attr[] = set_s($p, 'user_chunkster', Yii::t('admin', 'Allow Users to run the Chunkster tool'), Yii::t('admin', 'This requires more configuration, see the How-To section on the Multicraft website.'), true);
Example #2
    $val = '';
    if (!$list) {
        $val = CHtml::textField('settings[' . $id . ']', @$p['config'][$id]);
    } else {
        $val = CHtml::dropDownList('settings[' . $id . ']', @$p['config'][$id], $list);
    return array('label' => $desc, 'type' => 'raw', 'value' => $val, 'hint' => $hint);
function set_s($p, $id, $desc, $hint = '')
    return array('label' => $desc, 'type' => 'raw', 'value' => CHtml::dropDownList('settings[' . $id . ']', @$p['config'][$id] ? 'sel_true' : 'sel_false', array('sel_true' => 'True', 'sel_false' => 'False')), 'hint' => $hint);
echo 'Basic configuration. More settings will be available in the panel under Settings-&gt;Panel Configuration.<br/><br/>';
$attr[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton('Save'));
$attr[] = set_t($p, 'admin_email', 'Administrator contact Email', 'empty to hide the "Support" menu entry');
$attr[] = set_s($p, 'api_enabled', 'Enable the Multicraft API');
$attr[] = set_t($p, 'api_ips', Yii::t('admin', 'Restrict API IPs'), Yii::t('admin', 'Only allow these IPs to use the API, empty for no restriction.'));
$attr[] = set_s($p, 'hide_userlist', 'Hide the userlist from normal users');
$attr[] = set_s($p, 'ftp_client_disabled', 'Disable the integrated FTP client (net2ftp)');
$attr[] = set_t($p, 'theme', 'Theme', '', Controller::themeSelection());
$attr[] = set_t($p, 'language', 'Language', '', Controller::languageSelection());
if (@$p['config']['superuser'] != 'admin') {
    $attr[] = set_t($p, 'superuser', 'Root Superuser', 'Please create a user named "admin" and then set this to "admin"');
$attr[] = set_t($p, 'daemon_password', 'Password for daemon connections', 'Must be the same as "<b>password</b>" in your "<b>multicraft.conf</b>"');
$attr[] = set_t($p, 'login_tries', 'Number of login attempts before blocking', '0 to disable');
$attr[] = set_s($p, 'status_banner', 'Generate server status banners (requires GD)', '');
$attr[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton('Save'));
$this->widget('zii.widgets.CDetailView', array('data' => array(), 'attributes' => $attr));
echo CHtml::endForm();