public function isRegisteredButton(Button $button) { /** @var Input $registeredInput */ foreach ($this->registeredButtons as $registeredButton) { if ($button->getId()) { /** @var Input $registeredButton */ if ($registeredButton->getId() === $button->getId()) { return true; } } //$x1 = $registeredButton->getXpath(); //$x2 = $button->getXpath(); if ($registeredButton->getXpath() === $button->getXpath()) { return true; } if ($registeredButton->getNode()->getOuterHtml() === $button->getNode()->getOuterHtml()) { return true; } } return false; }
/** * @param DataTable $dt * @param Button|Text $action * @param Block $codeBlock */ private static function createActionTest(DataTable $dt, $action, Block $codeBlock) { $options = ['session' => '$session', 'xpath' => $action->getXpath()]; if ($action->hasClass('ColVis_Button')) { if ($action->getLabel() === 'Kolumny') { // clear filtr $codeBlock->appendRenderable(new Comment('action columns: ' . $action->getLabel())); $codeBlock->appendRenderable(new Statement(new StaticMethodCall('parent', 'dtActionColumns', $options))); } else { $x = 1; } } elseif ($action->getLabel() === 'filtr') { // visible columns $codeBlock->appendRenderable(new Comment('action filter: ' . $action->getLabel())); $codeBlock->appendRenderable(new Statement(new StaticMethodCall('parent', 'dtActionFilter', $options))); } elseif ($action->getLabel() === 'dtsearch') { $codeBlock->appendRenderable(new Comment('action globalsearch: ' . $action->getLabel())); $codeBlock->appendRenderable(new Statement(new StaticMethodCall('parent', 'dtActionGlobalSearch', $options))); } else { $x = 1; } }