Make the site into black-white-gray style for some unfortunately reasons.
Used for Drupal 7.x

Project page: http://drupal.org/sandbox/spiritfelix/1975496
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/spiritfelix/1975496.git gray

pareview: http://ventral.org/pareview/httpgitdrupalorgsandboxspiritfelix1975496git

Comments

sreynen’s picture

Title: Gray » [D7] Gray
sreynen’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

zterry95’s picture

  $form['gray_style_enable'] = array(
    '#type' => 'checkbox',
    '#title' => 'Enable Black-White-Gray Style',
    '#default_value' => variable_get('gray_style_enable', FALSE),
    '#description' => 'Make the site into black-white-gray style for some unfortunately reasons, wish no one will use this module',
  );

add t function for #description, #title. in gray.admin.inc

spiritfelix’s picture

oh, forgot it, thank you

zterry95’s picture

make a gray.install file, in this file, implement

  gray_uninstall() {
    variable_del('gray_style_enable');
  }

Or simplely write it in gray.module.

zterry95’s picture

change the menu path from

admin/config/gray

to

admin/config/user-interface/gray

this is more reasonable, and easily for user to find and understand.

spiritfelix’s picture

Thank you, zterry95

All of these has done, now.

a.milkovsky’s picture

Status: Needs review » Needs work

Please consieder reviewing of coding standarts

FILE: /var/www/drupal-7-pareview/pareview_temp/gray.install
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
9 | ERROR | Expected 2 space(s) before asterisk; 1 found
10 | ERROR | Expected 2 space(s) before asterisk; 1 found
13 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/gray.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
14 | ERROR | Do not use t() in hook_menu()
15 | ERROR | Do not use t() in hook_menu()
--------------------------------------------------------------------------------

Test your module at http://ventral.org/pareview/httpgitdrupalorgsandboxspiritfelix1975496git

spiritfelix’s picture

Status: Needs work » Needs review

a.milkovsky
Thank you!
Fixed!
And also reviewed at http://ventral.org/pareview/httpgitdrupalorgsandboxspiritfelix1975496git

thomas_rendleman’s picture

Status: Needs review » Needs work

hook_preprocess_HOOK() is great to use.
I just used it in my module "World Flag Logo".
It didn't effect all the websites because it is preprocessed.
You need to add hook_process_HOOK also with the same function.
The reason is some themes modify theme variable names, like marinelli. This will help you cover the majority of themes.

Currently I can't get any themes to work with this. That maybe your problem. Try to do a fresh install with your module and see what happens. I'm sure you can make it work. I would add a variable that is being saved into the database also (.install). If you need some help there are a lot of great tutorials "BUILD A MODULE.COM" or "DRUPALIZE.ME".

spiritfelix’s picture

Status: Needs work » Needs review

thomas_rendleman
thank you,

Add this to make the background white instead of other color or image:
background: #ffffff !important;

because different theme has different way to make the html, and there is not a way to make the background gray, so I define a background color instead.

reviewed by: http://ventral.org/pareview/httpgitdrupalorgsandboxspiritfelix1975496git

thomas_rendleman’s picture

Uninstalled your module.
Reinstalled your module.
Changed theme to Bartik.
Configured all background colors to be #ffffff
Configured your option to make it gray in admin/config/user-interface/gray.
Went back to home page in Bartik.
Nothing changed, didn't work.

spiritfelix’s picture

Status: Needs review » Needs work

Hi, thomas_rendleman

Thank you for test, maybe I know the point now, it works in my Chrome, but not work in Firefox, I will continue working on this, thank you!

thomas_rendleman’s picture

Status: Needs work » Needs review

Wow you are right. Went to Chrome with the module still active. Chrome did if fact show the gray color. Firefox still didn't work. Try to process and preprocess. I had to do both to get my logo module to work.

thomas_rendleman’s picture

By the way don't give up on this. I know I would have a use. You see when an employee is looking all day long at a screen colors can be anoying. This would be great if you could have in configured per role. Say you have a secretary who is entering data all day, this would save her eyes. It is a great idea.

