Advertisement
Guest User

Untitled

a guest
May 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. <?php
  2. /*
  3. * ----------------------------------------------------
  4. *
  5. * DBmovies ( Files ) for DooPlay
  6. *
  7. * @author: Doothemes
  8. * @author URI: https://doothemes.com/
  9. * @copyright: (c) 2018 Doothemes. All rights reserved
  10. * ----------------------------------------------------
  11. *
  12. * @since 2.2.0
  13. *
  14. */
  15.  
  16. /* Scripts Dbmovies
  17. ========================================================
  18. */
  19. if( ! function_exists( 'dbmovies_assets' ) ) {
  20. function dbmovies_assets() {
  21. global $post_type, $dbmvsoptions;
  22.  
  23. // Dbmovies APP
  24. if( isset( $_GET['page'] ) AND $_GET['page'] == 'dbmovies') {
  25. wp_enqueue_style('dt-importer-tool-styles', DOO_URI.'/inc/core/dbmovies/css/dbm-v223.css', '', DBMOVIES_version, 'all');
  26. wp_enqueue_script('dt-importer-tool-scripts', dbmovies_compose_javasript('dbmovies'), array('jquery'), DBMOVIES_version, false );
  27. wp_localize_script('dt-importer-tool-scripts', 'dBa', array(
  28. 'url' => admin_url('admin-ajax.php', 'relative'),
  29. 'loading' => __d('Loading..'),
  30. 'exists_notice' => __d('This content already exists in the database'),
  31. 'completed' => __d('Completed process'),
  32. 'error' => __d('Unknown error'),
  33. 'getting' => __d('Getting data..'),
  34. 'save' => __d('Save'),
  35. 'saving' => __d('Saving..'),
  36. 'search' => __d('Search'),
  37. 'filtering' => __d('Filtering..'),
  38. 'filter' => __d('Filter'),
  39. 'dbmv' => $dbmvsoptions['dbmv'],
  40. 'delaytime' => cs_get_option('dbmvsdelaytime','500'),
  41. 'safemode' => cs_get_option('dbmvssafemode'),
  42. 'apidbmv' => DBMOVIES_Api_dbmv
  43. ) );
  44. }
  45.  
  46. // Dbmovies in Movies
  47. if( $post_type == 'movies') {
  48. wp_enqueue_script('ajax_post_movies', dbmovies_compose_javasript('movies'), array('jquery'), DBMOVIES_version, false );
  49. wp_localize_script('ajax_post_movies', 'DTapi', array(
  50. // Importar
  51. 'dbm' => DBMOVIES_Api_dbmv,
  52. 'tmd' => DBMOVIES_Api_tmdb. 'movie/',
  53. 'dbmkey' => $dbmvsoptions['dbmv'],
  54. 'tmdkey' => $dbmvsoptions['tmdb'],
  55. 'pda' => $dbmvsoptions['active'],
  56. 'lang' => $dbmvsoptions['lang'],
  57. 'genres' => $dbmvsoptions['genres'],
  58. 'upload' => $dbmvsoptions['upload'],
  59. 'post' => isset($_GET['action']) ? $_GET['action'] : null,
  60. 'movtitle' => cs_get_option('dbmvstitlemovies','{name}'),
  61. 'loading' => __('Loading...'),
  62. ) );
  63. }
  64.  
  65. // Dbmovies in TVShows
  66. if( $post_type == 'tvshows') {
  67. wp_enqueue_script('ajax_post_movies', dbmovies_compose_javasript('tv'), array('jquery'), DBMOVIES_version, false );
  68. wp_localize_script('ajax_post_movies', 'DTapi', array(
  69. // Importar
  70. 'dbm' => DBMOVIES_Api_dbmv,
  71. 'tmd' => DBMOVIES_Api_tmdb. 'tv/',
  72. 'dbmkey' => $dbmvsoptions['dbmv'],
  73. 'tmdkey' => $dbmvsoptions['tmdb'],
  74. 'pda' => $dbmvsoptions['active'],
  75. 'lang' => $dbmvsoptions['lang'],
  76. 'genres' => $dbmvsoptions['genres'],
  77. 'upload' => $dbmvsoptions['upload'],
  78. 'post' => isset($_GET['action']) ? $_GET['action'] : null,
  79. 'tvstitle' => cs_get_option('dbmvstitletvshows','{name}'),
  80. 'loading' => __('Loading...')
  81. ) );
  82. }
  83.  
  84. // Dbmovies in TVShows > Seasons
  85. if( $post_type == 'seasons') {
  86. wp_enqueue_script('ajax_post_movies', dbmovies_compose_javasript('seasons'), array('jquery'), DBMOVIES_version, false );
  87. wp_localize_script('ajax_post_movies', 'DTapi', array(
  88. // Importar
  89. 'dbm' => DBMOVIES_Api_dbmv,
  90. 'tmd' => DBMOVIES_Api_tmdb. 'tv/',
  91. 'dbmkey' => $dbmvsoptions['dbmv'],
  92. 'pda' => $dbmvsoptions['active'],
  93. 'lang' => $dbmvsoptions['lang'],
  94. 'tmdkey' => $dbmvsoptions['tmdb'],
  95. 'upload' => $dbmvsoptions['upload'],
  96. 'post' => isset($_GET['action']) ? $_GET['action'] : null,
  97. 'seatitle' => cs_get_option('dbmvstitleseasons',__d('{name}: Season {season}')),
  98. 'loading' => __('Loading...')
  99. ) );
  100. }
  101.  
  102. // Dbmovies in TVShows > Episodes
  103. if( $post_type == 'episodes') {
  104. wp_enqueue_script('ajax_post_movies', dbmovies_compose_javasript('episodes'), array('jquery'), DBMOVIES_version, false );
  105. wp_localize_script('ajax_post_movies', 'DTapi', array(
  106. // Importar
  107. 'dbm' => DBMOVIES_Api_dbmv,
  108. 'tmd' => DBMOVIES_Api_tmdb. 'tv/',
  109. 'dbmkey' => $dbmvsoptions['dbmv'],
  110. 'pda' => $dbmvsoptions['active'],
  111. 'lang' => $dbmvsoptions['lang'],
  112. 'tmdkey' => $dbmvsoptions['tmdb'],
  113. 'upload' => $dbmvsoptions['upload'],
  114. 'post' => isset($_GET['action']) ? $_GET['action'] : null,
  115. 'epititle' => cs_get_option('dbmvstitleepisodes','{name}: {season}x{episode}'),
  116. 'loading' => __('Loading...')
  117. ) );
  118. }
  119. }
  120. add_action('admin_enqueue_scripts', 'dbmovies_assets');
  121. }
  122.  
  123. function dbmovies_compose_javasript($file){
  124. return DOO_URI."/inc/core/dbmovies/js/min/{$file}.js";
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement