Return controls of pagination as button `Load more`.

@param string $targetSelector jQuery selector to select data
from server response and selection of the element on the
page to add new data.
@return string Return button `Load more`.
559541
public function buttonLoadMore($targetSelector = null) {
		$result = '';
		if (empty($targetSelector)) {
			$targetSelector = 'table tbody';
		}

		$hasNext = $this->Paginator->hasNext();
		if (!$hasNext) {
			$paginatorParams = $this->Paginator->params();
			$count = (int)Hash::get($paginatorParams, 'count');
			$records = __dn('view_extension', 'record', 'records', $count);
			$result = $this->Html->div(
				'load-more',
				$this->Html->para('small', $this->Paginator->counter(__d('view_extension', 'Showing {:count} %s', $records)))
			);

			return $result;
		}

		$urlPaginator = [];
		if (isset($this->Paginator->options['url'])) {
			$urlPaginator = (array)$this->Paginator->options['url'];
		}
		$paginatorParams = $this->Paginator->params();
		$count = (int)Hash::get($paginatorParams, 'count');
		$page = (int)Hash::get($paginatorParams, 'page');
		$limit = (int)Hash::get($paginatorParams, 'limit');
		$urlLoadMore = $this->Paginator->url(['page' => $page + 1, 'show' => 'list'], true);
		$urlLoadMore = array_merge($urlPaginator, $urlLoadMore);
		$btnClass = $this->getBtnClass('btn-default btn-sm');
		$btnClass .= ' btn-block';
		$startRecord = 0;
		if ($count >= 1) {
			$startRecord = (($page - 1) * $limit) + 1;
		}
		$endRecord = $startRecord + $limit - 1;
		$records = __dn('view_extension', 'record', 'records', $endRecord);
		$result = $this->Html->div(
			'load-more',
			$this->Html->para('small', $this->Paginator->counter(
				__d('view_extension', 'Current loaded page {:page} of {:pages}, showing {:end} %s of {:count} total', $records)
			)) .
			$this->Html->link(
				$this->_getOptionsForElem('loadMore.linkTitle'),
				$urlLoadMore,
				[
					'class' => $btnClass . ' hidden-print',
					'data-target-selector' => $targetSelector,
				] + $this->_getOptionsForElem('loadMore.linkOpt')
			)
		);

		return $result;
	}
93189
public static function appendQueryString($targetUrl, $data)
    {

        // Extract anchor fragment, if any.
        $fragment    = null;
        $anchorIndex = strpos($targetUrl, '#');
        if ($anchorIndex !== false) {
            $fragment  = substr($targetUrl, $anchorIndex);
            $targetUrl = substr($targetUrl, 0, $anchorIndex);
        }

        // If there aren't already some parameters, we need a "?".
        $existing = array();

        $first = (($pos = strpos($targetUrl, '?')) === false?true:false);
        if(!$first) {
            parse_str(substr($targetUrl, $pos+1), $existing);
            $targetUrl = substr($targetUrl, 0, $pos);
            $first = true;
        }

        $found = array();
        foreach ((array) $data as $name => $value) {
            $found[] = $name;
            if (!is_array($value)) {

                if ($first == true) {
                    $targetUrl .= '?';
                    $first = false;
                } else
                    $targetUrl .= '&';

                $encodedKey   = urlencode("{$name}");
                $encodedValue = urlencode("{$value}");
                $targetUrl   .= $encodedKey . '='.$encodedValue;
            }
        }
        foreach($existing as $name => $value)
        {
            if(!in_array($name, $found)) {
                if ($first == true) {
                    $targetUrl .= '?';
                    $first = false;
                } else
                    $targetUrl .= '&';

                $encodedKey   = urlencode("{$name}");
                $encodedValue = urlencode("{$value}");
                $targetUrl   .= $encodedKey . '='.$encodedValue;
            }
        }


        // Append anchor fragment, if any, to end of URL.
        if ($fragment != null)
            $targetUrl .= $fragment;

        return $targetUrl;
    }
724112
public function withSelector(DocumentSelector $selector): DocumentSource
    {
        $source = clone $this;
        $source->setSelector($selector);

        return $source;
    }
