Returns the tracing link analysis.
@param bool $textOnly whether to render text or HTML
@return string
974617
public function _render($textOnly) {
        $tracingLinkNum = count($this->tracingLinks);
        $str = "";

        if ($textOnly) {
            $str .= "\nFeature Traceability\n====================\n" .
                 "The following $tracingLinkNum tracing links were found:\n\n";
            $maxLen = fphp\Helper\_String::getMaxLength($this->tracingLinks, "getFeatureName")
                    + fphp\Helper\_String::getMaxLength($this->tracingLinks, "getType");
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink, true, $maxLen);
        } else {
            $str .= "<h2>Feature Traceability</h2>";
            $str .= "<p>The following $tracingLinkNum tracing links were found:</p>";
            $str .= "<table cellpadding='2'>";
            $str .= "<tr align='left'><th>Feature</th><th>Type</th><th>Source</th><th>Target</th></tr>";
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink);
            $str .= "</table>";
        }
        
        return $str;
    }
898278
public static function getBacklinksTotal($url = false)
    {
        $url   = parent::getUrl($url);
        $query = urlencode("link:{$url}");

        return self::getSearchResultsTotal($query);
    }
1123245
public function getCurrentScheme($colorsOnly = false)
    {

        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());
        $results         = null;

        // Sending service start event
        $arrayParameters = $this->sendEvent('melis_core_package_scheme_get_current_scheme_start', $arrayParameters);

        $table = $this->schemeTable();

        $schemeData = $table->getActiveScheme($colorsOnly)->current();

        if(!$schemeData) {
            $schemeData = $table->getDefaultScheme($colorsOnly)->current();
        }

        // check if scheme has data
        if($schemeData) {

            $entScheme = new MelisCorePlatformScheme();

            $entScheme->setId($schemeData->pscheme_id);
            $entScheme->setName($schemeData->pscheme_name);
            $entScheme->setColors($schemeData->pscheme_colors);

            if(!$colorsOnly) {
                $entScheme->setSidebarHeaderLogo($schemeData->pscheme_sidebar_header_logo);
                $entScheme->setSidebarHeaderText($schemeData->pscheme_sidebar_header_text);
                $entScheme->setLoginLogo($schemeData->pscheme_login_logo);
                $entScheme->setLoginBackground($schemeData->pscheme_login_background);
                $entScheme->setFavicon($schemeData->pscheme_favicon);
            }

            $entScheme->setIsActive($schemeData->pscheme_is_active);

            $results = $entScheme;
        }

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $results;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melis_core_package_scheme_get_current_scheme_end', $arrayParameters);

        return $arrayParameters['results'];
    }
259744
public function getRenderedLine()
    {
        if (isset($this->_detectMatch[1]) && ($nbr = substr($this->_detectMatch[1], 1)) && is_numeric($nbr))
            $this->_nbrParagraphs = $nbr;
        $result = '';
        for ($i = 0; $i < $this->_nbrParagraphs; $i++)
            $result .= $this->_getParagraph($i == 0);
        return ($result);
    }
512546
public function getDebugQuery($r = null)
    {
        if ($r === null) {
            $r = $this->_render();
        }

        $d = $r;
        $pp = array();
        $d = preg_replace('/`([^`]*)`/', '`<font color="black">\1</font>`', $d);
        foreach (array_reverse($this->params) as $key => $val) {
            if (is_string($val)) {
                $d = preg_replace('/'.$key.'([^_]|$)/', '"<font color="green">'.
                    htmlspecialchars(addslashes($val)).'</font>"\1', $d);
            } elseif (is_null($val)) {
                $d = preg_replace(
                    '/'.$key.'([^_]|$)/',
                    '<font color="black">NULL</font>\1',
                    $d
                );
            } elseif (is_numeric($val)) {
                $d = preg_replace(
                    '/'.$key.'([^_]|$)/',
                    '<font color="red">'.$val.'</font>\1',
                    $d
                );
            } else {
                $d = preg_replace('/'.$key.'([^_]|$)/', $val.'\1', $d);
            }

            $pp[] = $key;
        }

        return $d." <font color='gray'>[".
            implode(', ', $pp).']</font>';
    }
893670
public function get_related_badges(bool $activeonly = false) {
        global $DB;

        $params = array('badgeid' => $this->id, 'badgeid2' => $this->id, 'badgeid3' => $this->id);
        $query = "SELECT DISTINCT b.id, b.name, b.version, b.language, b.type
                    FROM {badge_related} br
                    JOIN {badge} b ON (br.relatedbadgeid = b.id OR br.badgeid = b.id)
                   WHERE (br.badgeid = :badgeid OR br.relatedbadgeid = :badgeid2) AND b.id != :badgeid3";
        if ($activeonly) {
            $query .= " AND b.status <> :status";
            $params['status'] = BADGE_STATUS_INACTIVE;
        }
        $relatedbadges = $DB->get_records_sql($query, $params);
        return $relatedbadges;
    }
330748
public function loggerOnly($loggerOnly = null)
    {
        if (func_num_args() == 0) {
            return $this->loggerOnly;
        }

        $this->loggerOnly = (bool) $loggerOnly;
    }
