Advertisement
sathyashrayan

jtoolbars

Jan 25th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. in view.php
  2. <?php
  3. // Check to ensure this file is included in Joomla!
  4. defined('_JEXEC') or die( 'Restricted access' );
  5. require_once(JPATH_COMPONENT.DS.'libraries'.DS.'baseview.class.php');
  6. class JongmanViewReservations extends JBaseView
  7. {
  8.           function display()
  9.          {
  10.                JHTML::_('behavior.modal');
  11.                JToolBarHelper::title('Jongman :: '.JText::_(COM_JONGMAN_MANAGE_RESERVATIONS));
  12.                JToolBarHelper::custom('reservation.view', 'preview' , 'preview', "View" );
  13.                JToolBarHelper::editList('reservation.edit');  
  14.                JToolBarHelper::deleteList('', 'reservation.remove', "Delete");
  15.         $rows = & $this->get("Items");
  16.                 $pagination = & $this->get("Pagination");
  17.                 $sorting = & $this->get("Sorting");
  18.                 $searchword = & $this->get("SearchWord");
  19.                 $schedule_id = $this->get("ScheduleId");
  20.                 $this->assignRef('rows', $rows);
  21.                 $this->assignRef('pagination', $pagination);
  22.                 $this->assignRef('sorting', $sorting);
  23.                 $this->assignRef('searchword', $searchword);
  24.                 $this->assignRef('scheduleid', $schedule_id);
  25.                 parent::display();
  26.   }
  27. }
  28.  
  29. in tmpl/default.php
  30.  
  31. <?phpdefined( '_JEXEC' ) or die( 'Restricted access' );
  32. jimport('joomla.application.component.view');
  33. jimport('joomla.html.toolbar');
  34. require_once(JPATH_ADMINISTRATOR.DS.'includes'.DS.'toolbar.php');
  35. class JBaseView extends JView
  36. {
  37.          function display($tpl=null)
  38.          {
  39.                      global $mainframe, $option;
  40.  
  41.                       JHTML::stylesheet('rounded.css', "components/$option/assets/css/");
  42.                       JHTML::stylesheet('layout.css', "components/$option/assets/css/");
  43.                       $bar = JToolBar::getInstance('toolbar');
  44.                       $bar->addButtonPath(JPATH_COMPONENT.DS.'assets'.DS.'images'.DS.'toolbar');
  45. ?>
  46.             <div id="my-header">
  47.        <div id="toolbar-box">
  48.                <div>
  49.                     <div>
  50.                          <div></div>
  51.                     </div>
  52.                 </div>
  53.        <div>
  54.  
  55.         <div></div>
  56.          </div>
  57.  <div>
  58.  <div>
  59.  <div></div>
  60.  </div>
  61.  </div>
  62.  </div>
  63. <div></div>
  64.           </div>
  65.             <div id="my-main">
  66.                 <?php parent::display($tpl);?>
  67.             </div>
  68. <?php  
  69.   }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement