Closed (fixed)
Project:
Web File Manager
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 May 2007 at 19:20 UTC
Updated:
12 Jun 2007 at 15:20 UTC
Jump to comment: Most recent file
Hi,
I don't know how to enable attachements for certain node types only. I don't want to allow users to attach a file to an image node.
Thanks,
Charly
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | attach-by-title.patch | 1.41 KB | charly |
Comments
Comment #1
robmilne commentedThere is currently no way to conditionalize webfm attachment by node type. Does this functionality exist for the upload module?
Comment #2
charly commentedI got my hand on this.
To add radios on admin/content/type/x:
in function webfm_form_alter, add
To show the form on allowed node types only, replace the line
if (user_access('attach WebFM files') && $form['type']['#value'] .'_node_form' == $form_id && variable_get("wfm_attach_$node->type", TRUE)) {by
in the same function.
It seems the wfm_attach_$node->type veriable is some junk of previous version, or whetever. I didn't look at all the code.
I don't post a patch because my local version has some other changes (it only shows one collapsible form showing attached files & file browser).
Thanks,
Charly
Comment #3
charly commentedComment #4
robmilne commentedThanks a lot for the input. I really appreciate it.
I tried your fix and made some minor changes:
Comment #5
charly commentedhi,
sorry for delay,
this patch can be applied on developement version. it just keeps wfm_attach_ variable (cause used elsewhere).
Comment #6
robmilne commentedI don't think the following line will work:
variable_get("wfm_attach_$node->type", 1)) {
The code I sent below was:
variable_get('webfm_attach_'.$node->type, 0)) {
Test it out.
Comment #7
charly commentedI don't see difference, but it's right it's better to always use same syntax
Regards,
Comment #8
robmilne commentedVersion 1.6 has this feature.
Comment #9
(not verified) commented