Documentation

Find
in package
implements ActionInterface Uses BackwardCompatibility

Provides the search functionality inside the admin control panel.

Table of Contents

Interfaces

ActionInterface
Interface for all action classes.

Properties

$include_files  : array<string|int, mixed>
$language_files  : array<string|int, mixed>
$settings_search  : array<string|int, mixed>
$subaction  : string
$subactions  : array<string|int, mixed>
$obj  : object
$backcompat  : array<string|int, mixed>

Methods

call()  : void
Convenience method to load() and execute() an instance of this class.
execute()  : void
This function allocates out all the search stuff.
exportStatic()  : void
Provides a way to export a class's public static properties and methods to global namespace.
internal()  : mixed
A complicated but relatively quick internal search.
load()  : object
Static wrapper for constructor.
member()  : mixed
All this does is pass through to manage members.
online()  : mixed
This file allows the user to search the SM online manual for a little of help.
__construct()  : mixed
Constructor. Protected to force instantiation via self::load().

Properties

$include_files

public array<string|int, mixed> $include_files = []

Any extra files we ought to include.

MOD AUTHORS: If your mod uses autoloading classes, you don't need to worry about this array. Otherwise, you can add your file to this array via the integrate_admin_search hook.

$language_files

public array<string|int, mixed> $language_files = ['Drafts', 'Help', 'Login', 'ManageBoards', 'ManageCalendar', 'ManageMail', 'ManagePaid', 'ManagePermissions', 'ManageSettings', 'ManageSmileys', 'Search']

Load a lot of language files.

MOD AUTHORS: If your mod uses it's own language file for its settings, add the language file to this array via the integrate_admin_search hook.

public array<string|int, mixed> $settings_search = [[__NAMESPACE__ . '\\Features::basicConfigVars', 'area=featuresettings;sa=basic'], [__NAMESPACE__ . '\\Features::bbcConfigVars', 'area=featuresettings;sa=bbc'], [__NAMESPACE__ . '\\Features::layoutConfigVars', 'area=featuresettings;sa=layout'], [__NAMESPACE__ . '\\Features::likesConfigVars', 'area=featuresettings;sa=likes'], [__NAMESPACE__ . '\\Features::mentionsConfigVars', 'area=featuresettings;sa=mentions'], [__NAMESPACE__ . '\\Features::sigConfigVars', 'area=featuresettings;sa=sig'], [__NAMESPACE__ . '\\AntiSpam::getConfigVars', 'area=antispam'], [__NAMESPACE__ . '\\Warnings::getConfigVars', 'area=warnings'], [__NAMESPACE__ . '\\Mods::getConfigVars', 'area=modsettings;sa=general'], [__NAMESPACE__ . '\\Attachments::attachConfigVars', 'area=manageattachments;sa=attachments'], [__NAMESPACE__ . '\\Attachments::avatarConfigVars', 'area=manageattachments;sa=avatars'], [__NAMESPACE__ . '\\Calendar::getConfigVars', 'area=managecalendar;sa=settings'], [__NAMESPACE__ . '\\Boards::getConfigVars', 'area=manageboards;sa=settings'], [__NAMESPACE__ . '\\Mail::getConfigVars', 'area=mailqueue;sa=settings'], [__NAMESPACE__ . '\\News::getConfigVars', 'area=news;sa=settings'], [__NAMESPACE__ . '\\Membergroups::getConfigVars', 'area=membergroups;sa=settings'], [__NAMESPACE__ . '\\Permissions::getConfigVars', 'area=permissions;sa=settings'], [__NAMESPACE__ . '\\Posts::postConfigVars', 'area=postsettings;sa=posts'], [__NAMESPACE__ . '\\Posts::topicConfigVars', 'area=postsettings;sa=topics'], [__NAMESPACE__ . '\\Posts::draftConfigVars', 'area=postsettings;sa=drafts'], [__NAMESPACE__ . '\\Search::getConfigVars', 'area=managesearch;sa=settings'], [__NAMESPACE__ . '\\Smileys::getConfigVars', 'area=smileys;sa=settings'], [__NAMESPACE__ . '\\Server::generalConfigVars', 'area=serversettings;sa=general'], [__NAMESPACE__ . '\\Server::databaseConfigVars', 'area=serversettings;sa=database'], [__NAMESPACE__ . '\\Server::cookieConfigVars', 'area=serversettings;sa=cookie'], [__NAMESPACE__ . '\\Server::securityConfigVars', 'area=serversettings;sa=security'], [__NAMESPACE__ . '\\Server::cacheConfigVars', 'area=serversettings;sa=cache'], [__NAMESPACE__ . '\\Server::exportConfigVars', 'area=serversettings;sa=export'], [__NAMESPACE__ . '\\Server::loadBalancingConfigVars', 'area=serversettings;sa=loads'], [__NAMESPACE__ . '\\Languages::getConfigVars', 'area=languages;sa=settings'], [__NAMESPACE__ . '\\Registration::getConfigVars', 'area=regcenter;sa=settings'], [__NAMESPACE__ . '\\SearchEngines::getConfigVars', 'area=sengines;sa=settings'], [__NAMESPACE__ . '\\Subscriptions::getConfigVars', 'area=paidsubscribe;sa=settings'], [__NAMESPACE__ . '\\Tasks::getConfigVars', 'area=scheduledtasks;sa=settings'], [__NAMESPACE__ . '\\Logs::getConfigVars', 'area=logs;sa=settings']]

