◆ __construct()
◆ setup()
◆ getFavorite()
Retrieves a favorite (complete description) from its id.
- Parameters
-
string | array | $id | the favorite id, or an array having 1 key 'name' set to id, their keys are merged to favorite. |
- Returns
- array|bool array the favorite, false if not found (or not permitted)
References dcCore\app().
Referenced by getFavorites().
◆ getFavorites()
getFavorites |
( |
array |
$ids | ) |
|
getFavorites - retrieves a list of favorites.
- Parameters
-
array | $ids | an array of ids, as defined in getFavorite. |
- Returns
- array array of favorites, can be empty if ids are not found (or not permitted)
References $favorites, and getFavorite().
Referenced by migrateFavorites(), and setUserPrefs().
◆ setUserPrefs()
Get user favorites from settings.
These are complete favorites, not ids only returned favorites are the first non-empty list from :
- user-defined favorites
- globally-defined favorites
- a failback list "new post" (shall never be empty)
This method is called by setup()
References getFavorites().
Referenced by setup().
◆ migrateFavorites()
◆ legacyFavorites()
◆ getUserFavorites()
Returns favorites that correspond to current user (may be local, global, or failback favorites)
- Returns
- array array of favorites (enriched)
References $user_favorites.
◆ getFavoriteIDs()
getFavoriteIDs |
( |
bool |
$global = false | ) |
|
Returns user-defined or global favorites ids list shall not be called outside preferences.php...
- Parameters
-
boolean | $global | if true, retrieve global favs, user favs otherwise |
- Returns
- array array of favorites ids (only ids, not enriched)
References $local_favorites_ids.
◆ setFavoriteIDs()
setFavoriteIDs |
( |
array |
$ids, |
|
|
bool |
$global = false |
|
) |
| |
Stores user-defined or global favorites ids list shall not be called outside preferences.php...
- Parameters
-
array | $ids | list of fav ids |
boolean | $global | if true, retrieve global favs, user favs otherwise |
◆ getAvailableFavoritesIDs()
getAvailableFavoritesIDs |
( |
| ) |
|
Returns all available fav ids
- Returns
- array array of favorites ids (only ids, not enriched)
◆ appendMenuTitle()
◆ appendMenu()
◆ appendDashboardIcons()
appendDashboardIcons |
( |
|
$icons | ) |
|
Adds favorites icons to index page shall not be called outside admin/index.php...
- Parameters
-
array | arrayObject | $icons | dashboard icon list to enrich |
References dcCore\app().
◆ register()
register |
( |
string |
$favorite_id, |
|
|
array |
$favorite_data |
|
) |
| |
Registers a new favorite definition
- Parameters
-
string | $favorite_id | favorite id |
array | $favorite_data | favorite information. Array keys are : 'title' => favorite title (localized) 'url' => favorite URL, 'small-icon' => favorite small icon(s) (for menu) 'large-icon' => favorite large icon(s) (for dashboard) 'permissions' => (optional) comma-separated list of permissions for thie fav, if not set : no restriction 'dashboard_cb' => (optional) callback to modify title if dynamic, if not set : title is taken as is 'active_cb' => (optional) callback to tell whether current page matches favorite or not, for complex pages |
- Returns
- dcFavorites instance
Referenced by dcMaintenanceAdmin\adminDashboardFavorites(), and tagsBehaviors\dashboardFavorites().
◆ registerMultiple()
registerMultiple |
( |
array |
$data | ) |
|
◆ exists()
exists - tells whether a fav definition exists or not
- Parameters
-
string | $id | : the fav id to test |
- Returns
- bool true if the fav definition exists, false otherwise
◆ $favorites
◆ $workspace
◆ $local_favorites_ids
◆ $global_favorites_ids
◆ $user_favorites
The documentation for this class was generated from the following file: