PHP Class SettingsController, vanilla

Inheritance: extends BackEndController
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство Type Description
$Form Gdn_Form
$ModuleSortContainer string
$RequiredAdminPermissions List of permissions that should all have access to main dashboard.
$Uses Models to automatically instantiate.

Méthodes publiques

Méthode Description
addUpdateCheck ( ) Adds information to the definition list that causes the app to "phone home" and see if there are upgrades available.
analyticsTick ( ) Handle the tracking of a page tick.
applications ( string $Filter = '', string $ApplicationName = '' ) Application management screen.
avatars ( ) Settings page for managing avatar settings.
banner ( ) Banner management screen.
bans ( string $Action = '', string $Search = '', integer $Page = '', integer $ID = '' ) Manage user bans (add, edit, delete, list).
cancelPreview ( string $previewThemeFolder = '', string $transientKey = '' ) Closes theme preview.
compareAddonName ( array $A, array $B ) : integer Compare addon names for uasort.
configuration ( )
defaultAvatar ( ) Settings page for uploading, deleting and cropping the default avatar.
disableApplication ( $addonName, $filter )
disableLocale ( $addonName, $addonInfo )
disablePlugin ( $pluginName, $filter = 'all' )
email ( ) Outgoing Email management screen.
emailImageUrl ( ) Endpoint for retrieving current email image url.
emailPreview ( ) Echoes out a test email with the colors and image in the post request.
emailStyles ( ) Settings page for HTML email styling.
emailTest ( ) Form for sending a test email.
enableApplication ( $addonName, $filter )
enableLocale ( $addonName, $addonInfo )
enablePlugin ( $pluginName, $filter = 'all' )
getBanModel ( ) : BanModel Gets the ban model and instantiates it if it doesn't exist.
getTestEmail ( string $image = '', string $textColor = '', string $backGroundColor = '', string $containerBackgroundColor = '', string $buttonTextColor = '', string $buttonBackgroundColor = '' ) : Gdn_Email Sets up a new Gdn_Email object with a test email.
gettingStarted ( ) Prompts new admins how to get started using new install.
home ( )
homepage ( ) Homepage management screen.
index ( ) Main dashboard.
initialize ( ) Highlight menu path. Automatically run on every use.
isUploadedDefaultAvatar ( string $avatar ) : boolean Test whether a path is a relative path to the proper uploads directory.
locales ( string $Op = null, string $LocaleKey = null ) Manage list of locales.
mobileThemeOptions ( ) Manage options for a mobile theme.
mobileThemes ( string $ThemeName = '', string $TransientKey = '' ) Mobile Themes management screen.
plugins ( string $Filter = '', string $PluginName = '' ) Manage list of plugins.
previewTheme ( string $ThemeName = '', string $transientKey = '' ) Show a preview of a theme.
registration ( string $RedirectUrl = '' ) Configuration of registration settings.
removeDefaultAvatar ( ) Remove the default avatar from config & delete it.
removeEmailImage ( ) Remove the email image from config & delete it.
removeFavicon ( ) Remove the logo from config & delete it.
removeLogo ( ) Remove the logo from config & delete it.
removeMobileLogo ( ) Remove the mobile logo from config & delete it.
removeShareImage ( ) Remove the share image from config & delete it.
setEmailFormat ( $value ) Manages the Garden.Email.Format setting.
sortAddons ( array &$Array, boolean $Filter = true ) Sort list of addons for display.
testAddon ( string $AddonType = '', string $AddonName = '', string $TransientKey = '' ) Test and addon to see if there are any fatal errors during install.
themeInfo ( $themeName )
themeOptions ( ) Manage options for a theme.
themes ( string $ThemeName = '', string $TransientKey = '' ) Themes management screen.
tutorials ( string $Tutorial = '' )

Méthodes protégées

Méthode Description
_banFilter ( array $Ban ) Application management screen.
_nameSort ( $A, $B )

Private Methods

Méthode Description
deleteDefaultAvatars ( string $avatar = '' ) Deletes uploaded default avatars.
handleAddonToggle ( $addonName, $addonInfo, $type, $isEnabled, $filter = '', $action = '' )
saveDefaultAvatars ( string $source, array $thumbOptions ) : boolean Saves the default avatar to /uploads in three formats: The default image, which is not resized or cropped.
themeInfoToMediaItem ( string $themeKey, boolean $isCurrent = false ) : MediaItemModule Compiles theme info data into a media module.

