View file mc-master/modules/photo/helpers/photo_widget.php

File size: 1.03Kb
<?php

/**
 * MobileCMS
 *
 * Open source content management system for mobile sites
 *
 * @author MobileCMS Team <[email protected]>
 * @copyright Copyright (c) 2011-2019, MobileCMS Team
 * @link https://mobilecms.pro Official site
 * @license MIT license
 */


/**
 * Виджет фотоальбомов
 */
class photo_widget
{

    /**
     * Показ виджета
     */
    public static function display($widget_id)
    {
        $db = Registry::get('db');
        $albums = $db->get_one("SELECT COUNT(*) FROM #__photo_albums");
        $photos = $db->get_one("SELECT COUNT(*) FROM #__photo");

        return '<img src="' . URL . 'modules/photo/images/album.png" alt="" /> <a href="' . a_url('photo') . '">Фотоальбомы</a> <span class="count">[' . $albums . '/' . $photos . ']</span><br />';
    }

    /**
     * Настройка виджета
     */
    public static function setup($widget)
    {
        a_notice('Данный виджет не требует настройки', a_url('index_page/admin'));
    }

}

?>