Version Description
- Fixed an char encoding issue with server file browser path
Download this release
Release Info
Developer | codename065 |
Plugin | ![]() |
Version | 2.9.99 |
Comparing to | |
See all releases |
Code changes from version 2.8.3 to 2.9.99
- admin/class.WordPressDownloadManagerAdmin.php +199 -0
- admin/menus/class.Addons.php +44 -0
- admin/menus/class.Categories.php +249 -0
- admin/menus/class.Packages.php +215 -0
- admin/menus/class.Settings.php +335 -0
- admin/menus/class.Stats.php +47 -0
- admin/menus/class.Templates.php +238 -0
- admin/menus/class.Welcome.php +37 -0
- admin/server-file-browser.php +0 -105
- admin/settings/basic.php +0 -194
- admin/tpls/addons-list.php +363 -0
- admin/tpls/dashboard-widget.php +11 -0
- admin/tpls/email-template-editor.php +230 -0
- admin/tpls/email-templates/html-frame.html +11 -0
- admin/tpls/email-templates/wpdm-new-user.html +103 -0
- admin/tpls/email-templates/wpdm-remind-password.html +112 -0
- admin/tpls/emails-template.php +105 -0
- admin/tpls/metaboxes/attach-file.php +209 -0
- {tpls → admin/tpls}/metaboxes/icons.php +25 -8
- admin/tpls/metaboxes/lock-options.php +52 -0
- {tpls → admin/tpls}/metaboxes/package-settings.php +222 -135
- admin/tpls/settings.php +133 -0
- admin/tpls/settings/addon-update.php +156 -0
- admin/tpls/settings/basic.php +249 -0
- admin/{settings → tpls/settings}/buddypress.php +0 -0
- admin/{settings → tpls/settings}/cloud-storage.php +0 -0
- admin/tpls/settings/privacy.php +68 -0
- admin/tpls/settings/user-interface.php +235 -0
- admin/tpls/stats.php +43 -0
- admin/tpls/stats/history.php +59 -0
- admin/tpls/templates.php +378 -0
- tpls/wpdm-welcome.php → admin/tpls/welcome.php +72 -106
- admin/wpdm-m2cpt.php +0 -179
- admin/wpdm-settings.php +0 -325
- {bootstrap → assets/bootstrap}/css/bootstrap-theme.css +1 -1
- {bootstrap → assets/bootstrap}/css/bootstrap-theme.min.css +0 -0
- {bootstrap → assets/bootstrap}/css/bootstrap.css +12 -809
- assets/bootstrap/css/bootstrap.min.css +5912 -0
- {bootstrap → assets/bootstrap}/img/glyphicons-halflings-white.png +0 -0
- {bootstrap → assets/bootstrap}/img/glyphicons-halflings.png +0 -0
- {bootstrap → assets/bootstrap}/js/bootstrap.min.js +0 -0
- assets/css/admin-styles.css +1738 -0
- {css → assets/css}/bootstrap-select.min.css +0 -0
- {css → assets/css}/chosen-sprite.png +0 -0
- assets/css/chosen.css +392 -0
- assets/css/front.css +3296 -0
- {css → assets/css}/jquery.dataTables.css +0 -0
- {css → assets/css}/jquery.dataTables.min.css +0 -0
- {css → assets/css}/jqueryFileTree.css +0 -0
- assets/css/select2-spinner.gif +0 -0
- assets/css/select2.css +615 -0
- assets/css/select2x2.png +0 -0
- {css → assets/css}/style-paginate.css +0 -0
- file-type-icons/download4.png → assets/css/themes/default/close.png +0 -0
- images/add-file.png → assets/css/themes/default/close@2x.png +0 -0
- assets/css/themes/default/default.css +98 -0
- assets/css/themes/default/loading.gif +0 -0
- assets/css/themes/default/loading@2x.gif +0 -0
- assets/css/themes/default/next.png +0 -0
- assets/css/themes/default/next@2x.png +0 -0
- assets/css/themes/default/prev.png +0 -0
- assets/css/themes/default/prev@2x.png +0 -0
- assets/file-type-icons/17_download_program.png +0 -0
- assets/file-type-icons/7z.svg +1 -0
- file-type-icons/csv.png → assets/file-type-icons/_blank.png +0 -0
- assets/file-type-icons/aac.svg +1 -0
- {file-type-icons → assets/file-type-icons}/accdb.png +0 -0
- assets/file-type-icons/ai.svg +1 -0
- assets/file-type-icons/archive.svg +1 -0
- assets/file-type-icons/arj.svg +1 -0
- assets/file-type-icons/arrow_down.png +0 -0
- assets/file-type-icons/audio.svg +1 -0
- {file-type-icons → assets/file-type-icons}/avi.png +0 -0
- assets/file-type-icons/avi.svg +1 -0
- {file-type-icons → assets/file-type-icons}/bmp.png +0 -0
- assets/file-type-icons/box_download.png +0 -0
- assets/file-type-icons/bz2.svg +1 -0
- assets/file-type-icons/cloud-download.png +0 -0
- {file-type-icons → assets/file-type-icons}/css.png +0 -0
- assets/file-type-icons/css.svg +1 -0
- assets/file-type-icons/csv.png +0 -0
- assets/file-type-icons/csv.svg +1 -0
- assets/file-type-icons/dbf.svg +1 -0
- assets/file-type-icons/dmg.svg +1 -0
- file-type-icons/docx.png → assets/file-type-icons/doc.png +0 -0
- assets/file-type-icons/doc.svg +1 -0
- assets/file-type-icons/docx.png +0 -0
- assets/file-type-icons/docx.svg +1 -0
- file-type-icons/doc.png → assets/file-type-icons/docx_mac.png +0 -0
- assets/file-type-icons/down.png +0 -0
- assets/file-type-icons/down2.png +0 -0
- assets/file-type-icons/down3.png +0 -0
- assets/file-type-icons/download.png +0 -0
- assets/file-type-icons/download1.png +0 -0
- assets/file-type-icons/download2.png +0 -0
- assets/file-type-icons/download4.png +0 -0
- assets/file-type-icons/download_blue.png +0 -0
- assets/file-type-icons/download_box.png +0 -0
- assets/file-type-icons/download_drive.png +0 -0
- assets/file-type-icons/download_folder.png +0 -0
- assets/file-type-icons/dwg.svg +1 -0
- {file-type-icons → assets/file-type-icons}/eml.png +0 -0
- {file-type-icons → assets/file-type-icons}/eps.png +0 -0
- assets/file-type-icons/eps.svg +3 -0
- assets/file-type-icons/exe.svg +1 -0
- {file-type-icons → assets/file-type-icons}/fla.png +0 -0
- assets/file-type-icons/fla.svg +1 -0
- assets/file-type-icons/flac.svg +1 -0
- assets/file-type-icons/folder.png +0 -0
- assets/file-type-icons/folder_download.png +0 -0
- {file-type-icons → assets/file-type-icons}/gif.png +0 -0
- assets/file-type-icons/gif.svg +1 -0
- assets/file-type-icons/gz.svg +1 -0
- {file-type-icons → assets/file-type-icons}/html.png +0 -0
- assets/file-type-icons/html.svg +1 -0
- {file-type-icons → assets/file-type-icons}/ind.png +0 -0
- {file-type-icons → assets/file-type-icons}/ini.png +0 -0
- assets/file-type-icons/iso.svg +1 -0
- {file-type-icons → assets/file-type-icons}/jpeg.png +0 -0
- assets/file-type-icons/jpeg.svg +1 -0
- {file-type-icons → assets/file-type-icons}/jpg.png +0 -0
- assets/file-type-icons/jpg.svg +1 -0
- assets/file-type-icons/js.svg +1 -0
- {file-type-icons → assets/file-type-icons}/jsf.png +0 -0
- assets/file-type-icons/json.svg +1 -0
- assets/file-type-icons/link.svg +1 -0
- assets/file-type-icons/mdf.svg +1 -0
- {file-type-icons → assets/file-type-icons}/midi.png +0 -0
- assets/file-type-icons/midi.svg +1 -0
- {file-type-icons → assets/file-type-icons}/mov.png +0 -0
- assets/file-type-icons/mov.svg +1 -0
- assets/file-type-icons/mp2.svg +1 -0
- {file-type-icons → assets/file-type-icons}/mp3.png +0 -0
- assets/file-type-icons/mp3.svg +1 -0
- file-type-icons/mpeg.png → assets/file-type-icons/mp4.png +0 -0
- assets/file-type-icons/mp4.svg +1 -0
- assets/file-type-icons/mpeg.png +0 -0
- assets/file-type-icons/msi.svg +1 -0
- assets/file-type-icons/mxf.svg +1 -0
- assets/file-type-icons/nrg.svg +1 -0
- assets/file-type-icons/pcb.svg +1 -0
- assets/file-type-icons/pdf-download.png +0 -0
- {file-type-icons → assets/file-type-icons}/pdf.png +0 -0
- assets/file-type-icons/pdf.svg +1 -0
- {file-type-icons → assets/file-type-icons}/php.png +0 -0
- {file-type-icons → assets/file-type-icons}/png.png +0 -0
- assets/file-type-icons/png.svg +1 -0
- file-type-icons/pptx_win.png → assets/file-type-icons/ppt.png +0 -0
- assets/file-type-icons/ppt.svg +1 -0
- {file-type-icons → assets/file-type-icons}/pptx.png +0 -0
- assets/file-type-icons/pptx.svg +1 -0
- assets/file-type-icons/pptx_mac.png +0 -0
- {file-type-icons → assets/file-type-icons}/proj.png +0 -0
- {file-type-icons → assets/file-type-icons}/psd.png +0 -0
- assets/file-type-icons/psd.svg +1 -0
- {file-type-icons → assets/file-type-icons}/pst.png +0 -0
- {file-type-icons → assets/file-type-icons}/pub.png +0 -0
- assets/file-type-icons/pub.svg +1 -0
- {file-type-icons → assets/file-type-icons}/rar.png +0 -0
- assets/file-type-icons/rar.svg +1 -0
- {file-type-icons → assets/file-type-icons}/readme.png +0 -0
- assets/file-type-icons/resume-download.png +0 -0
- file-type-icons/txt.png → assets/file-type-icons/rtf.png +0 -0
- assets/file-type-icons/rtf.svg +1 -0
- {file-type-icons → assets/file-type-icons}/settings.png +0 -0
- {file-type-icons → assets/file-type-icons}/speed_download.png +0 -0
- assets/file-type-icons/svg.svg +1 -0
- assets/file-type-icons/text.svg +1 -0
- {file-type-icons → assets/file-type-icons}/tiff.png +0 -0
- assets/file-type-icons/tiff.svg +1 -0
- assets/file-type-icons/txt.png +0 -0
- assets/file-type-icons/txt.svg +1 -0
- assets/file-type-icons/unknown.png +0 -0
- assets/file-type-icons/unknown.svg +1 -0
- {file-type-icons → assets/file-type-icons}/url.png +0 -0
- assets/file-type-icons/video.svg +1 -0
- {file-type-icons → assets/file-type-icons}/vsd.png +0 -0
- assets/file-type-icons/vsd.svg +3 -0
- assets/file-type-icons/vst.svg +3 -0
- {file-type-icons → assets/file-type-icons}/wav.png +0 -0
- assets/file-type-icons/wav.svg +1 -0
- assets/file-type-icons/web.svg +104 -0
- {file-type-icons → assets/file-type-icons}/wma.png +0 -0
- assets/file-type-icons/wma.svg +1 -0
- {file-type-icons → assets/file-type-icons}/wmv.png +0 -0
- assets/file-type-icons/xlam.svg +1 -0
- file-type-icons/xlsx.png → assets/file-type-icons/xls.png +0 -0
- assets/file-type-icons/xls.svg +1 -0
- assets/file-type-icons/xlsm.svg +1 -0
- file-type-icons/xls.png → assets/file-type-icons/xlsx.png +0 -0
- assets/file-type-icons/xlsx.svg +1 -0
- assets/file-type-icons/xlt.svg +1 -0
- assets/file-type-icons/xltx.svg +1 -0
- assets/file-type-icons/xml.svg +1 -0
- {file-type-icons → assets/file-type-icons}/zip.png +0 -0
- assets/file-type-icons/zip.svg +1 -0
- assets/fontawesome/css/all.css +5 -0
- assets/fontawesome/css/brands.css +5 -0
- assets/fontawesome/css/fontawesome.css +5 -0
- assets/fontawesome/css/fontawesome.min.css +5 -0
- assets/fontawesome/css/regular.css +5 -0
- assets/fontawesome/css/solid.css +5 -0
- assets/fontawesome/css/svg-with-js.css +5 -0
- assets/fontawesome/css/v4-shims.css +2170 -0
- assets/fontawesome/css/v4-shims.min.css +5 -0
- assets/fontawesome/webfonts/fa-brands-400.eot +0 -0
- assets/fontawesome/webfonts/fa-brands-400.svg +1127 -0
- assets/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- assets/fontawesome/webfonts/fa-brands-400.woff +0 -0
- assets/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- assets/fontawesome/webfonts/fa-regular-400.eot +0 -0
- assets/fontawesome/webfonts/fa-regular-400.svg +467 -0
- assets/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- assets/fontawesome/webfonts/fa-regular-400.woff +0 -0
- assets/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- assets/fontawesome/webfonts/fa-solid-900.eot +0 -0
- assets/fontawesome/webfonts/fa-solid-900.svg +2231 -0
- assets/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- assets/fontawesome/webfonts/fa-solid-900.woff +0 -0
- assets/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- {images → assets/images}/Thumbs.db +0 -0
- {images → assets/images}/bullet1.gif +0 -0
- {images → assets/images}/bullet2.gif +0 -0
- {images → assets/images}/code.png +0 -0
- {images → assets/images}/css.png +0 -0
- {images → assets/images}/db.png +0 -0
- {images → assets/images}/directory.png +0 -0
- {images → assets/images}/doc.png +0 -0
- {images → assets/images}/down.png +0 -0
- {images → assets/images}/download-16.png +0 -0
- assets/images/download-count.png +0 -0
- assets/images/download-manager-16 copy.png +0 -0
- assets/images/download-manager-16.png +0 -0
- {images → assets/images}/download-manager.png +0 -0
- {images → assets/images}/download-now.png +0 -0
- {images → assets/images}/download.png +0 -0
- {images → assets/images}/email.png +0 -0
- {images → assets/images}/error.png +0 -0
- assets/images/error.svg +44 -0
- {images → assets/images}/fbconn.png +0 -0
- {images → assets/images}/file.png +0 -0
- {images → assets/images}/film.png +0 -0
- {images → assets/images}/flash.png +0 -0
- {images → assets/images}/folder_open.png +0 -0
- {images → assets/images}/generate-pass.png +0 -0
- {images → assets/images}/google-1.png +0 -0
- {images → assets/images}/help1.png +0 -0
- {images → assets/images}/html.png +0 -0
- {images → assets/images}/icon_sprite.png +0 -0
- {images → assets/images}/icons/download.png +0 -0
- assets/images/image.png +0 -0
- assets/images/img-404.png +0 -0
- {images → assets/images}/import-files.png +0 -0
- assets/images/info.svg +50 -0
- {images → assets/images}/information-balloon.png +0 -0
- {images → assets/images}/information.png +0 -0
- {images → assets/images}/java.png +0 -0
- {images → assets/images}/linux.png +0 -0
- assets/images/loader.svg +21 -0
- {images → assets/images}/loading-new.gif +0 -0
- {images → assets/images}/loading.gif +0 -0
- assets/images/loading.svg +16 -0
- {images → assets/images}/lock.png +0 -0
- {images → assets/images}/minus.png +0 -0
- {images → assets/images}/music.png +0 -0
- {images → assets/images}/next.png +0 -0
- {images → assets/images}/password.png +0 -0
- {images → assets/images}/pdf.png +0 -0
- {images → assets/images}/php.png +0 -0
- {images → assets/images}/picture.png +0 -0
- {images → assets/images}/play.png +0 -0
- {images → assets/images}/plus.png +0 -0
- {images → assets/images}/ppt.png +0 -0
- {images → assets/images}/previous.png +0 -0
- {images → assets/images}/progress_bar.gif +0 -0
- {images → assets/images}/psd.png +0 -0
- {images → assets/images}/reload.png +0 -0
- {images → assets/images}/remove.png +0 -0
- {images → assets/images}/ruby.png +0 -0
- {images → assets/images}/sales.png +0 -0
- {images → assets/images}/save.png +0 -0
- {images → assets/images}/script.png +0 -0
- assets/images/sep.png +0 -0
- {images → assets/images}/settings.png +0 -0
- {images → assets/images}/snext.png +0 -0
- assets/images/sort-active.svg +1 -0
- assets/images/sort.svg +1 -0
- {images → assets/images}/sort_asc.png +0 -0
- {images → assets/images}/sort_asc_disabled.png +0 -0
- {images → assets/images}/sort_both.png +0 -0
- {images → assets/images}/sort_desc.png +0 -0
- {images → assets/images}/sort_desc_disabled.png +0 -0
- {images → assets/images}/spinner.gif +0 -0
- {images → assets/images}/sprevious.png +0 -0
- {images → assets/images}/stats.png +0 -0
- assets/images/success.svg +38 -0
- {images → assets/images}/switch.gif +0 -0
- {images → assets/images}/templates.png +0 -0
- {images → assets/images}/txt.png +0 -0
- {images → assets/images}/ui-icons_454545_256x240.png +0 -0
- assets/images/wpdm-icon.png +0 -0
- assets/images/wpdm-logo.png +0 -0
- {images → assets/images}/wpdm-settings-active.png +0 -0
- {images → assets/images}/wpdm-settings.png +0 -0
- {images → assets/images}/wpdm-welcome.png +0 -0
- {images → assets/images}/xls.png +0 -0
- {images → assets/images}/zip.png +0 -0
- {jqui → assets/jqui}/css/custom.css +15 -1
- {jqui → assets/jqui}/css/normalise.css +0 -0
- {jqui → assets/jqui}/img/dark_wall.png +0 -0
- {jqui → assets/jqui}/js/custom.js +0 -0
- {jqui → assets/jqui}/js/jquery-ui.toggleSwitch.js +0 -0
- {jqui → assets/jqui}/js/jquery.imgpreload.min.js +0 -0
- {jqui → assets/jqui}/js/modernizr-2.0.6.min.js +0 -0
- {jqui → assets/jqui}/theme/images/icons_16.png +0 -0
- {jqui → assets/jqui}/theme/images/jGrowl-close.png +0 -0
- {jqui → assets/jqui}/theme/images/modalClose.png +0 -0
- {jqui → assets/jqui}/theme/images/modalClose@2x.png +0 -0
- {jqui → assets/jqui}/theme/images/slider_handles.png +0 -0
- {jqui → assets/jqui}/theme/images/slider_handles@2x.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_222222_256x240.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_2e83ff_256x240.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_454545_256x240.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_888888_256x240.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_FFFFFF_256x240.png +0 -0
- {jqui → assets/jqui}/theme/images/ui-icons_cd0a0a_256x240.png +0 -0
- {jqui → assets/jqui}/theme/jquery-ui.css +58 -7
- {js → assets/js}/bootstrap-select.min.js +0 -0
- assets/js/chosen.jquery.min.js +1257 -0
- assets/js/dataTables.bootstrap.min.js +8 -0
- assets/js/front.js +449 -0
- {js → assets/js}/img/delete.png +0 -0
- {js → assets/js}/img/donwloadmanager.png +0 -0
- {js → assets/js}/img/edit.png +0 -0
- {js → assets/js}/img/player-graphics.gif +0 -0
- assets/js/jquery-ui-timepicker-addon.js +2145 -0
- assets/js/jquery.dataTables.min.js +164 -0
- assets/js/jquery.validate.min.js +5 -0
- {js → assets/js}/jqueryFileTree.js +0 -0
- assets/js/select2.min.js +22 -0
- assets/js/validator.min.js +9 -0
- assets/js/wpdm-admin.js +301 -0
- bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- bootstrap/fonts/glyphicons-halflings-regular.svg +0 -228
- bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- cache/index.php +2 -0
- cache/pdfthumbs/index.php +2 -0
- css/admin-styles.css +0 -167
- css/aristo.css +0 -733
- css/button-styles.css +0 -485
- css/chosen.css +0 -339
- css/demo_table.css +0 -297
- css/demo_table_jui.css +0 -380
- css/front-tabs.css +0 -110
- css/front.css +0 -1571
- css/gh-buttons.css +0 -424
- css/icons.css +0 -60
- css/images/border.png +0 -0
- css/images/controls.png +0 -0
- css/images/gh-icons.png +0 -0
- css/images/ie6/borderBottomCenter.png +0 -0
- css/images/ie6/borderBottomLeft.png +0 -0
- css/images/ie6/borderBottomRight.png +0 -0
- css/images/ie6/borderMiddleLeft.png +0 -0
- css/images/ie6/borderMiddleRight.png +0 -0
- css/images/ie6/borderTopCenter.png +0 -0
- css/images/ie6/borderTopLeft.png +0 -0
- css/images/ie6/borderTopRight.png +0 -0
- css/images/loading.gif +0 -0
- css/images/loading_background.png +0 -0
- css/images/overlay.png +0 -0
- css/osx.css +0 -39
- css/sitemap-style.xml +0 -151
- css/tabs.css +0 -86
- download-manager.php +356 -132
- email-templates/abstract.html +139 -0
- email-templates/blue.html +130 -0
- email-templates/default.html +711 -0
- email-templates/leftist.html +304 -0
- email-templates/panel.html +139 -0
- email-templates/plain.html +484 -0
- email-templates/ui-blocks/panel.php +21 -0
- email-templates/ui-blocks/table.php +32 -0
- ext/player/player_mp3_maxi.swf +0 -0
- ext/tooltips/css/vtip.css +0 -3
- ext/tooltips/example.html +0 -31
- ext/tooltips/images/Thumbs.db +0 -0
- ext/tooltips/images/vtip_arrow.png +0 -0
- ext/tooltips/import.php +0 -0
- ext/tooltips/vtip-min.js +0 -5
- ext/tooltips/vtip.js +0 -38
- file-type-icons/17_download_program.png +0 -0
- file-type-icons/32x32/_blank.png +0 -0
- file-type-icons/32x32/accdb.png +0 -0
- file-type-icons/32x32/avi.png +0 -0
- file-type-icons/32x32/bmp.png +0 -0
- file-type-icons/32x32/css.png +0 -0
- file-type-icons/32x32/docx.png +0 -0
- file-type-icons/32x32/docx_mac.png +0 -0
- file-type-icons/32x32/eml.png +0 -0
- file-type-icons/32x32/eps.png +0 -0
- file-type-icons/32x32/fla.png +0 -0
- file-type-icons/32x32/gif.png +0 -0
- file-type-icons/32x32/html.png +0 -0
- file-type-icons/32x32/ind.png +0 -0
- file-type-icons/32x32/ini.png +0 -0
- file-type-icons/32x32/jpg.png +0 -0
- file-type-icons/32x32/jsf.png +0 -0
- file-type-icons/32x32/midi.png +0 -0
- file-type-icons/32x32/mov.png +0 -0
- file-type-icons/32x32/mp3.png +0 -0
- file-type-icons/32x32/mpeg.png +0 -0
- file-type-icons/32x32/pdf.png +0 -0
- file-type-icons/32x32/php.png +0 -0
- file-type-icons/32x32/png.png +0 -0
- file-type-icons/32x32/pptx.png +0 -0
- file-type-icons/32x32/pptx_win.png +0 -0
- file-type-icons/32x32/proj.png +0 -0
- file-type-icons/32x32/psd.png +0 -0
- file-type-icons/32x32/pst.png +0 -0
- file-type-icons/32x32/pub.png +0 -0
- file-type-icons/32x32/rar.png +0 -0
- file-type-icons/32x32/readme.png +0 -0
- file-type-icons/32x32/settings.png +0 -0
- file-type-icons/32x32/tiff.png +0 -0
- file-type-icons/32x32/txt.png +0 -0
- file-type-icons/32x32/url.png +0 -0
- file-type-icons/32x32/vsd.png +0 -0
- file-type-icons/32x32/wav.png +0 -0
- file-type-icons/32x32/wma.png +0 -0
- file-type-icons/32x32/wmv.png +0 -0
- file-type-icons/32x32/xlsx_mac.png +0 -0
- file-type-icons/32x32/xlsx_win.png +0 -0
- file-type-icons/32x32/zip.png +0 -0
- file-type-icons/_blank.png +0 -0
- file-type-icons/arrow_down.png +0 -0
- file-type-icons/blank.png +0 -0
- file-type-icons/box_download.png +0 -0
- file-type-icons/down.png +0 -0
- file-type-icons/down2.png +0 -0
- file-type-icons/down3.png +0 -0
- file-type-icons/download.png +0 -0
- file-type-icons/download1.png +0 -0
- file-type-icons/download2.png +0 -0
- file-type-icons/download_blue.png +0 -0
- file-type-icons/download_box.png +0 -0
- file-type-icons/download_drive.png +0 -0
- file-type-icons/download_folder.png +0 -0
- file-type-icons/folder_download.png +0 -0
- file-type-icons/ppt.png +0 -0
- file-type-icons/summer_download.png +0 -0
- files/.htaccess +0 -5
- font-awesome/css/font-awesome.css +0 -2026
- font-awesome/css/font-awesome.min.css +0 -4
- font-awesome/fonts/FontAwesome.otf +0 -0
- font-awesome/fonts/fontawesome-webfont.eot +0 -0
- font-awesome/fonts/fontawesome-webfont.svg +0 -640
- font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- font-awesome/fonts/fontawesome-webfont.woff +0 -0
- font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- images/1help1.png +0 -0
- images/CheckBox.png +0 -0
- images/add-image.gif +0 -0
- images/add.png +0 -0
- images/application.png +0 -0
- images/bg_header.jpg +0 -0
- images/browse.png +0 -0
- images/category.png +0 -0
- images/download-manager-16.png +0 -0
- images/liveform-logo.png +0 -0
- images/theme.png +0 -0
- images/wpdm-logo.png +0 -0
- images/wpdm.png +0 -0
- images/wpeden.png +0 -0
- images/wpmp.png +0 -0
- index.php +2 -0
- js/analytics.js +0 -135
- js/audio.js +0 -703
- js/chosen.jquery.min.js +0 -10
- js/editor_plugin.js +0 -44
- js/front.js +0 -32
- js/jquery.colorbox-min.js +0 -4
- js/jquery.dataTables.js +0 -14950
- js/jquery.dataTables.min.js +0 -160
- js/jquery.dump.js +0 -165
- js/jquery.facebook.js +0 -29
- js/jquery.fbjlike.js +0 -104
- js/jquery.form.js +0 -813
- js/jquery.gplusone.js +0 -73
- js/jquery.twitterbutton.js +0 -140
- js/jquery.ui.nestedSortable.js +0 -356
- js/jquery.validate.min.js +0 -51
- js/popup.js +0 -121
- js/raphael.js +0 -7
- js/tinymce.js +0 -74
- languages/download-manager-es_ES.mo +0 -0
- languages/download-manager-es_ES.po +1878 -0
- languages/download-manager-fr_FR.mo +0 -0
- languages/download-manager-fr_FR.po +1825 -0
- languages/download-manager-it_IT.mo +0 -0
- languages/download-manager-it_IT.po +1764 -0
- languages/{wpdmpro.mo → download-manager.mo} +0 -0
- languages/download-manager.po +1703 -0
- languages/wpdmpro.po +0 -670
- libs/class.Apply.php +766 -0
- libs/class.ApplySettings.php +0 -79
- libs/class.CategoryHandler.php +96 -0
- libs/class.Crypt.php +64 -0
- libs/class.DownloadStats.php +44 -0
- libs/class.Email.php +233 -0
- libs/class.FileList.php +326 -0
- libs/class.FileSystem.php +383 -0
- libs/class.MailUI.php +34 -0
- libs/class.MediaHandler.php +22 -0
- libs/class.Messages.php +73 -0
- libs/class.Package.php +1292 -0
- libs/class.PackageLocks.php +125 -0
- libs/{class.pagination.php → class.Pagination.php} +5 -18
- libs/class.Session.php +88 -0
- libs/class.Settings.php +18 -0
- libs/class.ShortCodes.php +384 -0
- libs/class.StreamMedia.php +159 -0
- libs/class.TempStorage.php +77 -0
- libs/class.Template.php +48 -0
- libs/class.UserDashboard.php +70 -31
- libs/class.logs.php +0 -33
- libs/class.pack.php +0 -366
- libs/wpdm-widgets.php +0 -408
- modules/server-file-browser.php +108 -0
- modules/widgets.php +478 -0
- readme.txt +411 -40
- screenshot-1.png +0 -0
- screenshot-10.png +0 -0
- screenshot-11.png +0 -0
- screenshot-12.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- screenshot-6.png +0 -0
- screenshot-7.png +0 -0
- screenshot-8.png +0 -0
- screenshot-9.png +0 -0
- templates/link-template-default.php +0 -12
- templates/page-template-default.php +0 -28
- tpls/already-logged-in.php +64 -0
- tpls/email-templates/html-frame.html +11 -0
- tpls/email-templates/wpdm-email-lock-template.html +85 -0
- tpls/email-templates/wpdm-new-user.html +103 -0
- tpls/email-templates/wpdm-remind-password.html +112 -0
- tpls/file-list.php +46 -0
- tpls/link-templates/link-template-bsthumnail.php +23 -0
- tpls/link-templates/link-template-button-popup.php +2 -0
- {templates → tpls/link-templates}/link-template-button.php +1 -1
- tpls/link-templates/link-template-calltoaction3.php +19 -0
- tpls/link-templates/link-template-default-alt.php +18 -0
- {templates → tpls/link-templates}/link-template-default-ext.php +1 -1
- tpls/link-templates/link-template-default-old.php +19 -0
- {templates → tpls/link-templates}/link-template-default-wdc.php +1 -1
- tpls/link-templates/link-template-default.php +18 -0
- tpls/lock-options-iframe.php +289 -0
- tpls/message.php +67 -0
- tpls/metaboxes/attach-file.php +0 -212
- tpls/metaboxes/items.php +0 -3
- tpls/page-templates/page-template-compact.php +4 -0
- tpls/page-templates/page-template-default.php +68 -0
- tpls/page-templates/page-template-extended.php +36 -0
- tpls/page-templates/page-template-popup.php +28 -0
- tpls/page-templates/page-template-simple.php +37 -0
- tpls/page-templates/page-template-video.php +39 -0
- tpls/page-templates/premium-package.php +67 -0
- tpls/page-templates/wpdm-email-lock-template.html +85 -0
- tpls/page-templates/wpdm-new-user.html +103 -0
- tpls/page-templates/wpdm-remind-password.html +112 -0
- tpls/simple-search-form.php +26 -0
- tpls/user-dashboard/download-history.php +8 -5
- tpls/user-dashboard/edit-profile.php +51 -27
- tpls/user-dashboard/profile.php +37 -22
- tpls/wpdm-addons-list.php +0 -295
- tpls/wpdm-all-downloads.php +264 -70
- tpls/wpdm-be-member.php +2 -195
- tpls/wpdm-category.php +52 -0
- tpls/wpdm-dashboard.php +27 -156
- tpls/wpdm-edit-user-profile.php +75 -0
- tpls/wpdm-generate-password.php +118 -0
- tpls/wpdm-login-form.php +259 -82
- tpls/wpdm-members.php +54 -0
- tpls/wpdm-reg-form.php +161 -100
- tpls/wpdm-remind-password.php +14 -0
- wpdm-core.php +180 -454
- wpdm-functions.php +1245 -1472
- wpdm-hooks.php +14 -51
- wpdm-start-download.php +120 -58
admin/class.WordPressDownloadManagerAdmin.php
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace WPDM\admin;
|
3 |
+
|
4 |
+
class WordPressDownloadManagerAdmin
|
5 |
+
{
|
6 |
+
|
7 |
+
function __construct()
|
8 |
+
{
|
9 |
+
new \WPDM\admin\menus\Welcome();
|
10 |
+
new \WPDM\admin\menus\Packages();
|
11 |
+
new \WPDM\admin\menus\Categories();
|
12 |
+
new \WPDM\admin\menus\Templates();
|
13 |
+
new \WPDM\admin\menus\Addons();
|
14 |
+
new \WPDM\admin\menus\Stats();
|
15 |
+
new \WPDM\admin\menus\Settings();
|
16 |
+
|
17 |
+
$this->Actions();
|
18 |
+
}
|
19 |
+
|
20 |
+
function Actions()
|
21 |
+
{
|
22 |
+
add_action('admin_enqueue_scripts', array($this, 'enqueueScripts'));
|
23 |
+
add_action('admin_init', array($this, 'metaBoxes'), 0);
|
24 |
+
add_action('init', array($this, 'registerScripts'), 0);
|
25 |
+
add_action('admin_init', array(new \WPDM\Email(), 'preview'));
|
26 |
+
add_action('wp_ajax_updatenow', array($this, 'updateNow'));
|
27 |
+
add_action('admin_head', array($this, 'adminHead'));
|
28 |
+
|
29 |
+
add_action('wp_ajax_updateaddon', array( $this, 'updateAddon' ));
|
30 |
+
add_action('wp_ajax_installaddon', array( $this, 'installAddon' ));
|
31 |
+
|
32 |
+
add_action('wp_dashboard_setup', array($this, 'addDashboardWidget'));
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
function registerScripts(){
|
37 |
+
wp_register_script('wpdm-bootstrap', WPDM_BASE_URL . 'assets/bootstrap/js/bootstrap.min.js', array('jquery'));
|
38 |
+
wp_register_style('wpdm-bootstrap', WPDM_BASE_URL . 'assets/bootstrap/css/bootstrap.min.css');
|
39 |
+
wp_register_style('wpdm-font-awesome', WPDM_BASE_URL . 'assets/fontawesome/css/all.css');
|
40 |
+
wp_register_style('wpdm-front', WPDM_BASE_URL . 'assets/css/front.css');
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Enqueue admin scripts & styles
|
45 |
+
*/
|
46 |
+
function enqueueScripts($hook){
|
47 |
+
|
48 |
+
|
49 |
+
if(get_post_type()=='wpdmpro' || wpdm_query_var('post_type') == 'wpdmpro' || $hook == 'index.php'){
|
50 |
+
wp_enqueue_script('jquery');
|
51 |
+
wp_enqueue_script('jquery-form');
|
52 |
+
wp_enqueue_script('jquery-ui-core');
|
53 |
+
wp_enqueue_script('jquery-ui-tabs');
|
54 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
55 |
+
wp_enqueue_script('jquery-ui-slider');
|
56 |
+
wp_enqueue_script('jquery-ui-sortable');
|
57 |
+
wp_enqueue_script('jquery-ui-timepicker', WPDM_BASE_URL.'assets/js/jquery-ui-timepicker-addon.js',array('jquery','jquery-ui-core','jquery-ui-datepicker','jquery-ui-slider') );
|
58 |
+
|
59 |
+
wp_enqueue_script('thickbox');
|
60 |
+
wp_enqueue_style('thickbox');
|
61 |
+
wp_enqueue_script('media-upload');
|
62 |
+
wp_enqueue_media();
|
63 |
+
|
64 |
+
wp_enqueue_script('jquery-choosen', plugins_url('/download-manager/assets/js/chosen.jquery.min.js'), array('jquery'));
|
65 |
+
wp_enqueue_style('choosen-css', plugins_url('/download-manager/assets/css/chosen.css'));
|
66 |
+
wp_enqueue_style('jqui-css', plugins_url('/download-manager/assets/jqui/theme/jquery-ui.css'));
|
67 |
+
|
68 |
+
wp_enqueue_script('wpdm-admin', plugins_url('/download-manager/assets/js/wpdm-admin.js'), array('jquery'));
|
69 |
+
wp_enqueue_style('wpdm-font-awesome' );
|
70 |
+
|
71 |
+
wp_enqueue_style( 'wp-color-picker' );
|
72 |
+
wp_enqueue_script( 'wp-color-picker' );
|
73 |
+
//wp_enqueue_script( 'my-script-handle', plugins_url('my-script.js', __FILE__ ), array( 'wp-color-picker' ), false, true );
|
74 |
+
|
75 |
+
}
|
76 |
+
|
77 |
+
if(get_post_type()=='wpdmpro' || wpdm_query_var('post_type') == 'wpdmpro' || $hook == 'index.php'){
|
78 |
+
wp_enqueue_script('wpdm-bootstrap' );
|
79 |
+
wp_enqueue_style('wpdm-bootstrap' );
|
80 |
+
//wp_enqueue_style('wpdm-bootstrap-theme', plugins_url('/download-manager/assets/bootstrap/css/bootstrap-theme.min.css'));
|
81 |
+
wp_enqueue_style('wpdm-admin-styles', plugins_url('/download-manager/assets/css/admin-styles.css'));
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
* @usage Single click add-on update
|
89 |
+
*/
|
90 |
+
function updateAddon(){
|
91 |
+
if(isset($_POST['updateurl']) && current_user_can(WPDM_ADMIN_CAP)){
|
92 |
+
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
93 |
+
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
94 |
+
$upgrader = new \Plugin_Upgrader( new \Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
95 |
+
$downloadlink = $_POST['updateurl'].'&preact=login&user=' . get_option('__wpdm_suname') . '&pass=' . get_option('__wpdm_supass').'&__wpdmnocache='.uniqid();
|
96 |
+
$update = new \stdClass();
|
97 |
+
$plugininfo = wpdm_plugin_data($_POST['plugin']);
|
98 |
+
deactivate_plugins($plugininfo['plugin_index_file'], true);
|
99 |
+
delete_plugins(array($plugininfo['plugin_index_file']));
|
100 |
+
$upgrader->install($downloadlink);
|
101 |
+
if(file_exists(dirname(WPDM_BASE_DIR).'/'.$plugininfo['plugin_index_file']))
|
102 |
+
activate_plugin($plugininfo['plugin_index_file']);
|
103 |
+
die("Updated Successfully");
|
104 |
+
} else {
|
105 |
+
die("Only site admin is authorized to install add-on");
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @usage Single click add-on install
|
111 |
+
*/
|
112 |
+
function installAddon(){
|
113 |
+
|
114 |
+
if(isset($_POST['updateurl']) && current_user_can(WPDM_ADMIN_CAP)){
|
115 |
+
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
116 |
+
include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
117 |
+
$upgrader = new \Plugin_Upgrader( new \Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
118 |
+
$downloadlink = $_POST['updateurl'].'&preact=login&user=' . get_option('__wpdm_suname') . '&pass=' . get_option('__wpdm_supass');
|
119 |
+
$upgrader->install($downloadlink);
|
120 |
+
$plugininfo = wpdm_plugin_data($_POST['plugin']);
|
121 |
+
if(file_exists(dirname(WPDM_BASE_DIR).'/'.$plugininfo['plugin_index_file']))
|
122 |
+
activate_plugin($plugininfo['plugin_index_file']);
|
123 |
+
die("Installed Successfully");
|
124 |
+
} else {
|
125 |
+
die("Only site admin is authorized to install add-on");
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
function adminHead(){
|
131 |
+
remove_submenu_page( 'index.php', 'wpdm-welcome' );
|
132 |
+
?>
|
133 |
+
<script type="text/javascript">
|
134 |
+
|
135 |
+
var wpdmConfig = {
|
136 |
+
siteURL: '<?php echo site_url(); ?>'
|
137 |
+
};
|
138 |
+
|
139 |
+
jQuery(function () {
|
140 |
+
|
141 |
+
|
142 |
+
jQuery('#TB_closeWindowButton').click(function () {
|
143 |
+
tb_remove();
|
144 |
+
});
|
145 |
+
|
146 |
+
});
|
147 |
+
</script>
|
148 |
+
<?php
|
149 |
+
}
|
150 |
+
|
151 |
+
function widgetCallback(){
|
152 |
+
include dirname(__FILE__).'/tpls/dashboard-widget.php';
|
153 |
+
}
|
154 |
+
|
155 |
+
function addDashboardWidget(){
|
156 |
+
wp_add_dashboard_widget('wpdm_dashboard_widget', 'WordPress Download Manager', array($this, 'widgetCallback'));
|
157 |
+
global $wp_meta_boxes;
|
158 |
+
$side_dashboard = $wp_meta_boxes['dashboard']['side']['core'];
|
159 |
+
$wpdm_widget = array('wpdm_dashboard_widget' => $wp_meta_boxes['dashboard']['normal']['core']['wpdm_dashboard_widget']);
|
160 |
+
unset($wp_meta_boxes['dashboard']['normal']['core']['wpdm_dashboard_widget']);
|
161 |
+
$sorted_dashboard = array_merge($wpdm_widget, $side_dashboard);
|
162 |
+
$wp_meta_boxes['dashboard']['side']['core'] = $sorted_dashboard;
|
163 |
+
}
|
164 |
+
|
165 |
+
function metaBoxes()
|
166 |
+
{
|
167 |
+
|
168 |
+
$meta_boxes = array(
|
169 |
+
'wpdm-settings' => array('title' => __('Package Settings','download-manager'), 'callback' => array($this, 'packageSettings'), 'position' => 'normal', 'priority' => 'low'),
|
170 |
+
'wpdm-upload-file' => array('title' => __('Attach File','download-manager'), 'callback' => array($this, 'uploadFiles'), 'position' => 'side', 'priority' => 'core'),
|
171 |
+
);
|
172 |
+
|
173 |
+
|
174 |
+
$meta_boxes = apply_filters("wpdm_meta_box", $meta_boxes);
|
175 |
+
foreach ($meta_boxes as $id => $meta_box) {
|
176 |
+
extract($meta_box);
|
177 |
+
if(!isset($position)) $position = 'normal';
|
178 |
+
if(!isset($priority)) $priority = 'core';
|
179 |
+
add_meta_box($id, $title, $callback, 'wpdmpro', $position, $priority);
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
function Files($post)
|
184 |
+
{
|
185 |
+
include(WPDM_BASE_DIR."admin/tpls/metaboxes/attached-files.php");
|
186 |
+
}
|
187 |
+
|
188 |
+
function packageSettings($post)
|
189 |
+
{
|
190 |
+
include(WPDM_BASE_DIR."admin/tpls/metaboxes/package-settings.php");
|
191 |
+
}
|
192 |
+
|
193 |
+
function uploadFiles($post)
|
194 |
+
{
|
195 |
+
include(WPDM_BASE_DIR."admin/tpls/metaboxes/attach-file.php");
|
196 |
+
}
|
197 |
+
|
198 |
+
|
199 |
+
}
|
admin/menus/class.Addons.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* User: shahnuralam
|
4 |
+
* Date: 11/9/15
|
5 |
+
* Time: 8:01 PM
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDM\admin\menus;
|
9 |
+
|
10 |
+
|
11 |
+
use WPDM\Session;
|
12 |
+
|
13 |
+
class Addons
|
14 |
+
{
|
15 |
+
|
16 |
+
function __construct()
|
17 |
+
{
|
18 |
+
add_action('admin_menu', array($this, 'Menu'));
|
19 |
+
}
|
20 |
+
|
21 |
+
function Menu()
|
22 |
+
{
|
23 |
+
add_submenu_page('edit.php?post_type=wpdmpro', __( "Add-Ons ‹ Download Manager" , "download-manager" ), __("Add-Ons" , "download-manager" ), WPDM_MENU_ACCESS_CAP, 'wpdm-addons', array($this, 'UI'));
|
24 |
+
}
|
25 |
+
|
26 |
+
function UI(){
|
27 |
+
if (!Session::get('wpdm_addon_store_data') || !is_array(json_decode(Session::get('wpdm_addon_store_data')))) {
|
28 |
+
$data = remote_get('https://www.wpdownloadmanager.com/?wpdm_api_req=getPackageList');
|
29 |
+
$cats = remote_get('https://www.wpdownloadmanager.com/?wpdm_api_req=getCategoryList');
|
30 |
+
Session::set('wpdm_addon_store_data', $data);
|
31 |
+
Session::set('wpdm_addon_store_cats', $cats);
|
32 |
+
} else {
|
33 |
+
$data = Session::get('wpdm_addon_store_data');
|
34 |
+
$cats = Session::get('wpdm_addon_store_cats');
|
35 |
+
}
|
36 |
+
$error = $data;
|
37 |
+
$data = json_decode($data);
|
38 |
+
$cats = json_decode($cats);
|
39 |
+
if(!is_array($data)) echo $error;
|
40 |
+
else
|
41 |
+
include(WPDM_BASE_DIR . "/admin/tpls/addons-list.php");
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
admin/menus/class.Categories.php
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* User: shahnuralam
|
4 |
+
* Date: 11/9/15
|
5 |
+
* Time: 7:30 PM
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDM\admin\menus;
|
9 |
+
|
10 |
+
|
11 |
+
class Categories
|
12 |
+
{
|
13 |
+
|
14 |
+
function __construct(){
|
15 |
+
add_action( 'wpdmcategory_add_form_fields', array($this,'MetaFields'), 10, 2 );
|
16 |
+
add_action( 'wpdmcategory_edit_form_fields', array($this,'MetaFieldsEdit'), 10, 2 );
|
17 |
+
|
18 |
+
add_action( 'edited_wpdmcategory', array($this,'SaveMetaData'), 10, 2 );
|
19 |
+
add_action( 'create_wpdmcategory', array($this,'SaveMetaData'), 10, 2 );
|
20 |
+
|
21 |
+
add_action( 'admin_init', array($this,'AdminInit') );
|
22 |
+
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
function AdminInit(){
|
27 |
+
add_filter("manage_edit-wpdmcategory_columns", array($this,'CategoryIDColumnHead'));
|
28 |
+
add_filter("manage_wpdmcategory_custom_column", array($this,'CategoryIDColumnData'), 10, 3);
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
function CategoryIDColumnHead($columns) {
|
33 |
+
$columns['tag_ID'] = 'ID<style>#tag_ID, .tag_ID{ width: 70px !important; }</style>';
|
34 |
+
return $columns;
|
35 |
+
}
|
36 |
+
|
37 |
+
function CategoryIDColumnData($c, $column_name, $term_id) {
|
38 |
+
|
39 |
+
if ($column_name == 'tag_ID') {
|
40 |
+
echo $term_id;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
function MetaFields() {
|
45 |
+
?>
|
46 |
+
<div class="form-field">
|
47 |
+
<label><?php _e( 'Category Image:', 'download-manager' ); ?></label>
|
48 |
+
<div class="button-group">
|
49 |
+
<input type="text" id="catimurl" placeholder="<?php _e( "Image URL" , "download-manager" ); ?>" class="button" style="background: #ffffff" name="__wpdmcategory[icon]" value=""> <button data-uploader_button_text="Insert" data-uploader_title="<?php _e('Select Category Image', 'download-manager'); ?>" id="catim" type="button" class="button button-secondary"><?php _e('Insert From Media Library', 'download-manager'); ?></button>
|
50 |
+
</div>
|
51 |
+
<script type="text/javascript">
|
52 |
+
|
53 |
+
jQuery(document).ready(function() {
|
54 |
+
|
55 |
+
var file_frame;
|
56 |
+
|
57 |
+
jQuery('body').on('click', '#catim', function( event ){
|
58 |
+
|
59 |
+
event.preventDefault();
|
60 |
+
|
61 |
+
// If the media frame already exists, reopen it.
|
62 |
+
if ( file_frame ) {
|
63 |
+
file_frame.open();
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
// Create the media frame.
|
68 |
+
file_frame = wp.media.frames.file_frame = wp.media({
|
69 |
+
title: jQuery( this ).data( 'uploader_title' ),
|
70 |
+
button: {
|
71 |
+
text: jQuery( this ).data( 'uploader_button_text' )
|
72 |
+
},
|
73 |
+
multiple: false // Set to true to allow multiple files to be selected
|
74 |
+
});
|
75 |
+
|
76 |
+
// When an image is selected, run a callback.
|
77 |
+
file_frame.on( 'select', function() {
|
78 |
+
// We set multiple to false so only get one image from the uploader
|
79 |
+
attachment = file_frame.state().get('selection').first().toJSON();
|
80 |
+
var imgurl = attachment.url;
|
81 |
+
jQuery('#catimurl').val(imgurl);
|
82 |
+
|
83 |
+
});
|
84 |
+
|
85 |
+
// Finally, open the modal
|
86 |
+
file_frame.open();
|
87 |
+
return false;
|
88 |
+
});
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
jQuery('.del_adp').click(function(){
|
95 |
+
if(confirm('Are you sure?')){
|
96 |
+
jQuery('#'+jQuery(this).attr('rel')).fadeOut().remove();
|
97 |
+
}
|
98 |
+
|
99 |
+
});
|
100 |
+
|
101 |
+
});
|
102 |
+
|
103 |
+
</script>
|
104 |
+
</div>
|
105 |
+
<div class="form-field">
|
106 |
+
<label><?php _e( 'Access:', 'wpdmcategory' ); ?></label>
|
107 |
+
<p class="description"><?php _e( "Select the roles who should have access to the packages under this category" , "download-manager" ); ?></p>
|
108 |
+
|
109 |
+
|
110 |
+
<label><input name="__wpdmcategory[access][]" type="checkbox" value="guest"> <?php echo __( "All Visitors" , "download-manager" ); ?></label>
|
111 |
+
<?php
|
112 |
+
global $wp_roles;
|
113 |
+
$roles = array_reverse($wp_roles->role_names);
|
114 |
+
foreach( $roles as $role => $name ) {
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
?>
|
121 |
+
<label><input name="__wpdmcategory[access][]" type="checkbox" value="<?php echo $role; ?>" > <?php echo $name; ?></label>
|
122 |
+
<?php } ?>
|
123 |
+
|
124 |
+
|
125 |
+
</div>
|
126 |
+
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
function MetaFieldsEdit() {
|
131 |
+
$MetaData = get_option( "__wpdmcategory" );
|
132 |
+
$MetaData = maybe_unserialize($MetaData);
|
133 |
+
$icon = get_term_meta(wpdm_query_var('tag_ID', 'int'), '__wpdm_icon', true);
|
134 |
+
if($icon == '')
|
135 |
+
$icon = isset($MetaData[(int)$_GET['tag_ID']]['icon'])?$MetaData[(int)$_GET['tag_ID']]['icon']:'';
|
136 |
+
|
137 |
+
?>
|
138 |
+
<tr class="form-field">
|
139 |
+
<th><?php _e( 'Category Image:', 'download-manager' ); ?></th>
|
140 |
+
<td class="button-group">
|
141 |
+
<input type="text" id="catimurl" placeholder="<?php _e( "Image URL" , "download-manager" ); ?>" class="button" style="background: #ffffff" name="__wpdmcategory[icon]" value="<?php echo $icon; ?>"> <button data-uploader_button_text="Insert" data-uploader_title="<?php _e('Select Category Image', 'download-manager'); ?>" id="catim" type="button" class="button button-secondary"><?php _e('Insert From Media Library', 'download-manager'); ?></button>
|
142 |
+
|
143 |
+
<script type="text/javascript">
|
144 |
+
|
145 |
+
jQuery(document).ready(function() {
|
146 |
+
|
147 |
+
var file_frame;
|
148 |
+
|
149 |
+
jQuery('body').on('click', '#catim', function( event ){
|
150 |
+
|
151 |
+
event.preventDefault();
|
152 |
+
|
153 |
+
// If the media frame already exists, reopen it.
|
154 |
+
if ( file_frame ) {
|
155 |
+
file_frame.open();
|
156 |
+
return;
|
157 |
+
}
|
158 |
+
|
159 |
+
// Create the media frame.
|
160 |
+
file_frame = wp.media.frames.file_frame = wp.media({
|
161 |
+
title: jQuery( this ).data( 'uploader_title' ),
|
162 |
+
button: {
|
163 |
+
text: jQuery( this ).data( 'uploader_button_text' )
|
164 |
+
},
|
165 |
+
multiple: false // Set to true to allow multiple files to be selected
|
166 |
+
});
|
167 |
+
|
168 |
+
// When an image is selected, run a callback.
|
169 |
+
file_frame.on( 'select', function() {
|
170 |
+
// We set multiple to false so only get one image from the uploader
|
171 |
+
attachment = file_frame.state().get('selection').first().toJSON();
|
172 |
+
var imgurl = attachment.url;
|
173 |
+
jQuery('#catimurl').val(imgurl);
|
174 |
+
|
175 |
+
});
|
176 |
+
|
177 |
+
// Finally, open the modal
|
178 |
+
file_frame.open();
|
179 |
+
return false;
|
180 |
+
});
|
181 |
+
|
182 |
+
|
183 |
+
|
184 |
+
|
185 |
+
|
186 |
+
jQuery('.del_adp').click(function(){
|
187 |
+
if(confirm('Are you sure?')){
|
188 |
+
jQuery('#'+jQuery(this).attr('rel')).fadeOut().remove();
|
189 |
+
}
|
190 |
+
|
191 |
+
});
|
192 |
+
|
193 |
+
});
|
194 |
+
|
195 |
+
</script>
|
196 |
+
</td>
|
197 |
+
</tr>
|
198 |
+
<tr class="form-field">
|
199 |
+
<th><label><?php _e( 'Access:', 'wpdmcategory' ); ?></label>
|
200 |
+
</th>
|
201 |
+
<td>
|
202 |
+
<p class="description"><?php _e( "Select the roles who should have access to the packages under this category" , "download-manager" ); ?></p>
|
203 |
+
<ul>
|
204 |
+
<input name="__wpdmcategory[access][]" type="hidden" value="__wpdm__" />
|
205 |
+
<?php
|
206 |
+
|
207 |
+
$currentAccess = maybe_unserialize(get_term_meta(wpdm_query_var('tag_ID', 'int'), '__wpdm_access', true));
|
208 |
+
if(!is_array($currentAccess))
|
209 |
+
$currentAccess = isset($MetaData[(int)$_GET['tag_ID']])?$MetaData[(int)$_GET['tag_ID']]['access']:array();
|
210 |
+
|
211 |
+
$selz = '';
|
212 |
+
if( $currentAccess ) $selz = (in_array('guest',$currentAccess))?'checked=checked':'';
|
213 |
+
?>
|
214 |
+
|
215 |
+
<li><label><input name="__wpdmcategory[access][]" type="checkbox" value="guest" <?php echo $selz ?>><?php echo __( "All Visitors" , "download-manager" ); ?></label></li>
|
216 |
+
<?php
|
217 |
+
global $wp_roles;
|
218 |
+
$roles = array_reverse($wp_roles->role_names);
|
219 |
+
foreach( $roles as $role => $name ) {
|
220 |
+
|
221 |
+
|
222 |
+
|
223 |
+
if( $currentAccess ) $sel = (in_array($role,$currentAccess))?'checked=checked':'';
|
224 |
+
else $sel = '';
|
225 |
+
|
226 |
+
|
227 |
+
|
228 |
+
?>
|
229 |
+
<li><label><input name="__wpdmcategory[access][]" type="checkbox" value="<?php echo $role; ?>" <?php echo $sel ?>> <?php echo $name; ?></label></li>
|
230 |
+
<?php } ?>
|
231 |
+
</ul>
|
232 |
+
</td>
|
233 |
+
</tr>
|
234 |
+
<?php
|
235 |
+
}
|
236 |
+
|
237 |
+
function saveMetaData( $term_id ) {
|
238 |
+
if ( isset( $_POST['__wpdmcategory'] ) ) {
|
239 |
+
//$MetaData = get_option( "__wpdmcategory" );
|
240 |
+
//$MetaData = maybe_unserialize($MetaData);
|
241 |
+
foreach ($_POST['__wpdmcategory'] as $metaKey => $metaValue){
|
242 |
+
update_term_meta($term_id, "__wpdm_".$metaKey, $metaValue);
|
243 |
+
}
|
244 |
+
//$MetaData[$term_id] = $_POST['__wpdmcategory'];
|
245 |
+
//update_option( "__wpdmcategory", $MetaData );
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
}
|
admin/menus/class.Packages.php
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace WPDM\admin\menus;
|
5 |
+
|
6 |
+
|
7 |
+
class Packages
|
8 |
+
{
|
9 |
+
|
10 |
+
function __construct()
|
11 |
+
{
|
12 |
+
|
13 |
+
add_action('wp_ajax_wpdm_admin_upload_file', array($this, 'uploadFile'));
|
14 |
+
add_action('save_post', array($this, 'savePackage'));
|
15 |
+
|
16 |
+
add_action('manage_posts_columns', array($this, 'columnsTH'));
|
17 |
+
add_action('manage_posts_custom_column', array($this, 'columnsTD'), 10, 2);
|
18 |
+
|
19 |
+
add_filter( 'request', array($this, 'orderbyDownloads') );
|
20 |
+
add_filter( 'manage_edit-wpdmpro_sortable_columns', array($this, 'sortableDownloads') );
|
21 |
+
|
22 |
+
add_filter('post_row_actions', array($this, 'rowActions'), 10, 2);
|
23 |
+
|
24 |
+
add_action( 'quick_edit_custom_box', array($this, 'quickEditForm'), 10, 2 );
|
25 |
+
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
function savePackage($post)
|
30 |
+
{
|
31 |
+
if(!current_user_can('edit_posts', $post)) return;
|
32 |
+
if (get_post_type() != 'wpdmpro' || !isset($_POST['file'])) return;
|
33 |
+
|
34 |
+
// Deleted old zipped file
|
35 |
+
$zipped = get_post_meta($post, "__wpdm_zipped_file", true);
|
36 |
+
if($zipped!='' && file_exists($zipped)) { @unlink($zipped); }
|
37 |
+
|
38 |
+
$cdata = get_post_custom($post);
|
39 |
+
foreach ($cdata as $k => $v) {
|
40 |
+
$tk = str_replace("__wpdm_", "", $k);
|
41 |
+
if (!isset($_POST['file'][$tk]) && $tk !== $k && $tk != "masterkey") {
|
42 |
+
delete_post_meta($post, $k);
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
foreach ($_POST['file'] as $meta_key => $meta_value) {
|
48 |
+
$key_name = "__wpdm_" . $meta_key;
|
49 |
+
if($meta_key == 'package_dir' && $meta_value != '') { $meta_value = realpath($meta_value); }
|
50 |
+
if($meta_key == 'package_size' && doubleval($meta_value) == 0) $meta_value = "";
|
51 |
+
if($meta_key == 'files') $meta_value = array_unique($meta_value);
|
52 |
+
if($meta_key == 'files'){
|
53 |
+
foreach ($meta_value as &$value){
|
54 |
+
$value = wpdm_escs($value);
|
55 |
+
}
|
56 |
+
} else
|
57 |
+
$meta_value = is_array($meta_value)?wpdm_sanitize_array($meta_value):wpdm_escs($meta_value);
|
58 |
+
update_post_meta($post, $key_name, $meta_value);
|
59 |
+
}
|
60 |
+
|
61 |
+
if(get_post_meta($post, '__wpdm_masterkey', true) == '')
|
62 |
+
update_post_meta($post, '__wpdm_masterkey', uniqid());
|
63 |
+
|
64 |
+
if (isset($_POST['reset_key']) && $_POST['reset_key'] == 1)
|
65 |
+
update_post_meta($post, '__wpdm_masterkey', uniqid());
|
66 |
+
|
67 |
+
if(isset($_REQUEST['reset_udl'])) delete_post_meta($post, '__wpdmx_user_download_count');
|
68 |
+
//do_action('after_update_package',$post, $_POST['file']);
|
69 |
+
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
function uploadFile(){
|
75 |
+
check_ajax_referer('wpdm_admin_upload_file');
|
76 |
+
if(!current_user_can('upload_files')) die('-2');
|
77 |
+
|
78 |
+
$name = isset($_FILES['package_file']['name']) && !isset($_REQUEST["chunks"])?$_FILES['package_file']['name']:$_REQUEST['name'];
|
79 |
+
$name = esc_attr($name);
|
80 |
+
$ext = explode('.', $name);
|
81 |
+
$ext = end($ext);
|
82 |
+
$ext = strtolower($ext);
|
83 |
+
if(in_array($ext, array('php', 'js', 'html', 'py', 'pl', 'htaccess'))) die('-3');
|
84 |
+
|
85 |
+
if(file_exists(UPLOAD_DIR.$name) && get_option('__wpdm_overwrrite_file',0)==1){
|
86 |
+
@unlink(UPLOAD_DIR.$name);
|
87 |
+
}
|
88 |
+
if(file_exists(UPLOAD_DIR.$name) && !isset($_REQUEST["chunks"]))
|
89 |
+
$filename = time().'wpdm_'.$name;
|
90 |
+
else
|
91 |
+
$filename = $name;
|
92 |
+
|
93 |
+
do_action("wpdm_before_upload_file", $_FILES['package_file']);
|
94 |
+
|
95 |
+
if(get_option('__wpdm_sanitize_filename', 0) == 1)
|
96 |
+
$filename = sanitize_file_name($filename);
|
97 |
+
|
98 |
+
if(isset($_REQUEST["chunks"])) $this->chunkUploadFile(UPLOAD_DIR.$filename);
|
99 |
+
else
|
100 |
+
move_uploaded_file($_FILES['package_file']['tmp_name'],UPLOAD_DIR.$filename);
|
101 |
+
$filename = apply_filters("wpdm_after_upload_file", $filename);
|
102 |
+
//@unlink($status['file']);
|
103 |
+
echo "|||".$filename."|||";
|
104 |
+
exit;
|
105 |
+
}
|
106 |
+
|
107 |
+
function chunkUploadFile($destFilePath){
|
108 |
+
|
109 |
+
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
|
110 |
+
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
|
111 |
+
|
112 |
+
$out = @fopen("{$destFilePath}.part", $chunk == 0 ? "wb" : "ab");
|
113 |
+
if ($out) {
|
114 |
+
// Read binary input stream and append it to temp file
|
115 |
+
$in = @fopen($_FILES['package_file']['tmp_name'], "rb");
|
116 |
+
|
117 |
+
if ($in) {
|
118 |
+
while ($buff = fread($in, 4096))
|
119 |
+
fwrite($out, $buff);
|
120 |
+
} else
|
121 |
+
die('-3');
|
122 |
+
|
123 |
+
@fclose($in);
|
124 |
+
@fclose($out);
|
125 |
+
|
126 |
+
@unlink($_FILES['package_file']['tmp_name']);
|
127 |
+
} else
|
128 |
+
die('-3');
|
129 |
+
|
130 |
+
if (!$chunks || $chunk == $chunks - 1) {
|
131 |
+
// Strip the temp .part suffix off
|
132 |
+
rename("{$destFilePath}.part", $destFilePath);
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
|
137 |
+
function columnsTH($defaults) {
|
138 |
+
if(get_post_type()!='wpdmpro') return $defaults;
|
139 |
+
$img['image'] = "<span class='wpdm-th-icon ttip' style='font-size: 0.8em'><i style='font-size: 80%' class='fa fa-image'></i></span>";
|
140 |
+
wpdm_array_splice_assoc( $defaults, 1, 0, $img );
|
141 |
+
$otf['download_count'] = "<span class='wpdm-th-icon ttip' style='font-size: 0.8em'><i style='font-size: 80%' class='fa fa-download'></i></span>";
|
142 |
+
$otf['wpdmshortcode'] = 'Short-code';
|
143 |
+
wpdm_array_splice_assoc( $defaults, 3, 0, $otf );
|
144 |
+
return $defaults;
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
function columnsTD($column_name, $post_ID) {
|
149 |
+
if(get_post_type()!='wpdmpro') return;
|
150 |
+
if ($column_name == 'download_count') {
|
151 |
+
|
152 |
+
echo (int)get_post_meta($post_ID, '__wpdm_download_count', true);
|
153 |
+
|
154 |
+
}
|
155 |
+
if ($column_name == 'wpdmshortcode') {
|
156 |
+
|
157 |
+
echo "<input readonly=readonly class='wpdm-scode' onclick='this.select();' value=\"[wpdm_package id='$post_ID']\" />";
|
158 |
+
|
159 |
+
}
|
160 |
+
if ($column_name == 'image') {
|
161 |
+
if(has_post_thumbnail($post_ID))
|
162 |
+
echo get_the_post_thumbnail( $post_ID, 'thumbnail', array('class'=>'img60px') );
|
163 |
+
else {
|
164 |
+
$icon = get_post_meta($post_ID,'__wpdm_icon', true);
|
165 |
+
if($icon!=''){
|
166 |
+
$icon = $icon;
|
167 |
+
echo "<img src='$icon' class='img60px' alt='Icon' />";
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
|
174 |
+
function orderbyDownloads( $vars ) {
|
175 |
+
|
176 |
+
if ( isset( $vars['orderby'] ) && 'download_count' == $vars['orderby'] ) {
|
177 |
+
$vars = array_merge( $vars, array(
|
178 |
+
'meta_key' => '__wpdm_download_count',
|
179 |
+
'orderby' => 'meta_value_num'
|
180 |
+
) );
|
181 |
+
}
|
182 |
+
|
183 |
+
return $vars;
|
184 |
+
}
|
185 |
+
|
186 |
+
function sortableDownloads( $columns ) {
|
187 |
+
|
188 |
+
if(get_post_type()!='wpdmpro') return $columns;
|
189 |
+
|
190 |
+
$columns['download_count'] = 'download_count';
|
191 |
+
|
192 |
+
return $columns;
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
function rowActions($actions, $post)
|
197 |
+
{
|
198 |
+
if($post->post_type == 'wpdmpro')
|
199 |
+
$actions['download_link'] = '<a title="'.__('Direct Download','download-manager').'" href="'.\WPDM\Package::getMasterDownloadURL($post->ID).'" class="view_stats"><i class="fa fa-download text-success"></i></a>';
|
200 |
+
|
201 |
+
return $actions;
|
202 |
+
}
|
203 |
+
|
204 |
+
function quickEditForm($column_name, $post_type){
|
205 |
+
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
|
214 |
+
|
215 |
+
}
|
admin/menus/class.Settings.php
ADDED
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPDM\admin\menus;
|
4 |
+
|
5 |
+
use WPDM\Session;
|
6 |
+
|
7 |
+
class Settings
|
8 |
+
{
|
9 |
+
|
10 |
+
function __construct()
|
11 |
+
{
|
12 |
+
add_action('admin_init', array($this, 'initiateSettings'));
|
13 |
+
add_action('wp_ajax_wpdm_settings', array($this, 'loadSettingsPage'));
|
14 |
+
add_action('admin_menu', array($this, 'menu'));
|
15 |
+
}
|
16 |
+
|
17 |
+
function menu(){
|
18 |
+
$menu_access_cap = apply_filters('wpdm_admin_menu_settings', WPDM_MENU_ACCESS_CAP);
|
19 |
+
add_submenu_page('edit.php?post_type=wpdmpro', __('Settings ‹ Download Manager','download-manager'), __('Settings','download-manager'), $menu_access_cap, 'settings', array($this, 'UI'));
|
20 |
+
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
function loadSettingsPage()
|
25 |
+
{
|
26 |
+
global $stabs;
|
27 |
+
//$stabs['plugin-update']['callback'] = array($this, 'pluginUpdate');
|
28 |
+
if (current_user_can(WPDM_MENU_ACCESS_CAP)) {
|
29 |
+
$section = sanitize_text_field($_POST['section']);
|
30 |
+
call_user_func($stabs[$section]['callback']);
|
31 |
+
}
|
32 |
+
die();
|
33 |
+
}
|
34 |
+
|
35 |
+
function UI(){
|
36 |
+
if (isset($_POST['access']) && $_POST['access'] != '') {
|
37 |
+
update_option('access_level', $_POST['access']);
|
38 |
+
}
|
39 |
+
|
40 |
+
$access = get_option('access_level');
|
41 |
+
include(WPDM_BASE_DIR . 'admin/tpls/settings.php');
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @param $tabid
|
46 |
+
* @param $tabtitle
|
47 |
+
* @param $callback
|
48 |
+
* @param string $icon
|
49 |
+
* @return array
|
50 |
+
*/
|
51 |
+
public static function createMenu($tabid, $tabtitle, $callback, $icon = 'fa fa-cog')
|
52 |
+
{
|
53 |
+
return array('id' => $tabid, 'icon'=>$icon, 'link' => 'edit.php?post_type=wpdmpro&page=settings&tab=' . $tabid, 'title' => $tabtitle, 'callback' => $callback);
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @usage Initiate Settings Tabs
|
59 |
+
*/
|
60 |
+
function initiateSettings()
|
61 |
+
{
|
62 |
+
global $stabs;
|
63 |
+
$tabs = array();
|
64 |
+
$tabs['basic'] = array('id' => 'basic','icon'=>'fas fa-cog', 'link' => 'edit.php?post_type=wpdmpro&page=settings', 'title' => 'Basic', 'callback' => array($this, 'Basic'));
|
65 |
+
$tabs['wpdmui'] = array('id' => 'wpdmui','icon'=>'fas fa-fill-drip', 'link' => 'edit.php?post_type=wpdmpro&page=settings', 'title' => 'User Interface', 'callback' => array($this, 'userInterface'));
|
66 |
+
|
67 |
+
// Add buddypress settings menu when buddypress plugin is active
|
68 |
+
if (function_exists('bp_is_active')) {
|
69 |
+
$tabs['buddypress'] = array('id' => 'buddypress','icon'=>'fa fa-users', 'link' => 'edit.php?post_type=wpdmpro&page=settings&tab=buddypress', 'title' => 'BuddyPress', 'callback' => array($this, 'Buddypress'));
|
70 |
+
}
|
71 |
+
|
72 |
+
if(defined('WPDM_CLOUD_STORAGE')){
|
73 |
+
$tabs['cloud-storage'] = array('id' => 'cloud-storage','icon'=>'fa fa-cloud', 'link' => 'edit.php?post_type=wpdmpro&page=settings&tab=cloud-storage', 'title' => 'Cloud Storage', 'callback' => array($this, 'cloudStorage'));
|
74 |
+
}
|
75 |
+
|
76 |
+
if(!$stabs) $stabs = array();
|
77 |
+
|
78 |
+
|
79 |
+
$stabs = $tabs + $stabs;
|
80 |
+
|
81 |
+
$stabs = apply_filters("add_wpdm_settings_tab", $stabs);
|
82 |
+
|
83 |
+
$stabs['plugin-update'] = array('id' => 'plugin-update','icon'=>'fas fa-sync', 'link' => 'edit.php?post_type=wpdmpro&page=settings&tab=plugin-update', 'title' => 'Updates', 'callback' => array($this, 'pluginUpdate'));
|
84 |
+
$stabs['privacy'] = array('id' => 'privacy','icon'=>'fas fa-user-shield', 'link' => 'edit.php?post_type=wpdmpro&page=settings&tab=privacy', 'title' => 'Privacy', 'callback' => array($this, 'privacy'));
|
85 |
+
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @usage Admin Settings Tab Helper
|
92 |
+
* @param string $sel
|
93 |
+
*/
|
94 |
+
public static function renderMenu($sel = '')
|
95 |
+
{
|
96 |
+
global $stabs;
|
97 |
+
|
98 |
+
foreach ($stabs as $tab) {
|
99 |
+
if ($sel == $tab['id'])
|
100 |
+
echo "<li class='active'><a id='{$tab['id']}' href='{$tab['link']}'><i class='{$tab['icon']}'></i> {$tab['title']}</a></li>";
|
101 |
+
else
|
102 |
+
echo "<li class=''><a id='{$tab['id']}' href='{$tab['link']}'><i class='{$tab['icon']}'></i> {$tab['title']}</a></li>";
|
103 |
+
//if (isset($tab['func']) && function_exists($tab['func'])) {
|
104 |
+
// add_action('wp_ajax_' . $tab['func'], $tab['func']);
|
105 |
+
//}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
function Basic(){
|
111 |
+
|
112 |
+
$validate = array(
|
113 |
+
'wpdm_permission_msg' => 'kses',
|
114 |
+
'wpdm_login_msg' => 'kses',
|
115 |
+
'_wpdm_file_browser_root' => 'serverpath',
|
116 |
+
'_wpdm_file_browser_access' => 'txtarray',
|
117 |
+
'__wpdm_sanitize_filename' => 'int',
|
118 |
+
'__wpdm_chunk_upload' => 'int',
|
119 |
+
'__wpdm_chunk_size' => 'int',
|
120 |
+
'__wpdm_download_speed' => 'int',
|
121 |
+
'__wpdm_blocked_ips' => 'txt',
|
122 |
+
'__wpdm_blocked_ips_msg' => 'kses',
|
123 |
+
'__wpdm_download_resume' => 'int',
|
124 |
+
'__wpdm_support_output_buffer' => 'int',
|
125 |
+
'__wpdm_open_in_browser' => 'int',
|
126 |
+
'_wpdm_recaptcha_site_key' => 'txt',
|
127 |
+
'_wpdm_recaptcha_secret_key' => 'txt',
|
128 |
+
'__wpdm_login_url' => 'int',
|
129 |
+
'__wpdm_register_url' => 'int',
|
130 |
+
'__wpdm_user_dashboard' => 'int',
|
131 |
+
'__wpdm_rss_feed_main' => 'int',
|
132 |
+
|
133 |
+
);
|
134 |
+
|
135 |
+
if (isset($_POST['task']) && $_POST['task'] == 'wdm_save_settings' && current_user_can(WPDM_ADMIN_CAP)) {
|
136 |
+
|
137 |
+
if(!wp_verify_nonce($_POST['__wpdms_nonce'], NONCE_KEY)) die(__('Security token is expired! Refresh the page and try again.', 'download-manager'));
|
138 |
+
|
139 |
+
foreach ($_POST as $optn => $optv) {
|
140 |
+
if(strpos("__".$optn, '_wpdm_')) {
|
141 |
+
$optv = wpdm_sanitize_var($optv, $validate[$optn]);
|
142 |
+
update_option($optn, $optv);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
if (!isset($_POST['__wpdm_skip_locks'])) delete_option('__wpdm_skip_locks');
|
146 |
+
if (!isset($_POST['__wpdm_login_form'])) delete_option('__wpdm_login_form');
|
147 |
+
if (!isset($_POST['__wpdm_cat_desc'])) delete_option('__wpdm_cat_desc');
|
148 |
+
if (!isset($_POST['__wpdm_cat_img'])) delete_option('__wpdm_cat_img');
|
149 |
+
if (!isset($_POST['__wpdm_cat_tb'])) delete_option('__wpdm_cat_tb');
|
150 |
+
flush_rewrite_rules();
|
151 |
+
global $wp_rewrite, $WPDM;
|
152 |
+
$WPDM->registerPostTypeTaxonomy();
|
153 |
+
$wp_rewrite->flush_rules();
|
154 |
+
die('Settings Saved Successfully');
|
155 |
+
}
|
156 |
+
include(WPDM_BASE_DIR.'admin/tpls/settings/basic.php');
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
function userInterface(){
|
162 |
+
|
163 |
+
if (isset($_POST['task']) && $_POST['task'] == 'wdm_save_settings' && current_user_can(WPDM_ADMIN_CAP)) {
|
164 |
+
|
165 |
+
if(!wp_verify_nonce($_POST['__wpdms_nonce'], NONCE_KEY)) die(__('Security token is expired! Refresh the page and try again.', 'download-manager'));
|
166 |
+
|
167 |
+
foreach ($_POST as $optn => $optv) {
|
168 |
+
if(strpos("__".$optn, '_wpdm_')) {
|
169 |
+
$optv = wpdm_sanitize_array($optv);
|
170 |
+
update_option($optn, $optv);
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
die('Settings Saved Successfully');
|
175 |
+
}
|
176 |
+
include(WPDM_BASE_DIR.'admin/tpls/settings/user-interface.php');
|
177 |
+
|
178 |
+
}
|
179 |
+
|
180 |
+
|
181 |
+
function Frontend(){
|
182 |
+
if(isset($_POST['section']) && $_POST['section']=='frontend' && isset($_POST['task']) && $_POST['task']=='wdm_save_settings' && current_user_can(WPDM_ADMIN_CAP)){
|
183 |
+
|
184 |
+
if(!wp_verify_nonce($_POST['__wpdms_nonce'], NONCE_KEY)) die(__('Security token is expired! Refresh the page and try again.', 'download-manager'));
|
185 |
+
|
186 |
+
foreach($_POST as $k => $v){
|
187 |
+
if(strpos("__".$k, '_wpdm_')){
|
188 |
+
$v = wpdm_sanitize_array($v);
|
189 |
+
update_option($k, $v);
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
global $wp_roles;
|
194 |
+
|
195 |
+
$roleids = array_keys($wp_roles->roles);
|
196 |
+
$roles = maybe_unserialize(get_option('__wpdm_front_end_access',array()));
|
197 |
+
$naroles = array_diff($roleids, $roles);
|
198 |
+
|
199 |
+
foreach($roles as $role) {
|
200 |
+
$role = get_role($role);
|
201 |
+
if(is_object($role))
|
202 |
+
$role->add_cap('upload_files');
|
203 |
+
}
|
204 |
+
|
205 |
+
foreach($naroles as $role) {
|
206 |
+
$role = get_role($role);
|
207 |
+
if(!isset($role->capabilities['edit_posts']) || $role->capabilities['edit_posts']!=1)
|
208 |
+
$role->remove_cap('upload_files');
|
209 |
+
}
|
210 |
+
|
211 |
+
$refresh = 0;
|
212 |
+
|
213 |
+
$page_id = $_POST['__wpdm_user_dashboard'];
|
214 |
+
if($page_id != '') {
|
215 |
+
$page_name = get_post_field("post_name", $page_id);
|
216 |
+
add_rewrite_rule('^' . $page_name . '/(.+)/?', 'index.php?page_id=' . $page_id . '&udb_page=$matches[1]', 'top');
|
217 |
+
$refresh = 1;
|
218 |
+
}
|
219 |
+
|
220 |
+
$page_id = $_POST['__wpdm_author_dashboard'];
|
221 |
+
if($page_id != '') {
|
222 |
+
$page_name = get_post_field("post_name", $page_id);
|
223 |
+
add_rewrite_rule('^' . $page_name . '/(.+)/?', 'index.php?page_id=' . $page_id . '&adb_page=$matches[1]', 'top');
|
224 |
+
$refresh = 1;
|
225 |
+
}
|
226 |
+
|
227 |
+
if($refresh == 1){
|
228 |
+
global $wp_rewrite;
|
229 |
+
$wp_rewrite->flush_rules(true);
|
230 |
+
}
|
231 |
+
|
232 |
+
die('Settings Saved Successfully!');
|
233 |
+
}
|
234 |
+
include(WPDM_BASE_DIR."admin/tpls/settings/frontend.php");
|
235 |
+
}
|
236 |
+
|
237 |
+
function Buddypress(){
|
238 |
+
if(isset($_POST['section']) && $_POST['section']=='buddypress' && isset($_POST['task']) && $_POST['task']=='wdm_save_settings' && current_user_can(WPDM_ADMIN_CAP)){
|
239 |
+
|
240 |
+
if(!wp_verify_nonce($_POST['__wpdms_nonce'], NONCE_KEY)) die(__('Security token is expired! Refresh the page and try again.', 'download-manager'));
|
241 |
+
|
242 |
+
foreach($_POST as $k => $v){
|
243 |
+
if(strpos("__".$k, '_wpdm_')){
|
244 |
+
$v = wpdm_escs($v);
|
245 |
+
update_option($k, $v);
|
246 |
+
}
|
247 |
+
}
|
248 |
+
die('Settings Saved Successfully!');
|
249 |
+
}
|
250 |
+
include(WPDM_BASE_DIR . "admin/tpls/settings/buddypress.php");
|
251 |
+
}
|
252 |
+
|
253 |
+
function cloudStorage(){
|
254 |
+
if(isset($_POST['section']) && $_POST['section']=='cloud-storage' && isset($_POST['task']) && $_POST['task']=='wdm_save_settings' && current_user_can(WPDM_ADMIN_CAP)){
|
255 |
+
|
256 |
+
if(!wp_verify_nonce($_POST['__wpdms_nonce'], NONCE_KEY)) die(__('Security token is expired! Refresh the page and try again.', 'download-manager'));
|
257 |
+
|
258 |
+
foreach($_POST as $k => $v){
|
259 |
+
if(strpos("__".$k, '_wpdm_')){
|
260 |
+
$v = wpdm_escs($v);
|
261 |
+
update_option($k, $v);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
die('Settings Saved Successfully!');
|
265 |
+
}
|
266 |
+
include(WPDM_BASE_DIR . "admin/tpls/settings/cloud-storage.php");
|
267 |
+
}
|
268 |
+
|
269 |
+
function pluginUpdate(){
|
270 |
+
if(isset($_REQUEST['logout']) && $_REQUEST['logout'] == 1){
|
271 |
+
delete_option('__wpdm_suname');
|
272 |
+
delete_option('__wpdm_supass');
|
273 |
+
delete_option('__wpdm_purchased_items');
|
274 |
+
delete_option('__wpdm_freeaddons');
|
275 |
+
delete_option('__wpdm_core_update_check');
|
276 |
+
delete_option('__wpdm_access_token');
|
277 |
+
Session::clear('__wpdm_download_url');
|
278 |
+
die('<script>location.href="edit.php?post_type=wpdmpro&page=settings&tab=plugin-update";</script>Refreshing...');
|
279 |
+
}
|
280 |
+
|
281 |
+
if(isset($_POST['__wpdm_suname']) && $_POST['__wpdm_suname'] != ''){
|
282 |
+
update_option('__wpdm_suname',$_POST['__wpdm_suname']);
|
283 |
+
update_option('__wpdm_supass',$_POST['__wpdm_supass']);
|
284 |
+
delete_option('__wpdm_purchased_items');
|
285 |
+
delete_option('__wpdm_freeaddons');
|
286 |
+
delete_option('__wpdm_core_update_check');
|
287 |
+
delete_option('__wpdm_access_token');
|
288 |
+
Session::clear('__wpdm_download_url');
|
289 |
+
$access_token = wpdm_access_token();
|
290 |
+
if($access_token != '') {
|
291 |
+
$purchased_items = remote_get('https://www.wpdownloadmanager.com/?wpdmppaction=getpurchaseditems&wpdm_access_token=' . $access_token);
|
292 |
+
$ret = json_decode($purchased_items);
|
293 |
+
update_option('__wpdm_purchased_items', $purchased_items);
|
294 |
+
die('<script>location.href=location.href;</script>Login successful. Refreshing...');
|
295 |
+
} else{
|
296 |
+
die('Error: Invalid Login!');
|
297 |
+
}
|
298 |
+
|
299 |
+
}
|
300 |
+
|
301 |
+
if(get_option('__wpdm_suname') != '') {
|
302 |
+
$purchased_items = get_option('__wpdm_purchased_items', false);
|
303 |
+
if(!$purchased_items || wpdm_query_var('newpurchase') != '' ) {
|
304 |
+
$purchased_items = remote_get('https://www.wpdownloadmanager.com/?wpdmppaction=getpurchaseditems&wpdm_access_token=' . wpdm_access_token());
|
305 |
+
update_option('__wpdm_purchased_items', $purchased_items);
|
306 |
+
}
|
307 |
+
$purchased_items = json_decode($purchased_items);
|
308 |
+
if (isset($purchased_items->error)){ delete_option('__wpdm_suname'); delete_option('__wpdm_purchased_items'); }
|
309 |
+
if (isset($purchased_items->error)) $purchased_items->error = str_replace("[redirect]", admin_url("edit.php?post_type=wpdmpro&page=settings&tab=plugin-update"), $purchased_items->error);
|
310 |
+
}
|
311 |
+
if(get_option('__wpdm_freeaddons') == '' || wpdm_query_var('newpurchase') != '' || 1) {
|
312 |
+
$freeaddons = remote_get('https://www.wpdownloadmanager.com/?wpdm_api_req=getPackageList&cat_id=1148');
|
313 |
+
update_option('__wpdm_freeaddons', $freeaddons);
|
314 |
+
}
|
315 |
+
$freeaddons = json_decode(get_option('__wpdm_freeaddons'));
|
316 |
+
|
317 |
+
include(WPDM_BASE_DIR . 'admin/tpls/settings/addon-update.php');
|
318 |
+
}
|
319 |
+
|
320 |
+
function Privacy(){
|
321 |
+
if (wpdm_query_var('task') == 'wdm_save_settings' && wpdm_query_var('section') == 'privacy') {
|
322 |
+
foreach ($_POST as $key => $value){
|
323 |
+
if(strstr($key, '_wpdm_')){
|
324 |
+
$value = wpdm_sanitize_array($value);
|
325 |
+
update_option($key, $value);
|
326 |
+
}
|
327 |
+
}
|
328 |
+
_e("Privacy Settings Saved Successfully", "download-manager");
|
329 |
+
die();
|
330 |
+
}
|
331 |
+
include(WPDM_BASE_DIR . 'admin/tpls/settings/privacy.php');
|
332 |
+
}
|
333 |
+
|
334 |
+
|
335 |
+
}
|
admin/menus/class.Stats.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: shahnuralam
|
5 |
+
* Date: 11/9/15
|
6 |
+
* Time: 7:44 PM
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace WPDM\admin\menus;
|
10 |
+
|
11 |
+
|
12 |
+
use \WPDM\libs\FileSystem;
|
13 |
+
|
14 |
+
class Stats
|
15 |
+
{
|
16 |
+
function __construct()
|
17 |
+
{
|
18 |
+
add_action('admin_menu', array($this, 'Menu'));
|
19 |
+
add_action('admin_init', array($this, 'Export'));
|
20 |
+
}
|
21 |
+
|
22 |
+
function Menu()
|
23 |
+
{
|
24 |
+
$menu_access_cap = apply_filters('wpdm_admin_menu_stats', WPDM_MENU_ACCESS_CAP);
|
25 |
+
add_submenu_page('edit.php?post_type=wpdmpro', __('History ‹ Download Manager','download-manager'), __('History','download-manager'), $menu_access_cap, 'wpdm-stats', array($this, 'UI'));
|
26 |
+
}
|
27 |
+
|
28 |
+
function Export(){
|
29 |
+
if(wpdm_query_var('page') == 'wpdm-stats' && wpdm_query_var('task') == 'export'){
|
30 |
+
global $wpdb;
|
31 |
+
$data = $wpdb->get_results("select s.*, p.post_title as file from {$wpdb->prefix}ahm_download_stats s, {$wpdb->prefix}posts p where p.ID = s.pid order by id DESC");
|
32 |
+
FileSystem::downloadHeaders("download-stats.csv");
|
33 |
+
echo "File,User ID,Order ID,Date,Timestamp,IP\r\n";
|
34 |
+
foreach ($data as $d){
|
35 |
+
echo "{$d->file},{$d->uid},{$d->oid},{$d->year}-{$d->month}-{$d->day},{$d->timestamp},{$d->ip}\r\n";
|
36 |
+
}
|
37 |
+
die();
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
function UI()
|
42 |
+
{
|
43 |
+
include(WPDM_BASE_DIR."admin/tpls/stats.php");
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
}
|
admin/menus/class.Templates.php
ADDED
@@ -0,0 +1,238 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WPDM\admin\menus;
|
4 |
+
|
5 |
+
|
6 |
+
class Templates
|
7 |
+
{
|
8 |
+
|
9 |
+
function __construct()
|
10 |
+
{
|
11 |
+
add_action('admin_init', array($this, 'Save'));
|
12 |
+
add_action('wp_ajax_template_preview', array($this, 'Preview'));
|
13 |
+
add_action('wp_ajax_wpdm_delete_template', array($this, 'deleteTemplate'));
|
14 |
+
add_action('wp_ajax_update_template_status', array($this, 'updateTemplateStatus'));
|
15 |
+
add_action('wp_ajax_wpdm_save_email_setting', array($this, 'saveEmailSetting'));
|
16 |
+
add_action('admin_menu', array($this, 'Menu'));
|
17 |
+
}
|
18 |
+
|
19 |
+
function Menu()
|
20 |
+
{
|
21 |
+
add_submenu_page('edit.php?post_type=wpdmpro', __( "Templates ‹ Download Manager" , "download-manager" ), __( "Templates" , "download-manager" ), WPDM_MENU_ACCESS_CAP, 'templates', array($this, 'UI'));
|
22 |
+
}
|
23 |
+
|
24 |
+
function UI(){
|
25 |
+
$ttype = isset($_GET['_type']) ? esc_attr($_GET['_type']) : 'link';
|
26 |
+
|
27 |
+
if (isset($_GET['task']) && $_GET['task'] == 'EditEmailTemplate')
|
28 |
+
\WPDM\admin\menus\Templates::EmailEditor();
|
29 |
+
else
|
30 |
+
\WPDM\admin\menus\Templates::Show();
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
public static function Editor(){
|
35 |
+
include(WPDM_BASE_DIR . "admin/tpls/template-editor.php");
|
36 |
+
}
|
37 |
+
|
38 |
+
|
39 |
+
public static function EmailEditor(){
|
40 |
+
include(WPDM_BASE_DIR . "admin/tpls/email-template-editor.php");
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
public static function Show(){
|
45 |
+
include(WPDM_BASE_DIR . "admin/tpls/templates.php");
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @usage Delete link/page template
|
50 |
+
* @since 4.7.0
|
51 |
+
*/
|
52 |
+
|
53 |
+
function deleteTemplate(){
|
54 |
+
if (current_user_can(WPDM_ADMIN_CAP)) {
|
55 |
+
$ttype = wpdm_query_var('ttype');
|
56 |
+
$tplid = wpdm_query_var('tplid');
|
57 |
+
$tpldata = maybe_unserialize(get_option("_fm_{$ttype}_templates"));
|
58 |
+
if (!is_array($tpldata)) $tpldata = array();
|
59 |
+
unset($tpldata[$tplid]);
|
60 |
+
update_option("_fm_{$ttype}_templates", @serialize($tpldata));
|
61 |
+
die('ok');
|
62 |
+
}
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @usage Save Link/Page Templates
|
69 |
+
*/
|
70 |
+
function Save()
|
71 |
+
{
|
72 |
+
if (!isset($_GET['page']) || $_GET['page'] != 'templates') return;
|
73 |
+
$ttype = isset($_GET['_type']) ? esc_attr($_GET['_type']) : 'link';
|
74 |
+
if (isset($_GET['task']) && $_GET['task'] == 'DeleteTemplate') {
|
75 |
+
$tpldata = maybe_unserialize(get_option("_fm_{$ttype}_templates"));
|
76 |
+
if (!is_array($tpldata)) $tpldata = array();
|
77 |
+
unset($tpldata[wpdm_query_var('tplid')]);
|
78 |
+
update_option("_fm_{$ttype}_templates", @serialize($tpldata));
|
79 |
+
|
80 |
+
header("location: edit.php?post_type=wpdmpro&page=templates&_type=$ttype");
|
81 |
+
die();
|
82 |
+
}
|
83 |
+
|
84 |
+
if (isset($_POST['tpl'])) {
|
85 |
+
if (is_array(get_option("_fm_{$ttype}_templates")))
|
86 |
+
$tpldata = (get_option("_fm_{$ttype}_templates"));
|
87 |
+
else
|
88 |
+
$tpldata = maybe_unserialize(get_option("_fm_{$ttype}_templates"));
|
89 |
+
if (!is_array($tpldata)) $tpldata = array();
|
90 |
+
$tplid = wpdm_query_var('tplid');
|
91 |
+
$tpldata[$tplid] = $_POST['tpl'];
|
92 |
+
update_option("_fm_{$ttype}_templates", @serialize($tpldata));
|
93 |
+
|
94 |
+
header("location: edit.php?post_type=wpdmpro&&page=templates&_type=$ttype");
|
95 |
+
die();
|
96 |
+
}
|
97 |
+
|
98 |
+
if (isset($_POST['email_template'])) {
|
99 |
+
$email_template = wpdm_query_var('email_template', array('validate' => array('subject' => '', 'message' => 'escs', 'from_name' => '', 'from_email' => '')));
|
100 |
+
update_option("__wpdm_etpl_".wpdm_query_var('id'), $email_template);
|
101 |
+
if(wpdm_is_ajax()){
|
102 |
+
die('ok');
|
103 |
+
}
|
104 |
+
header("location: edit.php?post_type=wpdmpro&&page=templates&_type=$ttype");
|
105 |
+
die();
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* @usage Preview link/page template
|
111 |
|