Method Details

_banFilter() protected méthode

Application management screen.
Since: 2.0.0
protected _banFilter ( array $Ban )
$Ban array Data about the ban. Valid keys are BanType and BanValue. BanValue is what is to be banned. Valid values for BanType are email, ipaddress or name.

_nameSort() protected static méthode

protected static _nameSort ( $A, $B )

addUpdateCheck() public méthode

Currently added to the dashboard only. Nothing renders with this method. It is public so it can be added by plugins.
public addUpdateCheck ( )

analyticsTick() public méthode

Handle the tracking of a page tick.
public analyticsTick ( )

applications() public méthode

Application management screen.
Since: 2.0.0
public applications ( string $Filter = '', string $ApplicationName = '' )
$Filter string 'enabled', 'disabled', or 'all' (default)
$ApplicationName string Unique ID of app to be modified.

avatars() public méthode

Displays the current avatar and exposes the following config settings: Garden.Thumbnail.Size Garden.Profile.MaxWidth Garden.Profile.MaxHeight
public avatars ( )

banner() public méthode

Banner management screen.
Since: 2.0.0
public banner ( )

bans() public méthode

Manage user bans (add, edit, delete, list).
Since: 2.0.18
public bans ( string $Action = '', string $Search = '', integer $Page = '', integer $ID = '' )
$Action string Add, edit, delete, or none.
$Search string Term to filter ban list by.
$Page integer Page number.
$ID integer Ban ID we're editing or deleting.

cancelPreview() public méthode

Closes theme preview.
Since: 2.0.0
public cancelPreview ( string $previewThemeFolder = '', string $transientKey = '' )
$previewThemeFolder string
$transientKey string

compareAddonName() public static méthode

Compare addon names for uasort.
See also: self::SortAddons()
Since: 2.0.0
public static compareAddonName ( array $A, array $B ) : integer
$A array First addon data.
$B array Second addon data.
Résultat integer Result of strcasecmp.

configuration() public méthode

public configuration ( )

defaultAvatar() public méthode

Settings page for uploading, deleting and cropping the default avatar.
public defaultAvatar ( )

disableApplication() public méthode

public disableApplication ( $addonName, $filter )

disableLocale() public méthode

public disableLocale ( $addonName, $addonInfo )

disablePlugin() public méthode

public disablePlugin ( $pluginName, $filter = 'all' )

email() public méthode

Outgoing Email management screen.
Since: 2.0.0
public email ( )

emailImageUrl() public méthode

Endpoint for retrieving current email image url.
public emailImageUrl ( )

emailPreview() public méthode

Echoes out a test email with the colors and image in the post request.
public emailPreview ( )

emailStyles() public méthode

Exposes config settings: Garden.EmailTemplate.BackgroundColor Garden.EmailTemplate.ButtonBackgroundColor Garden.EmailTemplate.ButtonTextColor Garden.EmailTemplate.Image Saves the image based on 2 config settings: Garden.EmailTemplate.ImageMaxWidth (default 400px) and Garden.EmailTemplate.ImageMaxHeight (default 300px)
public emailStyles ( )

emailTest() public méthode

On postback, sends a test email to the addresses specified in the form.
public emailTest ( )

enableApplication() public méthode

public enableApplication ( $addonName, $filter )

enableLocale() public méthode

public enableLocale ( $addonName, $addonInfo )

enablePlugin() public méthode

public enablePlugin ( $pluginName, $filter = 'all' )

getBanModel() public méthode

Gets the ban model and instantiates it if it doesn't exist.
public getBanModel ( ) : BanModel
Résultat BanModel

getTestEmail() public méthode

Sets up a new Gdn_Email object with a test email.
public getTestEmail ( string $image = '', string $textColor = '', string $backGroundColor = '', string $containerBackgroundColor = '', string $buttonTextColor = '', string $buttonBackgroundColor = '' ) : Gdn_Email
$image string The img src of the previewed image
$textColor string The hex color code of the text.
$backGroundColor string The hex color code of the background color.
$containerBackgroundColor string The hex color code of the container background color.
$buttonTextColor string The hex color code of the link color.
$buttonBackgroundColor string The hex color code of the button background.
Résultat Gdn_Email The email object with the test colors set.

