Method to create an icon for saving a new ordering in a grid

@param   array   $rows  The array of rows of rows
@param   string  $cls   Classname to apply
@param   string  $task  The task to use, defaults to save order
@return  string
322884
public static function order($rows, $cls = 'saveoder', $task = 'saveorder')
	{
		// Load the behavior.
		self::behavior();

		$href = '<a href="#" data-rows="' . (count($rows) - 1) . '" data-task="' . $task . '" class="grid-order-save ' . $cls . '" title="' . Lang::txt('JLIB_HTML_SAVE_ORDER') . '"><span>' . Lang::txt('JLIB_HTML_SAVE_ORDER') . '</span></a>';

		return $href;
	}
1127125
protected function doSearch(array $rows, $title, $language = null)
    {
        if ($language === null) {
            $language = $this->defaultLanguage;
        }

        $results = [];
        foreach ($rows as $row) {
            $node = $this->treeManager->getByNodeId($row['id'])->get($row['id']);

            if (!$this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN') && !$this->authorizationChecker->isGranted('VIEW', $node)) {
                continue;
            }

            $element = $this->elementService->findElement($node->getTypeId());
            $elementVersion = $this->elementService->findLatestElementVersion($element);
            $siteroot = $this->siterootManager->find($node->getTree()->getSiterootId());

            $handlerData = array(
                'handler' => 'element',
                'parameters' => array(
                    'id' => $node->getId(),
                    'siteroot_id' => $node->getTree()->getSiterootId(),
                    'title' => $siteroot->getTitle($language),
                    'start_tid_path' => '/'.implode('/', $node->getTree()->getIdPath($node)),
                ),
            );

            $createUserName = 'Unknown User';
            try {
                $createUser = $this->userManager->find($elementVersion->getCreateUserId());
                if ($createUser) {
                    $createUserName = $createUser->getDisplayName();
                }
            } catch (\Exception $e) {
            }

            $icon = $this->iconResolver->resolveTreeNode($node, $language);

            $results[] = new SearchResult(
                $node->getId(),
                $siteroot->getTitle($language).' :: '.$elementVersion->getBackendTitle($language).' ('.$language.', '.$node->getId().')',
                $createUserName,
                $elementVersion->getCreatedAt(),
                $icon,
                $title,
                $handlerData
            );
        }

        return $results;
    }
1101446
protected function table($headers, $rows)
    {
        if($this->console instanceof Command) {
            $this->console->table($headers, $rows);
        }
    }
480989
public function table(array $headers, array $rows, $tableStyle = 'default', array $columnStyles = [])
    {
        $this->output->table($headers, $rows, $tableStyle, $columnStyles);
    }
690280
protected function getRowClassString($row, $count)
    {
        $class_string = null;

        $classes = $this->getRowClasses($row, $count);

        if (count($classes) > 0) {
            $class_string = implode(' ', $classes);
        }

        return $class_string;
    }
623095
public function getHtmlTable(array $rows): string
  {
    $this->prepare();

    $ret = $this->getHtmlPrefix();

    $ret .= Html::generateTag('table', $this->attributes);

    // Generate HTML code for the column classes.
    $ret .= '<colgroup>';
    foreach ($this->columns as $column)
    {
      // If required disable sorting of this column.
      if (!$this->sortable) $column->notSortable();

      // Generate column element.
      $ret .= $column->getHtmlCol();
    }
    $ret .= '</colgroup>';

    // Generate HTML code for the table header.
    $ret .= Html::generateTag('thead', ['class' => static::$class]);
    $ret .= $this->getHtmlHeader();
    $ret .= '</thead>';

    // Generate HTML code for the table body.
    $ret .= Html::generateTag('tbody', ['class' => static::$class]);
    $ret .= $this->getHtmlBody($rows);
    $ret .= '</tbody>';

    $ret .= '</table>';

    $ret .= $this->getHtmlPostfix();

    $this->generateResponsiveCss();

    return $ret;
  }
643792
public function setRows(array $rows)
    {
        $this->downloader->setRows($rows);
        $this->outputter->setRows($rows);
        $this->writer->setRows($rows);

        return $this;
    }
198993
protected function buildJoinOn(array $cls, array $settings)/*# : string */
    {
        $res = ['ON'];
        $on = $cls[4];
        if (is_string($on)) { // ON string
            $res[] = $on;
        } elseif (is_object($on)) { // ON is an object
            $res[] = $this->quoteItem($on, $settings);
        } else { // common on
            $res[] = $this->quote( // left
                $this->getFirstTableAlias($on[0]) . $on[0],
                $settings
            );
            $res[] = $on[1]; // operator
            $res[] = $this->quote( // right
                $this->getSecondTableAlias($cls, $on[2]) . $on[2],
                $settings
            );
        }
        return join(' ', $res);
    }
99975
protected function fireTasksQueue($tasks)
    {
        $this->prepareEnvironment();

        // Fire tasks and events around them
        $status = $this->runWithBeforeAfterEvents(function () use ($tasks) {
            if ($this->straight) {
                return $this->builder->buildTask($tasks)->fire();
            }

            $pipeline = $this->queue->run($tasks);

            return $pipeline->succeeded();
        });

        // Remove command instance
        $this->container->remove('command');

        // Save history to logs
        $this->explainer->info('Saved logs to '.$this->logs->getLogsRealpath());

        return $status ? 0 : 1;
    }
