Skip to content
Snippets Groups Projects
Commit 52e315ca authored by Christian Stück's avatar Christian Stück
Browse files

Corrected variable integration.

parent 103edaf5
No related branches found
Tags 7.x-1.0-beta3
No related merge requests found
......@@ -9,13 +9,13 @@
* Implements hook_menu().
*/
function yotpo_menu() {
$items = array();
$items['admin/config/services/yotpo'] = array(
'title' => 'Yotpo',
'description' => 'Configure settings associated with Yotpo.',
'page callback' => 'drupal_get_form',
'page arguments' => array('yotpo_admin_settings_form', NULL),
'page arguments' => array('variable_group_form', 'yotpo'),
'access arguments' => array('administer site configuration'),
'file' => 'yotpo.admin.inc',
);
return $items;
}
......@@ -78,8 +78,8 @@ function yotpo_load() {
*/
function yotpo_get_instance() {
if (yotpo_load()) {
$id = variable_get('commerce_yotpo_id');
$secret = variable_get('commerce_yotpo_secret');
$id = variable_get('commerce_yotpo_api_id');
$secret = variable_get('commerce_yotpo_api_secret');
$yotpo = new Yotpo($id, $secret);
return $yotpo;
}
......
<?php
/**
* @file
* Variable integration for the yotpo module.
*/
function yotpo_variable_group_info() {
$groups['yotpo'] = array(
'title' => t('Yotpo settings'),
'description' => t('Yotpo settings (API credentials)'),
'access' => 'administer site configuration',
'path' => array('admin/config/services/yotpo'),
);
return $groups;
}
/**
* Implements hook_variable_info().
*/
function yotpo_variable_info($options) {
$variable['commerce_yotpo_api_id'] = array(
'title' => t('Yotpo API ID', array(), $options),
'description' => t('Your Yotpo API ID.', array(), $options),
'type' => 'string',
'default' => t('', array(), $options),
);
$variable['commerce_yotpo_api_secret'] = array(
'title' => t('Yotpo API Secret', array(), $options),
'description' => t('Your Yotpo API Secret.', array(), $options),
'type' => 'string',
'default' => t('', array(), $options),
);
return $variable;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment