From 8341712d5812d57f0dd2e1a5550910e950fc5cd5 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Wed, 3 Apr 2024 15:52:25 -0300 Subject: [PATCH] Update page builder --- admin/index.php | 348 +++-- objects/Page.php | 68 +- objects/functions.php | 4 + objects/functionsMail.php | 1 + plugin/AD_Server/index.php | 26 +- .../Categories_has_users_groups/index.php | 24 +- .../View/Users_affiliations/index.php | 22 +- .../View/Users_extra_info/index.php | 22 +- plugin/Live/view/Live_restreams/index.php | 23 +- .../Live/view/Live_restreams_logs/index.php | 24 +- plugin/Live/view/Live_schedule/index.php | 23 +- plugin/Live/view/Live_servers/index.php | 22 +- .../View/Users_login_history/index.php | 23 +- plugin/Meet/View/Meet_join_log/index.php | 20 +- plugin/Meet/View/Meet_schedule/index.php | 23 +- .../Meet_schedule_has_users_groups/index.php | 20 +- plugin/PayPalYPT/View/PayPalYPT_log/index.php | 23 +- .../View/Users_groups_permissions/index.php | 22 +- .../View/Playlists_schedules/index.php | 20 +- plugin/Scheduler/View/Email_to_user/index.php | 22 +- .../Scheduler/View/Emails_messages/index.php | 20 +- .../View/Scheduler_commands/index.php | 23 +- .../View/User_notifications/index.php | 20 +- plugin/UserNotifications/View/editor.php | 62 +- .../View/Tags_subscriptions/index.php | 20 +- plugin/VideoTags/View/editor.php | 62 +- plugin/VideoTags/index.php | 21 +- .../View/Statistics/index.php | 22 +- plugin/VideosStatistics/View/editor.php | 62 +- plugin/YPTWallet/paymentsTest.php | 303 ++--- plugin/YPTWallet/view/addFunds.php | 123 +- plugin/YPTWallet/view/adminManageWallets.php | 240 ++-- plugin/YPTWallet/view/configuration.php | 31 +- plugin/YPTWallet/view/history.php | 286 ++-- plugin/YPTWallet/view/manualAddFunds.php | 177 ++- plugin/YPTWallet/view/manualWithdrawFunds.php | 194 ++- plugin/YPTWallet/view/pendingRequests.php | 206 ++- plugin/YouPHPFlix2/view/modeFlix.php | 44 +- view/charts.php | 23 +- view/charts_body.php | 4 - view/configurations.php | 32 +- view/configurations_body.php | 1190 ++++++++--------- view/managerCategories.php | 21 +- view/managerPlugins.php | 24 +- view/managerUsers.php | 29 +- view/managerUsersGroups.php | 31 +- view/managerUsersGroups_body.php | 213 +-- view/managerUsers_body.php | 591 ++++---- view/managerVideos.php | 27 +- 49 files changed, 2141 insertions(+), 2740 deletions(-) diff --git a/admin/index.php b/admin/index.php index 011d59cd45..fea9742712 100644 --- a/admin/index.php +++ b/admin/index.php @@ -189,197 +189,181 @@ switch ($_GET['page']) { $includeBody = $global['systemRootPath'] . 'view/charts_body.php'; break; } -?> - - - - - "; - include $includeHead; - echo ""; - } - ?> - - - - -
-
-
-
-
- $value) { - $uid = uniqid(); - $href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"'; - if (!empty($value->href)) { - $href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"'; - } - if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) { +$_page = new Page(array('Administration')); +if (!empty($includeHead) && file_exists($includeHead)) { + $_page->setIncludeInHead(array($includeHead)); +} + +?> + +
+
+
+
+
+ $value) { + $uid = uniqid(); + $href = 'data-toggle="collapse" data-parent="#accordion" href="#collapse' . $uid . '"'; + if (!empty($value->href)) { + $href = 'href="' . $global['webSiteRootURL'] . 'admin/?page=' . $value->href . '"'; + } + if (!empty($_REQUEST['page']) && $_REQUEST['page'] == $value->href) { + $panel = 'panel-primary'; + } else { + foreach ($value->itens as $key2 => $value2) { + if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) { $panel = 'panel-primary'; - } else { - foreach ($value->itens as $key2 => $value2) { - if (!empty($_REQUEST['page']) && $_REQUEST['page'] === $value2->href) { - $panel = 'panel-primary'; + } + } + } ?> +
+ + itens)) { + $in = ''; + if (!empty($_GET['page'])) { + foreach ($value->itens as $search) { + if ($_GET['page'] === $search->href) { + $in = "in"; + break; } } } ?> -
- - itens)) { - $in = ''; - if (!empty($_GET['page'])) { - foreach ($value->itens as $search) { - if ($_GET['page'] === $search->href) { - $in = "in"; - break; - } - } - } ?> -
-
- - itens as $key2 => $value2) { - if (!empty($_GET['page']) && $_GET['page'] === $value2->href) { +
+
+
+ itens as $key2 => $value2) { + if (!empty($_GET['page']) && $_GET['page'] === $value2->href) { + $active = "active"; + } ?> + + + + - - - - -
+ title; ?> +
- title; ?> -
-
-
- -
- -
-
-
- -
- - -
- -
- - +
- -
+
+ +
+
- - - - - - + }); + $('.pluginSwitch').change(function(e) { + modal.showPleaseWait(); + $.ajax({ + url: webSiteRootURL + 'objects/pluginSwitch.json.php', + data: { + "uuid": $(this).attr('uuid'), + "name": $(this).attr('name'), + "dir": $(this).attr('name'), + "enable": $(this).is(":checked") + }, + type: 'post', + success: function(response) { + modal.hidePleaseWait(); + } + }); + }); + }); + +print(); +?> \ No newline at end of file diff --git a/objects/Page.php b/objects/Page.php index 5211893cbc..12a85d6fc8 100644 --- a/objects/Page.php +++ b/objects/Page.php @@ -14,6 +14,7 @@ class Page private $includeFooter = true; private $includeBGAnimation = false; private $includeInHead = array(); + private $includeInBody = array(); private $includeInFooter = array(); public function __construct($title, $bodyClass = '', $loadBasicCSSAndJS = false) @@ -92,6 +93,11 @@ class Page $this->includeInHead = $includeInHead; } + public function setIncludeInBody(array $includeInBody) + { + $this->includeInBody = $includeInBody; + } + public function setIncludeInFooter(array $includeInFooter) { $this->includeInFooter = $includeInFooter; @@ -117,7 +123,16 @@ class Page include $global['systemRootPath'] . 'view/include/head.php'; if (!empty($this->includeInHead)) { foreach ($this->includeInHead as $value) { - include $global['systemRootPath'] . $value; + if(!empty($value)){ + if(!file_exists($value)){ + $value = $global['systemRootPath'] . $value; + } + if(file_exists($value)){ + include $value; + }else{ + echo ""; + } + } } } if (!empty($this->extraStyles)) { @@ -157,7 +172,16 @@ class Page } if (!empty($this->includeInFooter)) { foreach ($this->includeInFooter as $value) { - include $global['systemRootPath'] . $value; + if(!empty($value)){ + if(!file_exists($value)){ + $value = $global['systemRootPath'] . $value; + } + if(file_exists($value)){ + include $value; + }else{ + echo ""; + } + } } } if (!empty($this->extraScripts)) { @@ -181,6 +205,20 @@ class Page $this->getNavBar(); //echo '
Loading...
'; //echo '
'; + if (!empty($this->includeInBody)) { + foreach ($this->includeInBody as $value) { + if(!empty($value)){ + if(!file_exists($value)){ + $value = $global['systemRootPath'] . $value; + } + if(file_exists($value)){ + include $value; + }else{ + echo ""; + } + } + } + } echo $this->bodyContent; //echo '
'; $this->getFooter(); @@ -207,4 +245,30 @@ class Page include $global['systemRootPath'] . 'objects/include_end.php'; } } + + public function printEditorIndex($plugin, $classname) + { + $this->loadBasicCSSAndJS(); + $this->setIncludeInHead(array("plugin/{$plugin}/View/{$classname}/index_head.php")); + $this->setIncludeInBody(array("plugin/{$plugin}/View/{$classname}/index_body.php")); + $this->print(); + } + + public function printEditorIndexFromFile($file) + { + global $config, $global; + $file = str_replace($global['systemRootPath'], '', $file); + $title = str_replace('/index.php', '', $file); + $parts = explode('/View/', $title); + $title = $parts[1]; + $title = ucwords(str_replace('_', ' ', $title)); + $this->setTitle($title); + $head = str_replace('index.php', 'index_head.php', $file); + $body = str_replace('index.php', 'index_body.php', $file); + //var_dump($title, $file, $head, $body);exit; + $this->loadBasicCSSAndJS(); + $this->setIncludeInHead(array($head)); + $this->setIncludeInBody(array($body)); + $this->print(); + } } diff --git a/objects/functions.php b/objects/functions.php index c159cfeaae..5fd1e8014e 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -5482,6 +5482,10 @@ function getHTMLTitle($titleArray) { global $config, $global; + if(!empty($_REQUEST['catName'])){ + $cat = Category::getCategoryByName($_REQUEST['catName']); + $titleArray[] = $cat['name']; + } if (!is_array($titleArray)) { $titleArray = []; } diff --git a/objects/functionsMail.php b/objects/functionsMail.php index 8b8de8da14..2c9e263f18 100644 --- a/objects/functionsMail.php +++ b/objects/functionsMail.php @@ -222,6 +222,7 @@ function createEmailMessageFromTemplate($message) global $global, $config; $text = file_get_contents("{$global['systemRootPath']}view/include/emailTemplate.html"); + $config = new AVideoConf(); $siteTitle = $config->getWebSiteTitle(); $logo = "getLogo()) . "\" alt=\"{$siteTitle}\"/>"; diff --git a/plugin/AD_Server/index.php b/plugin/AD_Server/index.php index 77d9bfd812..ec5969512c 100644 --- a/plugin/AD_Server/index.php +++ b/plugin/AD_Server/index.php @@ -7,24 +7,8 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - -?> - - - - - - - - - - +$_page = new Page(array('VAST')); +$_page->setIncludeInHead(array('plugin/AD_Server/index_head.php')); +$_page->setIncludeInBody(array('plugin/AD_Server/index_body.php')); +$_page->print(); +?> \ No newline at end of file diff --git a/plugin/CustomizeUser/View/Categories_has_users_groups/index.php b/plugin/CustomizeUser/View/Categories_has_users_groups/index.php index 76ad435ba4..e5cf47a896 100644 --- a/plugin/CustomizeUser/View/Categories_has_users_groups/index.php +++ b/plugin/CustomizeUser/View/Categories_has_users_groups/index.php @@ -1,28 +1,12 @@ - - - - <?php echo $config->getWebSiteTitle(); ?> :: CustomizeUser - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/CustomizeUser/View/Users_affiliations/index.php b/plugin/CustomizeUser/View/Users_affiliations/index.php index 4fbffdf1cb..c96901cc20 100644 --- a/plugin/CustomizeUser/View/Users_affiliations/index.php +++ b/plugin/CustomizeUser/View/Users_affiliations/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: CustomizeUser - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/CustomizeUser/View/Users_extra_info/index.php b/plugin/CustomizeUser/View/Users_extra_info/index.php index 76ad435ba4..a726553f97 100644 --- a/plugin/CustomizeUser/View/Users_extra_info/index.php +++ b/plugin/CustomizeUser/View/Users_extra_info/index.php @@ -7,22 +7,6 @@ if (!User::isAdmin()) { forbiddenPage("Must be admin"); } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: CustomizeUser - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Live/view/Live_restreams/index.php b/plugin/Live/view/Live_restreams/index.php index a97b2d1eba..302dd17ba8 100644 --- a/plugin/Live/view/Live_restreams/index.php +++ b/plugin/Live/view/Live_restreams/index.php @@ -8,22 +8,7 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - + +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Live/view/Live_restreams_logs/index.php b/plugin/Live/view/Live_restreams_logs/index.php index 9a486b69fd..e92c076dfc 100644 --- a/plugin/Live/view/Live_restreams_logs/index.php +++ b/plugin/Live/view/Live_restreams_logs/index.php @@ -8,22 +8,8 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: Live - - - - - - - +$_page = new Page(array('Live Restream')); +$_page->setIncludeInHead(array('plugin/Live/view/Live_restreams_logs/index_head.phpp')); +$_page->setIncludeInBody(array('plugin/Live/view/Live_restreams_logs/index_body.php')); +$_page->print(); +?> \ No newline at end of file diff --git a/plugin/Live/view/Live_schedule/index.php b/plugin/Live/view/Live_schedule/index.php index 221e1b552f..302dd17ba8 100644 --- a/plugin/Live/view/Live_schedule/index.php +++ b/plugin/Live/view/Live_schedule/index.php @@ -8,22 +8,7 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: Live - - - - - - - + +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Live/view/Live_servers/index.php b/plugin/Live/view/Live_servers/index.php index a97b2d1eba..c96901cc20 100644 --- a/plugin/Live/view/Live_servers/index.php +++ b/plugin/Live/view/Live_servers/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/LoginControl/View/Users_login_history/index.php b/plugin/LoginControl/View/Users_login_history/index.php index 3d60c6e9f2..28e87ba0c2 100644 --- a/plugin/LoginControl/View/Users_login_history/index.php +++ b/plugin/LoginControl/View/Users_login_history/index.php @@ -7,23 +7,6 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - -?> - - - - <?php echo __("Login Control") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Meet/View/Meet_join_log/index.php b/plugin/Meet/View/Meet_join_log/index.php index 03b92eb5b7..f218e9ff68 100644 --- a/plugin/Meet/View/Meet_join_log/index.php +++ b/plugin/Meet/View/Meet_join_log/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo __("Meet") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - diff --git a/plugin/Meet/View/Meet_schedule/index.php b/plugin/Meet/View/Meet_schedule/index.php index 03b92eb5b7..28e87ba0c2 100644 --- a/plugin/Meet/View/Meet_schedule/index.php +++ b/plugin/Meet/View/Meet_schedule/index.php @@ -7,23 +7,6 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - -?> - - - - <?php echo __("Meet") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Meet/View/Meet_schedule_has_users_groups/index.php b/plugin/Meet/View/Meet_schedule_has_users_groups/index.php index 03b92eb5b7..f218e9ff68 100644 --- a/plugin/Meet/View/Meet_schedule_has_users_groups/index.php +++ b/plugin/Meet/View/Meet_schedule_has_users_groups/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo __("Meet") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - diff --git a/plugin/PayPalYPT/View/PayPalYPT_log/index.php b/plugin/PayPalYPT/View/PayPalYPT_log/index.php index c0a68d522a..28e87ba0c2 100644 --- a/plugin/PayPalYPT/View/PayPalYPT_log/index.php +++ b/plugin/PayPalYPT/View/PayPalYPT_log/index.php @@ -7,23 +7,6 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: PayPalYPT - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Permissions/View/Users_groups_permissions/index.php b/plugin/Permissions/View/Users_groups_permissions/index.php index 664bb39774..c96901cc20 100644 --- a/plugin/Permissions/View/Users_groups_permissions/index.php +++ b/plugin/Permissions/View/Users_groups_permissions/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo __("Permissions") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/PlayLists/View/Playlists_schedules/index.php b/plugin/PlayLists/View/Playlists_schedules/index.php index 72f6729658..f218e9ff68 100644 --- a/plugin/PlayLists/View/Playlists_schedules/index.php +++ b/plugin/PlayLists/View/Playlists_schedules/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo __("PlayLists") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - - diff --git a/plugin/Scheduler/View/Email_to_user/index.php b/plugin/Scheduler/View/Email_to_user/index.php index d6619377e5..c96901cc20 100644 --- a/plugin/Scheduler/View/Email_to_user/index.php +++ b/plugin/Scheduler/View/Email_to_user/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: Scheduler - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/Scheduler/View/Emails_messages/index.php b/plugin/Scheduler/View/Emails_messages/index.php index d6619377e5..f218e9ff68 100644 --- a/plugin/Scheduler/View/Emails_messages/index.php +++ b/plugin/Scheduler/View/Emails_messages/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: Scheduler - - - - - - - diff --git a/plugin/Scheduler/View/Scheduler_commands/index.php b/plugin/Scheduler/View/Scheduler_commands/index.php index d6619377e5..28e87ba0c2 100644 --- a/plugin/Scheduler/View/Scheduler_commands/index.php +++ b/plugin/Scheduler/View/Scheduler_commands/index.php @@ -7,23 +7,6 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: Scheduler - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/UserNotifications/View/User_notifications/index.php b/plugin/UserNotifications/View/User_notifications/index.php index fb169339e5..f218e9ff68 100644 --- a/plugin/UserNotifications/View/User_notifications/index.php +++ b/plugin/UserNotifications/View/User_notifications/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: UserNotifications - - - - - - - diff --git a/plugin/UserNotifications/View/editor.php b/plugin/UserNotifications/View/editor.php index 840e244a94..d7fef08da3 100644 --- a/plugin/UserNotifications/View/editor.php +++ b/plugin/UserNotifications/View/editor.php @@ -1,46 +1,30 @@ loadBasicCSSAndJS(); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: UserNotifications - - - - - - -
-
-
-
- -
-
-
- -
-
- -
-
+
+
+
+
+ +
+
+
+ +
+
+
- - - - - +
+
+print(); +?> \ No newline at end of file diff --git a/plugin/VideoTags/View/Tags_subscriptions/index.php b/plugin/VideoTags/View/Tags_subscriptions/index.php index 1912ee0a73..f218e9ff68 100644 --- a/plugin/VideoTags/View/Tags_subscriptions/index.php +++ b/plugin/VideoTags/View/Tags_subscriptions/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: VideoTags - - - - - - - diff --git a/plugin/VideoTags/View/editor.php b/plugin/VideoTags/View/editor.php index 3e61f1103a..2afce98f34 100644 --- a/plugin/VideoTags/View/editor.php +++ b/plugin/VideoTags/View/editor.php @@ -1,46 +1,30 @@ loadBasicCSSAndJS(); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: VideoTags - - - - - - -
-
-
-
- -
-
-
- -
-
- -
-
+
+
+
+
+ +
+
+
+ +
+
+
- - - - - +
+
+print(); +?> \ No newline at end of file diff --git a/plugin/VideoTags/index.php b/plugin/VideoTags/index.php index cbb5eeb4ee..11423140bd 100644 --- a/plugin/VideoTags/index.php +++ b/plugin/VideoTags/index.php @@ -7,21 +7,8 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } - +$_page = new Page(array('Tags')); +include $global['systemRootPath'] . 'plugin/VideoTags/index_body.php'; +$_page->print(); ?> - - - - <?php echo __("Tags") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - + diff --git a/plugin/VideosStatistics/View/Statistics/index.php b/plugin/VideosStatistics/View/Statistics/index.php index 944a2724b1..c96901cc20 100644 --- a/plugin/VideosStatistics/View/Statistics/index.php +++ b/plugin/VideosStatistics/View/Statistics/index.php @@ -8,22 +8,6 @@ if (!User::isAdmin()) { exit; } -?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: VideosStatistics - - - - - - - +$_page = new Page(array('')); +$_page->printEditorIndexFromFile(__FILE__); +?> \ No newline at end of file diff --git a/plugin/VideosStatistics/View/editor.php b/plugin/VideosStatistics/View/editor.php index 47c18650be..bf475700a4 100644 --- a/plugin/VideosStatistics/View/editor.php +++ b/plugin/VideosStatistics/View/editor.php @@ -1,46 +1,30 @@ loadBasicCSSAndJS(); ?> - - - - <?php echo $config->getWebSiteTitle(); ?> :: VideosStatistics - - - - - - -
-
-
-
- -
-
-
- -
-
- -
-
+
+
+
+
+ +
+
+
+ +
+
+
- - - - - +
+
+print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/paymentsTest.php b/plugin/YPTWallet/paymentsTest.php index e0659e7ea1..f44fffe12d 100644 --- a/plugin/YPTWallet/paymentsTest.php +++ b/plugin/YPTWallet/paymentsTest.php @@ -8,177 +8,162 @@ $global['paymentsTest'] = 1; $myWallet = AVideoPlugin::loadPlugin('YPTWallet'); $objWallet = $myWallet->getDataObject(); $myBalance = $myWallet->getBalance(User::getId()); -$planTitle = 'Test payment '.date('Y-m-d h:i:s'); +$planTitle = 'Test payment ' . date('Y-m-d h:i:s'); $_GET['plans_id'] = -1; - + +$_page = new Page(array('Payment tests')); ?> - - +
- - <?php echo $config->getWebSiteTitle(); ?> :: Show Plans - - +
+
+
+
+ - - -
- -
-
-
-
- - -
-
-

Subscription

-
-
- getAvailableRecurrentPayments(); - ?> -
+
+
+

Subscription

-
-
-

One time payment

-
-
- getAvailablePayments(); - ?> -
+
+ getAvailableRecurrentPayments(); + ?>
-
-
-
-

Test Card Numbers for Stripe

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Card NumberBrandResponse
4242 4242 4242 4242VisaSuccess
5555 5555 5555 4444MastercardSuccess
4000 0025 0000 3155Visa (debit)Success
4000 0000 0000 9995Visa (declined)Card declined
4000 0000 0000 0127Visa (processing error)Processing error
4000 0000 0000 0069Visa (fraudulent)Card declined
4000 0027 6000 3184Visa3D Secure authentication required
-
+
+
+

One time payment

+
+
+ getAvailablePayments(); + ?>
- -
-
-
-

Test Card Numbers for PayPal

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Card NumberBrandResponse
4111 1111 1111 1111VisaSuccess
5555 5555 5555 4444MastercardSuccess
4022 0028 8000 6242Visa (debit)Success
4000 0000 0000 0002Visa (declined)Card declined
4000 0000 0000 0127Visa (processing error)Processor declined
4000 0000 0000 0069Visa (fraudulent)Card declined
4000 0027 6000 3184Visa3D Secure authentication required
- - -
+
+
+
+
+

Test Card Numbers for Stripe

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Card NumberBrandResponse
4242 4242 4242 4242VisaSuccess
5555 5555 5555 4444MastercardSuccess
4000 0025 0000 3155Visa (debit)Success
4000 0000 0000 9995Visa (declined)Card declined
4000 0000 0000 0127Visa (processing error)Processing error
4000 0000 0000 0069Visa (fraudulent)Card declined
4000 0027 6000 3184Visa3D Secure authentication required
+
+
+
+ +
+
+
+

Test Card Numbers for PayPal

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Card NumberBrandResponse
4111 1111 1111 1111VisaSuccess
5555 5555 5555 4444MastercardSuccess
4022 0028 8000 6242Visa (debit)Success
4000 0000 0000 0002Visa (declined)Card declined
4000 0000 0000 0127Visa (processing error)Processor declined
4000 0000 0000 0069Visa (fraudulent)Card declined
4000 0027 6000 3184Visa3D Secure authentication required
+ +
-
-
Note: - These are test credit card numbers and should only be used in a test environment and should not be used for real transactions. - CSC can be any 3-digit number and expiration date can be any future date.
+
Note: + These are test credit card numbers and should only be used in a test environment and should not be used for real transactions. + CSC can be any 3-digit number and expiration date can be any future date.
+
- - - - \ No newline at end of file +
+
+print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/addFunds.php b/plugin/YPTWallet/view/addFunds.php index 549136284f..c7fd272a21 100644 --- a/plugin/YPTWallet/view/addFunds.php +++ b/plugin/YPTWallet/view/addFunds.php @@ -13,85 +13,68 @@ if (!empty($paypal)) { $options = _json_decode($obj->addFundsOptions); //unset($_SESSION['addFunds_Success']); //unset($_SESSION['addFunds_Fail']); +$_page = new Page(array('Add Funds')); ?> - - - - <?php echo __("Add Funds") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - -
-
-
-
-
-
- add_funds_text ?> +
+
+
+
+
+
+ add_funds_text ?> +
+
+ add_funds_success_fail; + break; + case "success": + $text = $obj->add_funds_success_success; + $class = "success"; + break; + case "cancel": + $text = $obj->add_funds_success_cancel; + $class = "warning"; + break; + } + ?> +
+
-
+ +
+ + - - - - -
- getAvailablePayments(); - ?> -
+
+ getAvailablePayments(); + ?>
- -
- - - - - + }); + +print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/adminManageWallets.php b/plugin/YPTWallet/view/adminManageWallets.php index 24a326dae9..e46bb989c4 100644 --- a/plugin/YPTWallet/view/adminManageWallets.php +++ b/plugin/YPTWallet/view/adminManageWallets.php @@ -10,144 +10,128 @@ if (!User::isAdmin()) { $plugin = AVideoPlugin::loadPluginIfEnabled("YPTWallet"); $obj = $plugin->getDataObject(); +$_page = new Page(array('Support Author')); ?> - - - - <?php echo __("Support Author") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - +
-
- -
-
Total Site Balance:
-
- - - - - - - - - - - -
-
-
+
+
Total Site Balance:
+
+ + + + + + + + + + +
+
- -
- - - - + $('#saveUserBtn').click(function(evt) { + $('#updateUserForm').submit(); + }); + + $('#updateUserForm').submit(function(evt) { + evt.preventDefault(); + modal.showPleaseWait(); + + $.ajax({ + url: webSiteRootURL + 'plugin/YPTWallet/view/saveBalance.php', + data: { + "users_id": $('#inputUserId').val(), + "balance": $('#inputUserBalance').val() + }, + type: 'post', + success: function(response) { + if (!response.error) { + $(".walletBalance").text(response.walletBalance); + $('#userFormModal').modal('hide'); + $("#grid").bootgrid("reload"); + } else { + avideoAlert("", "", "error"); + } + modal.hidePleaseWait(); + } + }); + return false; + }); + + }); + +print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/configuration.php b/plugin/YPTWallet/view/configuration.php index 567ce412ab..aec273fb34 100644 --- a/plugin/YPTWallet/view/configuration.php +++ b/plugin/YPTWallet/view/configuration.php @@ -3,7 +3,7 @@ require_once '../../../videos/configuration.php'; require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/functions.php'; -if(!User::isLogged()){ +if (!User::isLogged()) { header("Location: {$global['webSiteRootURL']}"); } @@ -12,26 +12,11 @@ $walletDataObject = $plugin->getDataObject(); $wallet = new Wallet(0); $wallet->setUsers_id(User::getId()); +$_page = new Page(array('Configuration')); ?> - - - - <?php echo __("Configuration") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - -
-
- -
- - - +
+ +
+print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/history.php b/plugin/YPTWallet/view/history.php index 9464c9aead..51d5539eb3 100644 --- a/plugin/YPTWallet/view/history.php +++ b/plugin/YPTWallet/view/history.php @@ -11,163 +11,149 @@ if (!User::isLogged()) { $users_id = 0; if (!empty($_GET['users_id'])) { $users_id = $_GET['users_id']; -}else{ +} else { $users_id = User::getId(); } +$_page = new Page(array('History')); ?> - - - - <?php echo __("History") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - -
-
-
- User Photo -

-
-
-
- - - - - - - - - -
-
-
+
+
+
+ User Photo +

+
+
+
+ + + + + + + + + +
+
+
+ + - function setStatus(status, wallet_log_id) { - modal.showPleaseWait(); - $.ajax({ - url: webSiteRootURL+'plugin/YPTWallet/view/changeLogStatus.json.php', - type: "POST", - data: { - status: status, - wallet_log_id: wallet_log_id - }, - success: function (response) { - $(".walletBalance").text(response.walletBalance); - modal.hidePleaseWait(); - if (response.error) { - setTimeout(function () { - avideoAlert("", response.msg, "error"); - }, 500); - } else { - $("#grid").bootgrid("reload"); - } - } - }); - } - - - - - +$_page->print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/manualAddFunds.php b/plugin/YPTWallet/view/manualAddFunds.php index 3e8a2b6d74..da0cfa191d 100644 --- a/plugin/YPTWallet/view/manualAddFunds.php +++ b/plugin/YPTWallet/view/manualAddFunds.php @@ -10,112 +10,95 @@ if (!User::isLogged()) { $plugin = AVideoPlugin::loadPluginIfEnabled("YPTWallet"); $obj = $plugin->getDataObject(); $options = _json_decode($obj->addFundsOptions); +$_page = new Page(array('Add Funds')); ?> - - - - <?php echo __("Add Funds") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - -
-
-
-
-
-
- add_funds_text ?> +
+
+
+
+
+
+ add_funds_text ?> +
+
+ add_funds_success_fail; + break; + case "success": + $text = $obj->add_funds_success_success; + $class = "success"; + break; + case "cancel": + $text = $obj->add_funds_success_cancel; + $class = "warning"; + break; + } + ?> +
+
-
+ +
+ + - - - - -
-
- - -
- -
+
+
+ + +
+
- -
- - - - - + }); + }); + +print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/manualWithdrawFunds.php b/plugin/YPTWallet/view/manualWithdrawFunds.php index 5e8ec59f5d..eaea8cb030 100644 --- a/plugin/YPTWallet/view/manualWithdrawFunds.php +++ b/plugin/YPTWallet/view/manualWithdrawFunds.php @@ -10,118 +10,104 @@ if (!User::isLogged()) { $plugin = AVideoPlugin::loadPluginIfEnabled("YPTWallet"); $obj = $plugin->getDataObject(); $options = _json_decode($obj->withdrawFundsOptions); +$_page = new Page(array('Withdraw Funds')); ?> - - - - <?php echo __("Withdraw Funds") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - -
-
-
-
- - enableAutoWithdrawFundsPagePaypal) { - ?> - - +
+
+
+ + enableAutoWithdrawFundsPagePaypal) { + ?> + + +
+
+
+ withdraw_funds_text ?> + +
+
+ add_funds_success_fail; + break; + case "success": + $text = $obj->add_funds_success_success; + $class = "success"; + break; + case "cancel": + $text = $obj->add_funds_success_cancel; + $class = "warning"; + break; } - ?> -
-
-
- withdraw_funds_text ?> - + ?> +
+
-
+ +
+ + - - - - -
-
- - -
- -
+
+
+ + +
+
- - - - - + }); + }); + +print(); +?> \ No newline at end of file diff --git a/plugin/YPTWallet/view/pendingRequests.php b/plugin/YPTWallet/view/pendingRequests.php index 6d066e384e..23a5dc100a 100644 --- a/plugin/YPTWallet/view/pendingRequests.php +++ b/plugin/YPTWallet/view/pendingRequests.php @@ -7,120 +7,106 @@ if (!User::isAdmin()) { forbiddenPage("You can not do this"); exit; } -?> - - - - <?php echo __("Pending Requests") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - -
-
-
- -
-
-
- - - - - - - - - - -
-
-
+$_page = new Page(array('Pending Requests')); +?> +
+
+
+ +
+
+
+ + + + + + + + + + +
+
+
+ - - + /* Executes after data is loaded and rendered */ + grid.find(".command-status-success").on("click", function(e) { + var row_index = $(this).closest('tr').index(); + var row = $("#grid").bootgrid("getCurrentRows")[row_index]; + setStatus("success", row.id); + }); + + grid.find(".command-status-canceled").on("click", function(e) { + var row_index = $(this).closest('tr').index(); + var row = $("#grid").bootgrid("getCurrentRows")[row_index]; + setStatus("canceled", row.id); + }); + createTimer('.pendingTimers'); + }); + }); + + function setStatus(status, wallet_log_id) { + modal.showPleaseWait(); + $.ajax({ + url: webSiteRootURL + 'plugin/YPTWallet/view/changeLogStatus.json.php', + type: "POST", + data: { + status: status, + wallet_log_id: wallet_log_id + }, + success: function(response) { + $(".walletBalance").text(response.walletBalance); + modal.hidePleaseWait(); + if (response.error) { + setTimeout(function() { + avideoAlert("", response.msg, "error"); + }, 500); + } else { + $("#grid").bootgrid("reload"); + } + } + }); + } + +print(); +?> \ No newline at end of file diff --git a/plugin/YouPHPFlix2/view/modeFlix.php b/plugin/YouPHPFlix2/view/modeFlix.php index d523a0e5da..2ad7db1552 100644 --- a/plugin/YouPHPFlix2/view/modeFlix.php +++ b/plugin/YouPHPFlix2/view/modeFlix.php @@ -2,41 +2,27 @@ $isFirstPage = 1; global $global, $config; if (!isset($global['systemRootPath'])) { - require_once '../videos/configuration.php'; + require_once __DIR__ . '/../../../videos/configuration.php'; } require_once $global['systemRootPath'] . 'objects/video.php'; require_once $global['systemRootPath'] . 'objects/category.php'; -if(AVideoPlugin::isEnabledByName('PlayLists')){ +if (AVideoPlugin::isEnabledByName('PlayLists')) { PlayLists::loadScripts(); } $obj = AVideoPlugin::getObjectData("YouPHPFlix2"); +$_page = new Page(array('')); +$_page->setIncludeInHead(array('plugin/YouPHPFlix2/view/modeFlixHead.php')); ?> - - - - - + - <?php if(!empty($_REQUEST['catName'])){echo $_REQUEST['catName'].' - ';}; echo $config->getWebSiteTitle(); ?> - - - - - - - - - - + +print(); +?> \ No newline at end of file diff --git a/view/charts.php b/view/charts.php index e6cc701aa1..e69b4f6a38 100644 --- a/view/charts.php +++ b/view/charts.php @@ -4,21 +4,8 @@ global $global, $config; if (!isset($global['systemRootPath'])) { require_once '../videos/configuration.php'; } -?> - - - - <?php echo __("Dashboard") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - - - - - +$_page = new Page(array('Dashboard')); +$_page->setIncludeInHead(array('view/charts_head.php')); +include $global['systemRootPath'] . 'view/charts_body.php'; +$_page->print(); +?> \ No newline at end of file diff --git a/view/charts_body.php b/view/charts_body.php index 43e9315dc9..f490dccaf1 100644 --- a/view/charts_body.php +++ b/view/charts_body.php @@ -41,10 +41,6 @@
- - - +
-
-
+
+
+
- - " class="img-responsive img-radio"> - - + " class="img-responsive"> + + Purchase the Customize Plugin + + Customize Colors +
+
- + getTheme(); + foreach ($themes as $fileEx) { + if ($fileEx == $savedTheme) { + ?> + + +
+
+
+
+ + " class="img-responsive img-radio"> + + +
+
+
+ +
+
+
+ +
+
+
+ + + $secondsTotal) { + $percent = intval($secondsTotal / $secondsLimit * 100); + } else { + $percent = 100; + } + ?> and you have minutes of storage +
+
+ % of your storage limit used +
+
+
-
- -
-
-
- - $secondsTotal) { - $percent = intval($secondsTotal / $secondsLimit * 100); - } else { - $percent = 100; - } - ?> and you have minutes of storage -
-
- % of your storage limit used -
+ if (isApache()) { + ?> +
+ + is Present +
+ +
+ + Your server is , you must install Apache +
+ + + + +
+ + PHP is present. +
+ +
+ + Your PHP version is . PHP 7.3 or newer is required. +
+ + + +
+ + Your video directory is writable +
+ +
+ + Your video directory must be writable +
+ + The video directory doesn't exist. AVideo doesn't have permission to create it. You must create it manually! +
+
sudo mkdir 
+ +
+ Then you can set the permissions. +
+
sudo chmod -R 777 
+
+
+ + + +
+ + Your post_max_size is +
+ +
+ + Your post_max_size is , it must be at least 100M + +
+ Edit the php.ini file +
+
sudo nano 
+
+
+ + + +
+ + Your upload_max_filesize is +
+ +
+ + Your upload_max_filesize is , it must be at least 100M + +
+ Edit the php.ini file +
+
sudo nano 
+
- -
- - is Present -
- -
- - Your server is , you must install Apache -
- +
- - -
- - PHP is present. -
- -
- - Your PHP version is . PHP 7.3 or newer is required. -
- - - -
- - Your video directory is writable -
- -
- - Your video directory must be writable -
- - The video directory doesn't exist. AVideo doesn't have permission to create it. You must create it manually! -
-
sudo mkdir 
- -
- Then you can set the permissions. -
-
sudo chmod -R 777 
-
-
- - - -
- - Your post_max_size is -
- -
- - Your post_max_size is , it must be at least 100M - -
- Edit the php.ini file -
-
sudo nano 
-
-
- - - -
- - Your upload_max_filesize is -
- -
- - Your upload_max_filesize is , it must be at least 100M - -
- Edit the php.ini file -
-
sudo nano 
-
-
- - -
-
- -
-
- -
-
-

-
-
-
- -
-
- - - -
-
-
- -
- -
-
- - " class="form-control" type="email" value="getContactEmail(); ?>"> -
- -
-
- -
- -
-
- - -
-
-
- -
- -
-
- - -
-
-
- -
- -
-
- - - -
-
-
- -
- -
-
- getAutoplay())) { - echo "checked"; - } - ?>> - -
-
-
- -
-
- -
-
-
-
-

