Wondering if anyone else finds this potentially useful --

Code restructure so the Alert system is a block instead of a separate structure that sits above the current container (not sure why it's a higher order item). This way you could use a block to do the same thing the alert system does instead of 1 hardcoded "block" area that sits the opposite side of the content.

Also either the ability to float to one-side or the other per block would be pretty cool. Found myself doing it throughout my theme that I made as it was.

Comments

icecreamyou’s picture

Status: Active » Postponed

This has been planned for awhile: Appbar will eventually stop recording alerts and instead recommend other modules like Activity for use as the alert system.

The reason Appbar doesn't currently have a setting for floating blocks to the right is that it messes up the ordering. I don't really see a way around that right now, but I'm open to suggestions.

btopro’s picture

Two options come to mind

1. Appbar-left-side and Appbar-right-side as regions added to the blocks page which then just render one after the other
2. a block that forces everything above it to float left and below it to float right (on the block reordering page)

icecreamyou’s picture

I like #1, that's actually a really good idea.

btopro’s picture

Cool, looks to me that it just involves hook_system_info_alter and then handling it in the theme function?


function appbar_system_info_alter(&$info, $file) {
  if (isset($info['regions'])) {
    $info['regions'] += array('appbar-left' => t('Appbar - left side'));
    $info['regions'] += array('appbar-right' => t('Appbar - right sie'));
  }
}

icecreamyou’s picture

Yes. These are the things that will need to be changed to support having blocks on the right side of the Appbar:

  • appbar_system_info_alter()
  • theme_appbar_bar()
  • All the CSS files

But then the alerts system needs to be ripped out, which is a pretty big job:

  • The {appbar} table needs to be removed.
  • The "delete" op of appbar_user() needs to be removed.
  • theme_appbar_alerts() and theme_appbar_alerts_list() need to be removed, including from appbar_theme(). theme_appbar_time() can then be removed too.
  • appbar_get_messages() and appbar_set_message() will no longer have any purpose and should be removed, along with helper function _appbar_set_message().
  • The setting to use Appbar alerts instead of default Drupal messages (as set by drupal_set_message()) needs to be removed, along with _appbar_reformat_messages() and _appbar_get_system_messages().
  • The ability/setting to send an alert to every user will need to be removed, along with _appbar_process_finished().
  • The "hide actions from others' appbar" permission (along with _appbar_hide_alerts()) will no longer be relevant and should be removed.
  • The setting to use the Alert system should be removed, along with the use_alerts JavaScript setting in _appbar_prepare().
  • All of the integrations should be removed, because they're all related to creating new alerts.
  • The jQuery associated with the alert system can be removed, as well as open.png and close.png.
  • Then, a new module will need to be created that integrates with one or more of the Activity, Heartbeat, and Message modules. The new module will keep track of which activity records are "read" or "unread" and by who.
    • The callback pages appbar/refresh/list and appbar/refresh/count, along with the associated callback function _appbar_page, will need to be redesigned.
    • All other settings except the Appbar style and visibility settings should be moved to the new module and updated for it.
    • A new schema will need to be created to store the state of each activity record, along with the associated API and integrated hook implementations.
    • Some sort of system for making Views rows for each activity record look read/unread will need to be created. This would ideally happen through some sort of Views style or alter, but could potentially also be done using JavaScript by passing lists of unread record IDs from PHP to JS or something.

Although these two things could be done separately, they're very closely related in my mind. I'll accept a patch to do either one separately though -- just keep in mind that any patch for the first will need to include an update function to migrate blocks from the old "appbar" region to the proposed "appbar-left" region.

icecreamyou’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Priority: Minor » Normal
Status: Postponed » Active

I've ripped the alerts system out of the D7 branch so this issue is now active again. I wrote the D7 branch with the idea in mind that the appbar-right region would be added so there are only two things needed to accomplish this now:

  1. Un-comment the appbar-right region in appbar_system_info_alter()
  2. Make theme_appbar_bar() support the new region

The second one is a little bit complicated, but not too bad.

icecreamyou’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.