List of available audience options

@param bool $any add option for "Any" (for search forms)
@return array
505801
public static function audience_options($any = false) {
        $options = array();
        if ($any) {
            $options['all'] = get_string('any');
        }
        $options[self::HUB_AUDIENCE_EDUCATORS] = get_string('audienceeducators', 'hub');
        $options[self::HUB_AUDIENCE_STUDENTS] = get_string('audiencestudents', 'hub');
        $options[self::HUB_AUDIENCE_ADMINS] = get_string('audienceadmins', 'hub');
        return $options;
    }
908121
public function getOptions($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        $options = $this->options;

        if ($includeBase && $this->baseFormat) {
            // append base options
            $options = array_replace($options, $this->baseFormat->getOptions());
        }

        return $options;
    }
388440
public function getFilterable(bool $assoc = false): array
	{
		if ($this->filterable === self::ALLOW_ALL) {
			return self::ALLOW_ALL;
		}

		return $assoc ? $this->filterable : array_keys($this->filterable);
	}
1357136
public static function getActionableViews() {
		static $views;
		if (isset($views)) {
			return $views;
		}

		$views = [];

		$plugin = elgg_get_plugin_from_id('hypeInteractions');
		$settings = $plugin->getAllSettings();
		foreach ($settings as $key => $value) {
			if (!$value) {
				continue;
			}
			list ($prefix, $view) = explode(':', $key);
			if ($prefix !== 'stream_object') {
				continue;
			}
			$views[] = $view;
		}

		return $views;
	}
1013816
public function stageChildren($showAll = false) {
		if ($this->Title != 'Content Root' && $this->source) {
			$children = new ArrayList();
			$item = new ExternalContentItem($this->source, $this->Title . '1');
			$item->Title = $this->Title . '1';
			$item->MenuTitle = $item->Title;

			$children->push($item);
			return $children;
		}
	}
1257684
function suggestions_may_interested( $page = 1, $count = 10 )
	{   
		$params = array();
		$params['page'] = $page;
		$params['count'] = $count;
		return $this->oauth->get( 'suggestions/users/may_interested', $params);
	}
770037
public function listBranches($all = false, $simple = false)
    {
        $this->clearAll();
        $this->addCommandName(self::BRANCH_COMMAND);
        if (!$simple) {
            $this->addCommandArgument('-v');
        }
        $this->addCommandArgument('--no-color');
        $this->addCommandArgument('--no-abbrev');
        if ($all) {
            $this->addCommandArgument('-a');
        }

        return $this->getCommand();
    }
1049517
protected function getParamOptions($checkParam)
    {
        if (isset($this->allowedParams[$checkParam])) {
            return array('param' => $checkParam, 'options' => $this->allowedParams[$checkParam]);
        } else {
            foreach ($this->allowedParams as $param => $options) {
                if (! empty($options['alias']) && in_array($checkParam, (array) $options['alias'])) {
                    return compact('param', 'options');
                }
            }
        }

        return false;
    }
1093894
public function get_enrolment_plugins($onlyenabled = true) {
        if ($this->_plugins === null) {
            $this->_plugins = enrol_get_plugins(true);
        }

        if ($onlyenabled) {
            return $this->_plugins;
        }

        if ($this->_allplugins === null) {
            // Make sure we have the same objects in _allplugins and _plugins.
            $this->_allplugins = $this->_plugins;
            foreach (enrol_get_plugins(false) as $name=>$plugin) {
                if (!isset($this->_allplugins[$name])) {
                    $this->_allplugins[$name] = $plugin;
                }
            }
        }

        return $this->_allplugins;
    }
429433
protected function get_valid_hosts_options() {
        global $CFG;
        require_once($CFG->dirroot.'/mnet/service/enrol/locallib.php');

        $service = mnetservice_enrol::get_instance();

        $subscribers = $service->get_remote_subscribers();
        $hosts = array(0 => get_string('remotesubscribersall', 'enrol_mnet'));
        foreach ($subscribers as $hostid => $subscriber) {
            $hosts[$hostid] = $subscriber->appname.': '.$subscriber->hostname.' ('.$subscriber->hosturl.')';
        }
        return $hosts;
    }
1049007
public function toOptionArray()
    {
        return [
            ['label' => __('Auto'), 'value' => self::AUTO_DISPLAYED],
            ['label' => __('Always hidden'), 'value' => self::ALWAYS_HIDDEN],
            ['label' => __('Always displayed'), 'value' => self::ALWAYS_DISPLAYED],
        ];
    }
1291452
public function addCurrentSiblings($anyParameters = false, $includeCurrent = false)
    {
        if ($current = $this->menu->getCurrent()) {
            if ($parent = $current->getParent()) {
                $parameters = $current->getParameters();
                if ($includeCurrent) {
                    $current = null;
                }

                foreach ($parent->getChildren() as $menuItem) {
                    // Add any menu item that is not the current menu item
                    // and that has the same parameters, unless $anyParameters is true.
                    if (($menuItem !== $current) && ($anyParameters || ($menuItem->getParameters() == $parameters))) {
                        $this->addMenuItem($menuItem);
                    }
                }
            }
        }
        return $this;
    }
1025113
function showNoOptionsAvailable( $elem ) {
        var bselect = _callMethod( $elem, "element" );
        bselect.find( ".bselect-message" ).text( $.bselect.i18n.noOptionsAvailable ).show();
    }
569365
public function getActivityFormTypeOptions($view = 'default')
    {
        $options['view'] = $this->view = $view;
        $options['bundle_name'] = $this->parameters['bundle_name'];
        $options['module_identifier'] = $this->parameters['module_identifier'];
        if (isset($this->parameters['hooks_options'])) {
            $options['hooks_options'] = $this->parameters['hooks_options'];
        }
        if($this->handler->hasContent($this->view)) {
            $options['content_forms'] = $this->getContentFormTypesOptions();
        }
        $options['campaign'] = $this->campaign;

        return $options;
    }
208541
public static function get_current_versions_ids($audience = null) {
        global $DB;
        $sql = "SELECT v.policyid, v.id
             FROM {tool_policy} d
             LEFT JOIN {tool_policy_versions} v ON v.policyid = d.id
             WHERE d.currentversionid = v.id";
        $params = [];
        if ($audience) {
            $sql .= " AND v.audience IN (?, ?)";
            $params = [$audience, policy_version::AUDIENCE_ALL];
        }
        return $DB->get_records_sql_menu($sql . " ORDER BY d.sortorder", $params);
    }
1100096
public function overall_feedback_content_options() {
        global $CFG;
        require_once($CFG->dirroot.'/repository/lib.php');

        return array(
            'subdirs' => 0,
            'maxbytes' => $this->overallfeedbackmaxbytes,
            'maxfiles' => $this->overallfeedbackfiles,
            'changeformat' => 1,
            'context' => $this->context,
            'return_types' => FILE_INTERNAL,
        );
    }
1287386
protected function getDisplayOptions()
    {
        $displayOptions = array();
        $dumperOptions = $this->getDumperOptions();
        // Only used by Symfony 3.2 and newer:
        if (isset($dumperOptions['expanded_depth'])) {
            $displayOptions['maxDepth'] = $dumperOptions['expanded_depth'];
        }
        // Only used by Symfony 3.2 and newer:
        if (isset($dumperOptions['max_string'])) {
            $displayOptions['maxStringLength'] = $dumperOptions['max_string'];
        }
        // Only used by Symfony 3.2 and newer:
        if (isset($dumperOptions['file_link_format'])) {
            $displayOptions['fileLinkFormat'] = $dumperOptions['file_link_format'];
        }
        return $displayOptions;
    }