1187982
public function getIterator() {
		if ($this->selection && count($this->rows) == 0) {
			$this->fetchAll();
		}
		return count($this->rows) > 0 ? new \ArrayIterator($this->rows) : new \ArrayIterator();
	}
806100
public function get($selector)
    {
        $xpath = new \DOMXPath($this->dom);

        if (class_exists('Symfony\Component\CssSelector\CssSelector')) {
            $expression = CssSelector::toXPath($selector);
        } else {
            $converter  = new CssSelectorConverter();
            $expression = $converter->toXPath($selector);
        }
        $nodes = $xpath->query($expression);

        $glnodes = [];
        foreach ($nodes as $node) {
            $glnodes[] = new GlHtmlNode($node);
        }

        return $glnodes;
    }
1251709
public static function getNumberOperands($includeSelector = false)
    {
        $values = array(
            self::OPERATOR_EQUAL,
            self::OPERATOR_GREATER_THAN,
            self::OPERATOR_GREATER_THAN_EQUAL,
            self::OPERATOR_LOWER_THAN,
            self::OPERATOR_LOWER_THAN_EQUAL,
        );

        if ($includeSelector) {
            $values[] = self::OPERAND_SELECTOR;
        }

        return $values;
    }
1285820
protected static function parseAndConvertSelector($selector, $prefix = '//')
    {
        if (substr($selector, 0, 1) === '>') {
            $prefix = '/';

            $selector = ltrim($selector, '> ');
        }

        $segments = self::getSegments($selector);
        $xpath = '';

        while (count($segments) > 0) {
            $xpath .= self::buildXpath($segments, $prefix);

            $selector = trim(substr($selector, strlen($segments['selector'])));
            $prefix = isset($segments['rel']) ? '/' : '//';

            if ($selector === '' || substr($selector, 0, 2) === '::' || substr($selector, 0, 1) === ',') {
                break;
            }

            $segments = self::getSegments($selector);
        }

        // if selector has property
        if (substr($selector, 0, 2) === '::') {
            $property = self::parseProperty($selector);
            $propertyXpath = self::convertProperty($property['name'], $property['args']);

            $selector = substr($selector, strlen($property['property']));
            $selector = trim($selector);

            $xpath .= '/' . $propertyXpath;
        }

        return [$xpath, $selector];
    }
408753
public function getSelectedLabel($sSelector)
    {
        if (strpos($sSelector, '/') === false) {
            $oSelectorsHandler = $this->getMinkSession()->getSelectorsHandler();
            $page = $this->getMinkSession()->getPage();

            $sParsedSelector = $oSelectorsHandler->xpathLiteral($sSelector);

            $oSelect = $page->find('named', array('select', $sParsedSelector));

            if (is_null($oSelect)) {
                $this->fail("Element '$sSelector' was not found! ");
            }
        } else {
            $oSelect = $this->getElementLazy($sSelector);
        }

        $aOptions = $oSelect->findAll('xpath', '//option[@selected]');

        if (empty($oOptions)) {
            $value = $this->_getValue($oSelect->getXpath());
            $value = $this->getMinkSession()->getSelectorsHandler()->xpathLiteral($value);
            $aOptions = $oSelect->findAll('xpath', '//option[@value=' . $value . ']');
        }
        $oOption = !empty($aOptions) ? array_pop($aOptions) : $oSelect->find('xpath', 'option');

        return $oOption ? $oOption->getText() : '';
    }
205870
private function getTargetSelectQuery(): QueryBuilder
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('DISTINCT ngbm_rule_target.*')
            ->from('ngbm_rule_target');

        return $query;
    }
1067148
function cancelTarget($targetTicket) {
		$cancelTargetRequest = new cancelTarget ();
		$cancelTargetRequest->targetId = $targetTicket;
		return $this->targetService->cancelTarget ( $cancelTargetRequest );
	}
