tawfekov/ZF2EntityAudit

View on GitHub
view/zf2-entity-audit/index/viewrevision.phtml

Summary

Maintainability
Test Coverage
<h1>Entities changed in revision <?php echo $this->escapeHtml($revision->getRev()); ?></h1>

<div class="row">
    <div class="col-lg-12">
        <table class="table table-striped table-hover table-bordered ">
            <thead>
            <tr>
                <td>Id</td>
                <td>Entity Name</td>
                <td>Entity details</td>
            </tr>
            </thead>

            <tfoot>
            <tr>
                <td>&nbsp;</td>
                <td>
                    <span class="label label-success">Insert</span>
                    <span class="label label-warning">Update</span>
                    <span class="label label-danger">Delete</span>
                </td>
                <td>&nbsp;</td>
            </tr>
            </tfoot>

            <tbody>
            <?php foreach ($changedEntities as $ce): ?>
                <tr>
                    <?php $id = $ce->getId(); ?>
                    <td>
                        <a href="<?php echo $this->url(
                            "audit_viewdetails",
                            array(
                                "id" => $id["id"] ,
                                "className" => str_replace('\\', '_', $ce->getClassName()),
                                "rev" =>$revision->getRev()
                            )
                        );?>">
                            <?php echo $this->escapeHtml($id["id"]);?></a>
                    </td>
                    <td>
                            <span class="label label-<?php
                            switch ($ce->getRevisionType()) {
                                case 'INS':
                                    echo 'success';
                                    break;
                                case 'UPD':
                                    echo 'warning';
                                    break;
                                case 'DEL':
                                    echo 'danger';
                                    break;
                                default:
                                    echo 'info';
                            }
                            ?>">
                                <?php $displayClassName = str_replace($prefixToIgnore, '', $ce->getClassName()) ?>
                                    <?php echo $this->escapeHtml($displayClassName); ?>
                            </span>
                    </td>
                    <td>
                        <pre><?php $this->Dump($ce->getEntity()); ?></pre>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>

        </table>
    </div>
</div>