Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kteraguchi committed May 25, 2017
2 parents b40359f + e5f7c88 commit 39a6d3f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions View/Elements/UserManager/delete_form.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* 会員削除テンプレート
*
* @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
*/
?>

<div class="nc-danger-zone" ng-init="dangerZone=false;">
<?php echo $this->NetCommonsForm->create('Users', array(
'type' => 'delete',
'url' => NetCommonsUrl::actionUrlAsArray(array('action' => 'delete'))
)); ?>

<uib-accordion close-others="false">
<div uib-accordion-group is-open="dangerZone" class="panel-danger">
<uib-accordion-heading class="clearfix">
<span style="cursor: pointer">
<?php echo __d('net_commons', 'Danger Zone'); ?>
</span>
<span class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': dangerZone, 'glyphicon-chevron-right': ! dangerZone}"></span>
</uib-accordion-heading>

<div class="pull-left">
<?php echo sprintf(__d('net_commons', 'Delete all data associated with the %s.'), __d('users', 'User')); ?>
</div>
<?php echo $this->NetCommonsForm->hidden('User.id'); ?>

<?php echo $this->Button->delete(
__d('net_commons', 'Delete'),
sprintf(__d('net_commons', 'Deleting the %s. Are you sure to proceed?'), __d('users', 'User')),
array('addClass' => 'pull-right')
); ?>
</div>
</uib-accordion>
<?php echo $this->NetCommonsForm->end(); ?>
</div>
2 changes: 1 addition & 1 deletion View/UserManager/edit.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
</div>

<?php if ($this->params['action'] === 'edit' && $canUserDelete) : ?>
<?php echo $this->element('Users.Users/delete_form'); ?>
<?php echo $this->element('UserManager.UserManager/delete_form'); ?>
<?php endif;

0 comments on commit 39a6d3f

Please sign in to comment.