Reviewed & tested by the community
Project:
WindowSize
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2012 at 17:10 UTC
Updated:
5 Dec 2012 at 18:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
alexweber commentedI was about to suggest this be stored as a regular variable as opposed to a theme setting but, on second thought, this would be nice to be theme-specific. :)
Some minor tweaks:
this form alter implementation is probably better off written as windowsize_form_system_theme_settings_alter()
comparing to == 1 is unnecessary in this case and can be safely omitted
Comment #2
upchuk commentedHey there,
Thanks for the comment.
I agree with the first point, can also be written like that.
However, for the second point,
theme_get_setting('toggle_windowsize') == 1This checks if the the variable in the theme settings is set to 1 (aka the widget is turned on) before adding the javascript and css files.
Thanks!
Comment #3
alexweber commented@knob I meant it can be safely replaced with
if (theme_get_setting('toggle_windowsize'))there's no need for the explicit comparison operator since PHP will cast to a boolean automatically when performing the comparison. I personally was not a huge fan because it can lead to errors sometimes but its the Drupal way :)Comment #4
upchuk commentedA..I see, yeah sure, sounds good!
Comment #5
willvincent commentedRerolled without the '== 1', and fixed trailing withspace issues
Comment #6
alexweber commentedlooks fine to me! :)
Comment #7
willvincent commentedActually.. I've got another coming here that includes this and a little more functionality, I'll roll that into a new patch.
In a new issue.
Comment #8
willvincent commentedSee: #1859354: Provide additional settings