| 1 |
<?php |
| 2 |
namespace Photonic_Plugin\Options; |
| 3 |
use Photonic_Plugin\Core\Photonic; |
| 4 |
use Photonic_Plugin\Core\Utilities; |
| 5 |
|
| 6 |
class Instagram extends Option_Tab { |
| 7 |
private static $instance; |
| 8 |
|
| 9 |
private function __construct() { |
| 10 |
$this->options = [ |
| 11 |
['name' => "Instagram settings", |
| 12 |
'desc' => "Control settings for Instagram", |
| 13 |
'category' => "instagram-settings", |
| 14 |
'type' => 'section',], |
| 15 |
|
| 16 |
['name' => "Instagram Access Token", |
| 17 |
'desc' => "Enter your Instagram Access Token. You can get this from <em>Photonic → Authentication</em> by clicking on <em>Login and get Access Token</em>", |
| 18 |
'id' => "instagram_access_token", |
| 19 |
'grouping' => "instagram-settings", |
| 20 |
'type' => 'text'], |
| 21 |
|
| 22 |
['name' => 'Media to show', |
| 23 |
'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:', |
| 24 |
'id' => "instagram_media", |
| 25 |
'grouping' => "instagram-settings", |
| 26 |
'type' => 'select', |
| 27 |
'options' => Utilities::media_options()], |
| 28 |
|
| 29 |
['name' => "Disable lightbox linking", |
| 30 |
'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page.", |
| 31 |
'id' => "instagram_disable_title_link", |
| 32 |
'grouping' => "instagram-settings", |
| 33 |
'type' => 'checkbox'], |
| 34 |
|
| 35 |
['name' => "Title Display", |
| 36 |
'desc' => "How do you want the title of the photo thumbnail?", |
| 37 |
'id' => "instagram_photo_title_display", |
| 38 |
'grouping' => "instagram-settings", |
| 39 |
'type' => 'radio', |
| 40 |
'options' => $this->title_styles()], |
| 41 |
|
| 42 |
['name' => "Constrain Photos Per Row", |
| 43 |
'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.", |
| 44 |
'id' => "instagram_photos_per_row_constraint", |
| 45 |
'grouping' => "instagram-settings", |
| 46 |
'type' => 'select', |
| 47 |
'options' => ["padding" => "Fix the padding around the thumbnails", |
| 48 |
"count" => "Fix the number of thumbnails per row", |
| 49 |
]], |
| 50 |
|
| 51 |
['name' => "Constrain by padding", |
| 52 |
'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by", |
| 53 |
'id' => "instagram_photos_constrain_by_padding", |
| 54 |
'grouping' => "instagram-settings", |
| 55 |
'type' => 'text', |
| 56 |
'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."], |
| 57 |
|
| 58 |
['name' => "Constrain by number of thumbnails", |
| 59 |
'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails", |
| 60 |
'id' => "instagram_photos_constrain_by_count", |
| 61 |
'grouping' => "instagram-settings", |
| 62 |
'type' => 'select', |
| 63 |
'options' => $this->selection_range(1, 25)], |
| 64 |
]; |
| 65 |
} |
| 66 |
|
| 67 |
public static function get_instance() { |
| 68 |
if (self::$instance == null) { |
| 69 |
self::$instance = new Instagram(); |
| 70 |
} |
| 71 |
return self::$instance; |
| 72 |
} |
| 73 |
} |
| 74 |
|