<?php

defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class wishlogueViewwishlogueadspace extends JViewLegacy {

    public function display($tpl = NULL) {

        if (JRequest::getVar('task') == 'add') { // THIS CODE IS TO ADD A NEW CATEGORY
            JToolBarHelper::title('Add new Ad');
            JToolBarHelper::save(); //view the save toolbar
            JToolBarHelper::cancel(); //view the cancel toolbar
            JToolBarHelper::preferences('com_wishlogue');
            parent::display();
        }

        if (JRequest::getVar('task') == '') { //THIS CODE IS TO DISPLAY LIST OF CATEGORIES
            JToolBarHelper::title('Wishlogue ads');
            JToolBarHelper::addNew();
            JToolBarHelper::divider();
            JToolBarHelper::publishList(); //view the publish toolbar
            JToolBarHelper::divider();
            JToolBarHelper::unpublishList();
            JToolBarHelper::divider();
            JToolBarHelper::trash();
            JToolBarHelper::divider();
            JToolBarHelper::cancel();
            JToolBarHelper::divider();
            JToolBarHelper::preferences('com_wishlogue');
            $model = $this->getModel();
            $getallads = $model->getallads();
            $this->assignRef('getallads', $getallads);
            parent::display();
        }
    }
}

?>