Gets all global actions

@param bool	$override

@return array of Action objects
346689
public function getGlobalActions($override = false)
	{
		//make sure we only run this once and then return the cached version
		if (!sizeof($this->globalActions) || $override)
		{
			$this->globalActions = array();

			//loop over the actions to build the list
			foreach ($this->config->getOption('global_actions') as $name => $options)
			{
				$this->globalActions[] = $this->make($name, $options);
			}
		}

		return $this->globalActions;
	}
435420
protected function scanOverrideFiles($directory, array &$results = array())
    {
        foreach (new DirectoryIterator($directory) as $file) {
            if ($file->isFile() && $file->getExtension() === 'php') {
                $results[] = $file->getFilename();
            } elseif ($file->isDir() && !$file->isDot()) {
                $this->scanOverrideFiles($file->getRealPath(), $results);
            }
        }

        return $results;
    }
470761
public function has_overrides() {
        global $DB;

        $override = $DB->record_exists('assign_overrides', array('assignid' => $this->get_instance()->id));

        if ($override) {
            return true;
        }

        return false;
    }
104260
public function publish($override = false)
    {
        // publish files
        foreach ($this->publishAssets['files'] as $from => $to) {
            $this->publishFile($from, $to, $override);
        }

        // publish directory
        foreach ($this->publishAssets['dirs'] as $fromDir => $toDir) {
            $this->publishDir($fromDir, $toDir, $override);
        }

        // no define asset to publish, will publish source-path to publish-path
        if (!$this->hasAssetToPublish()) {
            $this->publishDir($this->sourcePath, $this->publishPath, $override);
        }

        return $this;
    }
4118
public function getActions($controller)
    {
        $actions = [];
        foreach (get_class_methods($controller) as $method) {
            if (preg_match('#^(.*)Action$#', $method, $match)) {
                $actions[] = $match[1];
            }
        }

        return $actions;
    }
949782
public function getActionsOptions($override = false)
    {
        //make sure we only run this once and then return the cached version
        if (empty($this->actionsOptions) || $override) {
            $this->actionsOptions = array();

            //loop over the actions to build the list
            foreach ($this->getActions($override) as $name => $action) {
                $this->actionsOptions[] = $action->getOptions(true);
            }
        }

        return $this->actionsOptions;
    }
1159187
public function getActions()
    {
        if(! $this->_actions) {
            $this->_actions = array();

            foreach ($this->getMethods() as $method) {
                if (substr($method, 0, 7) == '_action') {
                    $this->_actions[] = strtolower(substr($method, 7));
                }
            }

            $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));
        }

        return $this->_actions;
    }
596972
protected function getActions($row)
    {
        $classname = get_class($row);
        return (array_key_exists($classname, $this->actions)) ? array_get($this->actions, $classname, []) : [];
    }
1159825
private function getOverrideProperties(Action $action, EnvironmentInterface $environment)
    {
        $selectProperties = $this->getPropertiesFromSession($action, $environment);

        $properties = [];
        foreach (\array_keys($selectProperties) as $propertyName) {
            $properties[$propertyName] = $selectProperties[$propertyName];
        }

        return $properties;
    }
950525
public function config($key = null, $value = null, $override = false)
    {
        if (is_array($key) && is_bool($value)) {
            $override = $value;
        }

        return Util::operateArray($this->config, $key, $value, null, null, $override);
    }
1128012
public function getFrontEndWorkflowActions()
    {
        $action    = $this->CurrentAction();
        $options   = $action->getValidTransitions();
        $actions   = new FieldList();

        $hide_disabled_actions_on_frontend = $this->config()->hide_disabled_actions_on_frontend;

        foreach ($options as $option) {
            $btn = new FormAction("transition_{$option->ID}", $option->Title);

            // add cancel class to passive actions, this prevents js validation (using jquery.validate)
            if ($option->Type == 'Passive') {
                $btn->addExtraClass('cancel');
            }

            // disable the button if canExecute() returns false
            if (!$option->canExecute($this)) {
                if ($hide_disabled_actions_on_frontend) {
                    continue;
                }

                $btn = $btn->performReadonlyTransformation();
                $btn->addExtraClass('hide');
            }

            $actions->push($btn);
        }

        $action->updateFrontEndWorkflowActions($actions);

        return $actions;
    }
1374077
public function load($url, $override = false)
    {
        if (!$this->isLoaded($url))
        {
            $translations = array();

            foreach ($this->find($url) as $file)
            {
                try {
                    $loaded = $this->getObject('object.config.factory')->fromFile($file)->toArray();
                } catch (Exception $e) {
                    return false;
                }

                $translations = array_merge($translations, $loaded);
            }

            $this->getCatalogue()->add($translations, $override);

            $this->setLoaded($url);
        }

        return true;
    }
812448
protected function getAllActions()
    {
        $fields = $this->form->Fields()->dataFields();
        $actions = $this->form->Actions()->dataFields();

        $fieldsAndActions = array_merge($fields, $actions);
        $actions = array_filter($fieldsAndActions, function ($fieldOrAction) {
            return $fieldOrAction instanceof FormAction;
        });

        return $actions;
    }
1133936
public static function config($name = null, $config = null, $override = false)
    {
        $overrideAll = (is_array($name) && is_bool($config)) ? $config : false;

        return Util::operateArray(self::$agentsConfig, $name, $config, [], function ($name, array $config) use ($override) {
            self::modifyConfig($name, $config, $override);
        }, $overrideAll, function (array $origin) {
            foreach (array_keys($origin) as $name) {
                if (self::hasAgent("$name")) {
                    self::getAgent("$name")->config([], true);
                }
            }
        });
    }
606811
public function add(array $translations, $override = false)
    {
        if ($override) {
            $this->_data = array_merge($this->_data, $translations);
        } else {
            $this->_data = array_merge($translations, $this->_data);
        }

        return true;
    }
517623
public function setOverrides($overrides)
    {
        $fieldsOverridden = [];
        if (isset($this->payload->body)) {
            foreach ($this->payload->body as &$field) {
                if (
                    isset($field->overridable)
                    && true === $field->overridable
                    && isset($field->key)
                    && isset($overrides[$field->key])
                    && null !== $overrides[$field->key]
                ) {
                    $field->value                  = $overrides[$field->key];
                    $fieldsOverridden[$field->key] = $overrides[$field->key];
                }
            }
        }
        if ($fieldsOverridden) {
            $this->setLogs($fieldsOverridden, 'fieldsOverridden');
        }

        return $this;
    }
1272860
public function get_role_overrides_from_data(\stdClass $data) {
        $overrides = [];
        if (!empty($data->overrides)) {
            $searchkey = 'roleoverride_';

            for ($i = 0; $i < $data->overrides; $i++) {
                $overridedata = (object) [];
                foreach ((array) $data as $fieldname => $value) {
                    if (strpos($fieldname, $searchkey) !== 0) {
                        continue;
                    }

                    $overridefieldname = substr($fieldname, strlen($searchkey));
                    $overridedata->$overridefieldname = $value[$i];
                }

                if (empty($overridedata->roleid) || empty($overridedata->retentionperiodnumber)) {
                    // Skip this one.
                    // There is no value and it will be delete.
                    continue;
                }

                $override = static::convert_fields($overridedata);

                $overrides[$i] = $override;
            }
        }

        return $overrides;
    }