First of all thanks for this great modules.

Is it possible to use this module also for anonymous users?

Would be great!

Glenn

CommentFileSizeAuthor
#7 global_on_off_user_switch_1673584-7.patch15.49 KBdqd

Comments

kaldimar’s picture

Subscribing, I'd like to have this module available in the public area for form submission feedback and so.

SweetTomato’s picture

This seems to be implemented (Set default global settings to show messages the "nice" way). But I dont' see results on my site. Is there possibly an issue with this function that checks if nice messages are enabled?

function nicemessages_are_enabled() {
  if (user_access('toggle nicemessages')) {
    global $user;
    // Load the full user entity with fields attached.
    $accounts = entity_load('user', array($user->uid));
    $account = array_shift($accounts);
    return empty($account->{NICEMESSAGES_FIELDNAME}[LANGUAGE_NONE][0]['value']) ? false : true;
  } else {
    return variable_get('nicemessages_default_state', 1) == 1 ? true : false;
  }
}

I'd like to work through it as well, so if anyone knows what user_access('toggle nicemessages') does, I would appreciate your knowledge. (I think the user_access function checks if a user has a setting enabled, and not adding the user ie user_access(permission) instead of user_access(permission, user) just checks if that permission exists?

As a user, you can set "use nice messages" to None, Yes, or No. Where is this code responding to that permission being none?

dqd’s picture

Title: Anonymous Users » Option to show nice messages for the Anonymous User
Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

SweetTomato: Thanks for bringing some light into it. Which version of nice messages do you use? rc1 or dev?

I would love to move it to dev, since it seems to be an unfinished feature in the code.

dqd’s picture

Component: Miscellaneous » Code
dqd’s picture

Assigned: Unassigned » dqd
Status: Postponed (maintainer needs more info) » Needs review

Ok, I am already working on it. And it seems to work how I changed the forms now. There was also a typo in an older patch of somewhen. ALl together I think I've created a better option logic now, since user based on/off only makes sense for logged in users, and a global ON should take effect for all users, also anonymous. I will commit to HEAD of 2.x dev next hours, since I made some other small changes and it makes no sense to create a patch for this here. I will rather create a new release (2.x) to inform users to make an update to have this feature finally implemented. All other settings will not be affected.

dqd’s picture

Title: Option to show nice messages for the Anonymous User » Option to enable/disable popups globally
Priority: Normal » Major
dqd’s picture

Title: Option to enable/disable popups globally » Global activation options including a switch to user account settings
StatusFileSize
new15.49 KB

I also have added some style features (f.e. facebook style) and optimized the options for shadows with no extra comment or issue here. So this patch is a collection of changes including this feature request but for release history only and will be committed to new dev release. To use the options from this fixed issue here, please just simply update Nicemessage module to the latest dev or release version 2.x.

  • Commit cbc021e on 7.x-2.x by Digidog:
    Issue #1673584 by glenn_jones, SweetTomato, Digidog: Global activation...
dqd’s picture

Status: Needs review » Reviewed & tested by the community
dqd’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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