Jump to content

set staff info in structure view


Blesta Addons

Recommended Posts

when a client is logged in, blesta set the client info to the global structure view, but for staff is not the same, we can't get the staff name, email ... ect  in the structure, this info is only available in the edit setting for profile.

sample case, we need to show a welcome message (Hello mr xxxxxx, ....) in our theme .

i think the code should be like this, and it should be done in the app_controller.php asi think, adding it to the admin_controller.php is not take any effect that because all admin_xxx file inherit from AppController directly

                $this->uses(['Staff']);

                $staff = $this->Staff->get($this->Session->read('blesta_staff_id'));
                if ($staff) {
                    $this->structure->set('staff', $staff);
                }

 

or the magic option is to allow as inject vars to the structure view from preAction event or any new similar hook, let say i want to inject a list of PM's to the structure to use it in our custom admin theme .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...