This is a special array of functions that contain setting data. We query all these simply to find all the settings.

MOD AUTHORS: If you want to be "real freaking good" then add any settings pages for your mod to this array via the integrate_admin_search hook!

Format: array('function_to_get_config_vars', 'url_for_admin_area_and_sa')

$subaction

public string $subaction = 'internal'

The requested sub-action. This should be set by the constructor.

$subactions

public static array<string|int, mixed> $subactions = ['internal' => 'internal', 'online' => 'online', 'member' => 'member']

Available sub-actions.

$obj

protected static object $obj

An instance of this class. This is used by the load() method to prevent mulitple instantiations.

$backcompat

private static array<string|int, mixed> $backcompat = ['func_names' => ['call' => 'AdminSearch']]

BackwardCompatibility settings for this class.

Methods

call()

Convenience method to load() and execute() an instance of this class.

public static call() : void

execute()

This function allocates out all the search stuff.

public execute() : void

exportStatic()

Provides a way to export a class's public static properties and methods to global namespace.

public static exportStatic() : void

To do so:

  1. Use this trait in the class.
  2. At the END of the class's file, call its exportStatic() method.

Although it might not seem that way at first glance, this approach conforms to section 2.3 of PSR 1, since executing this method is simply a dynamic means of declaring functions when the file is included; it has no other side effects.

Regarding the $backcompat items:

A class's static properties are not exported to global variables unless explicitly included in $backcompat['prop_names']. Likewise, a class's static methods are not exported as global functions unless explicitly included in $backcompat['func_names'].

$backcompat['prop_names'] is a simple array where the keys are the names of one or more of a class's static properties, and the values are the names of global variables. In each case, the global variable will be set to a reference to the static property. Static properties that are not named in this array will not be exported.

$backcompat['func_names'] is a simple array where the keys are the names of one or more of a class's static methods, and the values are the names that should be used for global functions that will encapsulate those methods. Methods that are not named in this array will not be exported.

Adding non-static properties or methods to the $backcompat arrays will produce runtime errors. It is the responsibility of the developer to make sure not to do this.

internal()

A complicated but relatively quick internal search.

public internal() : mixed

load()

Static wrapper for constructor.

public static load() : object
Return values
object

An instance of this class.

member()

All this does is pass through to manage members.

public member() : mixed

ViewMembers()

online()

This file allows the user to search the SM online manual for a little of help.

public online() : mixed

__construct()

Constructor. Protected to force instantiation via self::load().

protected __construct() : mixed

        
On this page

Search results