use formField()

This commit is contained in:
Uwe Steinmann 2018-06-20 20:40:47 +02:00
parent 0a841b22aa
commit 2d27a491c3

View File

@ -130,50 +130,50 @@ $(document).ready(function() {
?> ?>
<br> <br>
<form action="../op/op.FolderNotify.php" method="post" id="form1" name="form1"> <form class="form-horizontal" action="../op/op.FolderNotify.php" method="post" id="form1" name="form1">
<?php echo createHiddenFieldWithKey('foldernotify'); ?> <?php echo createHiddenFieldWithKey('foldernotify'); ?>
<input type="Hidden" name="folderid" value="<?php print $folder->getID()?>"> <input type="hidden" name="folderid" value="<?php print $folder->getID()?>">
<input type="Hidden" name="action" value="addnotify"> <input type="hidden" name="action" value="addnotify">
<table class="table-condensed"> <?php
<tr> $options = array();
<td><?php printMLText("user");?>:</td> $options[] = array('-1', getMLText("select_one"));
<td> if ($user->isAdmin()) {
<select name="userid"> $allUsers = $dms->getAllUsers($sortusersinlist);
<option value="-1"><?php printMLText("select_one");?> foreach ($allUsers as $userObj) {
<?php if (!$userObj->isGuest() && !$userObj->isDisabled() && ($folder->getAccessMode($userObj) >= M_READ) && !in_array($userObj->getID(), $userNotifyIDs))
if ($user->isAdmin()) { $options[] = array($userObj->getID(), htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()));
foreach ($allUsers as $userObj) { }
if (!$userObj->isGuest() && ($folder->getAccessMode($userObj) >= M_READ) && !in_array($userObj->getID(), $userNotifyIDs)) } elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) {
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getFullName()) . "\n"; $options[] = array($user->getID(), htmlspecialchars($user->getLogin() . " - " .$user->getFullName()));
} }
} $this->formField(
elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) { getMLText("user"),
print "<option value=\"".$user->getID()."\">" . htmlspecialchars($user->getFullName()) . "\n"; array(
} 'element'=>'select',
?> 'id'=>'userid',
</select> 'name'=>'userid',
</td> 'options'=>$options
</tr> )
<tr> );
<td><?php printMLText("group");?>:</td> $options = array();
<td> $options[] = array('-1', getMLText("select_one"));
<select name="groupid"> $allGroups = $dms->getAllGroups();
<option value="-1"><?php printMLText("select_one");?> foreach ($allGroups as $groupObj) {
<?php if (($user->isAdmin() || $groupObj->isMember($user,true)) && $folder->getGroupAccessMode($groupObj) >= M_READ && !in_array($groupObj->getID(), $groupNotifyIDs)) {
foreach ($allGroups as $groupObj) { $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName()));
if (($user->isAdmin() || $groupObj->isMember($user,true)) && $folder->getGroupAccessMode($groupObj) >= M_READ && !in_array($groupObj->getID(), $groupNotifyIDs)) { }
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "\n"; }
} $this->formField(
} getMLText("group"),
?> array(
</select> 'element'=>'select',
</td> 'id'=>'groupid',
</tr> 'name'=>'groupid',
<tr> 'options'=>$options
<td></td> )
<td><input type="submit" class="btn" value="<?php printMLText("add") ?>"></td> );
</tr> $this->formSubmit(getMLText('add'));
</table> ?>
</form> </form>
<?php <?php