Skip to content

Instantly share code, notes, and snippets.

@mikihicom mikihicom/forms.php

Last active Dec 27, 2016
What would you like to do?
//基本的には、削除ボタンが押せなくなればいいので、 disabledを使用することに。
$u = new User();
//削除不可の場合は、buttonタグに disabled を追加
if($u->isSuperUser() || $u->inGroup(Group::getByName('Administrators'))){ ?>
<button class="btn btn-danger btn-sm delete-form-answers"
<?php }else{ ?>
<button class="btn btn-danger btn-sm delete-form-answers"
name='ccm-submit-button' disabled>
<?php }
if($u->isSuperUser()|| $u->inGroup(Group::getByName('Administrators'))){
echo $ih->submit(t('Delete'), false, 'left', 'btn pull-right btn-danger delete-response');
echo $ih->submit(t('Delete'), false, 'left', 'btn pull-right btn-danger delete-response',['disabled'=>'disabled']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.