public function testAddButtonPathArray() { $initialValue = $this->readAttribute($this->object, '_buttonPath'); $this->object->addButtonPath(array('MyTestPath1', 'MyTestPath2')); $newValue = $this->readAttribute($this->object, '_buttonPath'); $this->assertThat($newValue[0], $this->equalTo('MyTestPath2' . DIRECTORY_SEPARATOR)); $this->assertThat($newValue[1], $this->equalTo('MyTestPath1' . DIRECTORY_SEPARATOR)); $initialCount = count($initialValue); for ($i = 0; $i < $initialCount; $i++) { $this->assertThat($initialValue[$i], $this->equalTo($newValue[$i + 2])); } }
/** * K2import entry point for K2import Component * * @package K2import * @link http://www.individual-it.net * @license GNU/GPL */ // no direct access defined('_JEXEC') or die('Restricted access'); // Require the base controller require_once JPATH_COMPONENT . DS . 'controller.php'; require_once JPATH_COMPONENT . DS . 'helper.php'; //Create a new toolbar: jimport('joomla.html.toolbar'); $toolbar = new JToolbar('toolbar'); //Add the Jix button path & load the upload button type: $toolbar->addButtonPath(JPATH_COMPONENT . DS . 'button'); $button =& $toolbar->loadButtonType('Upload', true); $button =& $toolbar->loadButtonType('Export', true); $button =& $toolbar->loadButtonType('Instructions', true); // Require specific controller if requested if ($controller = JRequest::getVar('controller')) { require_once JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php'; } // Create the controller $classname = 'K2importController' . $controller; $controller = new $classname(); // Perform the Request task $controller->execute(JRequest::getVar('task')); // Redirect if set by the controller $controller->redirect();