586974
protected function updateSelector()
    {
        $buffer = implode('', $this->getBuffer());
        $qtiClassMap = ($this->isWebComponentFriendly()) ? array_merge(self::$qtiClassMapping, self::$wcFriendlyQtiClassMapping) : self::$qtiClassMapping;

        if (strpos($buffer, ',') === false) {

            // Do not rescope if already scoped!
            if (strpos($buffer, '#' . $this->getId()) === false) {
                $buffer = ($this->doesMapQtiClasses() === true) ? CssUtils::mapSelector($buffer, $qtiClassMap) : $buffer;
                $buffer = ($this->doesMapQtiPseudoClasses() === true) ? CssUtils::mapPseudoClasses($buffer, self::getQtiPseudoClassMapping()) : $buffer;
                $this->output('#' . $this->getId() . ' ' . $buffer . '{');
            } else {
                $buffer = ($this->doesMapQtiPseudoClasses() === true) ? CssUtils::mapPseudoClasses($buffer, self::getQtiPseudoClassMapping()) : $buffer;
                $this->output($buffer . '{');
            }
        } else {
            $classes = explode(',', $buffer);
            $newClasses = array();

            foreach ($classes as $c) {

                // Same as above, do not rescope if already scoped...
                if (strpos($c, '#' . $this->getId()) === false) {
                    $c = ($this->doesMapQtiClasses() === true) ? CssUtils::mapSelector($c, $qtiClassMap) : $c;
                    $newC =  '#' . $this->getId() . ' ' . trim($c);
                    $newC = str_replace(trim($c), $newC, $c);
                } else {
                    $newC = $c;
                }

                $newClasses[] = $newC;
            }

            $buffer = implode(',', $newClasses);
            $buffer = ($this->doesMapQtiPseudoClasses() === true) ? CssUtils::mapPseudoClasses($buffer, self::getQtiPseudoClassMapping()) : $buffer;
            $this->output($buffer . '{');
        }
    }
912142
protected function getPreviousButton()
    {
        if ($this->paginator->currentPage() <= 1) {
            return $this->getDisabledLink($this->previousButtonText);
        }

        $url = $this->paginator->url(
            $this->paginator->currentPage() - 1
        );

        return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');
    }
741054
public function get($selector, \DOMNode $context = null, $registerNodeNS = true)
    {
        return $this->exec('query', $selector, $context, $registerNodeNS);
    }
987333
public function getPaginationControl(PaginatorInterface $paginator) {
		$currentPage = $paginator->getCurrentPage();
		
		$data = [
			PaginatorInterface::CONTROL_CURRENT => $currentPage,
			PaginatorInterface::CONTROL_RANGE   => [$currentPage]
		];
		
		if ($currentPage > 2) {
			$data[PaginatorInterface::CONTROL_FIRST] = 1;
		}
		
		if ($currentPage > 1) {
			$data[PaginatorInterface::CONTROL_PREVIOUS] = $currentPage - 1;
		}
		
		if ($paginator->count() >= $paginator->getItemsNumberPerPage()) {
			$data[PaginatorInterface::CONTROL_NEXT] = $currentPage + 1;
		}
		
		return $data;
	}
951634
public function ajaxCall($url, $target = null, bool $replaceTag = false, $waitTarget = false)
    {
        $js  = '$.ajaxCall("' . $url . '"';
        $js .= $target !== null ? ',"' . $target . '"' : ($replaceTag || $waitTarget ? ',false' : '');
        $js .= $replaceTag ? ',1' : ($waitTarget ? ',false' : '');
        $js .= $waitTarget ? ',' . ($waitTarget === true ? 'true' : '"' . $waitTarget . '"') : '';
        $js .= ');';
        return $this->registerScript($js);
    }
88070
public function iGoToInTheEmail($linkSelector)
    {
        if(!$this->lastMatchedEmail) {
            throw new \LogicException('No matched email found from previous step');
        }

        $match = $this->lastMatchedEmail;
        $crawler = new Crawler($match->Content);
        $linkEl = $crawler->selectLink($linkSelector);
        assertNotNull($linkEl);
        $link = $linkEl->attr('href');
        assertNotNull($link);

        return new Step\When(sprintf('I go to "%s"', $link));
    }
1097607
public function appendSelector(FileSelector $selector)
    {
        if ($this->isReference()) {
            throw $this->noChildrenAllowed();
        }
        $this->selectorsList[] = $selector;
    }