From ad84363810fa5cd1a72b54d7cb1658571183d01e Mon Sep 17 00:00:00 2001 From: Kyle Kaminski Date: Thu, 17 Jul 2014 16:03:41 -0500 Subject: drupal_mail test --- ckeditor-settings.txt | 24 ++++++++++++++++++++++++ drupal_mail_test.php | 26 ++++++++++++++++++++++++++ list-unvisitied-nodes.php | 18 ++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 ckeditor-settings.txt create mode 100644 drupal_mail_test.php create mode 100644 list-unvisitied-nodes.php diff --git a/ckeditor-settings.txt b/ckeditor-settings.txt new file mode 100644 index 0000000..10f86a7 --- /dev/null +++ b/ckeditor-settings.txt @@ -0,0 +1,24 @@ +CKEDITOR.on('dialogDefinition', function(ev) { + var dialogName = ev.data.name; + var dialogDefinition = ev.data.definition; + + /* check if the definition is from the link dialog */ + if (dialogName == 'link') { + /* get a reference to the "Target" tab and set default to '_blank' */ + var targetTab = dialogDefinition.getContents('target'); + var targetField = targetTab.get('linkTargetType'); + targetField['default'] = '_blank'; + + } else if (dialogName == 'image') { + var infoTab = dialogDefinition.getContents('info'); + /* remove unnecessary widgets/elements from the 'Image Info' tab */ + //infoTab.remove('txtHSpace'); + //infoTab.remove('txtVSpace'); + + /* set default image target to _blank */ + var linkTab = dialogDefinition.getContents('Link'); + var targetField = linkTab.get('cmbTarget'); + targetField['default'] = '_blank'; + } +}); + diff --git a/drupal_mail_test.php b/drupal_mail_test.php new file mode 100644 index 0000000..8c9725f --- /dev/null +++ b/drupal_mail_test.php @@ -0,0 +1,26 @@ + $my_module . '_' . $my_mail_token, + 'to' => $to, + 'subject' => 'test', + 'body' => 'test', + 'headers' => array( + 'From' => $from, + 'Sender' => $from, + 'Return-Path' => $from, + ), + ); + $system = drupal_mail_system('no_module', $my_mail_token); + if ($system->mail($message)) { + dpm('ok'); + } + else { + dpm('error'); + } + +?> \ No newline at end of file diff --git a/list-unvisitied-nodes.php b/list-unvisitied-nodes.php new file mode 100644 index 0000000..41294d7 --- /dev/null +++ b/list-unvisitied-nodes.php @@ -0,0 +1,18 @@ +fields('og', array('etid')) + ->where("og.entity_type = 'node' AND `field_name` = 'blog_ref' AND og.etid NOT IN (SELECT `entity_id` FROM {flagging} WHERE `fid` = :fid AND `uid` = :uid) AND og.etid IN (SELECT `etid` FROM {og_membership} WHERE `gid` = :gid AND `entity_type` = 'node')", array(':fid' => 3, ':uid' => 1, ':gid' => 192)); +$result = $query->execute(); + +$i = 0; +foreach ($result as $record) { + print $record->etid . PHP_EOL; + $i++; +} +print $i; -- cgit v1.2.3