-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmove.ctp
More file actions
82 lines (73 loc) · 3.03 KB
/
move.ctp
File metadata and controls
82 lines (73 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* 移動画面View
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
?>
<?php $this->start('title_for_modal'); ?>
<?php echo __d('pages', 'Select move page'); ?>
<?php $this->end(); ?>
<?php echo $this->NetCommonsForm->create('Page', array(
'type' => 'put',
'url' => NetCommonsUrl::actionUrlAsArray(array('action' => 'move'))
)); ?>
<?php echo $this->NetCommonsForm->hidden('_NetCommonsUrl.redirect'); ?>
<?php echo $this->NetCommonsForm->hidden('Page.id', array('value' => Current::read('Page.id'))); ?>
<?php echo $this->NetCommonsForm->hidden('Page.room_id', array('value' => Current::read('Room.id'))); ?>
<?php echo $this->NetCommonsForm->hidden('Room.id', array('value' => Current::read('Room.id'))); ?>
<?php echo $this->NetCommonsForm->unlockField('Page.parent_id'); ?>
<?php echo $this->NetCommonsForm->hidden('Page.type', array('value' => 'move')); ?>
<?php echo $this->MessageFlash->description(
__d('pages', 'Please select the destination of the "%s" page.', Hash::get($pages, Current::read('Page.id') . '.PagesLanguage.name'))
); ?>
<?php if ($treeList) : ?>
<table class="table table-hover">
<tbody>
<?php foreach ($treeList as $pageId) : ?>
<tr ng-class="{active: pageParentId === '<?php echo $pageId; ?>'}">
<td>
<?php echo $this->PagesEdit->indent($pageId); ?>
<?php if (Current::read('Page.parent_id') !== (string)$pageId) : ?>
<?php echo $this->NetCommonsForm->radio('Page.parent_id',
array($pageId => Hash::get($pages, $pageId . '.PagesLanguage.name')),
array(
'hiddenField' => false,
'ng-click' => 'pageParentId = \'' . $pageId . '\'',
'div' => array('class' => 'form-inline page-move-radio'),
)
); ?>
<?php else : ?>
<strong>
<?php echo h(Hash::get($pages, $pageId . '.PagesLanguage.name')); ?>
</strong>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="text-center">
<button name="cancel" type="button" ng-disabled="sending" ng-click="cancel()" class="btn btn-default btn-workflow">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
<?php echo __d('net_commons', 'Cancel'); ?>
</button>
<button type="submit" ng-disabled="(sending || ! pageParentId)" class="btn btn-primary btn-workflow" name="save">
<?php echo __d('net_commons', 'OK'); ?>
</button>
</div>
<?php else : ?>
<article class="not-found">
<?php echo __d('pages', 'Page not found.'); ?>
</article>
<div class="text-center">
<button name="cancel" type="button" ng-disabled="sending" ng-click="cancel()" class="btn btn-default btn-workflow">
<span class="glyphicon glyphicon-remove"></span> <?php echo __d('net_commons', 'Close'); ?>
</button>
</div>
<?php endif; ?>
<?php echo $this->NetCommonsForm->end();