toolbar() public method

Creates a new Toolbar
public toolbar ( array $config = [] ) : Toolbar
$config array The configuration values for the Toolbar object
return FOF30\Toolbar\Toolbar
Esempio n. 1
0
 /**
  * @group           SwitchFactory
  * @covers          FOF30\Factory\SwitchFactory::toolbar
  * @dataProvider    SwitchFactoryDataprovider::getTestToolbar
  */
 public function testToolbar($test, $check)
 {
     $msg = 'SwitchFactory::toolbar %s - Case: ' . $check['case'];
     $container = new TestContainer(array('componentName' => $test['component']));
     $platform = $container->platform;
     $platform::$isAdmin = $test['backend'];
     $factory = new SwitchFactory($container);
     $result = $factory->toolbar();
     $this->assertEquals($check['result'], get_class($result), sprintf($msg, 'Returned the wrong result'));
 }
Esempio n. 2
0
 /**
  * Creates a new Toolbar
  *
  * @param   array  $config  The configuration values for the Toolbar object
  *
  * @return  Toolbar
  */
 public function toolbar(array $config = array())
 {
     $appConfig = $this->container->appConfig;
     $defaultConfig = array('useConfigurationFile' => true, 'renderFrontendButtons' => in_array($appConfig->get("views.*.config.renderFrontendButtons"), array(true, 'true', 'yes', 'on', 1)), 'renderFrontendSubmenu' => in_array($appConfig->get("views.*.config.renderFrontendSubmenu"), array(true, 'true', 'yes', 'on', 1)));
     $config = array_merge($defaultConfig, $config);
     return parent::toolbar($config);
 }