gettingStarted() public méthode

Prompts new admins how to get started using new install.
Since: 2.0.0
public gettingStarted ( )

home() public méthode

public home ( )

homepage() public méthode

Homepage management screen.
Since: 2.0.0
public homepage ( )

index() public méthode

You can override this method with a method in your plugin named SettingsController_Index_Create. You can hook into it with methods named SettingsController_Index_Before and SettingsController_Index_After.
Since: 2.0.0
public index ( )

initialize() public méthode

Highlight menu path. Automatically run on every use.
Since: 2.0.0
public initialize ( )

isUploadedDefaultAvatar() public méthode

Test whether a path is a relative path to the proper uploads directory.
public isUploadedDefaultAvatar ( string $avatar ) : boolean
$avatar string The path to the avatar image to test (most often Garden.DefaultAvatar)
Résultat boolean Whether the avatar has been uploaded from the dashboard.

locales() public méthode

Manage list of locales.
Since: 2.0.0
public locales ( string $Op = null, string $LocaleKey = null )
$Op string 'enable' or 'disable'
$LocaleKey string Unique ID of locale to be modified.

mobileThemeOptions() public méthode

Manage options for a mobile theme.
Since: 2.0.0
public mobileThemeOptions ( )

mobileThemes() public méthode

Mobile Themes management screen.
Since: 2.2.10.3
public mobileThemes ( string $ThemeName = '', string $TransientKey = '' )
$ThemeName string Unique ID.
$TransientKey string Security token.

plugins() public méthode

Manage list of plugins.
Since: 2.0.0
public plugins ( string $Filter = '', string $PluginName = '' )
$Filter string 'enabled', 'disabled', or 'all' (default)
$PluginName string Unique ID of plugin to be modified.

previewTheme() public méthode

Show a preview of a theme.
Since: 2.0.0
public previewTheme ( string $ThemeName = '', string $transientKey = '' )
$ThemeName string Unique ID.
$transientKey string

registration() public méthode

Events: BeforeRegistrationUpdate
Since: 2.0.0
public registration ( string $RedirectUrl = '' )
$RedirectUrl string Where to send user after registration.

removeDefaultAvatar() public méthode

Remove the default avatar from config & delete it.
Since: 2.0.0
public removeDefaultAvatar ( )

removeEmailImage() public méthode

Remove the email image from config & delete it.
public removeEmailImage ( )

removeFavicon() public méthode

Remove the logo from config & delete it.
Since: 2.1
public removeFavicon ( )

removeShareImage() public méthode

Remove the share image from config & delete it.
Since: 2.1
public removeShareImage ( )

setEmailFormat() public méthode

Manages the Garden.Email.Format setting.
public setEmailFormat ( $value )
$value Whether to send emails in plaintext.

sortAddons() public static méthode

Sort list of addons for display.
Since: 2.0.0
public static sortAddons ( array &$Array, boolean $Filter = true )
$Array array Addon data (e.g. $PluginInfo).
$Filter boolean Whether to exclude hidden addons (defaults to TRUE).

testAddon() public méthode

Test and addon to see if there are any fatal errors during install.
Since: 2.0.0
public testAddon ( string $AddonType = '', string $AddonName = '', string $TransientKey = '' )
$AddonType string
$AddonName string
$TransientKey string Security token.

themeInfo() public méthode

public themeInfo ( $themeName )

themeOptions() public méthode

Manage options for a theme.
Since: 2.0.0
public themeOptions ( )

themes() public méthode

Themes management screen.
Since: 2.0.0
public themes ( string $ThemeName = '', string $TransientKey = '' )
$ThemeName string Unique ID.
$TransientKey string Security token.

tutorials() public méthode

public tutorials ( string $Tutorial = '' )
$Tutorial string

Property Details

$Form public_oe property

public Gdn_Form $Form
Résultat Gdn_Form

$ModuleSortContainer public_oe property

public string $ModuleSortContainer
Résultat string

$RequiredAdminPermissions public_oe property

List of permissions that should all have access to main dashboard.
public $RequiredAdminPermissions

$Uses public_oe property

Models to automatically instantiate.
public $Uses