'conditions' => $conditions,
'recursive' => -1,
));
+
if (!empty($systems)) {
foreach ($systems as $k => $v) {
$systems[$k] = $this->{$this->modelClass}->restore_html($v);
+
+ // SingleSystem
+ if (isset($this->site_configs['System.singleSystem']['value']) && $this->site_configs['System.singleSystem']['value']) {
+ break;
+ }
}
}
function add() {
$systems = $this->_get_systems();
+ // SingleSystem
+ if (isset($this->site_configs['System.singleSystem']['value']) && $this->site_configs['System.singleSystem']['value']) {
+ $this->params['named']['system_id'] = key($systems);
+ }
+
if (isset($this->params['named']['system_id'])) {
$system = $this->Character->System->find('first', array(
'conditions' => array(
'System.set_npc',
)
));
- if (!empty($system['System']) && $system['System']['set_npc']) {
- $this->isNpc = true;
- }
+ }
+ if (isset($system['System']) && !empty($system['System']) && $system['System']['set_npc']) {
+ $this->isNpc = true;
}
if (!empty($this->data)) {
));
if (isset($this->params['named']['system_id']) && !empty($this->params['named']['system_id'])) {
echo '<div class="input select">';
- echo '<label for="CharacterSystemId">'. __('System').'</label>';
+ echo '<label for="CharacterSystemId">'. __('System', true).'</label>';
echo $form->input('system_id', array(
'type' => 'hidden',
'value' => $this->params['named']['system_id'],