joomla/com_wk1_6/admin/views/wk1s/view.html.php

<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_wk1
 *
 * @copyright   Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
 
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
/**
 * HTML View class for the wk1 Component
 *
 * @since  0.0.5
 */
class Wk1ViewWk1s extends JViewLegacy
{
    /**
     * Display the wk1s view 
     *
     * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
     *
     * @return  void
     */
    function display($tpl = null)
    {
        // Get data from the model
        $this->items        = $this->get('Items');
        $this->pagination    = $this->get('Pagination');
 
        // Check for errors.
        if (count($errors = $this->get('Errors')))
        {
            JError::raiseError(500, implode('<br />', $errors));
 
            return false;
        }
 
        // Set the toolbar
        $this->addToolBar(); 

        // Display the template
        parent::display($tpl);
    }

    /**
     * Add the page title and toolbar.
     *
     * @return  void
     *
     * @since   1.6
     */
    protected function addToolBar()    {
        JToolbarHelper::title(JText::_('COM_WK1_MANAGER_WK1S'));
        JToolbarHelper::addNew('wk1.add');
        JToolbarHelper::editList('wk1.edit');
        JToolbarHelper::deleteList('', 'wk1s.delete');
    }
}