-
-
- -
- -
-
- - " class="form-control" type="text" value="getWebSiteTitle(); ?>"> -
-
-
- - - -
- -
- - -
- -
-
- -
-
- -
- -
- -
-
-
-
-
-
-
-
-
-
-

-
-
- -
-
- - -
-
-
- -
- - -
- : https://encoder1.wwbn.net/ or - -
-
-
- -
- -
- -
-
- - -
- -
-
- getDisable_analytics())) { - echo "checked"; - } - ?> aria-describedby="disable_analyticsHelp"> - -
- -
-
-
- -
-
- getAllow_download())) { - echo "checked"; - } - ?> aria-describedby="allow_downloadHelp"> - -
- -
-
-
-
- -
-

Email Configuration

+

- -
-

- - , - -

-
- -
- -
-
- getSmtp())) { - echo "checked"; - } - ?>> - + +
+
+ + +
+
- + +
+
+ + " class="form-control" type="email" value="getContactEmail(); ?>"> +
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+
+ + + +
+
+
+ +
+
- getSmtpAuth())) { + getAutoplay())) { echo "checked"; } ?>> - + +
+
+
+ +
+
+ +
+
+
+
+

+
+
+ +
+ +
+
+ + " class="form-control" type="text" value="getWebSiteTitle(); ?>"> +
+
+
+ +
- -
- - -
-
- -
- -
- - -
-
- - -
- -
- -
-
- -
- -
- -
-
- -
- -
- getSmtpPassword() . '"', __("SMTP Password")); ?> + +
+ +
+
- -
- + +
+
+
+
- - - -

