I had an idea to have a module that will generate the code for a skin. The point of this module is to:

  1. Reduce the time needed to create a skin.
  2. Make it easier for people that may not be familiar with PHP but still want to use Skinr.
  3. Creating .inc file is a fairly repetitive procedure and could be well handled by code generation.

Any thoughts, comments, or suggestions would be appreciated. Attached is a mock up to give a better idea of how the module will work.

Comments

jacine’s picture

I would LOVE to see something this.

moonray’s picture

Status: Needs review » Needs work

+1 :-)

Hari’s picture

Awesome! Thanks for the feedback.

Hari’s picture

Status: Needs work » Needs review
StatusFileSize
new9.02 KB

Attached is a patch that will add a work in progress version of skin creator to Skinr.

moonray’s picture

Status: Needs review » Needs work

First off, this looks like it would be quite useful for many people. Well done. :-)

A few notes about the patch, though:

  • The module description in the .info file should probably read something more like: Provides tools to generate skin plugins for Skinr.
  • In skin options under admin/appearance/skinr/skincreator the Type form element would look better as radios. Also, having the options in alphabetical order might help, with checkboxes being the default.
  • When generating the plugin data: Implements hook_skinr_skin_plugin_info() should have a trailing period. It's probably good to add it to the MODIFY THIS INFO TO DESCRIBE THIS FILE line as well. Basically comments should (nearly) always have a trailing period.
  • The 'group' and 'status' options are missing, as is the 'attached' option.
  • Inline comments should be indented to match surrounding code. (e.g. // Lists installed themes on line 54).
  • $options[$theme->name] = $theme->info['name'] . ' [' . t('enabled') . ']'; should be written as $options[$theme->name] = t('!theme [enabled]', array('!theme' => $theme->info['name']));
  • When an array is inline (on 1 line) no trailing comma is needed for the last item (e.g. array('select' => 'select', 'radio' => 'radio', 'checkbox' => 'checkbox', ), on line 114.
  • If you're going to use min() to limit the max number of lines the textarea can have on '#rows' => min(isset($form_state['generated']) ? substr_count($form_state['generated'], "\n") + 1 : 10, 5000), line 151, what's the point if the max is 5000? Might as well remove the limit. :-)
  • You should strip any trailing spaces (or spaces from lines with only spaces).
  • Line 207 has a strange orphaned $comment =.

I hope that's not too discouraging. All in all it's well done. :-)

Hari’s picture

Coool! Thanks for the feedback. I'll look into fixing it up.

stephthegeek’s picture

Sent Hari an email about collaborating on this. We've worked on some wireframes in the past and would be happy to help out with the code for this and the D6 .info -> inc converter.

Hari’s picture

Status: Needs work » Needs review
StatusFileSize
new13.49 KB

Here is an updated patch to the skin creator module(still a work in progress). The code has been revised to be cleaner and more readable. Looking forward to hearing your comments and feedback.

drupov’s picture

subscribe

bmx269’s picture

WOW. Great work.

bmx269’s picture

Nice. I will have to test this when I am back from Drupalcon.

Hari’s picture

Status: Needs review » Active

Changing the status of this from "needs review" to "active" while we work on the patch further to include skin conversion from D6 to D7.

moonray’s picture

Skin converter has been merged into this module. See #1061612: Skin converter from .info to php skin plugin for reference.

moonray’s picture

Updating title to reflect merged functionality.

moonray’s picture

Title: Module to generate the code for .inc files for skins. » Generate new skin plugins, and converter D6 skins to D7 skin plugins

oops.

Hari’s picture

Here is an update as to status of Skinr Creator and Skinr Converter.

Skinr Creator:

  • Complete redesign of GUI.
  • Caching functionality added to allow more complex skin creation and manipulation.
  • Proper validation added to prevent conflicting, plugin / skin / group creation.

Here is what is still being worked on.

  1. Handling of multiple fields for adding options to a skin.
  2. Drag-n-drop value reordering for Skins
  3. Change theme_hooks to an auto completing field instead of checkboxes
  4. Download needs to connected with our var_export function.
  5. *Optional. I think it would be useful to have the creator generate CSS files with the classes specified in the skins. I'd be happy to hear peoples thoughts on this

Skinr Converter:

  • Skin Conversion functionality should be fully functional and needs testing.

Look for a patch later tonight or early tomorrow.

Hari’s picture

StatusFileSize
new82.76 KB

This patch adds the plugin skin_creator to Skinr. As mentioned above there are still a few important things that need to be done but nonetheless if anyone is interested in seeing the changes that have been made from the original idea they can get a look here by patching the latest version of Skinr. Look forward to your feedback.

aquariumtap’s picture

I haven't had a chance to test this yet, but it patched cleanly and looks very cool. Given the amount of code involved, I wonder if it might be best forked into a separate project? If not, perhaps this should be committed into an experimental branch, or iterated upon within some sandbox environment.

aquariumtap’s picture

I've created a sandbox here. @Hari, you should have commit access:

http://drupal.org/sandbox/aquariumtap/1251482

Hari’s picture

@aquariumtap Cool! We do have a project on github at the moment, https://github.com/VortexGOD/skinr_creator. Not sure which is better to be using, github or drupals sandboxes. Open to suggestions.

Hari’s picture

Title: Generate new skin plugins, and converter D6 skins to D7 skin plugins » Generate new skin plugins

The conversion part has been broken out into a separate module. See issue #1555880: Skinr_Converter: Converting Drupal 6 Skins to Drupal 7 Skins.

moonray’s picture

astonvictor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.