Returns the stylesheet URL of this editor content

@param bool $encoded false means use & and true use &amp; in URLs
@return moodle_url
494047
public function editor_css_url($encoded=true) {
        global $CFG;
        $rev = theme_get_revision();
        if ($rev > -1) {
            $themesubrevision = theme_get_sub_revision_for_theme($this->name);

            // Provide the sub revision to allow us to invalidate cached theme CSS
            // on a per theme basis, rather than globally.
            if ($themesubrevision && $themesubrevision > 0) {
                $rev .= "_{$themesubrevision}";
            }

            $url = new moodle_url("/theme/styles.php");
            if (!empty($CFG->slasharguments)) {
                $url->set_slashargument('/'.$this->name.'/'.$rev.'/editor', 'noparam', true);
            } else {
                $url->params(array('theme'=>$this->name,'rev'=>$rev, 'type'=>'editor'));
            }
        } else {
            $params = array('theme'=>$this->name, 'type'=>'editor');
            $url = new moodle_url('/theme/styles_debug.php', $params);
        }
        return $url;
    }
995748
public function get_doc_url(\core_search\document $doc) {
        $contextmodule = \context::instance_by_id($doc->get('contextid'));
        $params = array('id' => $contextmodule->instanceid, 'chapterid' => $doc->get('itemid'));
        return new \moodle_url('/mod/book/view.php', $params);
    }
943084
public function get_url() {
        if ($this->other['badgetype'] == BADGE_TYPE_COURSE) {
            // Course badge.
            $return = new \moodle_url('/badges/index.php',
                    array('type' => BADGE_TYPE_COURSE, 'id' => $this->other['courseid']));
        } else {
            // Site badge.
            $return = new \moodle_url('/badges/index.php', array('type' => BADGE_TYPE_SITE));
        }
        return $return;
    }