- -
-
-
- -
- - - - - - - - - - : https://analytics.google.com
- -
-
- -
- -
- plugins'> +
+ +
+
+
+
+

+
+
+ +
+
+ + +
+
+
+ +
+ + +
+ : https://encoder1.wwbn.net/ or + +
+
+
+ +
+ +
+ +
+
+ + +
+ +
+
+ getDisable_analytics())) { + echo "checked"; + } + ?> aria-describedby="disable_analyticsHelp"> + +
+ +
+
+
+ +
+
+ getAllow_download())) { + echo "checked"; + } + ?> aria-describedby="allow_downloadHelp"> + +
+ +
+
+
+
+ +
+
+ +
+
+

Email Configuration

+
+
+ +
+

+ + , + +

+
+ + +
+ +
+
+ getSmtp())) { + echo "checked"; + } + ?>> + +
+
+
+
+ +
+
+ getSmtpAuth())) { + echo "checked"; + } + ?>> + +
+
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ getSmtpPassword() . '"', __("SMTP Password")); ?> +
+
+
+ +
+ +
+
+ +
+
+
+
+ + + +

+ +
+
+
+ +
+ + + + + + + + + + : https://analytics.google.com
+ +
+
+
+ +
+ +
+ +
+ -
- -
- - + +
+ \ No newline at end of file diff --git a/view/managerUsers_body.php b/view/managerUsers_body.php index 42a49ff5db..eb86429f15 100644 --- a/view/managerUsers_body.php +++ b/view/managerUsers_body.php @@ -16,337 +16,338 @@ foreach ($userGroups as $value) { ?> -
-
-
- - - - - - - - - - -
- 0 -
-
-
- " . __($value['title']); - $items[] = array('href' => "#{$value['selector']}Tab", 'tooltip' => __($value['title']), 'onclick' => "startUserGrid('#{$value['selector']}', '{$value['queryString']}', " . intval($value['userGroupID']) . ");", 'label' => $label); - } - generateHorizontalFlickity($items); - ?> -
-
-
- - -
- -
-
- - -
-
- - - - - - - - - - - - - - - -
+
+
+
+
+ + + + + + + + + + +
+ 0
+
+
" . __($value['title']); + $items[] = array('href' => "#{$value['selector']}Tab", 'tooltip' => __($value['title']), 'onclick' => "startUserGrid('#{$value['selector']}', '{$value['queryString']}', " . intval($value['userGroupID']) . ");", 'label' => $label); } + generateHorizontalFlickity($items); ?>
-
-
+
+
- - -
-
+
+
-