1 (edited by nakome 2014-08-21 00:00:08)

Topic: Total info Dashboard snippet

Add this in Plugins/box/dashboard/views/backend/index.view.php

<!-- Total info -->
<?php 
    $pages = new Table('pages');
    $pages_list = $pages->select('[slug!="error404"]');

    $blocks_path = STORAGE . DS  . 'blocks' . DS;
    $blocks_list = File::scan($blocks_path, '.block.html');

    $snippets_path = STORAGE . DS  . 'snippets' . DS;
    $snippets_list = File::scan($snippets_path, '.snippet.php');

    $users = new Table('users');
    $users_list = $users->select(null,'all');
?>

<div class="well dashboard-well">
    <div class="row">
        <div class="col-md-3">
            <h4>Pages</h4>
            <p><b>Total:</b>  <?php echo count($pages_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=pages&action=add_page">New Page</a>
        </div>
        <div class="col-md-3">
            <h4>Blocks</h4>
            <p><b>Total:</b>  <?php echo count($blocks_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=blocks&action=add_block">New Block</a>
        </div>
        <div class="col-md-3">
            <h4>Snippets</h4>
            <p><b>Total:</b>  <?php echo count($snippets_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=snippets&action=add_snippet">New Snippet</a>
        </div>
        <div class="col-md-3">
            <h4>Users</h4>
            <p><b>Total:</b>  <?php echo count($users_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=users&action=add">New User</a>
        </div>
    </div>
</div>
<!-- Total info -->

Preview:
Screenshot

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

Re: Total info Dashboard snippet

Image link is broken

Monstra Loves You! Give some love back!

Re: Total info Dashboard snippet

Ups Sorry fixed smile

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

Re: Total info Dashboard snippet

Hi everyone,
especially nakome.

I did russian version of Total info Dashboard snippet.
It's my very first little step between  Monstra Giants!!!

I've decided to stop here after quite  a long wandering around of internet "infinity".
Monstra  cool!


*don’t repair it if it ain’t broken


<!-- Total info -->
<?php 
    $pages = new Table('pages');
    $pages_list = $pages->select('[slug!="error404"]');

    $blocks_path = STORAGE . DS  . 'blocks' . DS;
    $blocks_list = File::scan($blocks_path, '.block.html');

    $snippets_path = STORAGE . DS  . 'snippets' . DS;
    $snippets_list = File::scan($snippets_path, '.snippet.php');

    $users = new Table('users');
    $users_list = $users->select(null,'all');
?>

<div class="well dashboard-well">
    <div class="row">
        <div class="col-md-3">
            <h4>Страница</h4>
            <p><b>Всего:</b>  <?php echo count($pages_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=pages&action=add_page">Новая Страница</a>
        </div>
        <div class="col-md-3">
            <h4>Блоки</h4>
            <p><b>Всего:</b>  <?php echo count($blocks_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=blocks&action=add_block">Новый Блок</a>
        </div>
        <div class="col-md-3">
            <h4>Сниппеты</h4>
            <p><b>Всего:</b>  <?php echo count($snippets_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=snippets&action=add_snippet">Новый Сниппет</a>
        </div>
        <div class="col-md-3">
            <h4>Пользователи</h4>
          <p><b>Всего:</b>  <?php echo count($users_list);?></p>
            <a href="<?php echo Site::url(); ?>/admin/index.php?id=users&action=add">Новый Пользователь</a>
        </div>
    </div>
</div>
<!-- Total info -->