spiritfelix’s picture

Good Idea!
I will keep on this, first of all, make it work on Firefox and others, and then maybe add more, thank you for your idea!

thomas_rendleman’s picture

No problem.
Also if it would be good for some websites that has tutorials. Maybe like a button "Easy Eye Mode" that would turn it on and off. I would love that.

pagolo’s picture

Hi spiritfelix,
your module works fine, however it seems to be too short (less than 120 lines of code).
Automated review: it's all ok.
Manual review:

  • gray.info file can be improved. You should add this line:
    configure = admin/config/user-interface/gray
  • gray.module: you can implement hook_help() [see api hook_help()]
  • gray.install: you can implement hook_install() to show a message ('module is installed ok') and a configuration link.
spiritfelix’s picture

Thanks pagolo,

I have added, and also make it works in Firefox already.

I am in Ubutnu now, Can anybody help me to check this in windows, and alse IE(maybe 8 and 9?)?

pagolo’s picture

I am in Ubutnu now, Can anybody help me to check this in windows, and alse IE(maybe 8 and 9?)?

I can test IE and Chrome, if you wish...

spiritfelix’s picture

I can test IE and Chrome, if you wish...

thank you, pagolo,

I have tested in Windows and IE, I found it works in both Chrome and Firefox, but not work well in IE...

spiritfelix’s picture

Add a setting to make it auto-disable by cron.

spiritfelix’s picture

sorry, wrong input about tags.

thmnhat’s picture

Status: Needs review » Needs work

Hi spiritfelix,

My manual review:

In gray.admin.inc:
- You should use t() function for the description of the second element.

  $form['gray_style_end_date'] = array(
    '#type' => 'date',
    '#title' => 'End date',
    '#default_value' => variable_get('gray_style_end_date', FALSE),
    '#description' => 'Make the black-white-gray style disable from this day',
  );



In gray.install
- You should support non url-rewriting websites by changing the link

$msg = $t('Gray module installed, you can enable the effect <a href = "admin/config/user-interface/gray">here</a>');

to

$msg = $t('Gray module installed, you can enable the effect <a href="!link">here</a>', array('!link' => url('admin/config/user-interface/gray')));



In gray,module, function gray_help()
- The the <a> tag, you should use ! instead @, because your link doesn't contain any special characters, so we don't have to run the check_plain(). And also (just my point of view) you should use double quotes instead of quote in the attribute.

$output .= '<p>' . t("For more information or feedback, see the issue for <a href='@gray'>Gray module</a>.", array('@gray' => 'http://drupal.org/node/1976472')) . '</p>';

My correction

$output .= '<p>' . t('For more information or feedback, see the issue for <a href="!link">Gray module</a>.', array('!link' => 'http://drupal.org/node/1976472')) . '</p>';

Just one more thing, what happens if my cron runs once per day or later than one day? hmmmm

spiritfelix’s picture

yey, thmnhat,
thank you very much!

spiritfelix’s picture

to thmnhat,
if you enable the gray style and setup the date, it will be gray and come back to "not gray" after cron run when over the date.

spiritfelix’s picture

to thmnhat,
and about the "@" in the hook_help, the same as it is in the blog module "blog_help()", so I will not change, any way, thank you!

spiritfelix’s picture

Status: Needs work » Needs review

Others Fixed

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

This is a great module? All your text descriptions are so negative, but the comments here are overwhelmingly positive! It's a clean module and certainly unique. It may not be quite up the typical word count, but that's ok with me. Usually too-short modules are just a single hook implementation of something basic, but this is not.

----
Top Shelf Modules - Enterprise modules from the community for the community.

spiritfelix’s picture

I wanna to know what shall I do next to make this sandbox project into a module.
THX

stborchert’s picture

Status: Reviewed & tested by the community » Needs work

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away.

There are some serious issues with this project you need to fix:

README.txt
Please take a moment to make your README.txt follow the guidelines for in-project documentation.
project page
Please take a moment to make your project page follow tips for a great project page.
Code too short
This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project for you.
PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Add pareview link