-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompro_instagram.module
49 lines (43 loc) · 1.19 KB
/
compro_instagram.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @file
* Code for the Compro Instagram feature.
*/
include_once 'compro_instagram.features.inc';
/**
* Implements hook_menu().
*/
function compro_instagram_menu() {
$items['admin/structure/entity-type/social/instagram/settings'] = array(
'title' => 'Settings',
'page callback' => 'drupal_get_form',
'page arguments' => array('compro_instragram_settings'),
'file' => 'includes/compro_instagram.admin.inc',
'access arguments' => array('administer instagram feature'),
'type' => MENU_LOCAL_TASK,
);
return $items;
}
/**
* Implements hook_permission().
*/
function compro_instagram_permission() {
return array(
'administer instagram feature' => array(
'title' => t('Administer Instagram feature'),
'description' => t('Perform administration tasks for Instagram feature.'),
),
);
}
/**
* Implements hook_cron().
*/
function compro_instagram_cron() {
// Grab settings.
$settings = variable_get('compro_instagram');
// Grab posts if enabled.
if (isset($settings['enable']) && $settings['enable']) {
module_load_include('inc', 'compro_instagram', 'includes/compro_instagram.cron');
compro_instagram_retrieve_posts($settings);
}
}