$this->redirect(array('action'=>'index'));
}
- $characterSheet = $this->CharacterSheet->read(null, $id);
+ $characterSheet = $this->CharacterSheet->find('first', array(
+ 'conditions' => array('CharacterSheet.id' => $id),
+ 'fields' => '',
+ 'recursive' => 2,
+ 'contain' => array(
+ 'System' => array(
+ 'Character',
+ ),
+ )
+ ));
if (empty($characterSheet)) {
$this->Session->setFlash(__('Invalid CharacterSheet.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('characterSheets', $characterSheet);
+ // キャラシビュー表示
+ $skin_dir = $this->getSkinDir($characterSheet['CharacterSheet']['key_name']);
+ $view_link = null;
+ if (is_readable($skin_dir. 'view.ctp') && !empty($characterSheet['System']['Character'])) {
+ $view_link = Router::url(array(
+ 'controller' => 'characters',
+ 'action' => 'view',
+ 'prefix' => Configure::read('Routing.admin'),
+ $characterSheet['System']['Character'][0]['id'],
+ 'mode:'. $characterSheet['CharacterSheet']['key_name']), true
+ );
+ }
+ $this->set('view_link', $view_link);
+
+
$this->pageTitle .= " - ". __('CharacterSheets', true);
}
msgid "CharacterSheet deleted"
msgstr "キャラクターシートを削除しました。"
+#: /controllers/character_sheets_controller.php:136
+msgid "Check View"
+msgstr "表示確認"
+
#: /controllers/characters_controller.php:99;167;286
msgid "%s has been saved."
msgstr "%sを保存しました。"
$form->end('Submit').
"</fieldset>\n";
+
+ if (!empty($view_link)) {
+ $body .= $html->div('leftLink',
+ $html->link(
+ __('Check View', true),
+ $view_link ,
+ array(
+ 'target' => 'sampleView',
+ )
+ )
+ );
+ }
+
$footer = null;
echo $this->renderElement('box', array(
));
?>
-</div>
+</div>