Flash the input for the current request to the session.

@param  string  $filter
@param  array   $keys
@return void
488084
public function flash($filter = null, $keys = [])
    {
        $flash = (! is_null($filter)) ? $this->$filter($keys) : $this->all();
        $this->session()->getFlashBag()->set($flash);
    }
1371966
public function flash_only( $keys ) {
		$this->session()->flash_input(
			$this->only( is_array( $keys ) ? $keys : func_get_args() )
		);
	}
234949
public function flash($key, $val)
    {
        $this->set($key, $val);
        $this->setSessionInfo($key, 'expire', true);
    }
187175
public function setFilter($filter)
    {
        $this->userOptions['value']     = $this->getFilterValue($this->validator->arrayGet($filter, 'value', $this->getOption('value')));
        $this->userOptions['min_value'] = $this->getFilterValue($this->validator->arrayGet($filter, 'min_value', $this->getOption('min_value')));
        $this->userOptions['max_value'] = $this->getFilterValue($this->validator->arrayGet($filter, 'max_value', $this->getOption('max_value')));
    }
831263
public static function addFilter($filter, $callback = null)
    {
        if (is_array($filter)) {
            $filters = $filter;
            foreach ($filters as $key => $filter) {
                if (is_numeric($key)) {
                    $key = $filter;
                }
                self::addFilter($key, $filter);
            }

            return true;
        } elseif (is_string($filter) && class_exists($filter, false) && is_subclass_of($filter, 'FilterCollection')) {
            foreach (get_class_methods($filter) as $f) {
                if (is_callable(array($filter, $f))) {
                    self::$filters[$f] = array($filter, $f);
                }
            }

            return true;
        }
        if (is_null($callback)) {
            $callback = $filter;
        }

        if (!is_callable($callback)) {
            return false;
        }
        self::$filters[$filter] = $callback;
    }
1001253
protected function setFilter($filter)
    {
        if (!in_array($filter, [
            self::FILTER_EVERYTHING,
            MediaLibraryItem::FILE_TYPE_IMAGE,
            MediaLibraryItem::FILE_TYPE_AUDIO,
            MediaLibraryItem::FILE_TYPE_DOCUMENT,
            MediaLibraryItem::FILE_TYPE_VIDEO
        ])) {
            throw new ApplicationException('Invalid input data');
        }

        $this->putSession('media_filter', $filter);
    }
723786
public function restoreRequest($key): void
    {
        $session = $this->getSession('Arachne.Application/requests');
        if (!isset($session[$key]) || ($this->user !== null && $session[$key][0] !== null && $session[$key][0] !== $this->user->getId())) {
            return;
        }
        $request = clone $session[$key][1];
        unset($session[$key]);

        try {
            $this->loader->filterIn($request);
        } catch (BadRequestException $e) {
            return;
        }
        $request->setFlag(Request::RESTORED, true);
        $parameters = $request->getParameters();
        $parameters[self::FLASH_KEY] = $this->getParameter(self::FLASH_KEY);
        $request->setParameters($parameters);
        $this->sendResponse(new ForwardResponse($request));
    }
37265
protected function flashInput(array $fields)
    {
        $flash = array_where($fields, function($key, $config){

            return $config['flash'];

        });

        Input::flashOnly(array_keys($flash));
    }
440835
public function multiTerm(array $keys, $value, $bool = "must", $filter = false, array $params = []) {
        $subQuery = $this->orWhere($bool);
        foreach ($keys as $key) {
            $subQuery->term($key, $value, $bool, true, $params);
        }
        $subQuery->endSubQuery();
        return $this;
    }
861077
function setDefaults($defaultValues = null, $filter = null)
    {
        if (is_array($defaultValues)) {
            if (isset($filter)) {
                if (is_array($filter) && (2 != count($filter) || !is_callable($filter))) {
                    foreach ($filter as $val) {
                        if (!is_callable($val)) {
                            return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                        } else {
                            $defaultValues = $this->_recursiveFilter($val, $defaultValues);
                        }
                    }
                } elseif (!is_callable($filter)) {
                    return self::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm::setDefaults()", 'HTML_QuickForm_Error', true);
                } else {
                    $defaultValues = $this->_recursiveFilter($filter, $defaultValues);
                }
            }
            $this->_defaultValues = HTML_QuickForm::arrayMerge($this->_defaultValues, $defaultValues);
            foreach (array_keys($this->_elements) as $key) {
                $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this);
            }
        }
    }
38875
public function flashOnly($keys)
    {
        $this->session()->flashInput(
            $this->only(is_array($keys) ? $keys : func_get_args())
        );
    }
877697
protected function removeFromOldFlashData(array $keys)
        {
            $old_data = $this->session->getValue($this->key_name.'.old');

            if (! is_array($old_data)) {
                $old_data = array();
            }
            $this->session->setValue($this->key_name.'.old', array_diff($old_data, $keys));
        }
88147
public function Applications($Filter = '', $ApplicationName = '', $TransientKey = '') {
      $this->Permission('Garden.Settings.Manage');
      
      // Page setup
      $this->AddJsFile('addons.js');
      $this->AddJsFile('applications.js');
      $this->Title(T('Applications'));
      $this->AddSideMenu('dashboard/settings/applications');
      
      // Validate & set parameters
      $Session = Gdn::Session();
      $ApplicationName = $Session->ValidateTransientKey($TransientKey) ? $ApplicationName : '';
      if (!in_array($Filter, array('enabled', 'disabled')))
         $Filter = 'all';
      $this->Filter = $Filter;
      $AuthenticatedPostBack = $this->Form->AuthenticatedPostBack();      
      
      $ApplicationManager = new Gdn_ApplicationManager();
      $this->AvailableApplications = $ApplicationManager->AvailableVisibleApplications();
      $this->EnabledApplications = $ApplicationManager->EnabledVisibleApplications();
      
      if ($ApplicationName != '') {
         $this->EventArguments['ApplicationName'] = $ApplicationName;
         if (array_key_exists($ApplicationName, $this->EnabledApplications) === TRUE) {
            try {
               $ApplicationManager->DisableApplication($ApplicationName);
               Gdn_LibraryMap::ClearCache();
               $this->FireEvent('AfterDisableApplication');
            } catch (Exception $e) {
               $this->Form->AddError(strip_tags($e->getMessage()));
            }
         } else {
            try {
               $ApplicationManager->CheckRequirements($ApplicationName);
            } catch (Exception $e) {
               $this->Form->AddError(strip_tags($e->getMessage()));
            }
            if ($this->Form->ErrorCount() == 0) {
               $Validation = new Gdn_Validation();
               $ApplicationManager->RegisterPermissions($ApplicationName, $Validation);
               $ApplicationManager->EnableApplication($ApplicationName, $Validation);
               Gdn_LibraryMap::ClearCache();
               $this->Form->SetValidationResults($Validation->Results());
               
               $this->EventArguments['Validation'] = $Validation;
               $this->FireEvent('AfterEnableApplication');
            }
            
         }
         if ($this->Form->ErrorCount() == 0)
            Redirect('settings/applications/'.$this->Filter);
      }
      $this->Render();
   }
898336
public function reflash(array $keys = []): void
	{
		$flashData = $this->sessionData['mako.flashdata'] ?? [];

		$flashData = empty($keys) ? $flashData : array_intersect_key($flashData, array_flip($keys));

		$this->flashData = array_merge($this->flashData, $flashData);
	}
141271
public static function flash(string $key, $value = null)
  {
    /**
     * Check if session already has variables.
     *
     * If variables have already been set, merge the new
     * variables with the old ones.
     */
    return $_SESSION['application']['with'] = array_merge(
                                                isset($_SESSION['application']['with']) ? $_SESSION['application']['with'] : [],
                                                [$key => $value]
                                              );
  }
156880
protected static function executeFilter(array $filter, array $vars)
	{
		// Add vars from the registeredVars array to the list of vars
		$vars += ['registeredVars' => []];
		$vars += $vars['registeredVars'];

		// Prepare the list of arguments
		$args = [];
		if (isset($filter['params']))
		{
			foreach ($filter['params'] as $k => $v)
			{
				$args[] = (isset($vars[$k])) ? $vars[$k] : $v;
			}
		}

		return call_user_func_array($filter['callback'], $args);
	}
360543
public function setFilters($filters = [])
    {
        foreach ($filters as $key => $value) {
            $this->addFilter($key, $value);
        }

        return $this;
    }