mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Differentiate array variable fields #65

Closed alexandru-elisei closed 3 years ago

alexandru-elisei commented 8 years ago

I have experimented with several ways to differentiate the fields for array variables, and what I think the best idea is to have the array index before the field.

For example, let's say that I have the following dependencies in the recipe:

dependencies:
    - plugin: mod_newmod
      version: 2016010100
    - plugin: block_test
      version: ANY_VERSION

On the web interface the fields will appear like this:

0. Plugin: mod_newmod
0. Version: 2016010100

1. Plugin: block_test
1. Version: ANY_VERSION

If it's not exactly clear how this will look like I can upload a screenshot.

With nested array variables (for example, capabilities):

0. Name
0. Riskbitmask
...
Archetypes:
0.0 Role
0.0 Permission

0.1 Role
0.1 Permission 

In case it might look a bit strange to start the numbering from 0 (e.g 0. Plugin): array indexes start at 0 with most programming languages, I would like to keep it that way on the web interface too. But if it looks too weird I can change it (I'll add 1 to the array index).

mudrd8mz commented 8 years ago

Looks good to me. Let us keep it enumerated from zero - it is a tool for geeks anyway.

alexandru-elisei commented 8 years ago

I've implemented the indexes for fields that are part of numerically indexed array. I've created a branch based on the web interface branch, which is pending integration.

Do you think I should merge the two branches into one single pull request?

I've opted to implement this feature on a separate branch because the web interface code is already very complex and I didn't want to add even more complexity in case I need to change something.

mudrd8mz commented 8 years ago

Do you think I should merge the two branches into one single pull request?

Yeah, it might be the best at this stage.

alexandru-elisei commented 8 years ago

Done, the web interface is now final. You can review the pull request.