79354
public function get_url() {
        if ($this->courseid) {
            $cat = $this->other['newcategoryid'] . ',' . $this->contextid;
            if ($this->contextlevel == CONTEXT_MODULE) {
                return new \moodle_url('/question/edit.php',
                        ['cmid' => $this->contextinstanceid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
            }
            return new \moodle_url('/question/edit.php',
                    ['courseid' => $this->courseid, 'cat' => $cat, 'lastchanged' => $this->objectid]);
        }
        // Lets try viewing from the frontpage for contexts above course.
        return new \moodle_url('/question/category.php',
                ['courseid' => SITEID, 'edit' => $this->other['newcategoryid'], 'lastchanged' => $this->objectid]);
    }
1196331
public function getUrl( $clean = false )
    {
        /** @var eZTagsObject[] $path */
        $path = $this->getPath();
        $fullPathCount = $this->getPathCount( true );
        $urlPrefix = trim( eZINI::instance( 'eztags.ini' )->variable( 'GeneralSettings', 'URLPrefix' ) );
        $urlPrefix = trim( $urlPrefix, '/' );

        $keywordArray = array();

        if ( is_array( $path ) )
        {
            if ( count( $path ) != $fullPathCount )
            {
                return 'tags/id/' . $this->attribute( 'id' );
            }
            else
            {
                foreach ( $path as $tag )
                {
                    $keywordArray[] = $clean ? $tag->attribute( 'keyword' ) : urlencode( $tag->attribute( 'keyword' ) );
                }

                $keywordArray[] = $clean ? $this->attribute( 'keyword' ) : urlencode( $this->attribute( 'keyword' ) );

                return $clean ? implode( '/', $keywordArray ) : $urlPrefix . '/' . implode( '/', $keywordArray );
            }
        }

        return $clean ? $this->attribute( 'keyword' ) : $urlPrefix . '/' . urlencode( $this->attribute( 'keyword' ) );
    }
1151748
public function get_editor_url(moodle_url $returnurl = null) {

        $params = array('areaid' => $this->areaid);

        if (!is_null($returnurl)) {
            $params['returnurl'] = $returnurl->out(false);
        }

        return new moodle_url('/grade/grading/form/'.$this->get_method_name().'/edit.php', $params);
    }
534032
public static function currentUri(bool $includeQueryParams = true, bool $encode = false)
    {
        if (RequestHelper::isCli()) {
            return null;
        }

        $uri = $_SERVER['REQUEST_URI'];

        if (!$includeQueryParams) {
            if ($separatorPosition = strpos($uri, '?')) {
                $uri = substr($uri, 0, $separatorPosition);
            }
        }

        return $encode ? urlencode($uri) : $uri;
    }
302251
public static function decode($encoded)
    {
        // Trying to decode null, eh?
        if (is_null($encoded) || empty($encoded))
        {
            return null;
        }

        // Unpack into array of characters
        $chars = str_split($encoded);

        // Convert the character array to an array of bytes
        $bytes = array();
        foreach ($chars as $char)
        {
            $bytes[] = ord($char);
        }

        $val = self::recursiveDecode($bytes);

        if (!empty($bytes))
        {
            throw new CborException("There are more bytes than expected in the CBOR byte array.");
        }

        return $val;
    }
729325
public function compile( $encoding = 'UTF-8' ): string
    {
        // If we just want to close an errant tag, let's leave this party as early as possible.
        if ( $this->justClose ) {
            return $this->compileCloseTag();
        }

        // first, we want an open tag, with all its attributes
        $html = $this->compileOpenTag( $encoding );

        // if we have content on this tag, let's get that content compiled!
        if ( $this->hasContent() ) {
            $html .= $this->content->compile( $encoding );

            // if for some reason we do not want the close tag on this baby, it is fine.
            if ( ! $this->leaveOpen ) {
                $html .= $this->compileCloseTag();
            }
        }

        return $html;

    }
459043
public function getView(bool $prefixed = false): string
    {
        if ($prefixed) {
            return $this->getTheme().'.'.$this->view;
        }

        return $this->view;
    }
50784
function css($flush = true) {
        $css = $this->_css;
        if ($flush) $this->_css = [];
        $html = '';
        foreach ($css as $url => $inc) {
            $html .= '<link rel="stylesheet" href="'.$url.'">'.PHP_EOL;
        }
        if (!empty($this->_styles)) {
            $styles = $this->_styles;
            if ($flush) $this->_styles = [];
            $html .= '<style>'.PHP_EOL;
            foreach ($styles as $selector => $style)
            {
                if ($selector) {
                    $html .= $selector . ' { ' . $style . ' }' . PHP_EOL;
                } else {
                    $html .= $style;
                }
            }
            $html .= '</style>';
        }
        return $html;
    }
1231217
public function getStyle($compiled = false)
    {
        if ($compiled) {
            $style = [];
            foreach ($this->style as $property => $value) {
                $style[] = "{$property}: {$value}";
            }

            return implode('; ', $style);
        }

        return $this->style;
    }
798308
public function toHtml(bool $preview = false)
    {
        $html = '';
        if ($preview) {
            if ($this->getImageUrl()) {
                $html = "<img src='{$this->getImageUrl()}' style='max-width: 100%;' />";
            }
        }
        if ($this->getVideoUrl()) {
            $html = "<iframe src='{$this->getVideoUrl()}' frameborder='0' allowfullscreen></iframe>";
        }

        return $html;
    }
969420
public function get_doc_url(\core_search\document $doc) {
        global $USER;

        // The post is already in static cache, we fetch it in self::search_access.
        $entry = $this->get_entry($doc->get('itemid'));
        $contextmodule = \context::instance_by_id($doc->get('contextid'));

        if ($entry->approved == false && $entry->userid != $USER->id) {
            // The URL should change when the entry is not approved and it was not created by the user.
            $docparams = array('id' => $contextmodule->instanceid, 'mode' => 'approval');
        } else {
            $docparams = array('id' => $contextmodule->instanceid, 'mode' => 'entry', 'hook' => $doc->get('itemid'));

        }
        return new \moodle_url('/mod/glossary/view.php', $docparams);
    }
1032434
public function get_url() {
        $url = new \moodle_url('/grade/edit/scale/index.php');
        if ($this->courseid) {
            $url->param('id', $this->courseid);
        }
        return $url;
    }
621936
public function getCode(bool $upper = false): string
    {
        $this->checkLocale();
        if (isset($this->locales[$this->selectLocale]['code'])) {
            $code = $this->locales[$this->selectLocale]['code'];
            return ($upper ? strtoupper($code) : $code);
        }
        return '';
    }
517480
public function getResultUrl($linked = false)
    {
        $linkText = $this->cObj->typoLink_URL($this->getResultLinkConfiguration());
        $linkText = htmlspecialchars($linkText);
        if ($linked) {
            return $this->cObj->typoLink($linkText, $this->getResultLinkConfiguration());
        }
        return $linkText;
    }