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.

Comments

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

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

nekobul’s picture

Status: Postponed (maintainer needs more info) » Active

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

nekobul’s picture

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.

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

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

nekobul’s picture

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.
nekobul’s picture

StatusFileSize
new83.06 KB

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.

amitaibu’s picture

Status: Postponed (maintainer needs more info) » Needs work

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

nekobul’s picture

StatusFileSize
new2.32 KB

Here it goes Amitai.

amitaibu’s picture

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.

nekobul’s picture

StatusFileSize
new2.34 KB

Amitai,

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

fago’s picture

* 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>.

nekobul’s picture

Category: feature » task

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?

nekobul’s picture

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));

  ...
fago’s picture

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

nekobul’s picture

StatusFileSize
new1.19 KB

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