| 1 |
<?php |
| 2 |
|
| 3 |
global $photonic_google_options; |
| 4 |
|
| 5 |
$photonic_google_options = array( |
| 6 |
array('name' => 'Google Photos settings', |
| 7 |
'desc' => 'Control settings for Google Photos', |
| 8 |
'category' => 'google-settings', |
| 9 |
'type' => 'section',), |
| 10 |
|
| 11 |
/* array('name' => 'Use own Google Client ID?', |
| 12 |
'desc' => "Photonic can perform authentication with its own Client ID. Select this option if you want to use your own Client ID instead. |
| 13 |
Creating a Google Client ID can take at least 15-30 minutes, but can save you from potential API quota issues if too many people start using Photonic's ID. |
| 14 |
<strong>Note that if you have already defined a Client ID and Secret below they will be used regardless of this option.</strong> |
| 15 |
", |
| 16 |
'id' => "google_google_use_own_keys", |
| 17 |
'grouping' => 'google-settings', |
| 18 |
'type' => 'checkbox'),*/ |
| 19 |
|
| 20 |
array('name' => 'Google Client ID', |
| 21 |
'desc' => "Enter your Google Client ID. You can get / create one from Google's <a href='https://console.developers.google.com/apis/'>API Manager</a>. |
| 22 |
The <a href='https://aquoid.com/plugins/photonic/google-photos/#api-key'>documentation page</a> can help you with further instructions. |
| 23 |
If you have previously obtained a Client ID for Picasa you can use that here, provided you follow the additional instructions in the documentation. |
| 24 |
<ol> |
| 25 |
<li>Use the option for 'OAuth Client ID', and subsequently pick 'Web applications'.</li> |
| 26 |
<li>Make sure that you add these as your Redirect URIs: |
| 27 |
<ol> |
| 28 |
<li>".site_url()."</li> |
| 29 |
<li>".admin_url('admin.php?page=photonic-auth&source=google')."</li> |
| 30 |
</ol> |
| 31 |
<strong>Without the above your authentication will not work.</strong> |
| 32 |
</li> |
| 33 |
</ol>", |
| 34 |
'id' => 'google_client_id', |
| 35 |
'grouping' => 'google-settings', |
| 36 |
'type' => 'text'), |
| 37 |
|
| 38 |
array('name' => 'Google Client Secret', |
| 39 |
'desc' => "Enter your Google Client Secret.", |
| 40 |
'id' => 'google_client_secret', |
| 41 |
'grouping' => 'google-settings', |
| 42 |
'type' => 'text'), |
| 43 |
|
| 44 |
array('name' => 'Refresh Token (for Back-end / Server-side Authentication)', |
| 45 |
'desc' => "To access any content in Google Photos you need to get a token. To get your token go to |
| 46 |
<em>Photonic → Authentication → Google Photos → Google Photos Refresh Token Getter</em>, and authenticate.", |
| 47 |
'id' => 'google_refresh_token', |
| 48 |
'grouping' => 'google-settings', |
| 49 |
'type' => 'text'), |
| 50 |
|
| 51 |
array('name' => 'Media to show', |
| 52 |
'desc' => 'You can choose to include photos as well as videos in your output. This can be overridden by the <code>media</code> parameter in the shortcode:', |
| 53 |
'id' => 'google_media', |
| 54 |
'grouping' => 'google-settings', |
| 55 |
'type' => 'select', |
| 56 |
'options' => Photonic::media_options()), |
| 57 |
|
| 58 |
array('name' => "Hide Photo Count in Album Title Display", |
| 59 |
'desc' => "This will hide the number of photos in your Album's title.", |
| 60 |
'id' => "google_hide_album_photo_count_display", |
| 61 |
'grouping' => 'google-settings', |
| 62 |
'type' => 'checkbox'), |
| 63 |
|
| 64 |
array('name' => "Photo titles and captions", |
| 65 |
'desc' => "What do you want to show as the photo title in the tooltip and lightbox?", |
| 66 |
'id' => "google_title_caption", |
| 67 |
'grouping' => "google-settings", |
| 68 |
'type' => 'select', |
| 69 |
'options' => array( |
| 70 |
'none' => esc_html__('No title / caption / description', 'photonic'), |
| 71 |
'title' => esc_html__('Always use the photo title, even if blank', 'photonic'), |
| 72 |
)), |
| 73 |
|
| 74 |
array('name' => "Chain queries", |
| 75 |
'desc' => "When you use Photonic to display a selected list of albums, Photonic will only display the matches from the first page of results. Select this option to let it display albums from later pages.", |
| 76 |
'id' => "google_chain_queries", |
| 77 |
'grouping' => 'google-settings', |
| 78 |
'type' => 'checkbox'), |
| 79 |
|
| 80 |
array('name' => "Photos (Main Page)", |
| 81 |
'desc' => "Control settings for photos from Google Photos when displayed in your page", |
| 82 |
'category' => 'google-photos', |
| 83 |
'type' => 'section',), |
| 84 |
|
| 85 |
array('name' => "What is this section?", |
| 86 |
'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='google' view='photos']</code>. In other words, the photos are printed directly on the page.", |
| 87 |
'grouping' => 'google-photos', |
| 88 |
'type' => "blurb",), |
| 89 |
|
| 90 |
array('name' => "Photo Title Display", |
| 91 |
'desc' => "How do you want the title of the photos?", |
| 92 |
'id' => "google_photo_title_display", |
| 93 |
'grouping' => 'google-photos', |
| 94 |
'type' => 'radio', |
| 95 |
'options' => photonic_title_styles()), |
| 96 |
|
| 97 |
array('name' => "Constrain Photos Per Row", |
| 98 |
'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.", |
| 99 |
'id' => "google_photos_per_row_constraint", |
| 100 |
'grouping' => 'google-photos', |
| 101 |
'type' => 'select', |
| 102 |
'options' => array("padding" => "Fix the padding around the thumbnails", |
| 103 |
"count" => "Fix the number of thumbnails per row", |
| 104 |
)), |
| 105 |
|
| 106 |
array('name' => "Constrain by padding", |
| 107 |
'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", |
| 108 |
'id' => "google_photos_constrain_by_padding", |
| 109 |
'grouping' => 'google-photos', |
| 110 |
'type' => 'text', |
| 111 |
'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."), |
| 112 |
|
| 113 |
array('name' => "Constrain by number of thumbnails", |
| 114 |
'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails", |
| 115 |
'id' => "google_photos_constrain_by_count", |
| 116 |
'grouping' => 'google-photos', |
| 117 |
'type' => 'select', |
| 118 |
'options' => photonic_selection_range(1, 25)), |
| 119 |
|
| 120 |
array('name' => "Photos (Overlaid Popup Panel)", |
| 121 |
'desc' => "Control settings for photos from Google Photos when displayed in a popup", |
| 122 |
'category' => 'google-photos-pop', |
| 123 |
'type' => 'section',), |
| 124 |
|
| 125 |
array('name' => "What is this section?", |
| 126 |
'desc' => "Options in this section are in effect when you use the shortcode format <code>[gallery type='google' view='albums']</code>, then click on an album to show an overlaid panel. In other words, the photos are printed directly in the overlaid panel.", |
| 127 |
'grouping' => 'google-photos-pop', |
| 128 |
'type' => "blurb",), |
| 129 |
|
| 130 |
array('name' => "Photo Title Display", |
| 131 |
'desc' => "How do you want the title of the photos?", |
| 132 |
'id' => "google_photo_pop_title_display", |
| 133 |
'grouping' => 'google-photos-pop', |
| 134 |
'type' => 'radio', |
| 135 |
'options' => photonic_title_styles()), |
| 136 |
|
| 137 |
array('name' => "Constrain Photos Per Row", |
| 138 |
'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.", |
| 139 |
'id' => "google_photos_pop_per_row_constraint", |
| 140 |
'grouping' => 'google-photos-pop', |
| 141 |
'type' => 'select', |
| 142 |
'options' => array("padding" => "Fix the padding around the thumbnails", |
| 143 |
"count" => "Fix the number of thumbnails per row", |
| 144 |
)), |
| 145 |
|
| 146 |
array('name' => "Constrain by padding", |
| 147 |
'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", |
| 148 |
'id' => "google_photos_pop_constrain_by_padding", |
| 149 |
'grouping' => 'google-photos-pop', |
| 150 |
'type' => 'text', |
| 151 |
'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."), |
| 152 |
|
| 153 |
array('name' => "Constrain by number of thumbnails", |
| 154 |
'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails", |
| 155 |
'id' => "google_photos_pop_constrain_by_count", |
| 156 |
'grouping' => 'google-photos-pop', |
| 157 |
'type' => 'select', |
| 158 |
'options' => photonic_selection_range(1, 25)), |
| 159 |
); |
| 160 |
|