예제 #1
0
 /**
  * visforms view display method
  * @return void
  **/
 public function display($tpl = null)
 {
     if ($this->getLayout() !== 'modal') {
         VisformsHelper::addSubmenu('visforms');
         $this->sidebar = JHtmlSidebar::render();
     }
     $app = JFactory::getApplication();
     $this->update_message = $app->getUserState('com_visforms.update_message');
     //only show update message once
     if (isset($this->update_message)) {
         $app->setUserState('com_visforms.update_message', null);
     }
     // Get data from the model
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->canDo = VisformsHelper::getActions();
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     $pagination = $this->get('Pagination');
     $this->assignRef('pagination', $pagination);
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal' && $this->getLayout() !== 'modal_data') {
         $this->addToolbar();
     }
     parent::display($tpl);
 }
예제 #2
0
 /**
  * Visform view display method
  *
  * @return void
  **/
 public function display($tpl = null)
 {
     VisformsHelper::addSubmenu('visforms');
     $this->sidebar = JHtmlSidebar::render();
     $doc = JFactory::getDocument();
     $css = '.icon-visform {background:url(../administrator/components/com_visforms/images/visforms_logo_32.png) no-repeat;}' . ' [class^="icon-visform"] {display: block; float: left; height: 32px; line-height: 32px; width: 32px;}' . '  .visformbottom {	text-align: center;	padding-top: 15px;	color: #999;}';
     $doc->addStyleDeclaration($css);
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_visforms/css/visforms_min.css');
     // What Access Permissions does this user have? What can (s)he do?
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->canDo = VisformsHelper::getActions($this->item->id);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $isNew = $this->item->id == 0;
     $text = $isNew ? JText::_('COM_VISFORMS_NEW') : JText::_('COM_VISFORMS_EDIT');
     JToolbarHelper::title(JText::_('COM_VISFORMS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'visform');
     if ($isNew) {
         if ($this->canDo->get('core.create')) {
             JToolbarHelper::apply('visform.apply');
             JToolbarHelper::save('visform.save');
             JToolbarHelper::save2new('visform.save2new');
             JToolbarHelper::divider();
             JToolbarHelper::custom('visform.fields', 'forms', 'forms', 'COM_VISFORMS_FIELDS', false);
             JToolbarHelper::divider();
         }
         JToolbarHelper::cancel('visform.cancel');
     } else {
         // Can't save the record if it's checked out.
         if (!$checkedOut) {
             if ($this->canDo->get('core.edit') || $this->canDo->get('core.edit.own') && $this->item->created_by == $userId) {
                 JToolbarHelper::apply('visform.apply');
                 JToolbarHelper::save('visform.save');
                 if ($this->canDo->get('core.create')) {
                     JToolbarHelper::save2new('visform.save2new');
                 }
             }
         }
         if ($this->canDo->get('core.create')) {
             JToolbarHelper::save2copy('visform.save2copy');
         }
         if (!$checkedOut) {
             if ($this->canDo->get('core.edit')) {
                 JToolbarHelper::divider();
                 JToolbarHelper::custom('visform.fields', 'forms', 'forms', 'COM_VISFORMS_FIELDS', false);
                 JToolbarHelper::divider();
             }
         }
         // for existing items the button is renamed `close`
         JToolbarHelper::cancel('visform.cancel', 'COM_VISFORMS_CLOSE');
     }
     JFactory::getApplication()->input->set('hidemainmenu', 1);
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_visforms/css/visforms.css');
     parent::display($tpl);
 }
예제 #3
0
 /**
  * HTML view display method
  *
  * @access  public
  * @param   string  $tpl  The name of the template file to parse
  * @return  void
  * @since   1.5.5
  */
 function display($tpl = null)
 {
     VisformsHelper::addSubmenu('visforms');
     $this->sidebar = JHtmlSidebar::render();
     $document = JFactory::getDocument();
     $css = '.icon-visform {background:url(../administrator/components/com_visforms/images/visforms_logo_32.png) no-repeat;}' . ' [class^="icon-visform"] {display: block; float: left; height: 32px; line-height: 32px; width: 32px;}' . '  .visformbottom {	text-align: center;	padding-top: 15px;	color: #999;}';
     $document->addStyleDeclaration($css);
     JToolbarHelper::title(JText::_('COM_VISFORMS_VISHELP'), 'visform');
     parent::display($tpl);
 }
예제 #4
0
 /**
  * visfields view display method
  * @return void
  * @since Joomla 1.6
  **/
 public function display($tpl = null)
 {
     $fid = JFactory::getApplication()->input->getInt('fid', -1);
     // Get data from the model
     $this->form = $this->get('Form');
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $pagination = $this->get('Pagination');
     $this->canDo = VisformsHelper::getActions($fid);
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     $user = JFactory::getUser();
     $doc = JFactory::getDocument();
     JToolbarHelper::title(JText::_('COM_VISFORMS_VISFORM_FIELDS'), 'visform');
     $css = '.icon-visform {background:url(../administrator/components/com_visforms/images/visforms_logo_32.png) no-repeat;}' . ' [class^="icon-visform"] {display: block; float: left; height: 32px; line-height: 32px; width: 32px;}' . '  .visformbottom {	text-align: center;	padding-top: 15px;	color: #999;}';
     $doc->addStyleDeclaration($css);
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_visforms/css/visforms_min.css');
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     VisformsHelper::addSubmenu('visforms');
     $this->sidebar = JHtmlSidebar::render();
     if ($this->canDo->get('core.create')) {
         JToolbarHelper::addNew('visfield.add');
     }
     if ($this->canDo->get('core.edit.state')) {
         JToolbarHelper::publishList('visfields.publish');
         JToolbarHelper::unpublishList('visfields.unpublish');
         JToolbarHelper::checkin('visfields.checkin');
     }
     if ($this->canDo->get('core.delete')) {
         JToolbarHelper::deleteList('COM_VISFORMS_DELETE_FIELD_TRUE', 'visfields.delete', 'COM_VISFORMS_DELETE');
     }
     if ($this->canDo->get('core.edit')) {
         JToolbarHelper::editList('visfield.edit');
     }
     // Add a batch button
     if ($user->authorise('core.create', 'com_visforms') && $user->authorise('core.edit', 'com_visforms') && $user->authorise('core.edit.state', 'com_visforms')) {
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         // Instantiate a new JLayoutFile instance and render the batch button
         $layout = new JLayoutFile('joomla.toolbar.batch');
         $dhtml = $layout->render(array('title' => $title));
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     JToolbarHelper::custom('visfields.forms', 'forms', 'forms', JText::_('COM_VISFORMS_SUBMENU_FORMS'), false);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
예제 #5
0
 /**
  * visforms view display method
  * @return void
  **/
 function display($tpl = null)
 {
     // Get data from the model
     VisformsHelper::addSubmenu('visforms');
     $this->sidebar = JHtmlSidebar::render();
     $this->item = $this->get('Item');
     $fid = JFactory::getApplication()->input->getInt('fid', -1);
     $this->canDo = VisformsHelper::getActions($fid);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $this->checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $this->fields = $this->get('VisdatasModel')->getDatafields();
     $this->addTitle();
     $this->addToolbar();
     parent::display($tpl);
 }
예제 #6
0
 /**
  * Visdata view display method
  *
  * @return void
  **/
 public function display($tpl = null)
 {
     if ($this->getLayout() !== 'modal') {
         VisformsHelper::addSubmenu('visforms');
         $this->sidebar = JHtmlSidebar::render();
     }
     $fid = JFactory::getApplication()->input->getInt('fid', 0);
     $this->canDo = VisformsHelper::getActions($fid);
     // We don't need toolbar and title in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addTitle();
         $this->addToolbar();
     }
     // Get data from the model
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->fields = $this->get('Datafields');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     $this->pagination = $this->get('Pagination');
     parent::display($tpl);
 }