Browse files

moving to trunk

git-svn-id: http://www.danielnorton.com/svn/opensrc/slpjq/trunk@14 e13d3cbb-0351-4081-91ff-4cc11ee021ac
  • Loading branch information...
1 parent 3b3379d commit ffbc343d4aba20ca41d90ee19ef1e3b68d612c4c @danorton committed Apr 6, 2010
Showing with 71 additions and 0 deletions.
  1. +71 −0 slpjq/slpjq.install
View
71 slpjq/slpjq.install
@@ -0,0 +1,71 @@
+<?php
+// $Id: $
+
+/**
+ * @file
+ * Install, update and uninstall functions for the SlipJaq module.
+ *
+ * @code
+ * © 2010 teeny-tiny websites
+ * http://www.teenytinywebsites.com
+ *
+ * Distributed under the terms of the GNU General Public License, version 3.0
+ * http://www.gnu.org/licenses/gpl-3.0.html
+ * @endcode
+ */
+
+/**
+ * @defgroup slpjq SlipJaq
+ * @{
+ */
+
+/**
+ * @name Installation hook functions
+ * @{
+ */
+
+/**
+ * Implementation of hook_install().
+ *
+ * To maximize code reusability, we simply pull in our admin
+ * configuration form, which contains all of our variable names
+ * and defaults.
+ */
+function slpjq_install() {
+ $form = slpjq_install_get_config_form();
+ foreach ($form as $field => $attrs) {
+ variable_set($field, $attrs['#default_value']);
+ }
+}
+
+
+/**
+ * Implementation of hook_uninstall().
+ *
+ * We use the same reusability technique as we did above with
+ * slpjq_install().
+ */
+function slpjq_uninstall() {
+ $form = slpjq_install_get_config_form();
+ foreach ($form as $field => $attrs) {
+ variable_del($field);
+ }
+}
+/* @} Installation hook functions */
+
+/**
+ * @name Installation internal functions
+ * @{
+ */
+
+/**
+ * Load up our full module and invoke slpjq_get_config_form().
+ */
+function slpjq_install_get_config_form() {
+ if (!function_exists('slpjq_get_config_form')) {
+ require_once('slpjq.module');
+ }
+ return slpjq_get_config_form();
+}
+/* @} Installation internal functions*/
+/* @} SlipJaq */

0 comments on commit ffbc343

Please sign in to comment.