/**
  * Method to test modal().
  *
  * @return void
  *
  * @covers Windwalker\Helper\ModalHelper::modal
  */
 public function testModal()
 {
     // Reset Loaded
     $this->reflectedLoaded->setValue($this->originalLoaded);
     // Execute method
     ModalHelper::modal('tag');
     // Test if JHtmlBootstrap::modal did executed
     $this->assertArrayHasKey('JHtmlBootstrap::modal', $this->reflectedLoaded->getValue());
 }
Exemple #2
0
 /**
  * Configure the toolbar button set.
  *
  * @param   array   $buttonSet Customize button set.
  * @param   object  $canDo     Access object.
  *
  * @return  array
  */
 protected function configureToolbar($buttonSet = array(), $canDo = null)
 {
     $buttonSet = array();
     $buttonSet['import_per_item'] = array('handler' => function () {
         JToolBarHelper::custom('item.saveall', 'new', 'new', 'COM_FBIMPORTER_IMPORT', true);
     }, 'access' => 'core.create', 'priority' => 1000);
     $buttonSet['import_as_one_article'] = array('handler' => function () {
         \Windwalker\Helper\ModalHelper::modal('saveAsCombinedModal');
         $bar = JToolbar::getInstance('toolbar');
         $option = array('class' => 'btn btn-small btn-success toolbar', 'icon' => 'icon-new icon-white');
         $title = JText::_('COM_FBIMPORTER_IMPORT_AS_COMBINED');
         $dhtml = \Windwalker\Helper\ModalHelper::modalLink($title, 'saveAsCombinedModal', $option);
         $bar->appendButton('Custom', $dhtml, 'new');
     }, 'access' => 'core.create', 'priority' => 800);
     $buttonSet['refresh'] = array('handler' => function () {
         JToolBarHelper::custom('items.refresh', 'refresh', 'refresh', 'COM_FBIMPORTER_REFRESH', false);
     }, 'priority' => 600);
     $buttonSet['option'] = array('handler' => 'preferences', 'access' => 'core.edit', 'priority' => 100);
     return $buttonSet;
 }