示例#1
0
            $attribs[] = array('label' => $form->labelEx($model, 'memory'), 'value' => $model->memory . ' ' . Yii::t('mc', 'MB'), 'cssClass' => 'adv');
        }
    }
    $attribs[] = array('label' => $form->labelEx($model, 'kick_delay'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->textField($model, 'kick_delay') . ' ' . $form->error($model, 'kick_delay'), 'hint' => Yii::t('mc', 'After how many milliseconds to kick players without access'));
    if (Yii::app()->user->isSuperuser() || $settings->user_schedule) {
        $attribs[] = array('label' => $form->labelEx($model, 'autosave'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($model, 'autosave') . ' ' . $form->error($model, 'autosave'), 'hint' => Yii::t('mc', 'Regularly save the world to the disk'));
    }
    $attribs[] = array('label' => $form->labelEx($model, 'announce_save'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($model, 'announce_save') . ' ' . $form->error($model, 'announce_save'), 'hint' => Yii::t('mc', 'Inform the players when the world has been saved'));
    if (Yii::app()->user->isSuperuser() || $edit && Yii::app()->params['user_chunkster']) {
        $attribs[] = array('label' => Yii::t('mc', 'Chunkster'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => CHtml::submitButton(Yii::t('mc', 'Run Chunkster'), array('name' => 'chunkster', 'confirm' => Yii::t('mc', 'This tool will only run when your server has been fully stopped first. Use it at your own risk.'), 'submit' => '', 'params' => array('run_chunkster' => 'true'))), 'hint' => Yii::t('mc', 'Chunkster is a tool that can fix corrupted worlds. Use it at your own risk and create a backup first.'));
    }
    $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attribs));
    $attribs = array();
    $attribs[] = array('label' => Yii::t('mc', 'Permissions'), 'value' => '', 'cssClass' => 'titlerow');
    if (Yii::app()->user->isSuperuser() || $settings->user_visibility) {
        $attribs[] = array('label' => $form->labelEx($settings, 'visible'), 'type' => 'raw', 'value' => $form->dropDownList($settings, 'visible', ServerConfig::getVisibility()) . ' ' . $form->error($settings, 'visible'), 'hint' => Yii::t('mc', 'Visibility in the Multicraft server list'));
        $attribs[] = array('label' => $form->labelEx($model, 'default_level'), 'type' => 'raw', 'value' => $form->dropDownList($model, 'default_level', $defaultRoles) . ' ' . $form->error($model, 'default_level'), 'hint' => Yii::t('mc', 'Role assigned to players on first connect ("No Access" for whitelisting)'));
    }
    $attribs[] = array('label' => $form->labelEx($settings, 'ip_auth_role'), 'type' => 'raw', 'value' => $form->dropDownList($settings, 'ip_auth_role', $ipRoles) . ' ' . $form->error($settings, 'ip_auth_role'), 'hint' => Yii::t('mc', 'For users whose IP matches a player ingame'));
    $attribs[] = array('label' => CHtml::label(Yii::t('mc', 'Cheat Role'), 'cheat_role'), 'type' => 'raw', 'value' => CHtml::dropDownList('cheat_role', $settings->give_role, $ipRoles), 'hint' => Yii::t('mc', 'Role required to use web based give/teleport'));
    $attribs[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::submitButton($model->isNewRecord ? Yii::t('mc', 'Create') : Yii::t('mc', 'Save')));
    if (isset($data['resources'])) {
        $set = Setting::model()->findByPk('resourceCheckInterval');
        if (!$set || $set->value > 0) {
            echo '<div id="resources-ajax">' . $data['resources'] . '</div>';
        }
    }
    ?>
<br/>

<?php