Provides a way to display modal windows containing call to actions buttons/links.
The logic is similar to the one implemented by drupal_set_message() and drupal_get_messages(): invoke modal_cta_set_message()to 'trigger' the visualisation of a call to action message within a modal window, which will be dinamically 'injected' in the page render array.
This logic let you, for example, handle the visualization of the call to action messages on node creation just by implementing hook_node_insert() for 'triggering' the event: no templating activities needed, no constraints on the node form submit landing page.

Project Page

http://drupal.org/sandbox/sbatman/2004746

Git repository

git clone --branch 7.x-1.x git.drupal.org:sandbox/sbatman/2004746.git

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxsbatman2004746git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

zterry95’s picture

add file modal_cta.install, in the file ,implement

function modal_cta_uninstall() {
  variable_del('modal_cta_width');
  variable_del('modal_cta_height');
}
zterry95’s picture

Issue summary: View changes

Just a typo correction

antoniopironti’s picture

Status: Needs work » Needs review

Oh right, I completely forgot it. Fixed.

medienverbinder’s picture

Status: Needs review » Needs work

Hi,

There are some errors reported by automated review:
See http://ventral.org/pareview/httpgitdrupalorgsandboxsbatman2004746git

Then you would have to still implement the function "modal_cta_uninstall()" to delete the used variables with the uninstall.
(Or perhaps you have forgotten "git push ...")
See No #2

Manual review:
- Install a fresh drupal 7.22
- Install module
- maintain some content and add the function " modal_cta_set_message("one question","want to see a great module ?",array('path' => "http://drupal.org/sandbox/sbatman/2004746", "label" => "YES"),"close") "
- save the node
- result as expected: get a modal call to action

In the readme I would still declare the function "modal_cta_set_message()" with parameters, so that the same is clear how is the module is to be used. Without these disclosures I have to look in the code, what parameters are used (or how many).

antoniopironti’s picture

Hi,
There are some errors reported by automated review:
See http://ventral.org/pareview/httpgitdrupalorgsandboxsbatman2004746git

Then you would have to still implement the function "modal_cta_uninstall()" to delete the used variables with the uninstall.
(Or perhaps you have forgotten "git push ...")

Right: I've pushed everything just on the 7.x-1.x branch. Now should be fine.

In the readme I would still declare the function "modal_cta_set_message()" with parameters, so that the same is clear how is the module is to be used. Without these disclosures I have to look in the code, what parameters are used (or how many).

Great suggestion. I've added it, thanks.

antoniopironti’s picture

Status: Needs work » Needs review

All the automated review problems are fixed, so I've se the status back to 'needs review'.

afi_amouzou’s picture

Very useful module. I have some suggestions:

Bugs:
Manual review:
- Install module
- add in my hook_node_insert function modal_cta_set_message

function my_module_node_insert() {
  modal_cta_set_message('my title', 'my message', array(), 'close');
}

I get this errors:

Undefined index: path in modal_cta_page_alter() (line 120 of modal_cta.module).
Undefined index: label in modal_cta_page_alter() (line 121 of modal_cta.module).

You should provide defauld data or error handling for these fields in case the user live them empty: e.g

function modal_cta_page_alter(&$page) {
  $modal_cta = modal_cta_get_next();
  if (!array_key_exist('path', $modal_cta ) || !isset($modal_cta['path'])) {
  // set default path or error handling
 }
}

Suggestion:
You should delete your master branch before you apply for PAReview.

antoniopironti’s picture

You should provide defauld data or error handling for these fields in case the user live them empty

You are right. Now if the $modal_cta array in $_SESSION does not contain either the action path parameter or the action label parameter, a watchdog error is raised and no modal window are displayed.
Thanks!

cybernetikz’s picture

Set the admin config link at .info file. Others looking good.

antoniopironti’s picture

Done. Thanks.

yury n’s picture

Status: Needs review » Reviewed & tested by the community

Automated review tools reported no problems.

Manual review:
- Install a fresh drupal 7.22
- Install module
- added following code to my hook_node_insert() function
modal_cta_set_message("Success","No you can visit your profile page",array('path' => url('user/' . $user->uid), "label" => "Ok"),"close")
- created node
- works as expected - I've got a modal dialog

Code is matching Coding standarts.

sergeypavlenko’s picture

Hi all

@YurikK_, you do not correctly identify the path to the page:

array('path' => url('user/' . $user->uid), "label" => "Ok")

Should be indicated without url(), otherwise there is a problem with forwarding:

array('path' => 'user/' . $user->uid, "label" => "Ok")

Made a review module, everything works well, I liked the code.

And another question, why did you leave the position of the line number 69, 93, 105, 113, 115? They can be removed.

antoniopironti’s picture

And another question, why did you leave the position of the line number 69, 93, 105, 113, 115? They can be removed.

You are right. I've just removed those lines. Thanks.

kscheirer’s picture

Status: Reviewed & tested by the community » Needs work

You dont need to specify php = 5.2.4 in your .info file, Drupal 7 already requires 5.2.5.

Possible Duplication

It seems that this module provides very similar functionality to many other popup/overlay modules. Could you describe how your module differs?

We prefer collaboration over competition, therefore we want to prevent having duplicating modules on drupal.org. If the differences between these modules are not too fundamental for patching the existing one, we would love to see you joining forces and concentrate all power on enhancing one module. (If the existing module is abandoned, please think about taking it over).

If that fails for whatever reason please get back to us and set this back to "needs review".

Code too short
This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project for you.

Implementing a hook_help(), adding options or admin configuration, or other simple hooks can help you get around this limitation. Simpletests are always welcome too!

----
Top Shelf Modules - Crafted, Curated, Contributed.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

Issue summary: View changes

Git clone instructions updated