<?php
/**
 * Joomla! 1.5 component NS Pro
 *
 * @version $Id: view.html.php 2009-04-28 01:47:12 svn $
 * @author Christopher Mavros
 * @package Joomla
 * @subpackage NS Pro
 * @license GNU/GPL
 *
 * Pro Version of Newsletter Subscriber.
Provides:
Keep subscriptions in database
Unsubscription Page
Optional Confirmation on subscribe/unsubscribe
Subscription Manager
Send Newsletters
Newsletter Manager
Subscription Statistics
Unique Emails (does not allow duplicates)
 *
 * This component file was created using the Joomla Component Creator by Not Web Design
 * http://www.notwebdesign.com/joomla_component_creator/
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Import Joomla! libraries
jimport( 'joomla.application.component.view');
class NsproViewNewsletters extends JView {

    function display($tpl = null)
    {

        global $mainframe, $option;
        $model      =& $this->getModel();
        $limit      = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
        $limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' );

        JToolBarHelper::title(   JText::_( 'NS Pro Manager' ), 'generic.png' );
        JToolBarHelper::customX('nsend', 'send.png', 'send.png', 'Send Newsletter', true, true);
        JToolBarHelper::deleteList('Are you sure you want to delete all selected items?', 'nremove', 'Delete');
        JToolBarHelper::editListX('nedit', 'Edit');
        JToolBarHelper::addNewX('nedit', 'New');

        jimport('joomla.html.pagination');
        $total = $model->getNewslettersCount();

        $pagination = new JPagination( $total, $limitstart, $limit );

        $this->assignRef('pagination',  $pagination);

        $newsletters = $model->getNewsletters($limit, $limitstart);

        $this->assignRef('newsletters', $newsletters);

        $nCount = $model->getNewslettersCount($limit, $limitstart);

        $this->assignRef('nCount', $nCount);

        parent::display($tpl);
    }
}
?>