Details
-
Type: Sub-task
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.11.0-b1
-
Component/s: Client Interface
-
Labels:None
Description
This will be a plugin based functionality. Plugins should be able to define a list of "Cards". In spite of the screenshot, these cards should be displayed at the top of the client profile but below the message box.
Create a new table plugin_cards
- id INT(10) UNSIGNED AUTOINCREMENT primary key
- plugin_id INT(10) UNSIGNED NOT NULL
- level ENUM('client', 'staff') NOT NULL DEFAULT 'client'
- value_callback VARCHAR(255) NULL DEFAULT NULL
- label VARCHAR(255) NULL DEFAULT NULL
- html_callback VARCHAR(255) NULL DEFAULT NULL
- background_color VARCHAR(255) NULL DEFAULT NULL
- background_image VARCHAR(255) NULL DEFAULT NULL
- enabled TINYINT(1) NOT NULL DEFAULT '1'
The Plugin class should add a new method getCards() similar to getActions(). Each card should support the following fields:
- level: The level this card should be displayed on (client or staff) (optional, default client)
- value_callback: A method defined by the plugin class for calculating the value of the Card. This method should at the least receive a $client_id parameter.
- label: A string or language key appearing under the value as a label
- html_callback: overrides the value_callback and label fields allowing plugins to insert an custom html in their place through a callback method
- link: The link url to use for wrapping the card in an <a> (optional)
- background-color: The default background color for this card (optional)
- background-image: The path to the default background image for this card (optional)
- enabled: Whether this card appears on client profiles by default (optional, default true)
Info on these cards, like actions, should be stored in the database and updated automatically on upgrade.