-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson-api-cincopa.php
More file actions
86 lines (43 loc) · 2.19 KB
/
json-api-cincopa.php
File metadata and controls
86 lines (43 loc) · 2.19 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
Plugin Name: JSON API Cincopa
Plugin URI: http://www.parorrey.com/solutions/json-api-cincopa/
Description: Extends the JSON API for RESTful BuddyPress Cincopa galleries listing for any user
Version: 2.0.1
Author: Ali Qureshi
Author URI: http://www.parorrey.com/
License: GPLv3
*/
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
define('JSON_API_CINCOPA_HOME', dirname(__FILE__));
function json_api_cincopa_load_plugin_textdomain() {
load_plugin_textdomain( 'json-api-cincopa', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'json_api_cincopa_load_plugin_textdomain' );
if (!is_plugin_active('json-api/json-api.php')) {
add_action('admin_notices', 'pim_draw_notice_json_api_cincopa');
return;
}
if (!is_plugin_active('buddypress-easy-albums-photos-video-and-music-next-gen/loader.php')) {
add_action('admin_notices', 'pim_draw_notice_buddypress_easy_albums');
return;
}
add_filter('json_api_controllers', 'pimJsonApiCincopaController');
add_filter('json_api_cincopa_controller_path', 'setCincopaControllerPath');
function pim_draw_notice_json_api_cincopa() {
echo '<div id="message" class="error fade"><p style="line-height: 150%">';
_e('<strong>JSON API Cincopa</strong> requires the JSON API plugin to be activated. Please <a href="http://wordpress.org/plugins/json-api/">install / activate JSON API</a> first.', 'json-api-cincopa');
echo '</p></div>';
}
function pim_draw_notice_buddypress_easy_albums() {
echo '<div id="message" class="error fade"><p style="line-height: 150%">';
_e('<strong>JSON API Cincopa</strong> requires the Easy Albums - Buddypress users create and share images, video and audio albums - the easy way. plugin to be activated. Please <a href="https://wordpress.org/plugins/buddypress-easy-albums-photos-video-and-music-next-gen/">install / activate Easy Albums</a> first.', 'json-api-cincopa');
echo '</p></div>';
}
function pimJsonApiCincopaController($aControllers) {
$aControllers[] = 'Cincopa';
return $aControllers;
}
function setCincopaControllerPath($sDefaultPath) {
return dirname(__FILE__) . '/controllers/Cincopa.php';
}