Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.37 KB | None | 0 0
  1. <?php
  2. if (!defined("JUICYCODES")) {
  3. exit;
  4. }
  5. use IT\Data;
  6. $html->active("add_link")->SetTitle("Add Link");
  7. require_once ADMINPATH . '/header.php';
  8. $pre = $var->cookie("jc_preview") ?: "url";
  9. $ico = ($pre == "file" ? "fa-chain" : "fa-cloud-upload");
  10. $pre_c = ($pre == "file" ? "url" : "file");
  11. $pre_i = ($pre == "file" ? "fa-cloud-upload" : "fa-chain");
  12. $html->element("div", array("class" => "panel"), array(
  13. $html->element("div", array("class" => "panel-heading"), array(
  14. $html->element("h3", array("class" => "panel-title"), array("ADD NEW LINK")),
  15. $html->element("div", array("class" => "right"), array(
  16. $html->element("button", array("type" => "button", "class" => "btn-toggle-collapse"), array(
  17. $html->element("i", array("class" => "lnr lnr-chevron-up")),
  18. )),
  19. )),
  20. )),
  21. $html->element("form", array("method" => "post", "action" => $html->url("actions"), "enctype" => "multipart/form-data"), array(
  22. $html->input("hidden", "hide", false, "action", "add_link"),
  23. $html->element("div", array("class" => "panel-body"), array(
  24. $html->element("div", array("class" => "row"), array(
  25. $html->element("div", array("class" => "col-lg-4 col-md-6"), array(
  26. $html->element("div", array("class" => "form-group"), array(
  27. $html->label("jc_title", "control-label", "Link Title"),
  28. $html->tip("Insert Title For This Video"),
  29. $html->input("text", "form-control", "jc_title", "jc_title", "Insert Title For This Video", true),
  30. )),
  31. $html->element("div", array("class" => "form-group"), array(
  32. $html->label("jc_link", "control-label", "Video Link"),
  33. $html->tip("Insert Link For This Video"),
  34. $html->input("url", "form-control", "jc_link", "jc_link", "Insert Link For This Video", true),
  35. )),
  36. $html->element("div", array("class" => "form-group"), array(
  37. $html->label("jc_embed", "control-label", "Alt Embed Link"),
  38. $html->tip("IInsert An Alternate Embed Link For This Video"),
  39. $html->input("url", "form-control", "jc_embed", "jc_embed", "Insert An Alternate Embed Link For This Video", true),
  40. )),
  41. $html->element("div", array("class" => "form-group"), array(
  42. $html->label("jc_preview", "control-label", "Custom Preview"),
  43. $html->tip("Insert Custom Preview URL For This Video"),
  44. $html->element("span", array("class" => "pull-right"), array(
  45. $html->element("span", array("class" => "label label-info cp", "id" => "pre"), array(
  46. $html->element("i", array("class" => "fa $ico")),
  47. )),
  48. )),
  49. $html->input($pre, "form-control", "jc_preview", "jc_preview", "Insert Custom Preview URL", true),
  50. )),
  51. )),
  52. )),
  53. $html->element("div", array("class" => "row"), array(
  54. $html->element("div", array("class" => "col-lg-2 col-md-3"), array(
  55. $html->element("div", array("class" => "form-group", "id" => "sub_files"), array(
  56. $html->label(false, "control-label", "Subtitle File"),
  57. $html->tip("Select Subtitle File For This Video"),
  58. $html->input("file", "form-control sub_file m-b-xs", false, "subtitle[]"),
  59. )),
  60. )),
  61. $html->element("div", array("class" => "col-lg-2 col-md-3"), array(
  62. $html->element("div", array("class" => "form-group", "id" => "sub_labels"), array(
  63. $html->label(false, "control-label", "Subtitle Label"),
  64. $html->tip("Insert Subtitle Language For This Video"),
  65. $html->element("span", array("class" => "pull-right"), array(
  66. $html->element("span", array("class" => "label label-info cp", "id" => "add_sub"), array(
  67. $html->element("i", array("class" => "fa fa-plus")),
  68. )),
  69. )),
  70. $html->input("text", "form-control sub_label m-b-xs", false, "subtitle_label[]"),
  71. )),
  72. )),
  73. )),
  74. $html->element("div", array("class" => "row"), array(
  75. $html->element("div", array("class" => "col-lg-2 col-md-3"), array(
  76. $html->element("div", array("class" => "form-group"), array(
  77. $html->label("jc_slug", "control-label", "Custom Slug"),
  78. $html->tip("Insert Custom Slug For This Video"),
  79. $html->input("text", "form-control", "jc_slug", "jc_slug"),
  80. )),
  81. )),
  82. $html->element("div", array("class" => "col-lg-2 col-md-3"), array(
  83. $html->element("div", array("class" => "form-group"), array(
  84. $html->label("jc_type", "control-label", "Generation Type"),
  85. $html->tip("Insert Title For This Video"),
  86. $html->element("select", array("class" => "form-control", "id" => "jc_type", "name" => "jc_type"), array(
  87. $html->option("Player + Download", "3", $var->cookie("jc_type")),
  88. $html->option("Only Player", "1", $var->cookie("jc_type")),
  89. $html->option("Only Download", "2", $var->cookie("jc_type")),
  90. )),
  91. )),
  92. )),
  93. )),
  94. )),
  95. $html->element("div", array("class" => "panel-footer"), array(
  96. $html->element("button", array("type" => "submit", "class" => "btn btn-info"), array("ADD LINK")),
  97. )),
  98. )),
  99. ), true);
  100. if (!empty($var->session("links"))) {
  101. $link = json_decode($var->session("links"));
  102. list($iw, $ih) = array(Data::Get("width"), Data::Get("height"));
  103. $html->element("div", array("class" => "panel"), array(
  104. $html->element("div", array("class" => "panel-heading"), array(
  105. $html->element("h3", array("class" => "panel-title"), array("GET LINKS & EMBED CODE")),
  106. $html->element("div", array("class" => "right"), array(
  107. $html->element("button", array("type" => "button", "class" => "btn-toggle-collapse"), array(
  108. $html->element("i", array("class" => "lnr lnr-chevron-up")),
  109. )),
  110. $html->element("button", array("type" => "button", "class" => "btn-remove"), array(
  111. $html->element("i", array("class" => "lnr lnr-cross")),
  112. )),
  113. )),
  114. )),
  115. $html->element("div", array("class" => "panel-body"), array(
  116. $html->element("div", array("class" => "row"), array(
  117. $html->element("div", array("class" => "col-lg-4 col-md-6"), array(
  118. $html->element("div", array("class" => "form-group"), array(
  119. $html->label("embed_player_link", "control-label", "Embed Player Link"),
  120. $html->input("text", "form-control", "embed_player_link", "embed_player_link",
  121. Data::Get("url") . '/' . Data::Get("embed_slug") . '/' . $link->slug . '/'
  122. ),
  123. ), false, array(
  124. array($link->type, "!=", "2"),
  125. )),
  126. $html->element("div", array("class" => "form-group"), array(
  127. $html->label("download_link", "control-label", "Download Link"),
  128. $html->input("text", "form-control", "download_link", "download_link",
  129. Data::Get("url") . '/' . Data::Get("download_slug") . '/' . $link->slug . '/'
  130. ),
  131. ), false, array(
  132. array($link->type, "!=", "1"),
  133. )),
  134. )),
  135. $html->element("div", array("class" => "col-lg-4 col-md-6"), array(
  136. $html->element("div", array("class" => "form-group"), array(
  137. $html->label("iframe_code", "control-label", "Embed Player Link"),
  138. $html->element("textarea", array("class" => "form-control", "id" => "iframe_code", "name" => "iframe_code", "rows" => "4"), array(
  139. $html->element("iframe", array(
  140. "width" => $iw,
  141. "height" => $ih,
  142. "src" => Data::Get("url") . '/' . Data::Get("embed_slug") . '/' . $link->slug . '/',
  143. "frameborder" => "0",
  144. "allowfullscreen" => "true",
  145. )),
  146. )),
  147. )),
  148. ), false, array(
  149. array($link->type, "!=", "2"),
  150. )),
  151. )),
  152. )),
  153. ), true);
  154. $var->remove_session("links");
  155. }
  156. $html->script('
  157. $("#pre").click(function(){
  158. var icon = $(this).find("i");
  159. $("#jc_preview").fadeOut("fast");
  160. if(icon.hasClass("' . $ico . '")){
  161. $(this).fadeOut("fast",function(){
  162. icon.removeClass("' . $ico . '").addClass("' . $pre_i . '");
  163. $("#jc_preview").prop("type","' . $pre_c . '").fadeIn("fast");
  164. $(this).fadeIn("fast");
  165. });
  166. } else{
  167. $(this).fadeOut("fast",function(){
  168. icon.removeClass("' . $pre_i . '").addClass("' . $ico . '");
  169. $("#jc_preview").prop("type","' . $pre . '").fadeIn("fast");
  170. $(this).fadeIn("fast");
  171. });
  172. }
  173. });
  174. $("#add_sub").click(function(){
  175. $($(".sub_file").eq(0).clone().val("")).appendTo($("#sub_files")).slideDown("fast");
  176. $($(".sub_label").eq(0).clone().val("")).appendTo($("#sub_labels")).slideDown("fast");
  177. });
  178. ');
  179. require_once ADMINPATH . '/footer.php';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement