UncleCheese\Dashboard\DashboardPanel
Defines the DashboardPanel dataobject. All dashboard panels must descend from this class.
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class DashboardPanel
extends DataObject
{
- // members
- private static string $table_name = 'DashboardPanel';
- private static array $db = ;
- private static array $has_one = ;
- private static string $default_sort = "SortOrder ASC";
- private static string $size = "normal";
- private static string $icon = "unclecheese/dashboard:images/dashboard-panel-default.png";
- private static integer $priority = 100;
- private static bool $configure_on_create = false;
- protected $template;
- protected string $holderTemplate = "UncleCheese\Dashboard\DashboardPanel";
- protected string $requestHandlerClass = DashboardPanelRequest::class;
- // methods
- public string registered()
- protected string getTemplate()
- public string getHolderTemplate()
- public string getRequestHandlerClass()
- public string getLabel()
- public string getDescription()
- public Dashboard getDashboard()
- public DBHTMLText render()
- public string Icon()
- public DBHTMLText Content()
- public string Link()
- public string DeleteLink()
- public string CreateLink()
- public boolean ShowConfigure()
- public FieldList getConfiguration()
- public ArrayList getPrimaryActions()
- public ArrayList getSecondaryActions()
- public DBHTMLText PanelHolder()
- public string Size()
- public Form Form()
- public void canCreate()
- public void canDelete()
- public void canEdit()
- public void canView()
- public void IsConfigured()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Tasks
Line | Task |
---|---|
246 | Should the class name be escaped? At least Convert::raw2url() is not suitable because it removes backslashes completely, not escaping them. |
Members
private
- $configure_on_create — UncleCheese\Dashboard\bool
- $db
- $default_sort
- $has_one
- $icon — string
- $priority — int
- $size — string
- $table_name
protected
- $holderTemplate — string
- $requestHandlerClass — string
- $template — string
Methods
protected
- getTemplate() — Gets the template, falls back on a default value of the class name
public
- Content() — Renders the inner contents of the panel. Similar to $Layout in pages.
- CreateLink() — The link to create this panel on the dashboard
- DeleteLink() — The link to delete this panel from the dashboard
- Form() — Gets the configuration form for this panel
- Icon() — A template accessor for the icon of this panel
- IsConfigured()
- Link() — The link to this panel through the Dashboard controller
- PanelHolder() — Renders the entire panel. Similar to {@link FormField::FieldHolder()}
- ShowConfigure() — Template accessor for the $configure_on_create boolean
- Size() — For backward compatibility to the old static $size property.
- canCreate()
- canDelete()
- canEdit()
- canView()
- getConfiguration() — Gets the {@link FieldList} object that is used to configure the fields on this panel.
- getDashboard() — An accessor to the Dashboard controller
- getDescription() — Essentially an abstract method. Every panel must have this method defined to provide a description to the panel selection window
- getHolderTemplate() — Gets the holder template
- getLabel() — Essentially an abstract method. Every panel must have this method defined to provide a title to the panel selection window
- getPrimaryActions() — Gets the primary actions, which may appear in the top of the panel
- getRequestHandlerClass() — Gets the request handler class
- getSecondaryActions() — Gets the secondary actions, which may appear in the bottom of the panel
- registered() — Allows the panel to be added
- render() — Renders the panel to its template