params = JComponentHelper::getParams('com_mc'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->state = $this->get('State'); $this->author = $this->get('Authorslist'); /*$this->bookauthor = $this->get('BooksAuthorslist');*/ //$this->tag = $this->get('Tagslist'); /*$this->booktag = $this->get('BooksTagslist');*/ $this->folderlist = $this->get('FolderList'); if ($this->item->docsfolder != ''){ $this->docslist = JFolder::files(JPATH_ROOT.DS.$this->item->docsfolder.DS, '', '', '', array('.svn', 'CVS','.DS_Store','__MACOSX', 'index.html')); } //$document = &JFactory::getDocument(); //$document->addScript( '/administrator/components/com_abook/assets/javascript/functions.js' ); JHTML::script(Juri::base() . 'components/com_abook/assets/javascript/functions.js'); //JHTML::_('script','components/com_abook/assets/javascript/functions.js'); $this->config = JComponentHelper::getParams( 'com_mc' ); $this->imageconfig= JComponentHelper::getParams('com_media'); $this->session= JFactory::getSession(); $this->canDo = McHelper::getActions($this->state->get('filter.category_id')); if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); } protected function addToolbar() { JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $isNew = ($this->item->id == 0); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); $canDo = McHelper::getActions($this->state->get('filter.category_id'), $this->item->id); $icon = $isNew ? 'bookadd' : 'bookedit'; JToolBarHelper::title(JText::_('Mc Event Manager:'.($checkedOut ? 'View Event' : ($isNew ? 'Add Event' : 'Edit Event'))), $icon); $document = JFactory::getDocument(); //$document->addStyleSheet('components/com_abook/assets/css/com_abook.css'); // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('event.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('event.save', 'JTOOLBAR_SAVE'); JToolbarHelper::save2new('event.save2new'); JToolbarHelper::save2copy('event.save2copy'); } if (empty($this->item->id)) { JToolBarHelper::cancel('event.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('event.cancel', 'JTOOLBAR_CLOSE'); } } }