diff options
Diffstat (limited to '')
| -rw-r--r-- | app/view/datamods.php | 55 | ||||
| -rw-r--r-- | app/view/stdpage.php | 7 | 
2 files changed, 61 insertions, 1 deletions
| diff --git a/app/view/datamods.php b/app/view/datamods.php index e27404c..e700043 100644 --- a/app/view/datamods.php +++ b/app/view/datamods.php @@ -64,3 +64,58 @@ require_once "class/user.class.php";      </div>  <?php } ?> +<?php function newPad() : void { ?> + +    <div id="newPadModal" class="modal fade" tabindex="-1" role="dialog"> +        <div class="modal-dialog modal-sm" role="document"> +            <div class="modal-content"> +                <div class="modal-header"> +                    <button type="button" class="close" data-dismiss="modal"> +                        <span aria-hidden="true">×</span> +                    </button> + +                    <h4 class="modal-title"> +                        <span class="glyphicon glyphicon-edit"></span> Create new Pad +                    </h4> +                </div> + +                <div class="modal-body"> +                    <form method="post" action="<?=ap()?>"> +                        <?=\formctrl\formname( "dm-pad-add" )?> + +                        <div class="form-group"> +                            <label>Owner</label> + +                            <select name="input[owner]" class="form-control selectpicker"> +                                <optgroup label="Users"> +                                    <option data-icon="glyphicon-user" value="<?=\user::getCurrent()->guid?>"> +                                        <?=\user::getCurrent()->getDisplayName()?> +                                    </option> +                                </optgroup> + +                                <optgroup label="Groups"> +                                    <?php foreach (\user::getCurrent()->getGroups_ordByOwnByName() as $g) { ?> +                                        <?php if (\user::getCurrent()->canCreateSub($g)) { ?> +                                            <option data-icon="glyphicon-th" value="<?=$g->guid?>"> +                                                <?=$g->getDisplayName()?> +                                            </option> +                                        <?php } ?> +                                    <?php } ?> +                                </optgroup> +                            </select> +                        </div> + +                        <?=\formctrl\text( "Pad Name", "name" )?> + +                        <button type="submit" class="btn btn-success pull-right"> +                            <span class="glyphicon glyphicon-plus"></span> Add +                        </button> + +                        <p> </p> +                    </form> +                </div> +            </div> +        </div> +    </div> + +<?php } ?> diff --git a/app/view/stdpage.php b/app/view/stdpage.php index 478c414..1629dbf 100644 --- a/app/view/stdpage.php +++ b/app/view/stdpage.php @@ -164,7 +164,11 @@ require_once "view/datamods.php";  <?php function nav() : void { ?>      <?=about()?> -    <?=\datamods\newGroup()?> + +    <?php if (\user::getCurrent()) { ?> +        <?=\datamods\newGroup()?> +        <?=\datamods\newPad()?> +    <?php } ?>      <nav class="navbar navbar-inverse navbar-fixed-top">          <div class="container-fluid"> @@ -208,6 +212,7 @@ require_once "view/datamods.php";                              <ul class="dropdown-menu">                                  <li><a href="#" data-toggle="modal" data-target="#newGroupModal">New Group</a></li> +                                <li><a href="#" data-toggle="modal" data-target="#newPadModal">New Pad</a></li>                              </ul>                          </li>                      </ul> | 
