### Eclipse Workspace Patch 1.0
#P ngpe_drupal
Index: sites/all/modules/mysite/plugins/layouts/left.php
===================================================================
--- sites/all/modules/mysite/plugins/layouts/left.php	(revision 32585)
+++ sites/all/modules/mysite/plugins/layouts/left.php	(working copy)
@@ -33,31 +33,7 @@
       $output .= '<div class="mysite-sortable mysite-quadruple-width" id="mysite-sort'. $col .'">';
     }
     foreach ($set as $key => $value) {
-    if ($value['mid'] && !$value['locked']) {
-        $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-      }
-      else {
-        $output .= '<div class="mysite-group collapsible">';
-      }
-      $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-      $output .= '<div class="mysite-content">';
-      if (!empty($value['output'])) {
-        if (!empty($value['output']['image'])) {
-          $output .= $value['output']['image'];
-        }
-        $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-      }
-      else {
-        $output .= t('<p>No content found.</p>');
-      }
-      $output .= '</div>';
-      $output .= '<div class="mysite-footer">';
-      if (!empty($value['output']['base'])) {
-        $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-      }
-      $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-      $output .= '</div>';
-      $output .= '</div>';
+      $output .= theme('mysite_box', $key, $value);
     }
     $output .= '</div>';
   }
