CompassMenu class
- Copyright
- HomeCu 05/2019
Create the upper right menu in home banking, now called the Compass menu. This concrete exists to customize params both from eternal elements and internal calculations.
See the foot of CreateMenu for usage and documentation.
As an extension no constructor is needed unless you need to do something on startup. :-)
Definition at line 14 of file CompassMenu.php.
| CompassMenu::setCompassParamsArray |
( |
|
$json_path = '' | ) |
|
|
protected |
Sets the array to inject into the parent makeMenu() method from dynamic external params. It looks complex, but is pretty straightforward. Visualize html elements
Text
Can be referenced with nested dot syntax by **element Id."
'some-div.attributes.class.this' = false // turns OFF "this" class 'somewhere-link.attributes.title' = 'My Title' // populates anchor title 'somewhere-link.attributes.class.the' = false // turns off 'the' class 'somewhere-link.content' = 'Use Meaningful Text' // Exchanges 'Text' for this value
Keys must exist in the JSON structure, they will not be added (in this version) See head of CreateMenu for full documentation.
- Parameters
-
| string | $json_path,path | to JSON template |
- Returns
- $this
Definition at line 130 of file CompassMenu.php.
134 $this->compass_params = [
135 'json_path' => $json_path,
136 'substitute_values' => [
137 'compass-menu-badge.display' => ($compass_count > 0)?
true :
false,
140 'user-activity.attributes.class.hcu-navbar-alert' => $this->
setBoolFromCount(
'activity'),
141 'user-activity-link.attributes.href' => $this->
setMenuUrl(
'activity'),
142 'activity-link-text.content' => $this->
getNestedTwoDeep(
'activity',
'display'),
144 'user-activity-badge.content' => $this->
setDisplayNum(
'activity', 9),
145 'secure-email-item.attributes.class.hcu-navbar-alert' => $this->
setBoolFromCount(
'messages'),
146 'secure-email-link.attributes.href' => $this->
setMenuUrl(
'messages'),
147 'secure-email-link-text.content' => $this->
getNestedTwoDeep(
'messages',
'display'),
149 'secure-email-badge.content' => $this->
setDisplayNum(
'messages', 9),
150 'user-status.attributes.class.hcu-navbar-alert' => $this->
setBoolFromCount(
'status'),
152 'user-status-badge.content' => $this->
setDisplayNum(
'status', 9),
153 'user-status-dropdown-link.attributes.href' => $this->
getNestedTwoDeep(
'status',
'endpoint'),
155 'failed-login-k-b.attributes.class.hcu-warning-color' => $this->
isErrorEnableClass(
'status',
'fail',
true),
156 'failed-login-summary-desc-label.content' => $this->
getNestedThreeDeep(
'status',
'fail',
'title'),
157 'failed-login-summary-desc-p.content' => $this->
getNestedThreeDeep(
'status',
'fail',
'date'),
158 'last-login-summary-desc-label.content' => $this->
getNestedThreeDeep(
'status',
'prior',
'title'),
159 'last-login-summary-value-label.content' => $this->
getNestedThreeDeep(
'status',
'prior',
'date'),
161 'acct-status-summary-desc-label.content' => $this->
getNestedThreeDeep(
'status',
'system',
'title'),
162 'acct-status-summary-p.content' => $this->
getNestedThreeDeep(
'status',
'system',
'date'),
163 'user-dropdown.attributes.class.hcu-navbar-alert' => $this->
setBoolFromCount(
'user'),
165 'user-menu-badge.content' => $this->
setDisplayNum(
'user', 9),
168 'update-password-icon-block' => $this->
getNestedThreeDeep(
'user',
'password',
'icon'),
169 'update-password-alert-text.content' => $this->
getNestedThreeDeep(
'user',
'password',
'message'),
170 'update-password-link.attributes.href' => $this->
getNestedThreeDeep(
'user',
'password',
'url'),
171 'update-password-link.content' => $this->
getNestedThreeDeep(
'user',
'password',
'link'),
173 'security-expiring-text.content' => $this->
getNestedThreeDeep(
'user',
'security',
'message'),
174 'update-security-link.attributes.href' => $this->
getNestedThreeDeep(
'user',
'security',
'url'),
175 'update-security-link.content' => $this->
getNestedThreeDeep(
'user',
'security',
'link'),
178 'update-email-link.attributes.href' => $this->
getNestedThreeDeep(
'user',
'email',
'url'),
180 'quicknav-logout-link.attributes.href' => $this->
setMenuUrl(
'logout'),