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

Amitaibu - April 23, 2008 - 17:25
Status:active» active (needs more info)

Can't you just add the CCL as a link with the full URL in your email?

#2

nekobul - April 23, 2008 - 17:25
Status:active (needs more info)» active

Also it will be good to expose CCL tag, which can be used in actions like send email.

#3

nekobul - April 23, 2008 - 17:27

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

Amitaibu - April 23, 2008 - 17:27
Status:active» active (needs more info)

You can theme it out in the post itself, no?

#5

nekobul - April 23, 2008 - 17:32

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

nekobul - April 24, 2008 - 01:11

The attached archive contains a couple of enhancements I have made to the cclinks module:

  • Added in the content type selection. This selection will disable cclink showing in the content, but it will be still possible to execute the event. The UI can be improved. Changed the cclink label not to be required, now that cclink hiding is possible.
  • Implemented link event to be called only with nid parameter. The vid parameter is optional.
  • Implemented by default to redirect to specified link nid if destination parameter is not provided.

Please review and enjoy.

AttachmentSize
workflow_ng.zip83.06 KB

#7

Amitaibu - April 24, 2008 - 07:23
Status:active (needs more info)» patch (code needs work)

@nekobul,
Please submit the patch according to these guidelines - http://drupal.org/patch/create

#8

nekobul - April 24, 2008 - 11:21

Here it goes Amitai.

AttachmentSize
no_show.patch2.32 KB

#9

Amitaibu - April 27, 2008 - 18:12

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

nekobul - April 27, 2008 - 20:59

Amitai,

I have patched it against 2.0 . My mistake. Please find attached the changes against 2.x.dev.

AttachmentSize
no_show.patch2.34 KB

#11

fago - May 13, 2008 - 13:16
Category:feature request» task

* 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

nekobul - May 7, 2008 - 14:58

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

nekobul - May 7, 2008 - 15:54

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

fago - May 13, 2008 - 13:19

@/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

nekobul - May 13, 2008 - 14:21

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

AttachmentSize
no_show.patch1.19 KB
 
 

Drupal is a registered trademark of Dries Buytaert.