Index: sites/all/modules/mysite/plugins/layouts/stacks.php
===================================================================
--- sites/all/modules/mysite/plugins/layouts/stacks.php	(revision 32585)
+++ sites/all/modules/mysite/plugins/layouts/stacks.php	(working copy)
@@ -33,31 +33,7 @@
       $output .= '<div class="mysite-sortable mysite-full-width" id="mysite-sort'. $col .'">';
     }
     foreach ($set as $key => $value) {
-    if ($value['mid'] && !$value['locked']) {
-        $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-      }
-      else {
-        $output .= '<div class="mysite-group collapsible">';
-      }
-      $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-      $output .= '<div class="mysite-content">';
-      if (!empty($value['output'])) {
-        if (!empty($value['output']['image'])) {
-          $output .= $value['output']['image'];
-        }
-        $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-      }
-      else {
-        $output .= t('<p>No content found.</p>');
-      }
-      $output .= '</div>';
-      $output .= '<div class="mysite-footer">';
-      if (!empty($value['output']['base'])) {
-        $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-      }
-      $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-      $output .= '</div>';
-      $output .= '</div>';
+      $output .= theme('mysite_box', $key, $value);
     }
     $output .= '</div>';
     if ($col == 0) {
Index: sites/all/modules/mysite/mysite.module
===================================================================
--- sites/all/modules/mysite/mysite.module	(revision 32585)
+++ sites/all/modules/mysite/mysite.module	(working copy)
@@ -4061,3 +4061,40 @@
 function mysite_handler_filter_mysiteuser() {
   return array('***MYSITE_USER***' => t('MySite User'));
 }
+
+
+
+function theme_mysite_box($key, $value) {
+  if ($value['mid'] && !$value['locked']) {
+	$output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
+  }
+  else {
+	$output .= '<div class="mysite-group collapsible">';
+  }
+	
+  $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
+	
+  $output .= '<div class="mysite-content">';
+  if (!empty($value['output'])) {
+   if (!empty($value['output']['image'])) {
+	 $output .= $value['output']['image'];
+   }
+   $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
+  }
+  else {
+	$output .= t('<p>No content found.</p>');
+  }
+
+  $output .= '</div>';
+  $output .= '<div class="mysite-footer">';
+	
+  if (!empty($value['output']['base'])) {
+	$output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
+  }
+
+  $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
+  $output .= '</div>';
+  $output .= '</div>';
+	
+  return $output;
+}
Index: sites/all/modules/mysite/API.php
===================================================================
--- sites/all/modules/mysite/API.php	(revision 32585)
+++ sites/all/modules/mysite/API.php	(working copy)
@@ -679,31 +679,7 @@
   $output .= '<div class="mysite-sortable mysite-full-width" id="mysite-sort0">';
   // cycle through the data
   foreach ($data as $key => $value) {
-    if ($value['mid']) {
-      $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-    }
-    else {
-      $output .= '<div class="mysite-group">';
-    }
-    $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-    $output .= '<div class="mysite-content">';
-    if (!empty($value['output'])) {
-      if (!empty($value['output']['image'])) {
-        $output .= $value['output']['image'];
-      }
-      $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-    }
-    else {
-      $output .= t('<p>No content found.</p>');
-    }
-    $output .= '</div>';
-    $output .= '<div class="mysite-footer">';
-    if (!empty($value['output']['base'])) {
-      $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-    }
-    $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-    $output .= '</div>';
-    $output .= '</div>';
+    $output .= theme('mysite_box', $key, $value);
   }
   $output .= '</div>';
   print theme('page', $output, variable_get('mysite_fullscreen', 1));
Index: sites/all/modules/mysite/plugins/layouts/triple.php
===================================================================
--- sites/all/modules/mysite/plugins/layouts/triple.php	(revision 32585)
+++ sites/all/modules/mysite/plugins/layouts/triple.php	(working copy)
@@ -28,31 +28,7 @@
   foreach ($data as $col => $set) {
     $output .= '<div class="mysite-sortable mysite-third-width" id="mysite-sort'. $col .'">';
     foreach ($set as $key => $value) {
-    if ($value['mid'] && !$value['locked']) {
-        $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-      }
-      else {
-        $output .= '<div class="mysite-group collapsible">';
-      }
-      $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-      $output .= '<div class="mysite-content">';
-      if (!empty($value['output'])) {
-        if (!empty($value['output']['image'])) {
-          $output .= $value['output']['image'];
-        }
-        $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-      }
-      else {
-        $output .= t('<p>No content found.</p>');
-      }
-      $output .= '</div>';
-      $output .= '<div class="mysite-footer">';
-      if (!empty($value['output']['base'])) {
-        $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-      }
-      $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-      $output .= '</div>';
-      $output .= '</div>';
+    	$output .= theme('mysite_box', $key, $value);
     }
     $output .= '</div>';
   }
Index: sites/all/modules/mysite/plugins/layouts/columns.php
===================================================================
--- sites/all/modules/mysite/plugins/layouts/columns.php	(revision 32585)
+++ sites/all/modules/mysite/plugins/layouts/columns.php	(working copy)
@@ -28,31 +28,7 @@
   foreach ($data as $col => $set) {
     $output .= '<div class="mysite-sortable mysite-half-width" id="mysite-sort'. $col .'">';
     foreach ($set as $key => $value) {
-    if ($value['mid'] && !$value['locked']) {
-        $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-      }
-      else {
-        $output .= '<div class="mysite-group collapsible">';
-      }
-      $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-      $output .= '<div class="mysite-content">';
-      if (!empty($value['output'])) {
-        if (!empty($value['output']['image'])) {
-          $output .= $value['output']['image'];
-        }
-        $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-      }
-      else {
-        $output .= t('<p>No content found.</p>');
-      }
-      $output .= '</div>';
-      $output .= '<div class="mysite-footer">';
-      if (!empty($value['output']['base'])) {
-        $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-      }
-      $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-      $output .= '</div>';
-      $output .= '</div>';
+      $output .= theme('mysite_box', $key, $value);
     }
     $output .= '</div>';
   }
Index: sites/all/modules/mysite/plugins/layouts/default.php
===================================================================
--- sites/all/modules/mysite/plugins/layouts/default.php	(revision 32585)
+++ sites/all/modules/mysite/plugins/layouts/default.php	(working copy)
@@ -27,31 +27,7 @@
   $output .= '<div class="mysite-sortable mysite-full-width" id="mysite-sort0">';
   // cycle through the data
   foreach ($data as $key => $value) {
-    if ($value['mid'] && !$value['locked']) {
-      $output .= '<div class="mysite-group collapsible sortable-item" id="m'. $value['mid'] .'">';
-    }
-    else {
-      $output .= '<div class="mysite-group collapsible">';
-    }
-    $output .= '<span class="mysite-header">'. $value['title'] .'</span>';
-    $output .= '<div class="mysite-content">';
-    if (!empty($value['output'])) {
-      if (!empty($value['output']['image'])) {
-        $output .= $value['output']['image'];
-      }
-      $output .= theme('mysite_'. $value['format'] .'_item', $value['output']['items']);
-    }
-    else {
-      $output .= t('<p>No content found.</p>');
-    }
-    $output .= '</div>';
-    $output .= '<div class="mysite-footer">';
-    if (!empty($value['output']['base'])) {
-      $output .= '<div class="mysite-footer-left">'. l(t('Read more'), $value['output']['base']) .'</div>';
-    }
-    $output .= ' <div class="mysite-footer-right">'. $value['actions'] .'</div> ';
-    $output .= '</div>';
-    $output .= '</div>';
+    $output .= theme('mysite_box', $key, $value);
   }
   $output .= '</div>';
   print theme('page', $output, variable_get('mysite_fullscreen', 1));
