PHP Class SettingsController, vanilla

Inheritance: extends BackEndController
显示文件 Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$Form Gdn_Form
$ModuleSortContainer string
$RequiredAdminPermissions List of permissions that should all have access to main dashboard.
$Uses Models to automatically instantiate.

Public Methods

Method 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 = '' )

Protected Methods

Method Description
_banFilter ( array $Ban ) Application management screen.
_nameSort ( $A, $B )

Private Methods

Method 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 method

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 method

protected static _nameSort ( $A, $B )

addUpdateCheck() public method

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 method

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

applications() public method

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 method

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

banner() public method

Banner management screen.
Since: 2.0.0
public banner ( )

bans() public method

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 method

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

compareAddonName() public static method

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.
return integer Result of strcasecmp.

configuration() public method

public configuration ( )

defaultAvatar() public method

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

disableApplication() public method

public disableApplication ( $addonName, $filter )

disableLocale() public method

public disableLocale ( $addonName, $addonInfo )

disablePlugin() public method

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

email() public method

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

emailImageUrl() public method

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

emailPreview() public method

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

emailStyles() public method

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 method

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

enableApplication() public method

public enableApplication ( $addonName, $filter )

enableLocale() public method

public enableLocale ( $addonName, $addonInfo )

enablePlugin() public method

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

getBanModel() public method

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

getTestEmail() public method

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.
return Gdn_Email The email object with the test colors set.

gettingStarted() public method

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

home() public method

public home ( )

homepage() public method

Homepage management screen.
Since: 2.0.0
public homepage ( )

index() public method

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 method

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

isUploadedDefaultAvatar() public method

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)
return boolean Whether the avatar has been uploaded from the dashboard.

locales() public method

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 method

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

mobileThemes() public method

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 method

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 method

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

registration() public method

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

removeDefaultAvatar() public method

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

removeEmailImage() public method

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

removeFavicon() public method

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

removeShareImage() public method

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

setEmailFormat() public method

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

sortAddons() public static method

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 method

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 method

public themeInfo ( $themeName )

themeOptions() public method

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

themes() public method

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

tutorials() public method

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

Property Details

$Form public_oe property

public Gdn_Form $Form
return Gdn_Form

$ModuleSortContainer public_oe property

public string $ModuleSortContainer
return 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