]> gitweb.fluxo.info Git - drupal/muamba.git/commitdiff
Adding powered block
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 23 Sep 2011 20:40:24 +0000 (17:40 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 23 Sep 2011 20:40:24 +0000 (17:40 -0300)
15 files changed:
CREDITS.txt
images/capitalism-kills.orig.png [new file with mode: 0644]
images/capitalism-kills.png [new file with mode: 0644]
images/druplicon.png [new file with mode: 0644]
images/earth-recycle.orig.png [new file with mode: 0644]
images/earth-recycle.png [new file with mode: 0644]
images/money-back-sticker.orig.png [new file with mode: 0644]
images/money-back-sticker.png [new file with mode: 0644]
images/waiting.orig.png [new file with mode: 0644]
images/waiting.png [new file with mode: 0644]
muamba-powered.tpl.php [new file with mode: 0644]
muamba.css
muamba.misc.inc
muamba.module
muamba.theme.inc [new file with mode: 0644]

index 6a501ac2fb0b6692fb1bc8930c4f5b661567e40d..5db5305d9bab7bb3974db5b1ed8b684fc19e52f8 100644 (file)
@@ -4,6 +4,11 @@ Credits
 Images
 ------
 
+https://drupal.org/node/9068
 http://www.openclipart.org/detail/146119/cardboard-box-by-lekamie
 http://www.openclipart.org/detail/87799/download-package-by-kuba
 http://www.openclipart.org/detail/74179/community-by-russel
+http://www.openclipart.org/detail/23920/sandglass-by-anonymous-23920
+http://www.openclipart.org/detail/103339/money-back-guarantee-sticker-by-vectorportal
+http://www.openclipart.org/detail/152557/capitalism-kills-by-worker-152557
+http://www.openclipart.org/detail/2213/crystal-earth-recycle-by-kuba
diff --git a/images/capitalism-kills.orig.png b/images/capitalism-kills.orig.png
new file mode 100644 (file)
index 0000000..badf93b
Binary files /dev/null and b/images/capitalism-kills.orig.png differ
diff --git a/images/capitalism-kills.png b/images/capitalism-kills.png
new file mode 100644 (file)
index 0000000..5492993
Binary files /dev/null and b/images/capitalism-kills.png differ
diff --git a/images/druplicon.png b/images/druplicon.png
new file mode 100644 (file)
index 0000000..765d7ab
Binary files /dev/null and b/images/druplicon.png differ
diff --git a/images/earth-recycle.orig.png b/images/earth-recycle.orig.png
new file mode 100644 (file)
index 0000000..661fbe4
Binary files /dev/null and b/images/earth-recycle.orig.png differ
diff --git a/images/earth-recycle.png b/images/earth-recycle.png
new file mode 100644 (file)
index 0000000..fab563e
Binary files /dev/null and b/images/earth-recycle.png differ
diff --git a/images/money-back-sticker.orig.png b/images/money-back-sticker.orig.png
new file mode 100644 (file)
index 0000000..be43ecd
Binary files /dev/null and b/images/money-back-sticker.orig.png differ
diff --git a/images/money-back-sticker.png b/images/money-back-sticker.png
new file mode 100644 (file)
index 0000000..9d48891
Binary files /dev/null and b/images/money-back-sticker.png differ
diff --git a/images/waiting.orig.png b/images/waiting.orig.png
new file mode 100644 (file)
index 0000000..837f996
Binary files /dev/null and b/images/waiting.orig.png differ
diff --git a/images/waiting.png b/images/waiting.png
new file mode 100644 (file)
index 0000000..fa7e4cb
Binary files /dev/null and b/images/waiting.png differ
diff --git a/muamba-powered.tpl.php b/muamba-powered.tpl.php
new file mode 100644 (file)
index 0000000..587bce5
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Show muamba sponsors.
+ */
+
+// Add javascript and CSS files
+$path = drupal_get_path('module', 'muamba');
+drupal_add_css($path .'/muamba.css');
+
+print '<div class="muamba-powered">';
+
+print theme('image',
+  array(
+    'path'  => $path .'/images/money-back-sticker.png',
+    'alt'   => t('Money back guarantee'),
+    'title' => t('Money back guarantee'),
+  )
+);
+
+print theme('image',
+  array(
+    'path'  => $path .'/images/druplicon.png',
+    'alt'   => t('Powered by Drupal'),
+    'title' => t('Powered by Drupal'),
+  )
+);
+
+print theme('image',
+  array(
+    'path'  => $path .'/images/earth-recycle.png',
+    'alt'   => t('Saving resources'),
+    'title' => t('Saving resources'),
+  )
+);
+
+print theme('image',
+  array(
+    'path'  => $path .'/images/capitalism-kills.png',
+    'alt'   => t('Capitalism kills'),
+    'title' => t('Capitalism kills'),
+  )
+);
+
+print '</div>';
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8957be6be5d68f06c6fc8cb6c3247bea5ed9e6e2 100644 (file)
@@ -0,0 +1,7 @@
+.muamba-powered {
+  text-align: center;
+}
+
+.muamba-powered img {
+  padding: 10px 10px 10px 10px;
+}
index 03fe8edef015f1dd7fcf3298e63b3006ef4a6c33..4168464a671e0d8f067f3f6628e9f03e38ceff55 100644 (file)
@@ -12,5 +12,8 @@
  *   Requested item.
  */
 function muamba_request($nid) {
+  // Sanitize
+  $nid = (int) $nid;
+
   return t('You have requested an item');
 }
index 96882d6941791cb8c372beaf2f6d82be5afcc708..1a94da2ead85cccbd34bb361ef95ed874412babe 100644 (file)
@@ -68,5 +68,38 @@ function muamba_theme($existing, $type, $theme, $path) {
       'template'  => 'muamba-widget',
       'variables' => array('nid' => NULL),
     ),
+    'muamba_powered' => array(
+      'template' => 'muamba-powered',
+    ),
   );
 }
+
+/**
+ * Implements hook_block_info()
+ */
+function muamba_block_info() {
+  $blocks['muamba_powered'] = array(
+    'info'   => t('Muamba powered'),
+    'cache'  => DRUPAL_NO_CACHE,
+    'status' => TRUE,
+    'region' => 'footer',
+  );
+
+  return $blocks;
+}
+
+/**
+ * Implements hook_block_view()
+ */
+function muamba_block_view($delta = '') {
+  $block = array();
+
+  switch ($delta) {
+    case 'muamba_powered':
+      $block['subject'] = t("You're welcome");
+      $block['content'] = theme('muamba_powered');
+      break;
+    
+  }
+  return $block;
+}
diff --git a/muamba.theme.inc b/muamba.theme.inc
new file mode 100644 (file)
index 0000000..056632f
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * Misc theme functions.
+ */