Here's some started code for a module that would enable an upload field on the node view page, enabling permissioned users to add files to the tree through Drupal. Any feedback on if I'm doing this right? I can't seem to get it to render on the page. I even tried to just attach some plain text to the #value field in the nodeapi hook, but it still didn't display. Could anyone point me in the direction of other examples of this I could compare mine to? Thanks a bunch! This will for sure be released back, so help me make it solid!
<?php
function filebrowser_up_nodeapi($node, $op, $a3, $a4) {
if($node->type == 'dir_listing' and $op == 'view') {
$node->content['filebrowser_up'] = array(
'#value' => theme('filebrowser_up_form', $node),
'#weight' => 9,
);
}
}
function theme_filebrowser_up_form($node){
return drupal_get_form('filebrowser_up', $node);
}
function filebrowser_up_form($node){
return 'Form Stuff Here';
}
Comments
Comment #1
brettev commentedI forgot the closing php tag so it didn't mark up right. Here it is correctly.
Comment #2
cmgui commentedthis is what i did:
http://drupal.org/node/361040#comment-1474768
Comment #3
Yoran commentedIt's now integrated in RC8