Determines the correct user title

@param string $title
@param string $name
@param string $groupTitle
@param int $gid
@return string
18466
public static function getTitle($title = '', $name = '', $groupTitle = '', $gid = 0)
    {
        static $ban_list;

        // If not already built in a previous call, build an array of lowercase banned usernames
        if (empty($ban_list)) {
            $ban_list = [];
            foreach (Container::get('bans') as $cur_ban) {
                $ban_list[] = utf8_strtolower($cur_ban['username']);
            }
        }

        // If the user has a custom title
        if ($title != '') {
            $user_title = self::escape($title);
        } // If the user is banned
        elseif (in_array(utf8_strtolower($name), $ban_list)) {
            $user_title = __('Banned');
        } // If the user group has a default user title
        elseif ($groupTitle != '') {
            $user_title = self::escape($groupTitle);
        } // If the user is a guest
        elseif ($gid == ForumEnv::get('FEATHER_GUEST')) {
            $user_title = __('Guest');
        } // If nothing else helps, we assign the default
        else {
            $user_title = __('Member');
        }

        return $user_title;
    }
523735
public function title($objectAttribute, $name = null)
    {
        $value = $objectAttribute->content();
        if (!$value instanceof Value) {
            return '';
        }

        return $this->fieldType->getName($value);
    }
1296912
private function hBlockIncludingTitle(string $title, string $html): string
    {
        return preg_replace_callback('/(<h\d\s*>\s*(.*?)\s*<\/h\d\s*>)/iu', function ($match) use ($title) {
            if (strlen($match[2]) >= 3 && strpos($title, $match[2]) !== false) {
                return '<div>' . $match[2] . '</div>';
            }

            return $match[1];
        }, $html);
    }
473545
public function set_title($title) {
        $title = format_string($title);
        $title = strip_tags($title);
        $title = str_replace('"', '&quot;', $title);
        $this->_title = $title;
    }
112277
public function groupName(string $name): void
    {
        $parts = array_map(
            function ($n) {
                return Inflector::humanize(Inflector::underscore(str_replace('Controller', '', $n)));
            },
            explode('\\', $name)
        );

        /*
        removes empty array entries
         */
        $parts = array_filter($parts);

        /*
        get just the controller and plugin names
         */
        $parts = array_slice($parts, -2);

        $name = implode(' :: ', $parts);

        $this->set('groupName', $name);
    }
700174
public static function text($name, $title=false)
    {
        global $USER;
        if ( ! $USER ) return false;

        $oldsettings = Settings::linkGetAll();
        $configured = isset($oldsettings[$name]) ? $oldsettings[$name] : false;
        if ( $title === false ) $title = $name;
        if ( ! $USER->instructor ) {
            if ( $configured === false || strlen($configured) < 1 ) {
                echo('<p>'._m('Setting').' '.htmlent_utf8($name).' '._m('is not set').'</p>');
            } else {
                echo('<p>'.htmlent_utf8(ucwords($name)).' '._m('is set to').' '.htmlent_utf8($configured).'</p>');
            }
            return;
        }

        // Instructor view
        echo('<label style="width:100%;" for="'.$name.'">'.htmlent_utf8($title)."\n");
        echo('<input type="text" class="form-control" style="width:100%;" name="'.$name.'"');
        echo('value="'.htmlent_utf8($configured).'"></label>'."\n");
    }
45188
public function translateTitle(
        string $title,
        string $prefix = ''
    ): string {
        $key = ltrim("$prefix.aggregation.$title.label", '.');
        $trans = $this
            ->symfonyTranslator
            ->trans($key, [], 'aggregations');

        return $trans === $key
            ? $title
            : $trans;
    }
234425
public function setTitle($title)
	{
		if ( $title == $this->getTitle() ) { return; }

		$this->_values['title'] = (string) $title;
		$this->setModified();
	}
1246815
public function setTitle($title, $siteName = null, $separator = null)
    {
        $this->meta()->setTitle($title, null, $separator);
        $this->openGraph()->setTitle($title);
        $this->twitter()->setTitle($title);

        return $this->setSiteName($siteName);
    }
1088738
public function setTitlePlaceholder(string $title): PostTypeInterface
    {
        $this->filter->add('enter_title_here', function ($default) use ($title) {
            $screen = get_current_screen();

            if ($this->slug === $screen->post_type) {
                return $title;
            }

            return $default;
        });

        return $this;
    }
505287
public function setTitle($title) {
		if (is_array($title) && empty($title)) {
			$this->title = new \stdClass;
		} else {
			$this->title = $title;
		}

		return $this;
	}
304865
public function setTitle($title)
    {
        $this->setAutoDiscoverTitle($title === null);
        $this->title = $title;

        return $this;
    }
879763
public function addGroupTextareaAction($title)
	{
		$id = ($s = sizeof($this->group_actions)) ? ($s + 1) : 1;

		return $this->group_actions[$id] = new GroupTextareaAction($title);
	}
922222
public function title($title = null)
    {
        if ($title === null) {
            return $this->title;
        }

        $title = $this->plain($title);

        if (empty($this->metas['title'])) {
            $this->metas['title'] = $title;
        }

        return $this->title = $title;
    }
794201
public static function filterTitle(string $title): string
    {
        $title = html_entity_decode($title);
        $title = static::filterPunctuation($title);
        $title = preg_replace('#[^=\x20-\x3B\x3F-\x7E\xA0\x{400}-\x{45F}]+#u', ' ', $title);
        $title = preg_replace('# {2,}#', ' ', $title);

        return trim($title);
    }
360650
public static function getGroupMemberRoles($uid, $gid)
	{
		$db = \App::get('db');
		$sql = "SELECT r.id, r.name, r.permissions FROM `#__xgroups_roles` as r, `#__xgroups_member_roles` as m WHERE r.id=m.roleid AND m.uidNumber=" . $db->quote($uid) . " AND r.gidNumber=" . $db->quote($gid);
		$db->setQuery($sql);

		return $db->loadAssocList();
	}
272665
protected function getLabels($title, $name)
    {
        if (is_array($title)) {
            $title = $this->getFirstElement($title);
        }

        $name = Helpers::removePostFixWith($name, '_id');

        $this->replaceModelName($title, $name, 'field_');

        if ($this->hasLanguages()) {
            $labels = [];

            foreach ($this->languages as $language) {
                $labels[$language] = $title;
            }

            return $labels;
        }

        return $title;
    }