From ad969637fb4dd8c0354b5829626516858208fed8 Mon Sep 17 00:00:00 2001
From: Derek Wright <git@dwwright.net>
Date: Wed, 16 Mar 2011 15:05:38 -0500
Subject: [PATCH] Issue #1095056 by dww: Removed dead and debugging code.

---
 dme.inc                       |   12 -----------
 dme.module                    |   45 -----------------------------------------
 dme_image/dme_image.admin.inc |    2 -
 dme_image/dme_image.module    |   20 ------------------
 4 files changed, 0 insertions(+), 79 deletions(-)

diff --git a/dme.inc b/dme.inc
index 44a25c8..1540310 100644
--- a/dme.inc
+++ b/dme.inc
@@ -168,7 +168,6 @@ class dmeEngine {
     if (count($this->_tag_list) == 0) {
       return $text;
     }
-    //$this->_tag_list = $tag_list;
 
     $tag_name_list = $this->_dme_get_tag_list($this->_tag_list);
 
@@ -176,8 +175,6 @@ class dmeEngine {
       // group 1 is the tag name, group 2 is the parameters, group 3 is the value, but shouldn't be used in the callback,
       //  and group 4 is the type of quote used, if any.
       $regex = "@\[dme:(". implode('|', $tag_name_list['simple']) .')\s*((?:\s+\w+=([-+]?[0-9.]+|(["\']).+?\4))*)\s*/\]@is';
-
-      //array($this, "_dme_process_callback")
       $text = preg_replace_callback($regex, array($this, "_dme_process_callback"), $text);
     }
 
@@ -205,7 +202,6 @@ class dmeEngine {
    *  Text to replace the tags with.
    */
   function _dme_process_callback($matches) {
-    //drupal_set_message(print_r($matches, true));
     $nid = 0;
     if (isset($this->_type) && isset($this->_cid)) {
       if ($this->_type == 'node') {
@@ -224,7 +220,6 @@ class dmeEngine {
           $arguments['dme_inner_text'] = $inner_text;
         }
         $arguments = array_merge($arguments, $tag_arguments);
-        //drupal_set_message('tag:'. print_r($tag, true));
         if ($tag['type'] == 'function') {
           if (!isset($arguments['nid'])) {
             $arguments['nid'] = $nid;
@@ -248,7 +243,6 @@ class dmeEngine {
             $tag_details[] = $node;
           }
           $arguments = array_merge($tag_details, $arguments);
-          //drupal_set_message('Arguments:'. print_r($arguments, true));
           return call_user_func_array('theme', $arguments);
         }
       }
@@ -272,13 +266,9 @@ class dmeEngine {
     }
     $result = array();
     $matches = array();
-    //drupal_set_message('looking in '. $arguments);
     $regex = '@(\w+)=([-+]?[0-9.]+|(["\'])(.+?)\3)@i';
-    //$regex = '@(\w+)=([0-9]+)@i';
-    //drupal_set_message('matching:'. preg_match($regex, $attributes, $matches));
     while (1 == preg_match($regex, $arguments, $matches)) {
       // Do stuff with matches.
-      //drupal_set_message('matches for '. $arguments .':'. print_r($matches, true));
       $matches[1] = strtolower($matches[1]);
       if ($allowed != 'all' && !is_array($allowed)) {
         drupal_set_message("Bad Setup for tag '". $tag ."'.  'allowed_attributes' must be an array if not 'all' or 'none'.", 'error');
@@ -293,8 +283,6 @@ class dmeEngine {
         }
       }
       $arguments = preg_replace($regex, '', $arguments, 1);
-      //drupal_set_message('remaining:'. $arguments);
-      //break;
     }
     return $result;
   }
diff --git a/dme.module b/dme.module
index 226c58c..175b169 100644
--- a/dme.module
+++ b/dme.module
@@ -28,13 +28,6 @@ function dme_menu() {
     'weight' => -10,
   );
 
-  $items['dme_test'] = array(
-    'title' => 'Test DME',
-    'page callback' => 'dme_test_page',
-    'access arguments' => array('access administration pages'),
-    'type' => MENU_CALLBACK,
-  );
-
   return $items;
 }
 
@@ -115,34 +108,6 @@ function dme_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   if ($op == 'insert') {
     _dme_nodeapi_insert($node);
   }
-  /*if ($op == 'alter') {
-    require_once(drupal_get_path('module', 'dme') .'/dme.inc');
-    $dme = new dmeEngine();
-    $dme->set_node($node);
-    if ($a3) {
-      $node->teaser = $dme->_dme_process_text($dme->_dme_prepare_text($node->teaser));
-    }
-    else {
-      $node->body = $dme->_dme_process_text($dme->_dme_prepare_text($node->body));
-    }
-  }*/
-  /*if ($op == 'rss item') {
-    require_once(drupal_get_path('module', 'dme') .'/dme.inc');
-    if ('teaser' == variable_get('feed_item_length', 'teaser')) {
-      $dme = new dmeEngine();
-      $dme->set_node($node);
-      $node->teaser = $dme->_dme_process_text($dme->_dme_prepare_text($node->teaser));
-    }
-    elseif ('fulltext' == variable_get('feed_item_length', 'teaser')) {
-      $dme = new dmeEngine();
-      $dme->set_node($node);
-      $node->body = $dme->_dme_process_text($dme->_dme_prepare_text($node->body));
-      // Just in case, as views may produce rss feeds that ignore the feed_item_length.
-      if (module_exists('views')) {
-        $node->teaser = $dme->_dme_process_text($dme->_dme_prepare_text($node->teaser));
-      }
-    }
-  }*/
 }
 
 /**
@@ -221,12 +186,6 @@ function content_dme_apply_fields($node_type) {
   return $result;
 }
 
-function dme_test_page() {
-  $return = dme_get_fields_to_apply('blog');
-
-  return '<pre>'. print_r($return, TRUE) .'</pre>';
-}
-
 /**
  * Called by dme_nodeapi when $op == 'presave'.
  *
@@ -234,11 +193,9 @@ function dme_test_page() {
  */
 function _dme_nodeapi_presave(&$node) {
   if (isset($node->nid)) {
-    //<dme:context type='node' cid='NNN' />
     // Check to see if the teaser is the start of the body or not.
     $include = !isset($node->teaser) || ($node->teaser == substr($node->body, 0, strlen($node->teaser)));
     $node_context = _dme_get_node_context_tag($node->nid);
-    //$nodetag_pattern = '!<dme:context (type|cid)=(["\'])(.*?)\2 (type|cid)=(["\'])(.*?)\5\s*/? >\s*(</dme:context>)?!i';
     // Some of this may no longer be necessary because of the prepare nodeapi call that has been added.
     if (preg_match(DME_CONTEXT_REGEXP, $node->body, $matches)) {
       $new_body = preg_replace(DME_CONTEXT_REGEXP, $node_context, $node->body);
@@ -287,14 +244,12 @@ function _dme_nodeapi_presave(&$node) {
 }
 
 function _dme_set_filter_field(&$field_value, $node_context) {
-  //dpm("Pre-presave Field value for $field_name is $field_value.");
   if (preg_match(DME_CONTEXT_REGEXP, $field_value, $matches)) {
     $field_value = preg_replace(DME_CONTEXT_REGEXP, $node_context, $field_value);
   }
   else {
     $field_value = $node_context . $field_value;
   }
-  //dpm("Field Value for $field_name is $field_value");
 }
 
 /**
diff --git a/dme_image/dme_image.admin.inc b/dme_image/dme_image.admin.inc
index b381d4c..6096f0d 100644
--- a/dme_image/dme_image.admin.inc
+++ b/dme_image/dme_image.admin.inc
@@ -9,9 +9,7 @@ function dme_image_settings() {
   $form = array();
 
   $node_types = node_get_types('names');
-  //dpm($node_types);
   $fields = content_fields();
-  //dpm($fields);
   $fields_by_type = array();
   $field_options = array(FALSE => t('No Default Field'));
   foreach ($fields as $field) {
diff --git a/dme_image/dme_image.module b/dme_image/dme_image.module
index 88d07ca..3f4bcc0 100644
--- a/dme_image/dme_image.module
+++ b/dme_image/dme_image.module
@@ -85,15 +85,6 @@ function _dme_image_create_image_tag($nid, $parameters) {
     return '';
   }
 
-  // This is an attempt at auto-numbering tags which is not quite working yet.
-  // Problem is that the tags do not necessarily get processed in order front to back!
-  /*if (array_key_exists($nid, $image_positions)) {
-    $default_number = ++$image_positions[$nid];
-  }
-  else {
-    $default_number = 0;
-    $image_positions[$nid] = 0;
-  }*/
   $default_number = 0;
   // Scrub the number parameter - make sure it is safe.
   if (array_key_exists('number', $parameters)) {
@@ -140,8 +131,6 @@ function _dme_image_create_image_tag($nid, $parameters) {
     }
   }
 
-  //dpm($parameters);
-
   if ($parameters['align'] == 'center' || !empty($caption)) {
     $img_width = _dme_image_get_width($parameters['imagecache'], $node->{$field_name}[$parameters['number']]['filepath']);
   }
@@ -210,8 +199,6 @@ function theme_dme_image($align, $preset, $file_data, $caption = '', $img_width
     }
     $img_tag = l($img_tag, $file_data['filepath'], $options);
   }
-    //$img_tag = '<a href="'. url($file_data['filepath']) .'" rel="shadowbox" title="'. $caption .'">'. $img_tag .'</a>';
-
 
   return $style .'<div class="'. implode(' ', $classes) .'">'.
     $img_tag . $caption_tag .'</div>';
@@ -247,7 +234,6 @@ function dme_image_init() {
  */
 function dme_image_form_alter($form, $form_state, $form_id) {
   if ($form['type']['#value'] && $form['type']['#value'] .'_node_form' == $form_id) {
-    //$path = drupal_get_path('module', 'dme_image') .'/plugins/dme_image-insert/images/Video.png';
     $namespace = variable_get('dme_image_'. $form['type']['#value'] .'_preset', FALSE);
     if (!$namespace) {
       $namespace = variable_get('dme_image_default_preset', FALSE);
@@ -257,12 +243,6 @@ function dme_image_form_alter($form, $form_state, $form_id) {
     }
 
     drupal_add_js(array('dme_image' => array('namespace' => $namespace)), 'setting');
-    //$placeholder_path = imagecache_create_path($namespace, $path);
-    //$placeholder_path = imagecache_create_url($namespace, $path);
-    /*if (!$placeholder_path) {
-      $placeholder_path = $path;
-    }*/
-    //drupal_add_js(array('dme_image' => array('placeholder_path' => $placeholder_path)), 'setting');
   }
 }
 
-- 
1.7.3.5

