The idea is to create WYSIWYG plugin to browse and embed Ads to the content area.

Comments

hypertext200’s picture

Status: Active » Needs review
StatusFileSize
new4.9 KB
hypertext200’s picture

Status: Needs work » Needs review
StatusFileSize
new15.36 KB

Ignore the #1

Status: Needs review » Needs work

The last submitted patch, 1780400-wysiwyg-plugin-02.diff, failed testing.

bleen’s picture

Status: Needs review » Needs work

DOH!! I had this open so I cross posted ... ignore this review.

bleen’s picture

I havent even looked at the JS files yet (other than to say that there are LOTS of coding standards issues in there - I recommend you install Dreditor so you can see them more easily)...

That said, this is an interesting idea, and I'm open to learning a bit more about how this might work but I'm not sure yet that this is something I would include. If I did it would * definitely* be an option that would need to be turn-off-able. That might be as easy as saying that the user could choose not to turn on the button in the WYSIWYG configuration, but I want to be clear that this has to be optional to even be considered.

One thing that stood out immediately is that you are creating a wysiwyg directory for the plugin ... that folder should definitely live in dfp/plugins/wysiwyg. I'm also concerned about naming in general. It appears you are calling your button "advertisement" instead of "DFP Tag" or "DFP Ad" or something like that. I'm weary of name space collisions with other advertising modules.

Plenty of other comments below...

+++ b/dfp.moduleundefined
@@ -90,7 +99,7 @@ function dfp_menu() {
-  $tags = _dfp_block_tags();
+  $tags   = _dfp_block_tags();

@@ -254,7 +263,7 @@ function dfp_token_info() {
-function dfp_tokens($type, $tokens, array $data = array(), array $options = array()) {
+function dfp_tokens($type, $tokens, array$data = array(), array$options = array()) {

Violates Drupal coding standards

+++ b/dfp.moduleundefined
@@ -380,7 +388,7 @@ function dfp_tag_load($machinename) {
-    $tag->raw = clone $tag;
+    $tag->raw = clone$tag;

Why are you removing spaces here?

+++ b/dfp.moduleundefined
@@ -505,7 +513,7 @@ function dfp_format_targeting($targeting, $tag = '') {
-  foreach ($targeting as $key => &$target) {
+  foreach ($targeting as $key => & $target) {

why are you adding spaces here?

+++ b/dfp.moduleundefined
@@ -714,8 +722,8 @@ function template_preprocess_dfp_tag(&$variables) {
-  $tag->size = dfp_format_size($tag->size);
-  $tag->slug = dfp_format_slug($tag->slug);
+  $tag->size   = dfp_format_size($tag->size);
+  $tag->slug   = dfp_format_slug($tag->slug);

Violates Drupal coding standards

+++ b/dfp.moduleundefined
@@ -737,9 +745,9 @@ function template_preprocess_dfp_short_tag(&$variables) {
-  $keyvals = array();
-  $keyvals['iu'] = $tag->adunit;
-  $keyvals['c'] = rand(100000, 99999);
+  $keyvals         = array();
+  $keyvals['iu']   = $tag->adunit;
+  $keyvals['c']    = rand(100000, 99999);

Violates Drupal coding standards

+++ b/dfp.moduleundefined
@@ -755,3 +763,58 @@ function template_preprocess_dfp_short_tag(&$variables) {
+  if (isset($_GET['render']) && $_GET['render'] == 'dfp-popup') {

Why are we using query strings here instead of a proper menu callback?

hypertext200’s picture

Thanks for the review. This essentially is an optional one and you never know unless you install WYSIWYG and you see the button option there. Thanks for the coding standard issue those happened due to auto correct on TextMate Drupal Coding standards plugin. I'll fix them when I get some time. Add/Removing spaces defensively from the editor, it auto correct most of them while I type. For the last query string, It's my bad, I'm using something else for url callback in the original code I made and I removed just that code.
We can name this as DFP Ad Unit for namespace problems. Thanks again for reviewing I'll roll a new patch with those changes soon.

Status: Needs work » Needs review
kalyanik’s picture

This plugin doesn't seem to be working for Filtered HTML.

vladimiraus’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Thank you for your contributions.
Drupal 7 is no longer supported.
Closing issue as outdated.