1195892
public static AbstractMatrix getInstance(int rows, int cols, Class<?> cls)
    {
        return new AbstractMatrix(rows, Array.newInstance(cls, rows*cols));
    }
926722
protected function row(Row $row, array $cells)
	{
		$html = '<tr';
		$this->addAttributes($html, $row->getAttributes());
		$html .= '>' . implode('', $cells) . '</tr>';

		return $html;
	}
377418
public function render(Row $row)
	{
		if (!$this->shouldBeRendered($row)) {
			return null;
		}

		try {
			// Renderer function may be used
			return $this->useRenderer($row);
		} catch (DataGridColumnRendererException $e) {
			// Do not use renderer
		}

		$link = $this->createLink(
			$this->grid,
			$this->href,
			$this->getItemParams($row, $this->params) + $this->parameters
		);

		$a = Html::el('a')->href($link);

		$this->tryAddIcon($a, $this->getIcon($row), $this->getName());

		if (!empty($this->data_attributes)) {
			foreach ($this->data_attributes as $key => $value) {
				$a->data($key, $value);
			}
		}

		if (!empty($this->attributes)) {
			$a->addAttributes($this->attributes);
		}

		$a->addText($this->translate($this->getName()));

		if ($this->title) {
			$a->title($this->translate($this->getTitle($row)));
		}

		if ($this->class) {
			$a->class($this->getClass($row));
		}

		if ($confirm = $this->getConfirm($row)) {
			$a->data(static::$data_confirm_attribute_name, $confirm);
		}

		if ($this->open_in_new_tab) {
			$a->addAttributes(['target' => '_blank']);
		}

		return $a;
	}
669057
private function buildTree($rows, $parent_id = 0)
    {
        $containerAttributes = '';

        if (!$this->containerOptionsIsSet) {
            $containerAttributes = Html::renderTagAttributes($this->containerOptions);
            $this->containerOptionsIsSet = true;
        }

        $result = "<ul$containerAttributes>";

        foreach ($rows as $row) {
            if ($row['parent_id'] == $parent_id) {

                $value = call_user_func_array($this->value, ['model' => $row['model']]);
                $result .= "<li>$value";

                if ($this->hasChild($rows, $row['id'])) {
                    $result.= $this->buildTree($rows, $row['id']);
                }

                $result .= '</li>';
            }
        }

        $result .= '</ul>';

        return $result;
    }
38667
public static function addRowsToMap($rows)
    {
        $firstRow = reset($rows);
        $idAttribute = static::getIdAttribute();
        if ($firstRow instanceof ActiveRecord) {
            foreach ($rows as $row) {
                self::$identityMap[$row[$idAttribute]] = $row->toArray();
                foreach (static::getUniqueAttributes() as $uniqueAttribute) {
                    self::$uniqueAttributeToId[$uniqueAttribute][$row[$uniqueAttribute]] = $row[$idAttribute];
                }
            }
        } else {
            foreach ($rows as $row) {
                self::$identityMap[$row[$idAttribute]] = $row;
                foreach (static::getUniqueAttributes() as $uniqueAttribute) {
                    self::$uniqueAttributeToId[$uniqueAttribute][$row[$uniqueAttribute]] = $row[$idAttribute];
                }
            }
        }
        $maxSize = self::getIdentityMapMaxSize();
        if ($maxSize !== -1) {
            $count = count(self::$identityMap);
            if ($count > $maxSize) {
                self::$identityMap = array_slice(
                    self::$identityMap,
                    $count - $maxSize,
                    $maxSize
                );
            }
        }
    }
450419
public function getTask($task, array $macroOptions = [])
    {
        $script = Arr::get($this->tasks, $task, '');

        if ($script == '') {
            throw new \Exception(sprintf('Task "%s" is not defined.', $task));
        }

        $options = array_merge($this->getTaskOptions($task), $macroOptions);

        $parallel = Arr::get($options, 'parallel', false);

        $confirm = Arr::get($options, 'confirm', null);

        return new Task($this->getServers($options), $options['as'], $script, $parallel, $confirm);
    }
224332
private static function selectIcon($sortColumn)
    {
        $icon = config('columnsortable.default_icon_set');

        foreach (config('columnsortable.columns', []) as $value) {
            if (in_array($sortColumn, $value['rows'])) {
                $icon = $value['class'];
            }
        }

        return $icon;
    }
1032224
public static function record_from_scheduled_task($task) {
        $record = new \stdClass();
        $record->classname = self::get_canonical_class_name($task);
        $record->component = $task->get_component();
        $record->blocking = $task->is_blocking();
        $record->customised = $task->is_customised();
        $record->lastruntime = $task->get_last_run_time();
        $record->nextruntime = $task->get_next_run_time();
        $record->faildelay = $task->get_fail_delay();
        $record->hour = $task->get_hour();
        $record->minute = $task->get_minute();
        $record->day = $task->get_day();
        $record->dayofweek = $task->get_day_of_week();
        $record->month = $task->get_month();
        $record->disabled = $task->get_disabled();

        return $record;
    }