| 01:48 | * | JustTB has quit (Quit: Leaving.) |
| 05:24 | * | JustTB has joined |
| 12:56 | tool172[m] | can you have more than 1 hook menu per module area or will i have to explode into folders? |
| 12:57 | tool172[m] | sorry. i got the json data flowing, now i'm working on formatting translating etc |
| 12:58 | mstenta[m] | Hi tool172 - sorry meant to follow up yesterday but dinner, kids bedtime, etc :-) |
| 12:58 | mstenta[m] | Glad to hear you figured it out! |
| 12:58 | mstenta[m] | A module can only have one `hook_menu` function, but it can provide multiple menu items |
| 12:58 | mstenta[m] | `hook_menu` returns an array of items |
| 12:59 | mstenta[m] | api.drupal.org/api/drupal/modules%21syst |
| 21:15 | tool172[m] | so i have one hook right now for the api key storage in farm settings |
| 21:15 | tool172[m] | but i would need to either subfolder that or are you suggesting a better way with returning the arrays |
| 21:15 | * | alexandria[m] has joined |
| 21:15 | tool172[m] | the Drupalize is confusing me, php not so much - i can grind that out |
| 21:23 | paul121[m] | tool172: do you mean something like this? github.com/farmOS/farmOS/blob/7.x-1.x/mo |
| 21:23 | tool172[m] | well |
| 21:23 | tool172[m] | i could use like farm maps, make a sub folder (module within a module) with 2 hook menus |
| 21:23 | paul121[m] | that implementation of `hook_menu` returns multiple menu items. just an example |
| 21:23 | tool172[m] | one to store the api key |
| 21:25 | tool172[m] | right, but i need a hook item for the settings page and another for the actual reports |
| 21:25 | paul121[m] | you should be able to do it in the same module |
| 21:26 | paul121[m] | does that make sense, returning two items from `hook_menu` ? |
| 21:47 | tool172[m] | that's where my mind is blown |
| 21:47 | tool172[m] | i need a visiual code example |
| 21:48 | paul121[m] | check the link above! :-) |
| 21:50 | tool172[m] | and each hook array is only called by the runtime libraries or whatever when needed |
| 21:50 | tool172[m] | ? |
| 21:50 | tool172[m] | it's the magic that always gets me with this thing |
| 21:51 | tool172[m] | well menu array |
| 21:51 | paul121[m] | haha yea there is some magic that happens there (some hooks are cached and not called as often) |
| 21:52 | paul121[m] | but the values you return are merged with all the others |
| 21:52 | tool172[m] | once i get this thing parsin json into views i'll strip out and modulize it and git repo it |
| 21:52 | tool172[m] | right now its strung across in php files |
| 21:53 | tool172[m] | i should buy php storm, i'm using notepad++ and winscp and my apache server |
| 21:53 | paul121[m] | yeah... php storm is nice. having the debugger helps see whats going on |
| 21:54 | tool172[m] | as always thanks guys |
| 21:54 | mstenta[m] | "hook_menu()" only runs occasionally. It is used to build the "{menu_router}" table in the database. That is what's actually used when a request comes into Drupal |
| 21:54 | tool172[m] | i'm making good progress right now...i'm tied in with the api and the json is flying in |
| 21:54 | mstenta[m] | It looks at the requested path and then looks that up in the database to find the callback function for it |
| 21:55 | tool172[m] | mentally i'm thinking of having some callbacks to shift the json requests around |
| 21:56 | tool172[m] | through a case in the hook when it runs |
| 21:56 | tool172[m] | then use Data to serve it as maps or i can us d3 |
| 21:56 | tool172[m] | use not us |
| 21:58 | tool172[m] | i need to road map this because we can link it with livestock stuff |
| 21:58 | tool172[m] | and actually estimate income in nrt based on historical averages for stockyards etc local |
| 21:59 | tool172[m] | cash crops are also reported |