1184807
public function getTld($level = null)
    {
        if (is_null($level)) {
            return implode('.', $this->tlds);
        } elseif (isset($this->tlds[ $level ])) {
            return $this->tlds[ $level ];
        }

        return false;
    }
164919
public function link($link, $text=null, $title=null, $popup=false, $class=null) {
		if (is_null($text)) {
			// if no text is given, we use the text originally provided by the user
			$text = $link;
		}

		// deal with internal and (slightly) malformed links
		$link = $this->getLink($link);

		$attributes = $this->getHtmlAttributes(array(
			'title'=>$title,
			'target'=>$this->isTrue($popup)?"blank":null,
			'class'=>$class
		));

		return "<a href='$link'$attributes>$text</a>";
	}
186779
public function trace() {
        $tracingLinks = array_merge(
            $this->getGeneratorElements("trace"),
            $this->getAllGenerators()["runtime"]->traceRuntimeCalls($this->generateFiles(), $this->productLine)
        );
        $tracingLinks = fphp\Helper\_Array::sortByKey($tracingLinks, "getFeatureName");
        return $tracingLinks;
    }
787126
public function page_doc_link($text = null) {
        if ($text === null) {
            $text = get_string('moodledocslink');
        }
        $path = page_get_doc_link_path($this->page);
        if (!$path) {
            return '';
        }
        return $this->doc_link($path, $text);
    }
768557
public function getSearchSpellchecking($defaultIfEmpty = false)
    {
        $isFacetingEnabled = $this->getValueByPathOrDefaultValue('plugin.tx_solr.search.spellchecking', $defaultIfEmpty);
        return $this->getBool($isFacetingEnabled);
    }
1090285
protected function _getSourcePath($trace, $fileOnly = false)
    {
        $path         = '';
        $currentTrace = $this->_getLastTrace($trace);

        if (isset($currentTrace['file'])) {
            $path = $this->_getRalativePath($currentTrace['file']);

            if ($fileOnly && $path) {
                $path = pathinfo($path, PATHINFO_BASENAME);
            }

            if (isset($currentTrace['line']) && $path) {
                $path = $path . ':' . $currentTrace['line'];
            }
        }

        if (!$path) {
            $path = 'undefined:0';
        }

        return $path;
    }
992435
public function humaniceTrace(array $trace) {
        /* @var $html_helper HtmlHelper */
        $html_helper = $this->html;
        $list = [];
        foreach ($trace as $id_trace => $e) {
            $class = explode('\\', key_exists('class', $e) ? $e['class'] : '');
            $type = key_exists('type', $e) ? $e['type'] : '';
            $function = key_exists('function', $e) ? $e['function'] : '';
            $args = key_exists('args', $e) ? $e['args'] : [];
            $file = key_exists('file', $e) ? $e['file'] : [];
            $line = key_exists('line', $e) ? $e['line'] : [];

            $item = $class ? '<span style="color:blue" title="' . implode('\\', $class) . '">' . end($class) . '</span>' : '';
            $item .= $type ? '<span style="color:teal">' . $type . '</span>' : '';
            $item .= $function ? '<span style="color:red">' . $function . '</span>' : '';
            $item .= $args ? 
                    '(' .
                        $html_helper->link(count($args) . ' arg', [], 
                            ['onclick' => 'var a=document.getElementById(\'args_' . $id_trace . '\');'
                                . ' if (a.style.display==\'block\') { a.style.display=\'none\' } else { a.style.display=\'block\' };'
                                . 'return false;']) . 
                    ')' : '()';
            $item .= $file ? ' - <span style="color:lightgray" onmouseover="this.style.color=\'gray\'" '
                    . 'onmouseout="this.style.color=\'lightgray\'" >' . $file . '</span>' : '';
            $item .= $line ? ' <span style="color:salmon">' . $line . '</span>' : '';
            $item .= $args ? '<div style="display:none" id="args_' . $id_trace . '">' . @d($args) . '</div>' : '';
            
            $list[] = $item;
        }
        
        return $html_helper->nestedList($list, [
                'style' => 'font-family: arial; line-height:30px;',
                'reversed' => 'reversed'
            ], [], 'ordered');
    }
1019184
public function determineAccessToken($headerOnly = false)
    {
        if (!empty($this->getRequest()->headers->get('Authorization'))) {
            $accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest());
        } elseif ($headerOnly === false && (! $this->getTokenType() instanceof MAC)) {
            $accessToken = ($this->getRequest()->server->get('REQUEST_METHOD') === 'GET')
                                ? $this->getRequest()->query->get($this->tokenKey)
                                : $this->getRequest()->request->get($this->tokenKey);
        }

        if (empty($accessToken)) {
            throw new InvalidRequestException('access token');
        }

        return $accessToken;
    }
134350
public function renderText($text, bool $escape = true): string
    {
        if ($escape) {
            $text = $this->esc($text);
        }
        return (string) Container::getMarkdown()->text((string) $text);
    }
403367
public function render_link_before() {
		$trail_renderer = $this->get_trail_renderer();
		$item_link      = $this->get_item_link();

		// HTML before link opening tag.
		$output = $trail_renderer->get_link_before();

		// Link can be optional or disabled.
		if ( $item_link && $this->is_link_enabled() ) {
			$output .= '<a href="' . $item_link . '"' . $this->get_item_attributes_html() . '>';
		}

		return $output;
	}