Skip to content

Instantly share code, notes, and snippets.

@KarlBaumann
Created December 16, 2016 13:17
Show Gist options
  • Save KarlBaumann/2bf7979eb7c43e73f79ae6c8a7fa5edd to your computer and use it in GitHub Desktop.
Save KarlBaumann/2bf7979eb7c43e73f79ae6c8a7fa5edd to your computer and use it in GitHub Desktop.
<?php
/**
* Created by PhpStorm.
* User: baumanisk
* Date: 12/08/2016
* Time: 14:16
*
* @version 1.1.0
*
* @var int $colCount
* @var string $url
* @var string $head
* @var array $mapping
* @var stdClass $rules
*/
?>
<div class="ts-analytics col-lg-12">
<div class="row row-eq-height">
<div class="col-lg-12">
<br>
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Matrix</a></li>
<li><a href="#tab2" data-toggle="tab">Auto Userright Assigner</a></li>
</ul>
<br>
<div id="my-tab-content" class="tab-content">
<div class="tab-pane active" id="tab1">
<div class="row">
<div class="ts-analytics col-lg-12">
<button type="button" data-toggle="modal" data-target="#confirm-delete" class="run-script btn btn-danger">Run File name recognition script</button>
<button type="button" class="reset btn btn-default">Reset Search</button>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-info">
<input type="checkbox" class=toggle-assigned autocomplete="off"><span>Hide Old and Already Assigned</span>
</label>
</div>
<button type="button" class="btn btn-default popover-button">
Visible Columns
</button>
<div class="hidden">
<div class="popover-target"></div>
</div>
</div>
</div>
<table id="media-access" class="bootstrap-popup focus-highlight">
<thead>
<tr class="tablesorter-ignoreRow">
<td class="pager" colspan="<?=$colCount?>">
<img src="<?=$url?>/first.png" class="first"/>
<img src="<?=$url?>/prev.png" class="prev"/>
<span class="pagedisplay"></span>
<!-- this can be any element, including an input -->
<img src="<?=$url?>/next.png" class="next"/>
<img src="<?=$url?>/last.png" class="last"/>
<select class="pagesize">
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="200">200</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2000">2000</option>
</select>
<select class="gotoPage" title="Select page number">
</select>
</td>
</tr>
<tr>
<th data-sorter=false data-filter=false class="fixed">ID</th>
<th data-sorter=false data-filter=false class="fixed">Upload date (GMT)</th>
<th class="fixed">Media files</th>
<?=$head?>
</tr>
</thead>
<tbody>
<!-- tbody will be loaded via JSON -->
</tbody>
<tfoot>
<tr>
<td class="pager" colspan="<?=$colCount?>">
<img src="<?=$url?>/first.png" class="first"/>
<img src="<?=$url?>/prev.png" class="prev"/>
<span class="pagedisplay"></span>
<!-- this can be any element, including an input -->
<img src="<?=$url?>/next.png" class="next"/>
<img src="<?=$url?>/last.png" class="last"/>
<select class="pagesize">
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="200">200</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2000">2000</option>
</select>
</td>
</tr>
</tfoot>
</table>
</div>
<!--TAB2 TABLE STARTS-->
<div class="tab-pane" id="tab2">
<div class="row">
<div class="control-group col-sm-12" id="fields">
<div class="alert alert-info">
<p>To change products and their relation to userrights, please speak with <a href="mailto:karlis.baumanis@icis.com">Karl</a>.</p>
</div>
<div class="controls">
<form role="form" autocomplete="off" class="row">
<?php foreach ($mapping as $product => $data) {
$products = $rules ? $rules->{$product} : $data['names']; //if rules are not set yet, use the hardcoded ones ?>
<div class='product col-xs-2'>
<h1 class=product-title><?=$product?></h1>
<?php foreach ($products as $name) { ?>
<div class='entry input-group'>
<input class='form-control prefix' name='fields[]' type='text' value='<?=$name?>' readonly/>
<span class='input-group-btn'>
<button class='btn btn-remove btn-danger' type='button'>
<span class='glyphicon glyphicon-minus'></span>
</button>
</span>
</div>
<?php } ?>
<div class='entry input-group'>
<input class='form-control' name='fields[]' type='text' placeholder='Enter new rule here'/>
<span class='input-group-btn'>
<button class='btn btn-success btn-add' type='button'>
<span class='glyphicon glyphicon-plus'></span>
</button>
</span>
</div>
</div>
<?php } ?>
</form>
<br>
<small>Press <span class="glyphicon glyphicon-plus gs"></span> to add another form field :)</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Confirm Userright Rewrite</h4>
</div>
<div class="modal-body">
<p>You are about to reset rights for files that have known patterns in their names. If you or somebody else has set rights for these files manually, this information will be lost.</p>
<br>
<p>This procedure is irreversible, do you want to proceed?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-ok">Yes</button>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment