Extend CCL to be possible to execute and to not be displayed in the node content
nekobul - April 23, 2008 - 17:23
| Project: | Workflow-ng |
| Version: | 5.x-2.x-dev |
| Component: | Configurable Content Links |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (code needs work) |
Description
Right now the CCL are displayed for particular node type when activated from access control. Extend CCL to be available for use, without displaying them in the node content. In this way it will possible to create emails with "click here to activate your post" links.

#1
Can't you just add the CCL as a link with the full URL in your email?
#2
Also it will be good to expose CCL tag, which can be used in actions like send email.
#3
I have tried adding the link, but it is displayed in the node content. If I disable the CCL access in the access control, it is not displayed in the node content, but trying to call the link results in "access denied" message.
#4
You can theme it out in the post itself, no?
#5
It is possible to theme it out, but it will look weird because the wrapping will be still there with all the other links in place. I still want to keep the other types of links available. I think the right solution would be to extend the CCL to not display, but still be callable.
#6
The attached archive contains a couple of enhancements I have made to the cclinks module:
Please review and enjoy.
#7
@nekobul,
Please submit the patch according to these guidelines - http://drupal.org/patch/create
#8
Here it goes Amitai.
#9
did you patch it against 2.x-dev?
Anyway I get an error:
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in C:\wamp\www\d5\sites\all\modules\workflow_ng\cclinks\cclinks_admin.inc on line 123.* warning: Invalid argument supplied for foreach() in C:\wamp\www\d5\includes\form.inc on line 949.
and 'content types' list is empty.
#10
Amitai,
I have patched it against 2.0 . My mistake. Please find attached the changes against 2.x.dev.
#11
* to make $vid optional, use $vid = NULL in the function signature.
* You can set node/nid as default drupal goto path.
* Perhaps better use
<none> instead of <not show>.#12
I have tried your first suggestion, but it doesn't work as expected. I have link like this:
/cclinks/cclink0/99
Where 99 is the $nid. When I use $vid = NULL in the function signature, the upper link doesn't work. The original code I did sent works properly.
I didn't quite understand your second and third comment. Can you please elaborate?
#13
Here is the code that doesn't work, based on your suggestion:
function cclinks_link_click($event_name, $nid, $vid = NULL) {
$cclinks = cclinks_get_events();
$settings = $cclinks[$event_name];
// Get node.
$node = is_int($vid) ? node_load(intval($nid), intval($vid)) : node_load(intval($nid));
...
#14
@/cclinks/cclink0/99: It already works now when you use /cclinks/cclink0/99/0.
I've fixed the display of my above comment, sry.
The second point is about this unnecessary code:
+ if (!isset($_REQUEST['destination'])) {
+ // If destination is not selected, go to related node by default.
+ drupal_goto('node/'. $nid);
+ }
+ else {
+ drupal_goto();
+ }
Try to keep the code simple. Same issue with $vid = NULL - avoid func_get_args. It's not necessary.
#15
I think your suggestion about keeping the code simple makes alot of sense. Please find attached only the change in cclinks_admin.inc from not show -> none
Regards,
Ivan