| 1 |
<?php |
| 2 |
/* |
| 3 |
* Gallery Box options |
| 4 |
* @link http://gbox.awesomebootstrap.net |
| 5 |
* @since 1.0.0 |
| 6 |
* @package Gallery box wordpress plugin |
| 7 |
* @author Noor alam |
| 8 |
*/ |
| 9 |
if (!class_exists('nGalleryBox_main_options')) : |
| 10 |
class nGalleryBox_main_options |
| 11 |
{ |
| 12 |
|
| 13 |
private $settings_api; |
| 14 |
|
| 15 |
function __construct() |
| 16 |
{ |
| 17 |
$this->settings_api = new ngallery_box_settings; |
| 18 |
|
| 19 |
add_action('admin_init', array($this, 'admin_init')); |
| 20 |
add_action('admin_menu', array($this, 'admin_menu')); |
| 21 |
} |
| 22 |
|
| 23 |
function admin_init() |
| 24 |
{ |
| 25 |
|
| 26 |
//set the settings |
| 27 |
$this->settings_api->set_sections($this->get_settings_sections()); |
| 28 |
$this->settings_api->set_fields($this->get_settings_fields()); |
| 29 |
|
| 30 |
//initialize settings |
| 31 |
$this->settings_api->admin_init(); |
| 32 |
} |
| 33 |
|
| 34 |
function admin_menu() |
| 35 |
{ |
| 36 |
add_submenu_page( |
| 37 |
'edit.php?post_type=gallery_box', |
| 38 |
__('Gallery Box settings', 'gallery-box'), |
| 39 |
__('Gallery Box settings', 'gallery-box'), |
| 40 |
'manage_options', |
| 41 |
'gallery-box-options.php', |
| 42 |
array($this, 'plugin_page') |
| 43 |
); |
| 44 |
} |
| 45 |
|
| 46 |
function get_settings_sections() |
| 47 |
{ |
| 48 |
$sections = array( |
| 49 |
array( |
| 50 |
'id' => 'Lightbox_settings', |
| 51 |
'title' => __('Lightbox settings', 'gallery-box') |
| 52 |
), |
| 53 |
array( |
| 54 |
'id' => 'img_style', |
| 55 |
'title' => __('All image gallery style', 'gallery-box') |
| 56 |
), |
| 57 |
array( |
| 58 |
'id' => 'youtube_style', |
| 59 |
'title' => __('Youtube gallery style', 'gallery-box') |
| 60 |
), |
| 61 |
array( |
| 62 |
'id' => 'vimeo_style', |
| 63 |
'title' => __('Vimeo gallery style', 'gallery-box') |
| 64 |
), |
| 65 |
array( |
| 66 |
'id' => 'iframe_style', |
| 67 |
'title' => __('Iframe gallery style', 'gallery-box') |
| 68 |
), |
| 69 |
|
| 70 |
); |
| 71 |
return $sections; |
| 72 |
} |
| 73 |
|
| 74 |
/** |
| 75 |
* Returns all the settings fields |
| 76 |
* |
| 77 |
* @return array settings fields |
| 78 |
*/ |
| 79 |
function get_settings_fields() |
| 80 |
{ |
| 81 |
$settings_fields = array( |
| 82 |
'Lightbox_settings' => array( |
| 83 |
array( |
| 84 |
'name' => 'use_typography', |
| 85 |
'label' => __('Gallery Box font', 'gallery-box'), |
| 86 |
'desc' => __('You can use gallery box default font or use your theme font and typography.', 'gallery-box'), |
| 87 |
'type' => 'radio', |
| 88 |
'default' => 'no', |
| 89 |
'options' => array( |
| 90 |
'yes' => __('Active', 'gallery-box'), |
| 91 |
'no' => __('Deactive', 'gallery-box'), |
| 92 |
) |
| 93 |
), |
| 94 |
array( |
| 95 |
'name' => 'loader_style', |
| 96 |
'label' => __('Image preloader style', 'gallery-box'), |
| 97 |
'desc' => __('Select lightbox image preloader style.', 'gallery-box'), |
| 98 |
'type' => 'select', |
| 99 |
'default' => 'double-bounce', |
| 100 |
'options' => array( |
| 101 |
'rotating-plane' => 'Rotating plane', |
| 102 |
'double-bounce' => 'Double bounce', |
| 103 |
'wave' => 'wave', |
| 104 |
'wandering-cubes' => 'Wandering cubes', |
| 105 |
'spinner-pulse' => 'Spinner pulse', |
| 106 |
'three-bounce' => 'Three bounce', |
| 107 |
'cube-grid' => 'Cube grid', |
| 108 |
|
| 109 |
) |
| 110 |
), |
| 111 |
array( |
| 112 |
'name' => 'loader_color', |
| 113 |
'label' => __('Set lightbox icon color.', 'gallery-box'), |
| 114 |
'desc' => __('The color show in arrow icon and close icon.', 'gallery-box'), |
| 115 |
'type' => 'color', |
| 116 |
'default' => '#b6b6b6', |
| 117 |
|
| 118 |
), |
| 119 |
array( |
| 120 |
'name' => 'light_border', |
| 121 |
'label' => __('Lightbox Image border', 'gallery-box'), |
| 122 |
'desc' => __('Set your image border by px. default value 0', 'gallery-box'), |
| 123 |
'type' => 'number', |
| 124 |
'default' => 0, |
| 125 |
|
| 126 |
), |
| 127 |
array( |
| 128 |
'name' => 'light_bcolor', |
| 129 |
'label' => __('Set lightbox background color.', 'gallery-box'), |
| 130 |
'desc' => __('The color show in preloader, border and text background.', 'gallery-box'), |
| 131 |
'type' => 'color', |
| 132 |
'default' => '#d2d2d2', |
| 133 |
|
| 134 |
), |
| 135 |
|
| 136 |
array( |
| 137 |
'name' => 'use_caption', |
| 138 |
'label' => __('lightbox caption', 'gallery-box'), |
| 139 |
'desc' => __('You can show hide lightbox caption.', 'gallery-box'), |
| 140 |
'type' => 'radio', |
| 141 |
'default' => 'yes', |
| 142 |
'options' => array( |
| 143 |
'yes' => __('Active', 'gallery-box'), |
| 144 |
'No' => __('Hide', 'gallery-box'), |
| 145 |
) |
| 146 |
), |
| 147 |
array( |
| 148 |
'name' => 'cap_position', |
| 149 |
'label' => __('Lightbox caption position', 'gallery-box'), |
| 150 |
'desc' => __('Set gallery lightbox caption position.', 'gallery-box'), |
| 151 |
'type' => 'radio', |
| 152 |
'default' => 'yes', |
| 153 |
'options' => array( |
| 154 |
'top' => __('top', 'gallery-box'), |
| 155 |
'bottom' => __('bottom', 'gallery-box'), |
| 156 |
) |
| 157 |
), |
| 158 |
array( |
| 159 |
'name' => 'show_arrow', |
| 160 |
'label' => __('Image Gallery navigation', 'gallery-box'), |
| 161 |
'desc' => __('Gallery navigation only work in image gallery.', 'gallery-box'), |
| 162 |
'type' => 'radio', |
| 163 |
'default' => 'yes', |
| 164 |
'options' => array( |
| 165 |
'yes' => __('Show', 'gallery-box'), |
| 166 |
'no' => __('Hide', 'gallery-box'), |
| 167 |
) |
| 168 |
), |
| 169 |
|
| 170 |
), |
| 171 |
//Image style |
| 172 |
'img_style' => array( |
| 173 |
array( |
| 174 |
'name' => 'img_column', |
| 175 |
'label' => __('Image gallery column ', 'gallery-box'), |
| 176 |
'desc' => __('Set your image gallery Column. Some of the animation may not work properly in 4 column.', 'gallery-box'), |
| 177 |
'type' => 'select', |
| 178 |
'default' => 3, |
| 179 |
'options' => array( |
| 180 |
1 => __('one column', 'gallery-box'), |
| 181 |
2 => __('Two column', 'gallery-box'), |
| 182 |
3 => __('Three column', 'gallery-box'), |
| 183 |
4 => __('Four column', 'gallery-box'), |
| 184 |
) |
| 185 |
), |
| 186 |
array( |
| 187 |
'name' => 'img_border', |
| 188 |
'label' => __('Image border', 'gallery-box'), |
| 189 |
'desc' => __('Set your image border by px. default value 0', 'gallery-box'), |
| 190 |
'type' => 'number', |
| 191 |
'default' => 0, |
| 192 |
|
| 193 |
), |
| 194 |
array( |
| 195 |
'name' => 'img_border_color', |
| 196 |
'label' => __('Image border color', 'gallery-box'), |
| 197 |
'desc' => __('Set your image border color.', 'gallery-box'), |
| 198 |
'type' => 'color', |
| 199 |
'default' => '#ffffff', |
| 200 |
), |
| 201 |
array( |
| 202 |
'name' => 'img_border_type', |
| 203 |
'label' => __('Image border type', 'gallery-box'), |
| 204 |
'desc' => __('Dotted may not be seen, |
| 205 |
When the background color and border color same.', 'gallery-box'), |
| 206 |
'type' => 'radio', |
| 207 |
'default' => 'solid', |
| 208 |
'options' => array( |
| 209 |
'solid' => __('Solid', 'gallery-box'), |
| 210 |
'dotted' => __('Dotted', 'gallery-box'), |
| 211 |
) |
| 212 |
), |
| 213 |
array( |
| 214 |
'name' => 'img_animation', |
| 215 |
'label' => __('Select hover animation', 'gallery-box'), |
| 216 |
'desc' => __('This plugin pro version support 16 hover animation. select one for image gallery.', 'gallery-box'), |
| 217 |
'type' => 'select', |
| 218 |
'default' => 'ehover12', |
| 219 |
'options' => array( |
| 220 |
'ehover1' => __('Animation One', 'gallery-box'), |
| 221 |
'ehover2' => __('Animation Two', 'gallery-box'), |
| 222 |
'ehover3' => __('Animation Three', 'gallery-box'), |
| 223 |
'ehover4' => __('Animation Four', 'gallery-box'), |
| 224 |
'ehover5' => __('Animation Five', 'gallery-box'), |
| 225 |
|
| 226 |
) |
| 227 |
), |
| 228 |
array( |
| 229 |
'name' => 'img_title_back', |
| 230 |
'label' => __('Title background color', 'gallery-box'), |
| 231 |
'desc' => __('Set your image gallery item title background color.', 'gallery-box'), |
| 232 |
'type' => 'color', |
| 233 |
'default' => '#000000', |
| 234 |
|
| 235 |
), |
| 236 |
array( |
| 237 |
'name' => 'img_title_opacity', |
| 238 |
'label' => __('Title background opacity', 'gallery-box'), |
| 239 |
'desc' => __('Set your image gallery item title background opacity.Opacity value 1 to 99', 'gallery-box'), |
| 240 |
'type' => 'number', |
| 241 |
'default' => 50, |
| 242 |
|
| 243 |
), |
| 244 |
array( |
| 245 |
'name' => 'img_title_color', |
| 246 |
'label' => __('Set title color', 'gallery-box'), |
| 247 |
'desc' => __('Set your image gallery item text color.', 'gallery-box'), |
| 248 |
'type' => 'color', |
| 249 |
'default' => '#ffffff', |
| 250 |
|
| 251 |
), |
| 252 |
array( |
| 253 |
'name' => 'img_title_font', |
| 254 |
'label' => __('Set title font size', 'gallery-box'), |
| 255 |
'desc' => __('Default font size is 17px.', 'gallery-box'), |
| 256 |
'type' => 'number', |
| 257 |
'default' => 17, |
| 258 |
|
| 259 |
), |
| 260 |
array( |
| 261 |
'name' => 'img_title_transform', |
| 262 |
'label' => __('Select title text transform', 'gallery-box'), |
| 263 |
'desc' => __('Set title text uppercase or lowercase.', 'gallery-box'), |
| 264 |
'type' => 'radio', |
| 265 |
'default' => 'uppercase', |
| 266 |
'options' => array( |
| 267 |
'uppercase' => __('Uppercase', 'gallery-box'), |
| 268 |
'lowercase' => __('Lowercase', 'gallery-box'), |
| 269 |
) |
| 270 |
|
| 271 |
), |
| 272 |
array( |
| 273 |
'name' => 'img_title_padding', |
| 274 |
'label' => __('Set title padding', 'gallery-box'), |
| 275 |
'desc' => __('Set your title padding default padding is 10px.', 'gallery-box'), |
| 276 |
'type' => 'number', |
| 277 |
'default' => 20, |
| 278 |
|
| 279 |
), |
| 280 |
array( |
| 281 |
'name' => 'img_btn_font', |
| 282 |
'label' => __('Set Button font size', 'gallery-box'), |
| 283 |
'desc' => __('Default font size 14px.', 'gallery-box'), |
| 284 |
'type' => 'number', |
| 285 |
'default' => 14, |
| 286 |
|
| 287 |
), |
| 288 |
array( |
| 289 |
'name' => 'img_btn_color', |
| 290 |
'label' => __('Button text color', 'gallery-box'), |
| 291 |
'desc' => __('Set Image gallery item button text color.', 'gallery-box'), |
| 292 |
'type' => 'color', |
| 293 |
'default' => '#ffffff', |
| 294 |
|
| 295 |
), |
| 296 |
array( |
| 297 |
'name' => 'img_btn_border', |
| 298 |
'label' => __('Button border color', 'gallery-box'), |
| 299 |
'desc' => __('Set Image gallery item button border color.', 'gallery-box'), |
| 300 |
'type' => 'color', |
| 301 |
'default' => '#ffffff', |
| 302 |
|
| 303 |
), |
| 304 |
array( |
| 305 |
'name' => 'img_load_button', |
| 306 |
'label' => __('Load more button', 'gallery-box'), |
| 307 |
'desc' => __('Load more button is pro feature.', 'gallery-box'), |
| 308 |
'type' => 'select', |
| 309 |
'default' => 'disable', |
| 310 |
'options' => array( |
| 311 |
'pro' => __('Only available in pro', 'gallery-box'), |
| 312 |
'disable' => __('Disable', 'gallery-box'), |
| 313 |
) |
| 314 |
|
| 315 |
), |
| 316 |
array( |
| 317 |
'name' => 'img_item_number', |
| 318 |
'label' => __('Images item number', 'gallery-box'), |
| 319 |
'desc' => __('Select how many item show in first page. pro feature', 'gallery-box'), |
| 320 |
'type' => 'number', |
| 321 |
'default' => 10, |
| 322 |
|
| 323 |
), |
| 324 |
array( |
| 325 |
'name' => 'img_load_position', |
| 326 |
'label' => __('Load more button position', 'gallery-box'), |
| 327 |
'desc' => __('Select load more button position left, right, center, full width. pro feature', 'gallery-box'), |
| 328 |
'type' => 'select', |
| 329 |
'default' => 'full', |
| 330 |
'options' => array( |
| 331 |
'left' => __('Left', 'gallery-box'), |
| 332 |
'right' => __('Right', 'gallery-box'), |
| 333 |
'center' => __('Center', 'gallery-box'), |
| 334 |
'full' => __('Full width', 'gallery-box'), |
| 335 |
) |
| 336 |
|
| 337 |
), |
| 338 |
array( |
| 339 |
'name' => 'img_load_color', |
| 340 |
'label' => __('Load more button color', 'gallery-box'), |
| 341 |
'desc' => __('select more button color by this color option. pro feature', 'gallery-box'), |
| 342 |
'type' => 'color', |
| 343 |
'default' => '#000000', |
| 344 |
), |
| 345 |
array( |
| 346 |
'name' => 'img_load_bgcolor', |
| 347 |
'label' => __('Load more button background color.', 'gallery-box'), |
| 348 |
'desc' => __('select more button background color by this color option. pro feature', 'gallery-box'), |
| 349 |
'type' => 'color', |
| 350 |
'default' => '#cccccc', |
| 351 |
), |
| 352 |
array( |
| 353 |
'name' => 'img_load_color_hover', |
| 354 |
'label' => __('Load more button hover color', 'gallery-box'), |
| 355 |
'desc' => __('select more button color by this color option.pro feature', 'gallery-box'), |
| 356 |
'type' => 'color', |
| 357 |
'default' => '#ffffff', |
| 358 |
), |
| 359 |
array( |
| 360 |
'name' => 'img_load_bgcolor_hover', |
| 361 |
'label' => __('Load more button hover background color. ', 'gallery-box'), |
| 362 |
'desc' => __('select more button background color by this color option. pro feature', 'gallery-box'), |
| 363 |
'type' => 'color', |
| 364 |
'default' => '#555555', |
| 365 |
), |
| 366 |
|
| 367 |
), |
| 368 |
//Youtube style settings |
| 369 |
'youtube_style' => array( |
| 370 |
array( |
| 371 |
'name' => 'youtube_column', |
| 372 |
'label' => __('Youtube gallery column.', 'gallery-box'), |
| 373 |
'desc' => __('Set your Youtube gallery Column. Some of the animation may not work properly in 4 column.', 'gallery-box'), |
| 374 |
'type' => 'select', |
| 375 |
'default' => 3, |
| 376 |
'options' => array( |
| 377 |
2 => __('Two column', 'gallery-box'), |
| 378 |
3 => __('Three column', 'gallery-box'), |
| 379 |
4 => __('Four column', 'gallery-box'), |
| 380 |
) |
| 381 |
), |
| 382 |
array( |
| 383 |
'name' => 'youtube_auto', |
| 384 |
'label' => __('Youtube video auto play.', 'gallery-box'), |
| 385 |
'desc' => __('You can set Youtube video auto paly when open in lightbox.', 'gallery-box'), |
| 386 |
'type' => 'select', |
| 387 |
'default' => 'yes', |
| 388 |
'options' => array( |
| 389 |
'yes' => __('Active', 'gallery-box'), |
| 390 |
'no' => __('Hide', 'gallery-box'), |
| 391 |
) |
| 392 |
), |
| 393 |
array( |
| 394 |
'name' => 'youtube_border', |
| 395 |
'label' => __('youtube column border', 'gallery-box'), |
| 396 |
'desc' => __('Set your youtube border by px. default value 0', 'gallery-box'), |
| 397 |
'type' => 'number', |
| 398 |
'default' => 0, |
| 399 |
|
| 400 |
), |
| 401 |
array( |
| 402 |
'name' => 'youtube_border_color', |
| 403 |
'label' => __('youtube column border color', 'gallery-box'), |
| 404 |
'desc' => __('Set your youtube border color.', 'gallery-box'), |
| 405 |
'type' => 'color', |
| 406 |
'default' => '#ffffff', |
| 407 |
), |
| 408 |
array( |
| 409 |
'name' => 'youtube_border_type', |
| 410 |
'label' => __('youtube column border type', 'gallery-box'), |
| 411 |
'desc' => __('Dotted may not be seen, |
| 412 |
When the background color and border color same.', 'gallery-box'), |
| 413 |
'type' => 'radio', |
| 414 |
'default' => 'solid', |
| 415 |
'options' => array( |
| 416 |
'solid' => __('Solid', 'gallery-box'), |
| 417 |
'dotted' => __('Dotted', 'gallery-box'), |
| 418 |
) |
| 419 |
), |
| 420 |
array( |
| 421 |
'name' => 'you_animation', |
| 422 |
'label' => __('Select hover animation', 'gallery-box'), |
| 423 |
'desc' => __('This plugin pro version support 16 hover animation. select one for Youtube video gallery.', 'gallery-box'), |
| 424 |
'type' => 'select', |
| 425 |
'default' => 'ehover5', |
| 426 |
'options' => array( |
| 427 |
'ehover1' => __('Animation One', 'gallery-box'), |
| 428 |
'ehover2' => __('Animation Two', 'gallery-box'), |
| 429 |
'ehover3' => __('Animation Three', 'gallery-box'), |
| 430 |
'ehover4' => __('Animation Four', 'gallery-box'), |
| 431 |
'ehover5' => __('Animation Five', 'gallery-box'), |
| 432 |
|
| 433 |
) |
| 434 |
), |
| 435 |
array( |
| 436 |
'name' => 'you_title_back', |
| 437 |
'label' => __('Title background color', 'gallery-box'), |
| 438 |
'desc' => __('Set your Youtube gallery item title background color.', 'gallery-box'), |
| 439 |
'type' => 'color', |
| 440 |
'default' => '#000000', |
| 441 |
|
| 442 |
), |
| 443 |
array( |
| 444 |
'name' => 'you_title_opacity', |
| 445 |
'label' => __('Title background opacity', 'gallery-box'), |
| 446 |
'desc' => __('Set your Youtube gallery item title background opacity.Opacity value 1 to 99', 'gallery-box'), |
| 447 |
'type' => 'number', |
| 448 |
'default' => 75, |
| 449 |
|
| 450 |
), |
| 451 |
array( |
| 452 |
'name' => 'you_title_color', |
| 453 |
'label' => __('Set title color', 'gallery-box'), |
| 454 |
'desc' => __('Set your Youtube gallery item text color.', 'gallery-box'), |
| 455 |
'type' => 'color', |
| 456 |
'default' => '#ffffff', |
| 457 |
|
| 458 |
), |
| 459 |
array( |
| 460 |
'name' => 'you_title_font', |
| 461 |
'label' => __('Set title font size', 'gallery-box'), |
| 462 |
'desc' => __('Default font size is 17px.', 'gallery-box'), |
| 463 |
'type' => 'number', |
| 464 |
'default' => 17, |
| 465 |
|
| 466 |
), |
| 467 |
array( |
| 468 |
'name' => 'you_title_transform', |
| 469 |
'label' => __('Select title text transform', 'gallery-box'), |
| 470 |
'desc' => __('Set title text uppercase or lowercase.', 'gallery-box'), |
| 471 |
'type' => 'radio', |
| 472 |
'default' => 'uppercase', |
| 473 |
'options' => array( |
| 474 |
'uppercase' => __('uppercase', 'gallery-box'), |
| 475 |
'lowercase' => __('Lowercase', 'gallery-box'), |
| 476 |
) |
| 477 |
|
| 478 |
), |
| 479 |
array( |
| 480 |
'name' => 'you_title_padding', |
| 481 |
'label' => __('Set title padding', 'gallery-box'), |
| 482 |
'desc' => __('Set your title padding default padding is 10px.', 'gallery-box'), |
| 483 |
'type' => 'number', |
| 484 |
'default' => 20, |
| 485 |
|
| 486 |
), |
| 487 |
array( |
| 488 |
'name' => 'you_btn_font', |
| 489 |
'label' => __('Set button font size', 'gallery-box'), |
| 490 |
'desc' => __('Default font size 14px .', 'gallery-box'), |
| 491 |
'type' => 'number', |
| 492 |
'default' => 14, |
| 493 |
|
| 494 |
), |
| 495 |
array( |
| 496 |
'name' => 'you_btn_color', |
| 497 |
'label' => __('Button text color', 'gallery-box'), |
| 498 |
'desc' => __('Set Youtube gallery item button text color.', 'gallery-box'), |
| 499 |
'type' => 'color', |
| 500 |
'default' => '#ffffff', |
| 501 |
|
| 502 |
), |
| 503 |
array( |
| 504 |
'name' => 'you_btn_border', |
| 505 |
'label' => __('Button border color', 'gallery-box'), |
| 506 |
'desc' => __('Set Youtube gallery item button border color.', 'gallery-box'), |
| 507 |
'type' => 'color', |
| 508 |
'default' => '#ffffff', |
| 509 |
|
| 510 |
), |
| 511 |
array( |
| 512 |
'name' => 'you_load_button', |
| 513 |
'label' => __('Load more button', 'gallery-box'), |
| 514 |
'desc' => __('Load more button is pro feature.', 'gallery-box'), |
| 515 |
'type' => 'select', |
| 516 |
'default' => 'disable', |
| 517 |
'options' => array( |
| 518 |
'pro' => __('Only available in pro', 'gallery-box'), |
| 519 |
'disable' => __('Disable', 'gallery-box'), |
| 520 |
) |
| 521 |
|
| 522 |
), |
| 523 |
array( |
| 524 |
'name' => 'you_item_number', |
| 525 |
'label' => __('Youtube video item ', 'gallery-box'), |
| 526 |
'desc' => __('Select how many item show in every page. pro feature.', 'gallery-box'), |
| 527 |
'type' => 'number', |
| 528 |
'default' => 10, |
| 529 |
|
| 530 |
), |
| 531 |
array( |
| 532 |
'name' => 'you_load_position', |
| 533 |
'label' => __('Load more button position', 'gallery-box'), |
| 534 |
'desc' => __('Select load more button position left, right, center, full width. pro feature.', 'gallery-box'), |
| 535 |
'type' => 'select', |
| 536 |
'default' => 'full', |
| 537 |
'options' => array( |
| 538 |
'left' => __('Left', 'gallery-box'), |
| 539 |
'right' => __('Right', 'gallery-box'), |
| 540 |
'center' => __('Center', 'gallery-box'), |
| 541 |
'full' => __('Full width', 'gallery-box'), |
| 542 |
) |
| 543 |
|
| 544 |
), |
| 545 |
array( |
| 546 |
'name' => 'you_load_color', |
| 547 |
'label' => __('Load more button color', 'gallery-box'), |
| 548 |
'desc' => __('select more button color by this color option. pro feature.', 'gallery-box'), |
| 549 |
'type' => 'color', |
| 550 |
'default' => '#000000', |
| 551 |
), |
| 552 |
array( |
| 553 |
'name' => 'you_load_bgcolor', |
| 554 |
'label' => __('Load more button background color. pro feature.', 'gallery-box'), |
| 555 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 556 |
'type' => 'color', |
| 557 |
'default' => '#cccccc', |
| 558 |
), |
| 559 |
array( |
| 560 |
'name' => 'you_load_color_hover', |
| 561 |
'label' => __('Load more button hover color', 'gallery-box'), |
| 562 |
'desc' => __('select more button color by this color option.', 'gallery-box'), |
| 563 |
'type' => 'color', |
| 564 |
'default' => '#ffffff', |
| 565 |
), |
| 566 |
array( |
| 567 |
'name' => 'you_load_bgcolor_hover', |
| 568 |
'label' => __('Load more button hover background color', 'gallery-box'), |
| 569 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 570 |
'type' => 'color', |
| 571 |
'default' => '#555555', |
| 572 |
), |
| 573 |
|
| 574 |
), |
| 575 |
//vimeo style settings |
| 576 |
'vimeo_style' => array( |
| 577 |
array( |
| 578 |
'name' => 'vimeo_column', |
| 579 |
'label' => __('Vimeo gallery column.', 'gallery-box'), |
| 580 |
'desc' => __('Set your Vimeo gallery Column. Some of the animation may not work properly in 4 column.', 'gallery-box'), |
| 581 |
'type' => 'select', |
| 582 |
'default' => 3, |
| 583 |
'options' => array( |
| 584 |
2 => __('Two column', 'gallery-box'), |
| 585 |
3 => __('Three column', 'gallery-box'), |
| 586 |
4 => __('Four column', 'gallery-box'), |
| 587 |
) |
| 588 |
), |
| 589 |
array( |
| 590 |
'name' => 'vimeo_autoplay', |
| 591 |
'label' => __('Vimeo video auto play.', 'gallery-box'), |
| 592 |
'desc' => __('You can set Vimeo video auto paly when open in lightbox.', 'gallery-box'), |
| 593 |
'type' => 'select', |
| 594 |
'default' => 'yes', |
| 595 |
'options' => array( |
| 596 |
'yes' => __('Active', 'gallery-box'), |
| 597 |
'no' => __('Hide', 'gallery-box'), |
| 598 |
) |
| 599 |
), |
| 600 |
array( |
| 601 |
'name' => 'vimeo_border', |
| 602 |
'label' => __('vimeo column border', 'gallery-box'), |
| 603 |
'desc' => __('Set your vimeo border by px. default value 0', 'gallery-box'), |
| 604 |
'type' => 'number', |
| 605 |
'default' => 0, |
| 606 |
|
| 607 |
), |
| 608 |
array( |
| 609 |
'name' => 'vimeo_border_color', |
| 610 |
'label' => __('vimeo column border color', 'gallery-box'), |
| 611 |
'desc' => __('Set your vimeo border color.', 'gallery-box'), |
| 612 |
'type' => 'color', |
| 613 |
'default' => '#ffffff', |
| 614 |
), |
| 615 |
array( |
| 616 |
'name' => 'vimeo_border_type', |
| 617 |
'label' => __('vimeo column border type', 'gallery-box'), |
| 618 |
'desc' => __('Dotted may not be seen, |
| 619 |
When the background color and border color same.', 'gallery-box'), |
| 620 |
'type' => 'radio', |
| 621 |
'default' => 'solid', |
| 622 |
'options' => array( |
| 623 |
'solid' => __('Solid', 'gallery-box'), |
| 624 |
'dotted' => __('Dotted', 'gallery-box'), |
| 625 |
) |
| 626 |
), |
| 627 |
array( |
| 628 |
'name' => 'vimeo_animation', |
| 629 |
'label' => __('Select hover animation', 'gallery-box'), |
| 630 |
'desc' => __('This plugin pro version support 16 hover animation. select one for vimeo video gallery.', 'gallery-box'), |
| 631 |
'type' => 'select', |
| 632 |
'default' => 'ehover3', |
| 633 |
'options' => array( |
| 634 |
'ehover1' => __('Animation One', 'gallery-box'), |
| 635 |
'ehover2' => __('Animation Two', 'gallery-box'), |
| 636 |
'ehover3' => __('Animation Three', 'gallery-box'), |
| 637 |
'ehover4' => __('Animation Four', 'gallery-box'), |
| 638 |
'ehover5' => __('Animation Five', 'gallery-box'), |
| 639 |
|
| 640 |
) |
| 641 |
), |
| 642 |
array( |
| 643 |
'name' => 'vimeo_title_back', |
| 644 |
'label' => __('Title background color', 'gallery-box'), |
| 645 |
'desc' => __('Set your Vimeo gallery item title background color.', 'gallery-box'), |
| 646 |
'type' => 'color', |
| 647 |
'default' => '#000000', |
| 648 |
|
| 649 |
), |
| 650 |
array( |
| 651 |
'name' => 'vimeo_title_opacity', |
| 652 |
'label' => __('Title background opacity', 'gallery-box'), |
| 653 |
'desc' => __('Set your Vimeo gallery item title background opacity.Opacity value 1 to 99', 'gallery-box'), |
| 654 |
'type' => 'number', |
| 655 |
'default' => 50, |
| 656 |
|
| 657 |
), |
| 658 |
array( |
| 659 |
'name' => 'vimeo_title_color', |
| 660 |
'label' => __('Set title color', 'gallery-box'), |
| 661 |
'desc' => __('Set your Vimeo gallery item text color.', 'gallery-box'), |
| 662 |
'type' => 'color', |
| 663 |
'default' => '#ffffff', |
| 664 |
|
| 665 |
), |
| 666 |
array( |
| 667 |
'name' => 'vimeo_title_font', |
| 668 |
'label' => __('Set title font size', 'gallery-box'), |
| 669 |
'desc' => __('Default font size is 17px.', 'gallery-box'), |
| 670 |
'type' => 'number', |
| 671 |
'default' => 17, |
| 672 |
|
| 673 |
), |
| 674 |
array( |
| 675 |
'name' => 'vimeo_title_transform', |
| 676 |
'label' => __('Select title text transform', 'gallery-box'), |
| 677 |
'desc' => __('Set title text uppercase or lowercase.', 'gallery-box'), |
| 678 |
'type' => 'radio', |
| 679 |
'default' => 'uppercase', |
| 680 |
'options' => array( |
| 681 |
'uppercase' => __('Uppercase', 'gallery-box'), |
| 682 |
'lowercase' => __('Lowercase', 'gallery-box'), |
| 683 |
) |
| 684 |
|
| 685 |
), |
| 686 |
array( |
| 687 |
'name' => 'vimeo_title_padding', |
| 688 |
'label' => __('Set title padding', 'gallery-box'), |
| 689 |
'desc' => __('Set your title padding default padding is 10px.', 'gallery-box'), |
| 690 |
'type' => 'number', |
| 691 |
'default' => 20, |
| 692 |
|
| 693 |
), |
| 694 |
array( |
| 695 |
'name' => 'vimeo_btn_font', |
| 696 |
'label' => __('Set Button font size', 'gallery-box'), |
| 697 |
'desc' => __('Default font size 14px ', 'gallery-box'), |
| 698 |
'type' => 'number', |
| 699 |
'default' => 14, |
| 700 |
|
| 701 |
), |
| 702 |
array( |
| 703 |
'name' => 'vimeo_btn_color', |
| 704 |
'label' => __('Button text color', 'gallery-box'), |
| 705 |
'desc' => __('Set vimeo gallery item button text color.', 'gallery-box'), |
| 706 |
'type' => 'color', |
| 707 |
'default' => '#ffffff', |
| 708 |
|
| 709 |
), |
| 710 |
array( |
| 711 |
'name' => 'vimeo_btn_border', |
| 712 |
'label' => __('Button border color', 'gallery-box'), |
| 713 |
'desc' => __('Set vimeo gallery item button border color.', 'gallery-box'), |
| 714 |
'type' => 'color', |
| 715 |
'default' => '#ffffff', |
| 716 |
|
| 717 |
), |
| 718 |
array( |
| 719 |
'name' => 'vimeo_load_button', |
| 720 |
'label' => __('Load more button', 'gallery-box'), |
| 721 |
'desc' => __('You can use load more button for pagination. pro feature', 'gallery-box'), |
| 722 |
'type' => 'select', |
| 723 |
'default' => 'disable', |
| 724 |
'options' => array( |
| 725 |
'enable' => __('Only available in pro', 'gallery-box'), |
| 726 |
'disable' => __('Disable', 'gallery-box'), |
| 727 |
) |
| 728 |
|
| 729 |
), |
| 730 |
array( |
| 731 |
'name' => 'vimeo_item_number', |
| 732 |
'label' => __('Vimeo item number', 'gallery-box'), |
| 733 |
'desc' => __('Select how many item show in every page. pro feature', 'gallery-box'), |
| 734 |
'type' => 'number', |
| 735 |
'default' => 10, |
| 736 |
|
| 737 |
), |
| 738 |
array( |
| 739 |
'name' => 'vimeo_load_position', |
| 740 |
'label' => __('Load more button position. pro feature.', 'gallery-box'), |
| 741 |
'desc' => __('Select load more button position left, right, center, full width.', 'gallery-box'), |
| 742 |
'type' => 'select', |
| 743 |
'default' => 'full', |
| 744 |
'options' => array( |
| 745 |
'left' => __('Left', 'gallery-box'), |
| 746 |
'right' => __('Right', 'gallery-box'), |
| 747 |
'center' => __('Center', 'gallery-box'), |
| 748 |
'full' => __('Full width', 'gallery-box'), |
| 749 |
) |
| 750 |
|
| 751 |
), |
| 752 |
array( |
| 753 |
'name' => 'vimeo_load_color', |
| 754 |
'label' => __('Load more button color', 'gallery-box'), |
| 755 |
'desc' => __('select more button color by this color option. pro feature.', 'gallery-box'), |
| 756 |
'type' => 'color', |
| 757 |
'default' => '#000000', |
| 758 |
), |
| 759 |
array( |
| 760 |
'name' => 'vimeo_load_bgcolor', |
| 761 |
'label' => __('Load more button background color. pro feature', 'gallery-box'), |
| 762 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 763 |
'type' => 'color', |
| 764 |
'default' => '#cccccc', |
| 765 |
), |
| 766 |
array( |
| 767 |
'name' => 'vimeo_load_color_hover', |
| 768 |
'label' => __('Load more button hover color', 'gallery-box'), |
| 769 |
'desc' => __('select more button color by this color option. pro feature.', 'gallery-box'), |
| 770 |
'type' => 'color', |
| 771 |
'default' => '#ffffff', |
| 772 |
), |
| 773 |
array( |
| 774 |
'name' => 'vimeo_load_bgcolor_hover', |
| 775 |
'label' => __('Load more button hover background color. pro feature.', 'gallery-box'), |
| 776 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 777 |
'type' => 'color', |
| 778 |
'default' => '#555555', |
| 779 |
), |
| 780 |
|
| 781 |
), |
| 782 |
|
| 783 |
//iframe style settings |
| 784 |
'iframe_style' => array( |
| 785 |
array( |
| 786 |
'name' => 'iframe_column', |
| 787 |
'label' => __('iframe gallery column.', 'gallery-box'), |
| 788 |
'desc' => __('Set your iframe gallery Column. Some of the animation may not work properly in 4 column.', 'gallery-box'), |
| 789 |
'type' => 'select', |
| 790 |
'default' => 3, |
| 791 |
'options' => array( |
| 792 |
2 => __('Two column', 'gallery-box'), |
| 793 |
3 => __('Three column', 'gallery-box'), |
| 794 |
4 => __('Four column', 'gallery-box'), |
| 795 |
) |
| 796 |
), |
| 797 |
array( |
| 798 |
'name' => 'iframe_border', |
| 799 |
'label' => __('iframe column border', 'gallery-box'), |
| 800 |
'desc' => __('Set your iframe border by px. default value 0', 'gallery-box'), |
| 801 |
'type' => 'number', |
| 802 |
'default' => 0, |
| 803 |
|
| 804 |
), |
| 805 |
array( |
| 806 |
'name' => 'iframe_border_color', |
| 807 |
'label' => __('iframe column border color', 'gallery-box'), |
| 808 |
'desc' => __('Set your iframe border color.', 'gallery-box'), |
| 809 |
'type' => 'color', |
| 810 |
'default' => '#ffffff', |
| 811 |
), |
| 812 |
array( |
| 813 |
'name' => 'iframe_border_type', |
| 814 |
'label' => __('iframe column border type', 'gallery-box'), |
| 815 |
'desc' => __('Dotted may not be seen, |
| 816 |
When the background color and border color same.', 'gallery-box'), |
| 817 |
'type' => 'radio', |
| 818 |
'default' => 'solid', |
| 819 |
'options' => array( |
| 820 |
'solid' => __('Solid', 'gallery-box'), |
| 821 |
'dotted' => __('Dotted', 'gallery-box'), |
| 822 |
) |
| 823 |
), |
| 824 |
array( |
| 825 |
'name' => 'iframe_animation', |
| 826 |
'label' => __('Select hover animation', 'gallery-box'), |
| 827 |
'desc' => __('This plugin pro version support 16 hover animation. select one for iframe gallery.', 'gallery-box'), |
| 828 |
'type' => 'select', |
| 829 |
'default' => 'ehover12', |
| 830 |
'options' => array( |
| 831 |
'ehover1' => __('Animation One', 'gallery-box'), |
| 832 |
'ehover2' => __('Animation Two', 'gallery-box'), |
| 833 |
'ehover3' => __('Animation Three', 'gallery-box'), |
| 834 |
'ehover4' => __('Animation Four', 'gallery-box'), |
| 835 |
'ehover5' => __('Animation Five', 'gallery-box'), |
| 836 |
|
| 837 |
) |
| 838 |
), |
| 839 |
array( |
| 840 |
'name' => 'iframe_title_back', |
| 841 |
'label' => __('Title background color', 'gallery-box'), |
| 842 |
'desc' => __('Set your Soundcloud gallery item title background color.', 'gallery-box'), |
| 843 |
'type' => 'color', |
| 844 |
'default' => '#000000', |
| 845 |
|
| 846 |
), |
| 847 |
array( |
| 848 |
'name' => 'iframe_title_opacity', |
| 849 |
'label' => __('Title background opacity', 'gallery-box'), |
| 850 |
'desc' => __('Set your Soundcloud gallery item title background opacity.Opacity value 1 to 99', 'gallery-box'), |
| 851 |
'type' => 'number', |
| 852 |
'default' => 75, |
| 853 |
|
| 854 |
), |
| 855 |
array( |
| 856 |
'name' => 'iframe_title_color', |
| 857 |
'label' => __('Set title color', 'gallery-box'), |
| 858 |
'desc' => __('Set your Soundcloud gallery item text color.', 'gallery-box'), |
| 859 |
'type' => 'color', |
| 860 |
'default' => '#ffffff', |
| 861 |
|
| 862 |
), |
| 863 |
array( |
| 864 |
'name' => 'iframe_title_font', |
| 865 |
'label' => __('Set title font size', 'gallery-box'), |
| 866 |
'desc' => __('Default font size is 17px.', 'gallery-box'), |
| 867 |
'type' => 'number', |
| 868 |
'default' => 17, |
| 869 |
|
| 870 |
), |
| 871 |
array( |
| 872 |
'name' => 'iframe_title_transform', |
| 873 |
'label' => __('Select title text transform', 'gallery-box'), |
| 874 |
'desc' => __('Set title text uppercase or lowercase.', 'gallery-box'), |
| 875 |
'type' => 'radio', |
| 876 |
'default' => 'uppercase', |
| 877 |
'options' => array( |
| 878 |
'uppercase' => __('Uppercase', 'gallery-box'), |
| 879 |
'lowercase' => __('Lowercase', 'gallery-box'), |
| 880 |
) |
| 881 |
|
| 882 |
), |
| 883 |
array( |
| 884 |
'name' => 'iframe_title_padding', |
| 885 |
'label' => __('Set title padding', 'gallery-box'), |
| 886 |
'desc' => __('Set your title padding default padding is 10px.', 'gallery-box'), |
| 887 |
'type' => 'number', |
| 888 |
'default' => 20, |
| 889 |
|
| 890 |
), |
| 891 |
array( |
| 892 |
'name' => 'iframe_btn_font', |
| 893 |
'label' => __('Set Button font size', 'gallery-box'), |
| 894 |
'desc' => __('Default font size 14px.', 'gallery-box'), |
| 895 |
'type' => 'number', |
| 896 |
'default' => 14, |
| 897 |
|
| 898 |
), |
| 899 |
array( |
| 900 |
'name' => 'iframe_btn_color', |
| 901 |
'label' => __('Button text color', 'gallery-box'), |
| 902 |
'desc' => __('Set iframe gallery item button text color.', 'gallery-box'), |
| 903 |
'type' => 'color', |
| 904 |
'default' => '#ffffff', |
| 905 |
|
| 906 |
), |
| 907 |
array( |
| 908 |
'name' => 'iframe_btn_border', |
| 909 |
'label' => __('Button border color', 'gallery-box'), |
| 910 |
'desc' => __('Set iframe gallery item button border color.', 'gallery-box'), |
| 911 |
'type' => 'color', |
| 912 |
'default' => '#ffffff', |
| 913 |
|
| 914 |
), |
| 915 |
array( |
| 916 |
'name' => 'iframe_load_button', |
| 917 |
'label' => __('Load more button', 'gallery-box'), |
| 918 |
'desc' => __('You can use load more button for pagination. pro feature.', 'gallery-box'), |
| 919 |
'type' => 'select', |
| 920 |
'default' => 'disable', |
| 921 |
'options' => array( |
| 922 |
'enable' => __('Only available in pro', 'gallery-box'), |
| 923 |
'disable' => __('Disable', 'gallery-box'), |
| 924 |
) |
| 925 |
|
| 926 |
), |
| 927 |
array( |
| 928 |
'name' => 'iframe_item_number', |
| 929 |
'label' => __('Iframe item number', 'gallery-box'), |
| 930 |
'desc' => __('Select how many item show in every page. pro feature.', 'gallery-box'), |
| 931 |
'type' => 'number', |
| 932 |
'default' => 10, |
| 933 |
|
| 934 |
), |
| 935 |
array( |
| 936 |
'name' => 'iframe_load_position', |
| 937 |
'label' => __('Load more button position', 'gallery-box'), |
| 938 |
'desc' => __('Select load more button position left, right, center, full width. pro feature.', 'gallery-box'), |
| 939 |
'type' => 'select', |
| 940 |
'default' => 'full', |
| 941 |
'options' => array( |
| 942 |
'left' => __('Left', 'gallery-box'), |
| 943 |
'right' => __('Right', 'gallery-box'), |
| 944 |
'center' => __('Center', 'gallery-box'), |
| 945 |
'full' => __('Full width', 'gallery-box'), |
| 946 |
) |
| 947 |
|
| 948 |
), |
| 949 |
array( |
| 950 |
'name' => 'iframe_load_color', |
| 951 |
'label' => __('Load more button color', 'gallery-box'), |
| 952 |
'desc' => __('select more button color by this color option. pro feature', 'gallery-box'), |
| 953 |
'type' => 'color', |
| 954 |
'default' => '#000000', |
| 955 |
), |
| 956 |
array( |
| 957 |
'name' => 'iframe_load_bgcolor', |
| 958 |
'label' => __('Load more button background color. pro feature', 'gallery-box'), |
| 959 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 960 |
'type' => 'color', |
| 961 |
'default' => '#cccccc', |
| 962 |
), |
| 963 |
array( |
| 964 |
'name' => 'iframe_load_color_hover', |
| 965 |
'label' => __('Load more button hover color', 'gallery-box'), |
| 966 |
'desc' => __('select more button color by this color option. pro feature.', 'gallery-box'), |
| 967 |
'type' => 'color', |
| 968 |
'default' => '#ffffff', |
| 969 |
), |
| 970 |
array( |
| 971 |
'name' => 'iframe_load_bgcolor_hover', |
| 972 |
'label' => __('Load more button hover background color. pro feature', 'gallery-box'), |
| 973 |
'desc' => __('select more button background color by this color option.', 'gallery-box'), |
| 974 |
'type' => 'color', |
| 975 |
'default' => '#555555', |
| 976 |
), |
| 977 |
|
| 978 |
|
| 979 |
|
| 980 |
), |
| 981 |
|
| 982 |
); |
| 983 |
return $settings_fields; |
| 984 |
} |
| 985 |
function plugin_page() |
| 986 |
{ |
| 987 |
echo '<div class="wrap easy-solution">'; |
| 988 |
echo '<a href="http://wpthemespace.com/product/x-blog/" target="_blank"> <img src="https://wpthemespace.com/wp-content/uploads/2019/01/xblog-pro.png' . '" alt="X blog pro" /></a>'; |
| 989 |
echo '<h1>' . esc_html__('Gallery box settings', 'gallery-box') . '</h1>'; |
| 990 |
echo '<div class="welcome-panel">'; |
| 991 |
$this->settings_api->show_navigation(); |
| 992 |
$this->settings_api->show_forms(); |
| 993 |
|
| 994 |
echo '</div>'; |
| 995 |
echo '</div>'; |
| 996 |
} |
| 997 |
|
| 998 |
/** |
| 999 |
* Get all the pages |
| 1000 |
* |
| 1001 |
* @return array page names with key value pairs |
| 1002 |
*/ |
| 1003 |
function get_pages() |
| 1004 |
{ |
| 1005 |
$pages = get_pages(); |
| 1006 |
|
| 1007 |
$pages_options = array(); |
| 1008 |
if ($pages) { |
| 1009 |
foreach ($pages as $page) { |
| 1010 |
$pages_options[$page->ID] = $page->post_title; |
| 1011 |
} |
| 1012 |
} |
| 1013 |
|
| 1014 |
return $pages_options; |
| 1015 |
} |
| 1016 |
} |
| 1017 |
endif; |
| 1018 |
require plugin_dir_path(__FILE__) . '/src/class.settings-api.php'; |
| 1019 |
new nGalleryBox_main_options(); |
| 1020 |
|