Guest User

Untitled

a guest
Jan 23rd, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.21 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace hamyar\main;
  15.  
  16. class admin_menu
  17. {
  18. static protected $_instance;
  19.  
  20. public function __construct()
  21. {
  22. $this->define_hooks();
  23. }
  24.  
  25. public function define_hooks()
  26. {
  27. add_action('admin_menu', [$this, 'register_main_menu']);
  28. add_action('admin_init', [$this, 'register_settings']);
  29. }
  30.  
  31. public function register_settings()
  32. {
  33. add_option('hamyar_addon_modules', []);
  34. register_setting('hamyar_addon_group', 'hamyar_addon_modules');
  35. }
  36.  
  37. public function register_main_menu()
  38. {
  39. add_menu_page(esc_html__('hamyar academy', 'hamyar'), esc_html__('hamyar academy', 'hamyar'), 'manage_options', 'hamyar_addon', [$this, 'show_rules'], $this->get_icon_svg());
  40. add_submenu_page('hamyar_addon', esc_html__('Remove restrictions', 'hamyar'), esc_html__('Remove restrictions', 'hamyar'), 'manage_options', 'module_remove', [$this, 'show_remove']);
  41. }
  42.  
  43. public function show_rules()
  44. {
  45. echo file_get_contents(__DIR__ . '/rules.html');
  46. }
  47.  
  48. public function show_remove()
  49. {
  50. echo file_get_contents(__DIR__ . '/remove.html');
  51. }
  52.  
  53. public function get_icon_svg($base64 = true)
  54. {
  55. $svg = '<svg width="920" height="940" xmlns="http://www.w3.org/2000/svg" data-name="Layer 4">' . "\r\n" . ' <defs>' . "\r\n" . ' <radialGradient gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.6600000262260437,-0.75,-4.21999979019165,-3.7100000381469727,175.796142578125,5420.10929775238)" r="167.83" cy="560.53" cx="4025.77" id="radial-gradient">' . "\r\n" . ' <stop stop-color="#bcbec0" offset="0.14"/>' . "\r\n" . ' <stop stop-opacity="0" stop-color="#fff" offset="1"/>' . "\r\n" . ' </radialGradient>' . "\r\n" . ' <radialGradient gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.8500000238418579,0.5299997925758362,1.1100000143051147,-1.75,-1378.373779296875,-368.0007791519165)" r="139" cy="6.19" cx="2025.76" id="radial-gradient-2">' . "\r\n" . ' <stop stop-color="#bcbec0" offset="0.08"/>' . "\r\n" . ' <stop stop-opacity="0" stop-color="#fff" offset="1"/>' . "\r\n" . ' </radialGradient>' . "\r\n" . ' <radialGradient gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.8600000143051147,0.5099999904632568,0.8700000047683716,-1.4700000286102295,-1729.2537841796875,-171.02075290679932)" r="214.53" cy="255.77" cx="2295.25" id="radial-gradient-3">' . "\r\n" . ' <stop stop-color="#bcbec0" offset="0.32"/>' . "\r\n" . ' <stop stop-opacity="0" stop-color="#fff" offset="1"/>' . "\r\n" . ' </radialGradient>' . "\r\n" . ' </defs>' . "\r\n" . ' <g>' . "\r\n" . ' <path id="svg_1" fill="#fff" d="m905.75621,481.25925c-1,-18.69 -8.3,-35.35 -19.62,-50.12a82.77,82.77 0 0 0 -15.2,-14.88c-6.36,-5 -12.72,-10 -19.08,-15.09c-4.64,-3.78 -9.38,-7.33 -14,-11.1c-6.69,-5.18 -13.26,-10.57 -19.95,-15.74c-4.63,-3.67 -9.27,-7.23 -13.79,-10.89c-6.8,-5.28 -13.48,-10.67 -20.16,-15.95c-4.64,-3.67 -9.27,-7.23 -13.91,-10.89c-6.68,-5.28 -13.36,-10.67 -20.16,-16c-4.73,-3.77 -9.59,-7.54 -14.44,-11.31c-5,-4 -10,-8 -15,-12c-4.63,-3.66 -9.37,-7.33 -14,-11l-15.83,-12.52c-4.63,-3.66 -9.37,-7.33 -14,-11c-6.68,-5.29 -13.25,-10.56 -19.94,-15.85c-4.64,-3.66 -9.38,-7.33 -14,-11c-6.69,-5.29 -13.37,-10.57 -20,-15.85c-4.73,-3.67 -9.59,-7.44 -14.33,-11.1c-6.58,-5.28 -13.15,-10.46 -19.73,-15.74c-4.64,-3.67 -9.38,-7.33 -14,-11c-6.68,-5.29 -13.26,-10.57 -19.95,-15.85c-4.63,-3.67 -9.37,-7.33 -14,-11c-6.68,-5.28 -13.26,-10.56 -19.94,-15.84c-4.85,-3.78 -9.81,-7.55 -14.66,-11.43c-6.47,-5.06 -12.94,-10.24 -19.3,-15.3c-4.74,-3.77 -9.6,-7.43 -14.34,-11.21c-6.56,-5.28 -13.26,-10.56 -19.94,-15.84c-4.74,-3.67 -9.47,-7.44 -14.23,-11.21c-5.07,-4 -10.24,-8.09 -15.42,-12.19l-9,-7.11c-6.56,-5.49 -13.26,-10.89 -19.84,-16.39c-4.31,-3.56 -8.94,-6.47 -14.55,-7.33a24.84,24.84 0 0 0 -19.51,4.85c-5.5,4 -8.84,9.38 -10.89,15.74q-17.13,51.9 -34.06,103.8c-4.1,12.39 -8.1,24.68 -12.18,37.2a6,6 0 0 0 1.05,5.62a6.41,6.41 0 0 0 0.49,0.55c-152.17,6.33 -273.59,131.69 -273.59,285.41c0,147.75 112.19,269.29 256,284.12c0.09,0 6.56,0.61 7.34,0.67l4,0.28l0.2,0c1.82,0.09 12.69,0.52 13.12,0.53l5.2,0.05l456.32,0a63.69,63.69 0 0 0 18.64,-2.26a67.71,67.71 0 0 0 22.34,-11.32a84.29,84.29 0 0 0 16.7,-17.25a85.7,85.7 0 0 0 12.94,-25.65c8.41,-27.17 16.71,-54.22 25,-81.39c8.08,-26.41 16.17,-52.71 24.25,-79.12c3.56,-11.66 7.21,-23.36 10.57,-35.14c2.54,-8.89 3.18,-22.19 2.38,-36.96zm-637.22,285.09l-1.06,-0.18a1.13,1.13 0 0 1 -0.31,-0.06l-0.12,0l0.35,0l0.28,0l0.15,0l1.95,0.33l0.18,0a11.25,11.25 0 0 1 -1.42,-0.09zm2.2,0.37l-0.12,0l0.33,0l-0.21,0zm45.62,-168a114,114 0 1 1 114,-114a114,114 0 0 1 -114,114zm415,-51c-3.12,11.75 -6.46,23.39 -9.81,35c-1.72,5.93 -6.25,9.81 -12.83,9.71l-127.54,0a290.77,290.77 0 0 0 21,-107.69a284.51,284.51 0 0 0 -4.95,-52.82a15.87,15.87 0 0 1 -0.33,-1.95c2.8,2.27 5.5,4.43 8.3,6.69c6.58,5.17 13.15,10.46 19.73,15.63c4.63,3.77 9.47,7.54 14.12,11.21c5.17,4.1 10.13,8.08 15.2,12.18c4.85,3.78 9.7,7.55 14.44,11.32c6.47,5.17 13,10.35 19.51,15.52c4.64,3.78 9.38,7.44 14,11.1c5.17,4.1 10.35,8.3 15.52,12.39c3,2.48 6.14,4.73 9.06,7.22c4.67,3.76 6.07,8.82 4.56,14.43l0.02,0.06z" class="cls-1"/>' . "\r\n" . ' <path id="svg_2" fill="url(#radial-gradient)" d="m581.17621,592.39925a290.77,290.77 0 0 0 21,-107.69a284.51,284.51 0 0 0 -4.95,-52.82a15.87,15.87 0 0 1 -0.33,-1.95l-292.61,-230.64l-3.57,0.17l-0.16,0l-0.62,0l-1.54,0.09l-0.44,0l-1.41,0.1l-1,0.07l-0.35,0l-2.66,0.21l-0.82,0.07l-1.46,0.13l-0.15,0l-1.38,0.13l-1,0.1l-1,0.11c-0.8,0.08 -1.59,0.16 -2.38,0.26s-1.32,0.14 -2,0.22l-1.77,0.22c-1.5,0.19 -3,0.39 -4.48,0.6l-1,0.14l-1.24,0.18l-1.1,0.16q-3.17,0.49 -6.32,1.05l-1.54,0.27l-4.39,0.84l-1.24,0.25l-1.55,0.32l-1.36,0.29c-0.8,0.16 -1.59,0.34 -2.38,0.52l-1,0.22c-0.53,0.11 -1.06,0.23 -1.58,0.36q-3.54,0.82 -7.05,1.74l-1.54,0.41l-0.59,0.15l-2,0.53l-1.51,0.42l-1.23,0.37l-1.55,0.45c-0.53,0.15 -1.05,0.3 -1.57,0.47l-1,0.3l-1.62,0.5c-2,0.62 -4,1.26 -5.93,1.92l-1.24,0.41l-1.31,0.45l-2,0.68c-1.18,0.41 -2.37,0.84 -3.55,1.28l-1.58,0.59q-2.69,1 -5.36,2.07c-0.59,0.23 -1.18,0.47 -1.77,0.73l-2.42,1l-1.96,0.92l-1.91,0.82l-1.21,0.53l-1.09,0.48l-2.19,1l-1.62,0.73c-1.8,0.83 -3.6,1.68 -5.38,2.55l-1.33,0.65q-4,2 -8,4.09l-2.69,1.46l-1.46,0.81l-1.41,0.79l-0.18,0.1l-1.34,0.76q-4.82,2.76 -9.53,5.69l-1.17,0.73c-1.21,0.77 -2.42,1.54 -3.62,2.33l-1.14,0.74l-0.45,0.3l-1.2,0.8l-2.78,1.88l-1.38,0.95l-1.64,1.15l-1.09,0.78l-1.36,1l-1.73,1.26l-1.09,0.81l-1.18,0.88q-2.07,1.54 -4.12,3.14l-1.22,0.95l-3.25,2.59c-0.36,0.31 -0.76,0.62 -1.14,0.93l-1.69,1.39l-1.25,1l-0.73,0.62l-1.34,1.14l-1.21,1l-1,0.86l-1.09,1l-1.41,1.25l-0.21,0.19l-1.36,1.23l-1.81,1.64l-1.31,1.21l-0.59,0.57l-1.28,1.21c-1.57,1.49 -3.13,3 -4.67,4.54q-1.61,1.6 -3.2,3.24l-1.36,1.41c-0.5,0.52 -1,1 -1.49,1.57l-1.49,1.58q-1.52,1.64 -3,3.3c-0.46,0.5 -0.91,1 -1.36,1.51l-2.57,2.92l-0.66,0.76c-0.33,0.37 -0.65,0.76 -1,1.14c-1,1.22 -2.06,2.44 -3.08,3.68l-1.16,1.42l-1.36,1.69c-0.45,0.57 -0.88,1.11 -1.29,1.61l-1,1.31l-0.73,0.95l-1,1.26q-1.18,1.56 -2.34,3.12l-0.45,0.6l-1.09,1.52c-0.43,0.58 -0.85,1.17 -1.27,1.76c-0.85,1.18 -1.68,2.37 -2.51,3.56c-0.33,0.47 -0.64,0.93 -1,1.4c-1.32,1.92 -2.62,3.87 -3.89,5.82l-1,1.46q-2.52,3.94 -4.93,8l-1,1.68a284.25,284.25 0 0 0 -39,144.11c0,147.75 112.18,269.29 256,284.12c0.08,0 6.55,0.61 7.33,0.67l4,0.28l0.2,0c1.82,0.09 12.68,0.52 13.11,0.53l5.21,0a286.55,286.55 0 0 0 264.64,-178l0.15,0.12zm-314.13,173.69l0,0zm1.49,0.26l-1.06,-0.18l-0.12,0l0,0l0.28,0l0.15,0l1.7,0.29l-0.95,-0.11zm47.82,-167.66a114.08,114.08 0 0 1 -108.66,-148.54c0.32,-1 0.66,-2 1,-3c0.28,-0.8 0.57,-1.61 0.87,-2.4c0.11,-0.33 0.24,-0.65 0.36,-1c0.41,-1.06 0.82,-2.1 1.26,-3.14c0.14,-0.34 0.29,-0.68 0.44,-1s0.29,-0.67 0.44,-1s0.36,-0.79 0.53,-1.19c0.29,-0.63 0.58,-1.26 0.88,-1.89c0.16,-0.33 0.32,-0.67 0.49,-1s0.24,-0.49 0.37,-0.73l0.36,-0.73c0.43,-0.85 0.88,-1.69 1.33,-2.52l0.46,-0.86l0.11,-0.19l0.5,-0.9l0.54,-0.93c0.75,-1.31 1.54,-2.6 2.35,-3.88c0.17,-0.28 0.36,-0.56 0.54,-0.85c0.46,-0.73 0.94,-1.45 1.42,-2.15l0.66,-1c0.26,-0.36 0.52,-0.75 0.79,-1.12c0.52,-0.74 1.06,-1.48 1.61,-2.21c0.27,-0.37 0.55,-0.73 0.83,-1.1l0.84,-1.09c0.28,-0.36 0.56,-0.73 0.85,-1.07s0.54,-0.67 0.81,-1q2.33,-2.81 4.81,-5.46l0.6,-0.64l1.09,-1.13l0.84,-0.85c1.32,-1.31 2.66,-2.6 4,-3.85l1,-0.88l1.07,-0.93l1,-0.89l0.93,-0.78l0.32,-0.27l1.73,-1.39l0.2,-0.16c0.3,-0.24 0.61,-0.47 0.91,-0.73q3.34,-2.57 6.87,-4.89l1,-0.68l0.21,-0.13l1.07,-0.67l1.11,-0.69c0.89,-0.54 1.78,-1.06 2.68,-1.58c0.31,-0.18 0.62,-0.37 0.94,-0.53l1.09,-0.6l0.9,-0.48l0.67,-0.37l0.06,0l1.93,-1c0.64,-0.32 1.36,-0.67 2.05,-1c0.29,-0.15 0.58,-0.28 0.88,-0.42l0.09,0c0.68,-0.32 1.36,-0.62 2,-0.92c0.41,-0.18 0.81,-0.37 1.22,-0.53l0.85,-0.36l0.78,-0.32l1.2,-0.49l0.1,0l1.2,-0.46l1.31,-0.49l1.31,-0.47l0.81,-0.28l0.67,-0.23l1.07,-0.36l0.75,-0.24l0.86,-0.27l1,-0.31l1,-0.28l0.77,-0.22l1.45,-0.4l1,-0.26c1.92,-0.48 3.86,-0.93 5.83,-1.33l1.06,-0.21l3,-0.54c0.91,-0.15 1.82,-0.29 2.74,-0.42l0.84,-0.11l1,-0.13l1,-0.12l1.44,-0.15l1.27,-0.13l1.8,-0.14l1.26,-0.09l1.4,-0.08l1.28,-0.06l0.66,0l0.67,0l0.77,0l2.54,0a114,114 0 0 1 114,114l0,1.46c0,0.46 0,0.91 0,1.37s0,1.15 0,1.73c0,0.41 0,0.83 -0.06,1.25s-0.05,1 -0.08,1.49s-0.05,0.8 -0.08,1.2c0,0.62 -0.1,1.24 -0.16,1.85c0,0.43 -0.08,0.86 -0.12,1.29c-0.09,0.92 -0.2,1.84 -0.31,2.75c0,0.27 -0.07,0.54 -0.11,0.8s-0.06,0.49 -0.1,0.73c-0.11,0.85 -0.25,1.7 -0.38,2.55c0,0.2 -0.07,0.4 -0.11,0.61c-0.06,0.42 -0.14,0.85 -0.22,1.27s-0.13,0.73 -0.2,1.09a0.27,0.27 0 0 1 0,0.15c-0.07,0.34 -0.13,0.69 -0.2,1c-0.2,1 -0.41,1.94 -0.63,2.92c0,0.2 -0.09,0.39 -0.14,0.59c-0.2,0.87 -0.41,1.73 -0.63,2.59l-0.24,0.91c-0.16,0.59 -0.32,1.17 -0.49,1.76l-0.25,0.85c-0.23,0.77 -0.46,1.53 -0.7,2.28l-0.57,1.76l-0.17,0.5c-0.12,0.36 -0.25,0.72 -0.37,1.09s-0.36,1 -0.54,1.51s-0.27,0.72 -0.41,1.11l-0.39,1l-0.63,1.57c-0.13,0.33 -0.27,0.66 -0.41,1l0,0.08c-0.1,0.25 -0.21,0.49 -0.32,0.75s-0.25,0.57 -0.37,0.86l-0.51,1.16c-0.11,0.25 -0.23,0.49 -0.34,0.73s-0.19,0.4 -0.28,0.6c-0.39,0.83 -0.79,1.66 -1.19,2.48c-0.2,0.38 -0.39,0.77 -0.59,1.16s-0.42,0.82 -0.64,1.22l0,0l-0.63,1.17l-0.68,1.24l-0.66,1.16c-0.23,0.39 -0.41,0.73 -0.63,1.07l-0.13,0.23c-0.2,0.36 -0.41,0.69 -0.62,1c-0.31,0.52 -0.62,1 -1,1.54s-0.43,0.69 -0.66,1l-0.36,0.58l-0.82,1.23c-0.27,0.41 -0.56,0.83 -0.84,1.24s-0.63,0.91 -1,1.36c-0.16,0.24 -0.33,0.48 -0.51,0.71l-0.42,0.59c-0.15,0.2 -0.37,0.48 -0.53,0.73c-0.59,0.8 -1.19,1.58 -1.82,2.36l-0.65,0.81l-0.79,1c-0.34,0.42 -0.69,0.83 -1,1.25l-1,1.14l-0.46,0.52c-0.28,0.32 -0.55,0.63 -0.84,0.94l-0.22,0.26l-1.1,1.21c-0.4,0.44 -0.82,0.88 -1.24,1.31s-0.83,0.87 -1.26,1.3s-0.85,0.86 -1.28,1.28l-1.3,1.25c-0.44,0.42 -0.83,0.78 -1.25,1.16l-0.17,0.16c-0.86,0.8 -1.73,1.57 -2.61,2.33l-1.38,1.17c-0.46,0.39 -0.86,0.73 -1.29,1.07l-1.72,1.36c-0.36,0.29 -0.73,0.56 -1.09,0.84l-0.32,0.24q-0.64,0.5 -1.29,1l-1.38,1l-0.27,0.19l-1.31,0.91l-1.29,0.88l-0.52,0.36l-1.22,0.79l-1.43,0.9l-0.24,0.14l-1.39,0.85l0,0a113.43,113.43 0 0 1 -58.36,16l-0.02,-0.01z" class="cls-2"/>' . "\r\n" . ' <path id="svg_3" fill="url(#radial-gradient-2)" d="m315.78621,770.35925c-1.52,0 -4.39,-0.05 -4.45,-0.05c-0.45,0 -12.38,-0.48 -13.32,-0.54l-4,-0.28c-0.77,-0.06 -7.25,-0.66 -7.33,-0.67q-2.94,-0.3 -5.85,-0.66c-104.17,-12.91 -190.92,-81.87 -229.17,-175.76a287.18,287.18 0 0 1 -13.84,-171.44l165,53.05c-0.33,3.51 -0.5,7.09 -0.5,10.69a114,114 0 0 0 133.52,112.33l-44.55,138.55l-0.17,0.51a26.51,26.51 0 0 0 17.54,33.11a27,27 0 0 0 7.08,1.16l0.04,0z" class="cls-3"/>' . "\r\n" . ' <path id="svg_4" fill="url(#radial-gradient-3)" d="m880.85621,592.39925l-0.17,0.53q-2.31,7.56 -4.63,15.12c-0.49,1.55 -1,3.1 -1.43,4.65l-6.01,19.79c-8.3,27.17 -16.6,54.23 -25,81.39a85.64,85.64 0 0 1 -13,25.66a84.5,84.5 0 0 1 -16.7,17.23a67.71,67.71 0 0 1 -22.43,11.32a64,64 0 0 1 -18.64,2.27l-456.3,0a286.59,286.59 0 0 0 264.63,-178l299.68,0.04z" class="cls-4"/>' . "\r\n" . ' </g>' . "\r\n" . ' </svg>';
  56.  
  57. if ($base64) {
  58. return 'data:image/svg+xml;base64,' . base64_encode($svg);
  59. }
  60.  
  61. return $svg;
  62. }
  63.  
  64. public function register_modular_item()
  65. {
  66. $modules = \hamyar\features\module_loader::available_module();
  67.  
  68. foreach ($modules as $key => $module) {
  69. echo ' <tr>' . "\r\n" . ' <th scope="row">' . "\r\n" . ' <label for="';
  70. echo $key;
  71. echo '">';
  72. echo $module['translate'];
  73. echo ' </label>' . "\r\n" . ' </th>' . "\r\n" . ' <td>' . "\r\n" . ' <input type="checkbox" id="';
  74. echo $key;
  75. echo '" name="hamyar_addon_modules[';
  76. echo $key;
  77. echo ']" value="on" ';
  78. checked($this->get_option($key), 'on');
  79. echo '>' . "\r\n" . ' <span class="help"> ';
  80. echo $module['description'];
  81. echo ' </span>' . "\r\n" . ' <!-- /.help -->' . "\r\n" . ' </td>' . "\r\n" . ' </tr>' . "\r\n" . ' ';
  82. }
  83. }
  84.  
  85. public function module_selector()
  86. {
  87. echo ' <div>' . "\r\n" . ' <h2>';
  88. _e('hamyar addon', 'hamyar');
  89. echo '</h2>' . "\r\n" . ' ' . "\r\n" . ' <form method="post" action="options.php">' . "\r\n" . ' ';
  90. settings_fields('hamyar_addon_group');
  91. echo ' <p>';
  92. _e('select every addon that you want to turn on', 'hamyar');
  93. .................................................................
  94. .........................................
  95. ..................
Add Comment
Please, Sign In to add comment