Generate a title for image tags

@return string
769429
public static function getRandomTitle()
    {
        static $titles = array(
            'Web analytics',
            'Open analytics platform',
            'Real Time Web Analytics',
            'Analytics',
            'Real Time Analytics',
            'Analytics in Real time',
            'Analytics Platform',
            'Data Platform',
        );
        $id = abs(intval(md5(Url::getCurrentHost())));
        $title = $titles[$id % count($titles)];
        return $title;
    }
905093
public function getTitle($allowBasicTags = false)
    {
        $titleParts = [];

        if ($allowBasicTags === true) {
            $allowedTags = '<b><del><em><i><strong><s>';
        } else {
            $allowedTags = '';
        }

        foreach ($this->getTitleColumnName() as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            $value = is_array($this->values[$fieldName]) ? implode(' ', $this->values[$fieldName]) : (string) $this->values[$fieldName];
            if (strip_tags($value, $allowedTags) !== '') {
                $titleParts[] = strip_tags($value, $allowedTags);
            }
        }

        if (!empty($titleParts)) {
            $title = implode(' ', $titleParts);
        } else {
            // nope, no title was found.
            $title = '';
        }

        return $title;
    }
455679
public static function getRssTitle($title = '')
    {
        $title = esc_html(trim(strip_tags($title)));
        $title = (empty($title)) ? __('Untitled', 'modularity') : $title;

        return $title;
    }
923034
public function getPageTitle()
    {
        $titleParts = [];
        $titleParts[] = $this->getTitlePrefix();
        $titleParts[] = $this->getTitle();
        $titleParts[] = $this->getTitleSuffix();
        $titleParts[] = $this->getTitlePageSuffix();

        $titleParts = array_filter($titleParts);

        return implode(' | ', $titleParts);
    }
469576
public function getTitle()
    {
        $iLang = \OxidEsales\Eshop\Core\Registry::getLang()->getTplLanguage();

        return $this->getInfo("title", $iLang);
    }
808263
public function getTagAttribute()
    {
        return ImageElement::img()
            ->isSelfClosing()
            ->src($this->getUrlAttribute() ?: false)
            ->alt($this->getAttribute('title') ?: false);
    }
645689
public function getTitle()
    {
        $fields = $this->_fields;

        if (array_key_exists('title', $fields)) {
            return (string) $fields['title'];
        }

        $fieldNames = $this->getTitleColumnNames($this->contenttype);

        $title = [];
        foreach ($fieldNames as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            if (array_key_exists($fieldName, $fields)) {
                $title[] = is_array($fields[$fieldName]) ? implode(' ', $fields[$fieldName]) : (string) $fields[$fieldName];
            }
        }

        return implode(' ', $title);
    }
1196553
public function getTitleFields() {
        return array(
            // Information
            LabelField::create('FaviconDescription', 'A title tag is the main text that describes an online document. Title elements have long been considered one of the most important on-page SEO elements (the most important being overall content), and appear in three key places: browsers, search engine results pages, and external websites.<br />@ <a href="https://moz.com/learn/seo/title-tag" target="_blank">Title Tag - Learn SEO - Mozilla</a>')
                ->addExtraClass('information'),
            // Title Order
            DropdownField::create('TitleOrder', 'Page Title Order', self::$TitleOrderOptions),
            // Title Separator
            TextField::create('TitleSeparator', 'Page Title Separator')
                ->setAttribute('placeholder', self::$TitleSeparatorDefault)
                ->setAttribute('size', 1)
                ->setMaxLength(1)
                ->setDescription('max 1 character'),
            // Title
            TextField::create('Title', 'Website Name'),
            // Tagline Separator
            TextField::create('TaglineSeparator', 'Tagline Separator')
                ->setAttribute('placeholder', self::$TaglineSeparatorDefault)
                ->setAttribute('size', 1)
                ->setMaxLength(1)
                ->setDescription('max 1 character'),
            // Tagline
            TextField::create('Tagline', 'Tagline')
                ->setDescription('optional')
        );
    }
1312319
private function getTitle(): string {
        $openGraph = $this->article()->getOpenGraph();

        // Rely on OpenGraph in case we have the data
        if (isset($openGraph['title'])) {
            return $this->cleanTitle($openGraph['title']);
        }

        $nodes = $this->getNodesByLowercasePropertyValue($this->article()->getDoc(), 'meta', 'name', 'headline');
        if ($nodes->count()) {
            return $this->cleanTitle($nodes->first()->attr('content'));
        }

        $nodes = $this->article()->getDoc()->find('html > head > title');
        if ($nodes->count()) {
            return $this->cleanTitle(Helper::textNormalise($nodes->first()->text()));
        }

        return '';
    }
40193
public function getTitle()
    {
        $name = (string) $this->getRequiredParameter('name');
        if (!$this->nameExists())
            return SlugUtils::unsluggify($name);

        $image = $this->_imageNames[$name];
        if (!array_key_exists('Title', $image))
            return SlugUtils::unsluggify($name);

        return $image['Title'];
    }
1363249
public function MetaTitle()
    {
        $mapping = self::$url_handlers;
        if ($action = $this->getRequest()->param('Action')) {
            switch ($mapping[$action]) {
                case 'show' :
                    $news = $this->getNews();
                    if (isset($news)) {
                        $this->Title = $news->Title . ' - ' . $this->Title;
                    }
                    break;
                case 'tag' :
                    $tags = $this->getTag();
                    if (isset($tags)) {
                        $this->Title = $tags->Title . ' - ' . $this->Title;
                    }
                    break;
                case 'tags' :
                    $this->Title = _t('News.ALLTAGS_PAGE', 'All tags - ') . $this->Title;
                    break;
                case 'author' :
                    $this->Title = _t('News.AUTHOR_PAGE', 'Items by ') . ucfirst($this->getRequest()->param('ID')) . ' - ' . $this->Title;
                    break;
                case 'archive' :
                    $this->Title = _t('News.ARCHIVE_PAGE', 'Items per period ') . $this->Title;
                    break;
            }

            return $this->Title;
        }
    }
1312472
public function getTitle()
    {
        // configure the link
        $linkconf = $this->getResultLinkConfiguration();

        list($type) = explode(':', $this->row['type']);
        switch ($type) {
            case 'file':
                // if we use FAL, see if we have a title in the metadata
                if ($this->row['orig_uid'] && ($fileObject = SearchHelper::getFile($this->row['orig_uid']))) {
                    $metadata = $fileObject->_getMetaData();
                    $linktext = ($metadata['title'] ? $metadata['title'] : $this->row['title']);
                } else {
                    $linktext = $this->row['title'];
                }
                break;
            default:
                $linktext = $this->row['title'];
                break;
        }

        // clean title
        $linktext = htmlspecialchars(strip_tags($linktext));

        // highlight hits in result title?
        if ($this->conf['highlightSword'] && count($this->pObj->swords)) {
            $linktext = $this->highlightArrayOfWordsInContent($this->pObj->swords, $linktext);
        }
        return $this->cObj->typoLink($linktext, $linkconf);
    }
1235575
public function getPageTitle()
    {
        if (!$this->parser) {
            return;
        }

        $node = $this->parser->find('title', 0);

        if ($node) {
            return $node->innertext;
        }
    }
1004502
public function getEnableTitleAttribute()
    {
        if ($this->attributes['data'] == '' || $this->attributes['type'] != 'image')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['enable_title']))
            return null;
        else {
            return $data['enable_title'];
        }
    }
760353
protected function getTitleTag()
    {
        $legend_tag = new SwatHtmlTag('legend');
        $legend_tag->setContent($this->title, $this->title_content_type);

        return $legend_tag;
    }
924920
public function documentTitle()
    {
        $siteName  = $this->siteName();
        $pageTitle = strip_tags($this->title());

        if ($pageTitle) {
            if ($pageTitle === $siteName) {
                return sprintf('%1$s &#8212; Charcoal', $pageTitle);
            } else {
                return sprintf('%1$s &lsaquo; %2$s &#8212; Charcoal', $pageTitle, $siteName);
            }
        }

        return $siteName;
    }
752524
public function getTitle()
    {
        if ($this->title === null) {
            $match = [];
            preg_match(self::$REGEX_TITLE, $this->output, $match);
            $this->title = array_key_exists(2, $match) ? trim($match[2]) : '';
        }

        return $this->title;
    }