? views Index: og.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/og/og.module,v retrieving revision 1.298.2.161 diff -u -r1.298.2.161 og.module --- og.module 5 Apr 2008 15:05:46 -0000 1.298.2.161 +++ og.module 11 Apr 2008 22:02:43 -0000 @@ -598,7 +598,7 @@ } function og_invite_form($gid) { - $max = variable_get('og_email_max', 10); + $max = og_variable_get('email_max', 10); $form['mails'] = array('#type' => 'textarea', '#title' => t('Email addresses or usernames'), '#description' => t('Enter up to %max email addresses or usernames. Separate multiple addresses by commas or new lines. Each person will receive an invitation message from you.', array('%max' => $max))); $form['pmessage'] = array('#type' => 'textarea', '#title' => t('Personal message'), '#description' => t('Optional. Enter a message which will become part of the invitation email.')); @@ -611,7 +611,7 @@ function og_invite_form_validate($form_id, $form_values, $form) { global $user; - $max = variable_get('og_email_max', 10); + $max = og_variable_get('email_max', 10); $mails = $form_values['mails']; $mails = str_replace("\n", ',', $mails); @@ -1093,7 +1093,7 @@ '#theme' => 'og_mission', ); - $view = views_get_view(variable_get('og_home_page_view', 'og_ghp_ron')); + $view = views_get_view(og_variable_get('home_page_view', 'og_ghp_ron')); $views_available = variable_get('views_defaults', array()); if ($views_available[$view->name] == "disabled") { // Do nothing. Assume the group node type handles homepage, or theme layer - i.e. node-.tpl.php @@ -1174,7 +1174,7 @@ // registration checkbox // get the visibility for normal users - $visibility = variable_get('og_visibility_registration', OG_REGISTRATION_CHOOSE_FALSE); + $visibility = og_variable_get('visibility_registration', OG_REGISTRATION_CHOOSE_FALSE); // admin can always choose - get right default if (user_access('administer nodes')) { @@ -1199,7 +1199,7 @@ // directory checkbox - $visibility = variable_get('og_visibility_directory', OG_DIRECTORY_CHOOSE_FALSE); + $visibility = og_variable_get('visibility_directory', OG_DIRECTORY_CHOOSE_FALSE); // override for admins - get right default if (user_access('administer nodes')) { @@ -1223,7 +1223,7 @@ } // private groups - $visibility = variable_get('og_private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE); + $visibility = og_variable_get('private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE); // override setting for admins - get right default if (user_access('administer nodes')) { $not = array(OG_PRIVATE_GROUPS_NEVER, OG_PRIVATE_GROUPS_CHOOSE_FALSE); @@ -1339,7 +1339,7 @@ // returns TRUE if node type should generate email notifications when posted to a group. function og_node_type_notify($type) { - $omitted = variable_get('og_omitted_email_node_types', array()); + $omitted = og_variable_get('omitted_email_node_types', array()); return in_array($type, $omitted) ? FALSE : TRUE; } @@ -1394,7 +1394,7 @@ } else { // Ensure that a group is selected if groups are required. needed when author has no groups. In other cases, fapi does the validation - if (!in_array($node->type, variable_get('og_omitted', array())) && variable_get('og_audience_required', FALSE) && !user_access('administer nodes')) { + if (!in_array($node->type, og_variable_get('omitted', array())) && og_variable_get('audience_required', FALSE) && !user_access('administer nodes')) { if (!isset($node->og_groups)) { form_set_error('title', t('You must !join before posting on this web site.', array('!join' => l(t('join a group'), 'og')))); } @@ -1526,7 +1526,7 @@ $form['author']['name']['#title'] = t('Group manager'); $form['options']['sticky']['#title'] = t('Sticky at top of group home page and other lists'); } - elseif (!in_array($node->type, variable_get('og_omitted', array()))) { + elseif (!in_array($node->type, og_variable_get('omitted', array()))) { if (!$node->nid) { if ($group_node = og_get_group_context()) { $bc[] = array('path' => 'og', 'title' => t('Groups')); @@ -1682,7 +1682,7 @@ } $node = $form['#node']; - $required = variable_get('og_audience_required', 0) && !user_access('administer nodes'); + $required = og_variable_get('audience_required', 0) && !user_access('administer nodes'); // Determine the list of groups that are shown. @@ -1737,7 +1737,7 @@ } // show read only item if we are non-admin, and in simple mode (i.e. non-checkboxes) and at least one group is in querystring - $simple = !user_access('administer organic groups') && !variable_get('og_audience_checkboxes', TRUE) && count($gids); + $simple = !user_access('administer organic groups') && !og_variable_get('audience_checkboxes', TRUE) && count($gids); // determine value of audience multi-select if (count($options) == 1 && $required) { @@ -1765,7 +1765,7 @@ // don't bother with visibility if access control is disabled. all is public. if (variable_get('og_enabled', FALSE)) { // get the visibility for normal users - $vis = variable_get('og_visibility', 0); + $vis = og_variable_get('visibility', 0); // override visibility for og admins and when author only has 1 group if (user_access('administer organic groups') && $vis < 2) { @@ -1785,7 +1785,7 @@ $group_node->nid = $gid; og_load_group($group_node); if ($group_node->og_private) { - $vis = variable_get('og_visibility', 0) == OG_VISIBLE_BOTH ? OG_VISIBLE_GROUPONLY : OG_VISIBLE_CHOOSE_PRIVATE; + $vis = og_variable_get('visibility', 0) == OG_VISIBLE_BOTH ? OG_VISIBLE_GROUPONLY : OG_VISIBLE_CHOOSE_PRIVATE; break; } } @@ -1855,7 +1855,7 @@ // Used by og_book to determine the public state of an autocreated node. // TODO: Does not consider private groups. function og_get_visibility_default() { - $vis = variable_get('og_visibility', 0); + $vis = og_variable_get('visibility', 0); switch ($vis) { case OG_VISIBLE_GROUPONLY: case OG_VISIBLE_CHOOSE_PRIVATE: @@ -1968,7 +1968,7 @@ '@site_mail' => variable_get("site_mail", ini_get("sendmail_from")), '@site_name' => mime_header_encode(variable_get("site_name", 'Drupal')), ); - $from_mail = strtr(variable_get("og_email_notification_pattern", '@user_name <@site_mail>'), $variables); + $from_mail = strtr(og_variable_get("email_notification_pattern", '@user_name <@site_mail>'), $variables); $headers = array('X-Mailer' => 'Drupal - og_mail', 'Precedence' => 'list', 'Message-Id' => "<$obj->msgid>"); if ($obj->in_reply_to) { @@ -2229,7 +2229,7 @@ $form['og_settings']['og_email'] = array('#type' => 'radios', '#title' => t('Email notifications'), '#options' => $options, - '#default_value' => isset($account->og_email) ? $account->og_email : variable_get('og_notification', 2), + '#default_value' => isset($account->og_email) ? $account->og_email : og_variable_get('notification', 2), '#description' => t('When posts are submitted into your groups, you may be notified via email.'), ); return $form; @@ -2246,7 +2246,7 @@ } $sql = 'INSERT INTO {og_uid_global} (uid, og_email) VALUES (%d, %d)'; - db_query($sql, $account->uid, variable_get('og_notification', OG_NOTIFICATION_ALWAYS)); + db_query($sql, $account->uid, og_variable_get('notification', OG_NOTIFICATION_ALWAYS)); $account->og_email = NULL; break; case 'update': @@ -2356,7 +2356,7 @@ } function og_is_omitted_type($type) { - return in_array($type, variable_get('og_omitted', array())); + return in_array($type, og_variable_get('omitted', array())); } @@ -2692,7 +2692,7 @@ // $group is an object containing the group node function og_og_create_links($group) { - $exempt = array_merge(variable_get('og_node_types', array('og')), variable_get('og_omitted', array())); + $exempt = array_merge(variable_get('og_node_types', array('og')), og_variable_get('omitted', array())); foreach (node_get_types() as $type) { // we used to check for node_access(create) but then node admins would get a false positive and see node types that they could not create // When this becomes a proper menu in D6, we get sorting for free @@ -2761,7 +2761,7 @@ t('Group creator chooses whether her group appears in the directory. Defaults to %in.', array('%in' => t('in directory'))), t('Group creator chooses whether her group appears in the directory. Defaults to %out.', array('%out' => t('not in directory'))), ); - $form['og_settings']['group_details']['og_visibility_directory'] = array('#type' => 'radios', '#title' => t('Groups directory control'), '#default_value' => variable_get('og_visibility_directory', OG_DIRECTORY_CHOOSE_TRUE), '#description' =>t('OG admins always see the checkbox for adding a group to the %dir. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.', array('%dir' => t('groups directory'))), '#options' => $options); + $form['og_settings']['group_details']['og_visibility_directory'] = array('#type' => 'radios', '#title' => t('Groups directory control'), '#default_value' => og_variable_get('visibility_directory', OG_DIRECTORY_CHOOSE_TRUE), '#description' =>t('OG admins always see the checkbox for adding a group to the %dir. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.', array('%dir' => t('groups directory'))), '#options' => $options); // groups registration visibility $options = array(t('New groups don\'t appear on the registration form. Administrators control the form exclusively.'), @@ -2769,7 +2769,7 @@ t('Group creator chooses whether her group appears on the registration form. Defaults to %in.', array('%in' => t('on form'))), t('Group creator chooses whether her group appears on the registration form. Defaults to %out.', array('%out' => t('not on form'))), ); - $form['og_settings']['group_details']['og_visibility_registration'] = array('#type' => 'radios', '#title' => t('Registration form control'), '#default_value' => variable_get('og_visibility_registration', OG_REGISTRATION_CHOOSE_FALSE), '#description' =>t('OG admins always see the checkbox for adding a group to the %dir. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.', array('%dir' => t('registration form'))), '#options' => $options); + $form['og_settings']['group_details']['og_visibility_registration'] = array('#type' => 'radios', '#title' => t('Registration form control'), '#default_value' => og_variable_get('visibility_registration', OG_REGISTRATION_CHOOSE_FALSE), '#description' =>t('OG admins always see the checkbox for adding a group to the %dir. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting.', array('%dir' => t('registration form'))), '#options' => $options); // private groups control $options = array(t('New group home pages and default audience are always public.'), @@ -2777,7 +2777,7 @@ t('Group administrator chooses whether her group homepage and audience are private or not. Defaults to %yes.', array('%yes' => t('private'))), t('Group administrator chooses whether her group homepage and audience are private or not. Defaults to %no.', array('%no' => t('public'))), ); - $form['og_settings']['group_details']['og_private_groups'] = array('#type' => 'radios', '#title' => t('Private Groups'), '#default_value' => variable_get('og_private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE), + $form['og_settings']['group_details']['og_private_groups'] = array('#type' => 'radios', '#title' => t('Private Groups'), '#default_value' => og_variable_get('private_groups', OG_PRIVATE_GROUPS_CHOOSE_FALSE), '#description' =>t('A private group\'s group home page cannot be seen by non-members, and new posts created in the group will default to being private. This setting controls what private groups options can be used when creating a new group or editing an existing group. If you select one of the group administrator chooses options then it will be up to group admins whether their new groups are private or not, with the default you specify here. '. 'Note that the privacy of all content in the group is determined as each node is created or edited, according to the Node authoring form / Visibility of Posts setting on this page. Note also that changing this setting only affects the default for new groups being created, not the privacy of any existing groups! To change those you must edit the groups and their individual content nodes directly. If the setting you want is disabled here, check the settings under Node authoring form / Visibility of Posts on this page. You cannot choose to only have private groups if nodes visibility is set to be always public, and vice versa.' ), @@ -2788,15 +2788,15 @@ $options = array(OG_NOTIFICATION_SELECTIVE => t('New members are not subscribed to group email notifications by default. A member may choose to enable this from her profile page or her My membership page.'), OG_NOTIFICATION_ALWAYS => t('New members are subscribed to group email notifications by default. A member may choose to disable this from her profile page.'), ); - $form['og_settings']['group_details']['og_notification'] = array('#type' => 'radios', '#title' => t('Group email notifications'), '#default_value' => variable_get('og_notification', OG_NOTIFICATION_ALWAYS), '#description' =>t('Should new members automatically be notified via email when new content is posted to their group? Note that changing this setting has no effect on existing members.'), '#options' => $options); + $form['og_settings']['group_details']['og_notification'] = array('#type' => 'radios', '#title' => t('Group email notifications'), '#default_value' => og_variable_get('notification', OG_NOTIFICATION_ALWAYS), '#description' =>t('Should new members automatically be notified via email when new content is posted to their group? Note that changing this setting has no effect on existing members.'), '#options' => $options); $form['og_settings']['node_form'] = array('#type' => 'fieldset', '#title' => t('Node authoring form'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $form['og_settings']['node_form']['og_audience_checkboxes'] = array('#type' => 'checkbox', '#title' => t('Audience checkboxes'), '#default_value' => variable_get('og_audience_checkboxes', TRUE), '#description' => t('Show each group that the user is a member of as a checkbox in the Audience section. This enables the member to place her post into multiple groups. If unchecked, simplify the user interface by omitting the checkboxes and assuming user wants to post into the current group. This simplification only applies to new nodes, and not to edits of existing nodes. Group administrators always see checkboxes.')); + $form['og_settings']['node_form']['og_audience_checkboxes'] = array('#type' => 'checkbox', '#title' => t('Audience checkboxes'), '#default_value' => og_variable_get('audience_checkboxes', TRUE), '#description' => t('Show each group that the user is a member of as a checkbox in the Audience section. This enables the member to place her post into multiple groups. If unchecked, simplify the user interface by omitting the checkboxes and assuming user wants to post into the current group. This simplification only applies to new nodes, and not to edits of existing nodes. Group administrators always see checkboxes.')); $options = array(t('Visible only within the targeted groups'), t('Visible within the targeted groups and on other pages'), t('Visibility chosen by author/editor using a checkbox on the posting form. '). t('Checkbox defaults to @pub.', array('@pub' => t('Public'))), t('Visibility chosen by author/editor using a checkbox on the posting form. '). t('Checkbox defaults to @pri.', array('@pri' => t('Private')))); - $form['og_settings']['node_form']['og_visibility'] = array('#type' => 'radios', '#title' => t('Visibility of posts'), '#default_value' => variable_get('og_visibility', 0), '#description' =>t('Determine how broadly available a given post should be when it is affiliated with a group. OG admins always see the checkbox for making a post @pub. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting. If the setting you want is disabled here, check the settings under Group details / Private Groups on this page. You cannot set node visibility to always be public if private groups are set to always on and vice versa.', array('@pub' => t('Public'))), '#options' => $options); + $form['og_settings']['node_form']['og_visibility'] = array('#type' => 'radios', '#title' => t('Visibility of posts'), '#default_value' => og_variable_get('visibility', 0), '#description' =>t('Determine how broadly available a given post should be when it is affiliated with a group. OG admins always see the checkbox for making a post @pub. Note that changing this setting has no effect on existing posts. Re-save those posts to acquire this new setting. If the setting you want is disabled here, check the settings under Group details / Private Groups on this page. You cannot set node visibility to always be public if private groups are set to always on and vice versa.', array('@pub' => t('Public'))), '#options' => $options); $options = array(t('optional'), t('required')); - $form['og_settings']['node_form']['og_audience_required'] = array('#type' => 'radios', '#title' => t('Audience required'), '#default_value' => variable_get('og_audience_required', 0), '#options' => $options, '#description' => t('Do you require that all (non administrator) posts be affiliated with a group? Note that changing this setting will affect existing posts when they are edited.')); + $form['og_settings']['node_form']['og_audience_required'] = array('#type' => 'radios', '#title' => t('Audience required'), '#default_value' => og_variable_get('audience_required', 0), '#options' => $options, '#description' => t('Do you require that all (non administrator) posts be affiliated with a group? Note that changing this setting will affect existing posts when they are edited.')); unset($options); $types = node_get_types(); foreach ($types as $type) { @@ -2808,20 +2808,20 @@ unset($options[$val]); } $non_group_type_options = $options; // save this for og_node_types - $form['og_settings']['node_form']['og_omitted'] = array('#type' => 'select', '#title' => t('Omitted content types'), '#default_value' => variable_get('og_omitted', array()), '#options' => $non_group_type_options, '#description' => t('Select any node types which should not participate in the Audience targetting system. Node types which are designated as group home page node types (see below) will be automatically excluded.'), '#multiple' => TRUE); + $form['og_settings']['node_form']['og_omitted'] = array('#type' => 'select', '#title' => t('Omitted content types'), '#default_value' => og_variable_get('omitted', array()), '#options' => $non_group_type_options, '#description' => t('Select any node types which should not participate in the Audience targetting system. Node types which are designated as group home page node types (see below) will be automatically excluded.'), '#multiple' => TRUE); $form['og_settings']['home'] = array('#type' => 'fieldset', '#title' => t('Group home page'), '#collapsible' => TRUE, '#collapsed' => TRUE); $options = og_get_available_views(); - $form['og_settings']['home']['og_home_page_view'] = array('#type' => 'radios', '#title' => t('Presentation style'), '#options' => $options, '#default_value' => variable_get('og_home_page_view', 'og_ghp_ron'), '#description' => t('Pick a View for your group home page. Only Views whose names start with og_ghp_ are eligible. The View determines the layout of your home page. You may alter the presentation using usual the !theme. Also see the Theme section of the !README.', array('!README' => og_readme(), '!theme' => l(t('usual Views themeing techniques'), 'http://drupal.org/node/42597')))); + $form['og_settings']['home']['og_home_page_view'] = array('#type' => 'radios', '#title' => t('Presentation style'), '#options' => $options, '#default_value' => og_variable_get('home_page_view', 'og_ghp_ron'), '#description' => t('Pick a View for your group home page. Only Views whose names start with og_ghp_ are eligible. The View determines the layout of your home page. You may alter the presentation using usual the !theme. Also see the Theme section of the !README.', array('!README' => og_readme(), '!theme' => l(t('usual Views themeing techniques'), 'http://drupal.org/node/42597')))); $form['og_settings']['home']['og_node_types'] = array('#type' => 'select', '#title' => t('Group home page node types'), '#default_value' => variable_get('og_node_types', array('og')), '#options' => $all_node_type_options, '#required' => TRUE, '#description' => t("Required. Select the node types which act as group home pages. Usually, you will want to !create called group for this purpose.", array('!create' => l(t('create a simple node type'), 'admin/content/types'))), '#multiple' => TRUE); $form['og_settings']['email'] = array('#type' => 'fieldset', '#title' => t('Email settings'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $form['og_settings']['email']['og_omitted_email_node_types'] = array('#type' => 'select', '#title' => t('Omitted node types for email notifications'), '#default_value' => variable_get('og_omitted_email_node_types', array()), '#options' => $non_group_type_options, '#description' => t("Select any node types which should not generate email notifications when they are posted into a group."), '#multiple' => TRUE); + $form['og_settings']['email']['og_omitted_email_node_types'] = array('#type' => 'select', '#title' => t('Omitted node types for email notifications'), '#default_value' => og_variable_get('omitted_email_node_types', array()), '#options' => $non_group_type_options, '#description' => t("Select any node types which should not generate email notifications when they are posted into a group."), '#multiple' => TRUE); $form['og_settings']['email']['og_email_notification_pattern'] = array( '#type' => 'textfield', '#title' => t('Format of From: field'), - '#default_value' => variable_get("og_email_notification_pattern", '@user_name <@site_mail>'), + '#default_value' => og_variable_get("email_notification_pattern", '@user_name <@site_mail>'), '#description' => t('Specify the format of the "From:" field on outgoing notifications. Available variables: @user_mail, @user_name, @site_mail, @site_name. Note that the @user_mail token reveals the author\'s email address. If the admin email examples above appear blank, you need to set your site email in the Site Configuration panel.'), ); $form['og_settings']['email']['og_new_node_subject'] = array('#type' => 'textfield', '#title' => t('New content subject'), '#description' => 'Subject of email for new content. Available variables: @group, !group_url, @type, @site, !content_url, !reply_url, @title, @subject, @node_full, @node_teaser, @username. %subject contains the comment title in the case of a comment but the node title in the case of a new post. @title is always the node title.', '#default_value' => _og_user_mail_text('og_new_node_subject')); @@ -2839,12 +2839,12 @@ $form['og_settings']['email']['og_new_admin_body'] = array('#type' => 'textarea', '#title' => t('New admin user email body'), '#rows' => 10, '#description' => 'The body of the email sent to a new admin for a group. Available variables: @group, @username, !group_url, !invite_url', '#default_value' => _og_user_mail_text('og_new_admin_body')); $form['og_settings']['pictures'] = array('#type' => 'fieldset', '#title' => t('Member pictures'), '#collapsible' => TRUE, '#collapsed' => TRUE); - $form['og_settings']['pictures']['og_member_pics'] = array('#type' => 'checkbox', '#title' => t('Member pictures'), '#default_value' => variable_get('og_member_pics', TRUE), '#description' => t('Should member pictures be shown on the members page, the group members block, and group details block? You must also enable pictures in !user.', array('!user' => l(t('User configuration'), 'admin/user/settings')))); + $form['og_settings']['pictures']['og_member_pics'] = array('#type' => 'checkbox', '#title' => t('Member pictures'), '#default_value' => og_variable_get('member_pics', TRUE), '#description' => t('Should member pictures be shown on the members page, the group members block, and group details block? You must also enable pictures in !user.', array('!user' => l(t('User configuration'), 'admin/user/settings')))); return system_settings_form($form); } function og_is_picture() { - return variable_get('user_pictures', 0) && variable_get('og_member_pics', TRUE); + return og_variable_get('og_user_pictures', 0) && og_variable_get('member_pics', TRUE); } // TODO: move this to new API function in Views where I can influence the WHERE clause. @@ -2987,9 +2987,9 @@ * An implementation of hook_node_type. Automatically update admin preferences when node type is renamed or removed. */ function og_node_type($op, $info) { - $node_type_variables = array('og_omitted_email_node_types', 'og_omitted', 'og_node_types'); + $node_type_variables = array('omitted_email_node_types', 'omitted', 'node_types'); foreach ($node_type_variables as $variable) { - $values = variable_get($variable, array()); + $values = og_variable_get($variable, array()); switch ($op) { case 'delete': if (in_array($info->old_type, $values)) { @@ -3094,3 +3094,62 @@ return t('Members of !group_n may view this node.', array('@op' => $op, '!group_n' => l($node->title, "node/$row->gid"))); } } + + +/** + * Replaces most calls to variable_get; if there is no current group context this function behaves as variable_get() would + * + * variable naming convention is as follows (in order of specificity); + * - og_GID_VARNAME // group instance specific settings + * - og_GROUPTYPENAME_VARNAME // group type specific settings + * - og_VARNAME // global group settings + * + * $variable string The variable to retrieve with the 'og_' prefix removed + * $default mixed The value to return if there is not one set for the corresponding $variable + * + */ +function og_variable_get($variable, $default, $type = NULL, $gid = NULL) { + $prefix = 'og_'; + $dummy = 'ASDLKNVEWI@!)@!#$N#$V(@$N@$V'; // non-sense value used to detect non-retrieval of values + $return = $dummy; + + // get instance specific if possible + if ($gid != NULL) { + $return = variable_get($prefix.$gid.'_'.$variable, $dummy); + } + + // get type specific if possible + if ($type != NULL) { + $return = variable_get($prefix.$type.'_'.$variable, $dummy); + } + + // fallback to og_get_group_context() + if (($type == NULL && $gid == NULL) || $return == $dummy) { + $group_node = og_get_group_context(); + $type = $group_node->type; + $gid = $group_node->nid; + + // og_get_group_context(); should probably dummy a type on return here + if ($group_node == NULL && arg(0) == 'node' && arg(1) == 'add') { + $type = arg(2); + } + + // try instance specific first + $return = variable_get($prefix.$gid.'_'.$variable, $dummy); + if ($return == $dummy) { + $return = variable_get($prefix.$type.'_'.$variable, $dummy); + } + + // get type specific if possible + if ($type != NULL) { + $return = variable_get($prefix.$type.'_'.$variable, $dummy); + } + } + + if ($return == $dummy) { + $return = variable_get($prefix.$variable, $default); + } + + return $return; +} +