Skip to content

Commit

Permalink
setup setting variables upon install
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Vercammen committed Feb 12, 2014
1 parent e533290 commit 3bbbf45
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
8 changes: 1 addition & 7 deletions includes/media_mediahaven.variables.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
/**
* This is the variable namespace, automatically prepended to module variables.
*/
define('MEDIA_MEDIAHAVEN_NAMESPACE', 'media_mediahaven__');
define('MEDIA_MEDIAHAVEN_NAMESPACE', 'media_mediahaven_');
define('MEDIA_MEDIAHAVEN_PAGER','25');
define('MEDIA_MEDIAHAVEN_RESTPOINT', '/mediahaven-rest-api/resources/');
define('MEDIA_MEDIAHAVEN_RIGHTS_OWNER', 'Zeticon');
define('MEDIA_MEDIAHAVEN_RIGHTS', 'Full rights on reproduction');
define('MEDIA_MEDIAHAVEN_COPYRIGHT_NOTICE', 'Not for commercial use');

#define('MEDIA_MEDIAHAVEN_API_APPLICATION_URL', 'http://www.mediahaven.com/services/api/keys');
#define('MEDIA_MEDIAHAVEN_MAIN_URL', 'http://www.mediahaven.com/');
Expand Down Expand Up @@ -109,9 +106,6 @@ function media_mediahaven_variable_default($name = NULL) {

if (!isset($defaults)) {
$defaults = array(
'url' => 'https://demo.debeeldbank.be',
'login' => 'restapi',
'password' => 'r3st@p1',
);
}

Expand Down
11 changes: 10 additions & 1 deletion media_mediahaven.install
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
* Implements hook_install().
*/
function media_mediahaven_install() {
return array();

media_mediahaven_variable_set('thumb_width', 150);
media_mediahaven_variable_set('thumb_height', 150);
media_mediahaven_variable_set('url', 'https://demo.debeeldbank.be');
media_mediahaven_variable_set('login', 'restapi');
media_mediahaven_variable_set('password', 'r3st@p1');
media_mediahaven_variable_set('rights_owner', 'Zeticon');
media_mediahaven_variable_set('rights', 'Full rights on reproduction');
media_mediahaven_variable_set('copyright', 'Not for commercial use');
return array('#finished' => 1);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions media_mediahaven.module
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function media_mediahaven_form($form, &$form_state) {
array(
'#type' => 'textfield',
'#title' => t('Rights owner'),
'#default_value' => media_mediahaven_variable_get('rights_owner',MEDIA_MEDIAHAVEN_RIGHTS_OWNER),
'#default_value' => media_mediahaven_variable_get('rights_owner'),
'#size' => 50,
'#description' => t('The rights owner for media uploaded to Mediahaven.'),
'#required' => TRUE,
Expand All @@ -287,7 +287,7 @@ function media_mediahaven_form($form, &$form_state) {
array(
'#type' => 'textfield',
'#title' => t('Rights'),
'#default_value' => media_mediahaven_variable_get('rights',MEDIA_MEDIAHAVEN_RIGHTS),
'#default_value' => media_mediahaven_variable_get('rights'),
'#size' => 50,
'#description' => t('The rights for using and ditributing the uploaded media.'),
'#required' => TRUE,
Expand All @@ -296,7 +296,7 @@ function media_mediahaven_form($form, &$form_state) {
array(
'#type' => 'textfield',
'#title' => t('Copyright Notice'),
'#default_value' => media_mediahaven_variable_get('copyright',MEDIA_MEDIAHAVEN_COPYRIGHT_NOTICE),
'#default_value' => media_mediahaven_variable_get('copyright'),
'#size' => 50,
'#description' => t('Copyright notice for media uploaded to Mediahaven.'),
'#required' => TRUE,
Expand All @@ -314,7 +314,7 @@ function media_mediahaven_form($form, &$form_state) {
array(
'#type' => 'textfield',
'#title' => t('Thumb_width'),
'#default_value' => media_mediahaven_variable_get('thumb_width',150),
'#default_value' => media_mediahaven_variable_get('thumb_width'),
'#size' => 5,
'#description' => t('Width of the thumbnails (in px)'),
'#required' => TRUE,
Expand All @@ -323,7 +323,7 @@ function media_mediahaven_form($form, &$form_state) {
array(
'#type' => 'textfield',
'#title' => t('Thumb_height'),
'#default_value' => media_mediahaven_variable_get('thumb_height',150),
'#default_value' => media_mediahaven_variable_get('thumb_height'),
'#size' => 5,
'#description' => t('Height of the thumbnails (in px)'),
'#required' => TRUE,
Expand Down Expand Up @@ -397,7 +397,7 @@ function media_mediahaven_media_browser_plugin_info() {
'title' => t('MediaHaven'),
'class' => 'MediaMediaHavenBrowser',
);

return $info;
}

Expand Down

0 comments on commit 3bbbf45

Please sign in to comment.