Returns a label.
@param  string $content The content of the label
@param  string  $class CSV list of classes you want to add
@param  string  $style Custom styles you want added
@return string HTML code for the separator
542692
public function renderLabel($content, $class = '', $style = '')
    {
        $styleAttr = ($style) ? ' style="' . $style . '"' : '';
        $classes = ($class) ? ' ' . $class : '';
        $renderLabel = '';
        $renderLabel .= '<span class="fs-label' . $classes . '"' . $style . '>';
        $renderLabel .= $content;
        $renderLabel .= '</span>';
        return $renderLabel;
    }
1363743
public function TagWithClass($cssclass) {
			if($this->owner->exists()) {
				$url = $this->owner->getURL();
				$title = ($this->owner->Title) ? $this->owner->Title : $this->owner->Filename;
				if($this->owner->Title) {
					$title = Convert::raw2att($this->owner->Title);
				} else {
					if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) {
						$title = Convert::raw2att($matches[1]);
					}
				}
				return "<img src=\"$url\" alt=\"$title\" class=\"$cssclass\" />";
			}
		}
875525
public function on($icon, array $classes = array(), $style='fas')
    {
        if (is_string($icon) === false) {
            throw new \InvalidArgumentException(
                'Icon label must be a string.'
            );
        }
        if (is_string($style) === false) {
            throw new \InvalidArgumentException(
                'The style label must be a string.'
            );
        }
        if (!in_array($style, $this->STYLES)) {
            throw new \InvalidArgumentException(
                'Invalid style.'
            );
        }

        $iconClasses = $icon . ' fa-stack-1x';

        if (count($classes) > 0) {
            foreach ($classes as $class) {
                $iconClasses .= ' ' . $this->classMapper($class);
            }
        }

        $this->bottomIcon = sprintf(self::ICON_HTML, $style, $iconClasses);

        return $this;
    }
15597
protected function _styleToString(&$style) {

        if (is_array($style)) {
            $css = $this->newStyle();
            foreach ($style as $prop => $val) {
                $css[$prop] = $val;
            }
            return $css->css();
        } elseif (is_a($style, '\\s4y\\Style')) {
            return $style->css();
        }
        return $style.PHP_EOL;
    }
687259
public function style($style)
    {
        if (is_string($style)) {
            $this->attributes['style'] = $style;

            return $this;
        }

        if (is_array($style)) {

            $html = [];

            foreach ($style as $name => $value) {
                $html[] = "$name:$value";
            }

            $this->attributes['style'] = implode(';', $html);
        }

        return $this;
    }
12031
public static Label newActionLabel (String text, String style, ClickHandler onClick)
    {
        return makeActionLabel(newLabel(text, style), onClick);
    }
1074334
public function jsonEncode(AbstractClassContent $content, $format = AbstractClassContent::JSON_DEFAULT_FORMAT)
    {
        if (AbstractClassContent::JSON_DEFINITION_FORMAT === $format) {
            $classname = get_class($content);
            $content = new $classname;
        }

        $result = $content->jsonSerialize($format);

        if (isset($result['image']) && null !== $this->iconizer) {
            $result['image'] = $this->iconizer->getIcon($content);
        }

        return $result;
    }
647465
private function getBorderXMLContent($style)
    {
        $borderProperty = '<style:table-cell-properties %s />';

        $borders = array_map(function (BorderPart $borderPart) {
            return BorderHelper::serializeBorderPart($borderPart);
        }, $style->getBorder()->getParts());

        return sprintf($borderProperty, implode(' ', $borders));
    }
855888
public function label($text)
    {
        $label = self::createElement('label');

        if (isset($this->attributeList['id'])) {
            $label->refer($this->attributeList['id']);
        }

        return $label->text($this)
            ->text($text);
    }
717441
function createLabelStyle(style) {
    return React.createClass({
        displayName: Label.displayName + style,
        render() {
            return <Label {...this.props} style={style.toLowerCase()} />;
        }
    });
}
766901
public function htmlLabel($identifier, $content="", $icon=NULL,$tagName="div") {
		return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$icon, $tagName));
	}
168794
public static function tr(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("tr", $content, $attributes);
    }
67020
public function getLabel($text, $info = null)
    {
        $options = [
            'text' => $text,
            'templateVars' => []
        ];

        if ($info !== null) {
            $options['templateVars']['labelInfo'] = '<small>' . $info . '</small>';
        }

        return $options;
    }
614207
public function get_label($data) {
        global $DB;

        $value      = $data['value'];
        $roleid     = $data['roleid'];
        $categoryid = $data['categoryid'];

        $a = new stdClass();
        $a->label = $this->_label;

        if ($roleid) {
            $role = $DB->get_record('role', array('id' => $roleid));
            $a->rolename = '"'.role_get_name($role).'"';
        } else {
            $a->rolename = get_string('anyrole', 'filters');
        }

        if ($categoryid) {
            $catname = $DB->get_field('course_categories', 'name', array('id' => $categoryid));
            $a->categoryname = '"'.format_string($catname).'"';
        } else {
            $a->categoryname = get_string('anycategory', 'filters');
        }

        if ($value) {
            $a->coursename = '"'.s($value).'"';
            if (!$DB->record_exists('course', array('shortname' => $value))) {
                return '<span class="notifyproblem">'.get_string('courserolelabelerror', 'filters', $a).'</span>';
            }
        } else {
            $a->coursename = get_string('anycourse', 'filters');
        }

        return get_string('courserolelabel', 'filters', $a);
    }
543660
public function getHeaders(string $content): array
    {
        \preg_match_all('/(?<=["\'])[^="\']*\.css(\.gzi?p?)?(\?\d*)?(?=["\'])/', $content, $cssFiles);
        $paths = $this->streamlineFilePaths((array)$cssFiles[0]);

        return $this->mapPathsWithType($paths, 'style');
    }
1238770
public function htmlMessage($identifier, $content="",$styles=NULL) {
		$msg= $this->addHtmlComponent(new HtmlMessage($identifier, $content));
		if(isset($msg) && $styles!==null)
			$msg->setStyle($styles);
		return $msg;
	}
365119
public function parse($content, StylesheetConstraint $stylesheetConstraint = null)
    {
        if($stylesheetConstraint !== null)
        {
            $this->setStylesheetConstraint($stylesheetConstraint);
        }

        $pageCollection = parent::parse($content);
        
        $this->fireOnEndParsing($pageCollection);

        $this->initialize();

        return $pageCollection;
    }