mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Update top menu and Main Social Media Integration in user profile
This commit is contained in:
parent
076bdf9433
commit
4bd92c49bb
11 changed files with 799 additions and 618 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -91,3 +91,4 @@ test.php
|
||||||
/.env
|
/.env
|
||||||
/plugin/User_Location/install/install.sql
|
/plugin/User_Location/install/install.sql
|
||||||
/plugin/PedagoFlix/
|
/plugin/PedagoFlix/
|
||||||
|
/plugin/YPTWebRTC/
|
||||||
|
|
|
@ -2961,7 +2961,8 @@ if (typeof gtag !== \"function\") {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getWebsite($users_id = '') {
|
|
||||||
|
public static function getSocialMediaURL($socialMedia, $users_id = '') {
|
||||||
global $config;
|
global $config;
|
||||||
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
|
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
|
||||||
if (empty($obj)) {
|
if (empty($obj)) {
|
||||||
|
@ -2971,10 +2972,14 @@ if (typeof gtag !== \"function\") {
|
||||||
$users_id = User::getId();
|
$users_id = User::getId();
|
||||||
}
|
}
|
||||||
$user = new User($users_id);
|
$user = new User($users_id);
|
||||||
$value = $user->getExternalOptions('userWebsite');
|
$value = $user->getExternalOptions($socialMedia);
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getWebsite($users_id = '') {
|
||||||
|
return self::getSocialMediaURL('website', $users_id);
|
||||||
|
}
|
||||||
|
|
||||||
public static function setProfilePassword($users_id, $value) {
|
public static function setProfilePassword($users_id, $value) {
|
||||||
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
|
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
|
||||||
if (empty($obj) || !User::isAdmin()) {
|
if (empty($obj) || !User::isAdmin()) {
|
||||||
|
|
|
@ -13,6 +13,49 @@ require_once $global['systemRootPath'] . 'plugin/CustomizeUser/Objects/Users_aff
|
||||||
class CustomizeUser extends PluginAbstract
|
class CustomizeUser extends PluginAbstract
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function getSocialMedia()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'website' => [
|
||||||
|
'class'=>'icoCopy',
|
||||||
|
'icon' => 'fas fa-globe',
|
||||||
|
'label' => __("Website"),
|
||||||
|
'placeholder' => __("Website URL"),
|
||||||
|
'isActive' => User::canUpload(),
|
||||||
|
],
|
||||||
|
'facebook' => [
|
||||||
|
'class'=>'icoFacebook',
|
||||||
|
'icon' => 'fab fa-facebook-f',
|
||||||
|
'label' => __("Facebook"),
|
||||||
|
'placeholder' => __("Facebook URL"),
|
||||||
|
'isActive' => true,
|
||||||
|
],
|
||||||
|
'twitter' => [
|
||||||
|
'class'=>'icoTwitter',
|
||||||
|
'icon' => 'fab fa-twitter',
|
||||||
|
'label' => __("Twitter"),
|
||||||
|
'placeholder' => __("Twitter URL"),
|
||||||
|
'isActive' => true,
|
||||||
|
],
|
||||||
|
'instagram' => [
|
||||||
|
'class'=>'icoInstagram',
|
||||||
|
'icon' => 'fab fa-instagram',
|
||||||
|
'label' => __("Instagram"),
|
||||||
|
'placeholder' => __("Instagram URL"),
|
||||||
|
'isActive' => true,
|
||||||
|
],
|
||||||
|
'linkedin' => [
|
||||||
|
'class'=>'icoLinkedIn',
|
||||||
|
'icon' => 'fab fa-linkedin-in',
|
||||||
|
'label' => __("LinkedIn"),
|
||||||
|
'placeholder' => __("LinkedIn URL"),
|
||||||
|
'isActive' => true,
|
||||||
|
]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function getTags()
|
public function getTags()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -1,41 +1,58 @@
|
||||||
<?php
|
<?php
|
||||||
if (User::canUpload()) {
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach (CustomizeUser::getSocialMedia() as $platform => $details) {
|
||||||
|
if (empty($details['isActive'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-4 control-label">
|
<label class="col-md-4 control-label">
|
||||||
<?php echo __("Website"); ?>
|
<?php echo $details['label']; ?>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-8 inputGroupContainer">
|
<div class="col-md-8 inputGroupContainer">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-addon"><i class="fas fa-globe"></i></span>
|
<span class="input-group-addon"><i class="<?php echo $details['icon']; ?>"></i></span>
|
||||||
<input id="userWebsite" placeholder="<?php echo __("Website"); ?>" class="form-control" type="url" value="<?php echo User::getWebsite(); ?>">
|
<input id="user<?php echo ucfirst($platform); ?>" platform="<?php echo $platform; ?>" placeholder="<?php echo $details['placeholder']; ?>" class="form-control CustomizeUserSocialMedia" type="url" value="<?php echo User::getSocialMediaURL($platform); ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<?php
|
||||||
$(document).ready(function () {
|
}
|
||||||
$('#userWebsite').change(function (e) {
|
?>
|
||||||
saveUserSite();
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
var saveTimeout;
|
||||||
|
|
||||||
|
$('.CustomizeUserSocialMedia').on('change keyup', function(e) {
|
||||||
|
clearTimeout(saveTimeout); // Clear the existing timeout
|
||||||
|
|
||||||
|
var platform = $(this).attr('platform');
|
||||||
|
var value = $(this).val();
|
||||||
|
|
||||||
|
saveTimeout = setTimeout(function() {
|
||||||
|
saveUserURL(platform, value);
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function saveUserSite() {
|
|
||||||
var userWebsite = $('#userWebsite').val();
|
function saveUserURL(platform, val) {
|
||||||
if(empty(userWebsite) || validURL(userWebsite)){
|
if (empty(val) || validURL(val)) {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: webSiteRootURL + 'plugin/CustomizeUser/getMyAccount.save.json.php',
|
url: webSiteRootURL + 'plugin/CustomizeUser/getMyAccount.save.json.php',
|
||||||
data: {userWebsite: userWebsite},
|
data: {
|
||||||
|
platform: platform,
|
||||||
|
val: val
|
||||||
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
avideoResponse(response);
|
avideoResponse(response);
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
|
@ -5,22 +5,41 @@ header('Content-Type: application/json');
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
$obj->error = true;
|
$obj->error = true;
|
||||||
$obj->msg = "";
|
$obj->msg = "";
|
||||||
if(!User::canUpload()){
|
|
||||||
$obj->msg = "Cannot Upload";
|
if(empty($_REQUEST['platform'])){
|
||||||
|
$obj->msg = "Platform is empty";
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
$userWebsite = preg_replace('/[^a-z0-9_\/@.:?&=;%-]/i', '', @$_POST['userWebsite']);
|
$platform = array();
|
||||||
|
|
||||||
if(!empty($userWebsite) && !isValidURL($userWebsite)){
|
foreach (CustomizeUser::getSocialMedia() as $key => $value) {
|
||||||
$obj->msg = "User Site is invalid {$_POST['userWebsite']} = {$userWebsite}";
|
if($_REQUEST['platform'] === $key){
|
||||||
|
$platform = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($platform)){
|
||||||
|
$obj->msg = "Platform {$_REQUEST['platform']} not found";
|
||||||
|
die(json_encode($obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($platform['isActive'])){
|
||||||
|
$obj->msg = "Platform is not active";
|
||||||
|
die(json_encode($obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = preg_replace('/[^a-z0-9_\/@.:?&=;%-]/i', '', @$_POST['val']);
|
||||||
|
|
||||||
|
if(!empty($url) && !isValidURL($url)){
|
||||||
|
$obj->msg = "URL is invalid {$_POST['url']} = {$url}";
|
||||||
die(json_encode($obj));
|
die(json_encode($obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
$cobj = AVideoPlugin::getObjectData("CustomizeUser");
|
$cobj = AVideoPlugin::getObjectData("CustomizeUser");
|
||||||
|
|
||||||
$user = new User(User::getId());
|
$user = new User(User::getId());
|
||||||
$obj->added = $user->addExternalOptions('userWebsite', $userWebsite);
|
$obj->added = $user->addExternalOptions($_REQUEST['platform'], $url);
|
||||||
|
|
||||||
$obj->error = empty($obj->added);
|
$obj->error = empty($obj->added);
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,18 @@ $configFile = $global['systemRootPath'] . 'videos/configuration.php';
|
||||||
require_once $configFile;
|
require_once $configFile;
|
||||||
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/Menu.php';
|
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/Menu.php';
|
||||||
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/MenuItem.php';
|
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/MenuItem.php';
|
||||||
|
$objTopMenu = AVideoPlugin::getDataObject('TopMenu');
|
||||||
$menu = Menu::getAllActive(Menu::$typeTopMenu);
|
$menu = Menu::getAllActive(Menu::$typeTopMenu);
|
||||||
|
$dropdownClass = '';
|
||||||
?>
|
?>
|
||||||
<!-- right menu start -->
|
<!-- right menu start -->
|
||||||
<?php
|
<?php
|
||||||
foreach ($menu as $key => $value) {
|
if (count($menu) < $objTopMenu->compactMenuIfIsGreaterThen->value) {
|
||||||
?>
|
$dropdownClass = 'hidden-lg';
|
||||||
<li class="dropdown">
|
foreach ($menu as $key => $value) {
|
||||||
<a href="#" class=" btn btn-default btn-light navbar-btn" data-toggle="dropdown" data-toggle="tooltip" title="<?php echo $value['menuName']; ?>" data-placement="bottom" >
|
?>
|
||||||
|
<li class="dropdown visible-lg">
|
||||||
|
<a href="#" class=" btn btn-default btn-light navbar-btn" data-toggle="dropdown" data-toggle="tooltip" title="<?php echo $value['menuName']; ?>" data-placement="bottom">
|
||||||
<?php
|
<?php
|
||||||
$hiddenClass = "hidden-md hidden-sm";
|
$hiddenClass = "hidden-md hidden-sm";
|
||||||
if (!empty($value['icon'])) {
|
if (!empty($value['icon'])) {
|
||||||
|
@ -28,13 +31,13 @@ foreach ($menu as $key => $value) {
|
||||||
</span>
|
</span>
|
||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dropdown-menu-right" id="availableLive" style="">
|
<ul class="dropdown-menu dropdown-menu-right" id="availableLive">
|
||||||
<?php
|
<?php
|
||||||
$menuItems = MenuItem::getAllFromMenu($value['id'], true);
|
$menuItems = MenuItem::getAllFromMenu($value['id'], true);
|
||||||
foreach ($menuItems as $key2 => $value2) {
|
foreach ($menuItems as $key2 => $value2) {
|
||||||
?>
|
?>
|
||||||
<li style="margin-right: 0;">
|
<li style="margin-right: 0;">
|
||||||
<a href="<?php echo $value2['finalURL']; ?>" <?php echo $value2['target']; ?> >
|
<a href="<?php echo $value2['finalURL']; ?>" <?php echo $value2['target']; ?>>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($value2['icon'])) {
|
if (!empty($value2['icon'])) {
|
||||||
?>
|
?>
|
||||||
|
@ -50,7 +53,39 @@ foreach ($menu as $key => $value) {
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<!-- This is for smaller screens (the hamburger menu) -->
|
||||||
|
<div class="<?php echo $dropdownClass; ?>">
|
||||||
|
<li class="dropdown">
|
||||||
|
<a href="#" class="btn btn-default btn-light navbar-btn" data-toggle="dropdown">
|
||||||
|
<i class="fas fa-bars"></i> <b class="caret"></b>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right">
|
||||||
|
<?php foreach ($menu as $key => $value) : ?>
|
||||||
|
<li class="dropdown-header"><?php echo __($value['menuName']); ?></li>
|
||||||
|
<?php
|
||||||
|
$menuItems = MenuItem::getAllFromMenu($value['id'], true);
|
||||||
|
foreach ($menuItems as $key2 => $value2) :
|
||||||
|
?>
|
||||||
|
<li style="margin-right: 0;">
|
||||||
|
<a href="<?php echo $value2['finalURL']; ?>" <?php echo $value2['target']; ?>>
|
||||||
|
<?php
|
||||||
|
if (!empty($value2['icon'])) {
|
||||||
|
?>
|
||||||
|
<i class="<?php echo $value2['icon'] ?>"></i>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php echo __($value2['title']); ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
<!-- right menu start -->
|
<!-- right menu start -->
|
|
@ -38,6 +38,14 @@ class TopMenu extends PluginAbstract {
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
$obj->show_menu_items = true;
|
$obj->show_menu_items = true;
|
||||||
|
|
||||||
|
$o = new stdClass();
|
||||||
|
$o->type = [0=>'Do not compact top menu'];
|
||||||
|
for ($i = 1; $i <= 10; $i++) {
|
||||||
|
$o->type[$i] = "Compact top menus if it is greater then $i items";
|
||||||
|
}
|
||||||
|
$o->value = 4;
|
||||||
|
$obj->compactMenuIfIsGreaterThen = $o;
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,27 +16,31 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<?php echo getLanguage(); ?>">
|
<html lang="<?php echo getLanguage(); ?>">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<title><?php echo __("Top Menu") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
<title><?php echo __("Top Menu") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/head.php';
|
include $global['systemRootPath'] . 'view/include/head.php';
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
|
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css" />
|
||||||
<style>
|
<style>
|
||||||
#sortable li{
|
#sortable li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
#sortable{
|
|
||||||
|
#sortable {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.ui-state-highlight{
|
|
||||||
|
.ui-state-highlight {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="<?php echo $global['bodyClass']; ?> ">
|
|
||||||
|
<body class="<?php echo $global['bodyClass']; ?> ">
|
||||||
<?php
|
<?php
|
||||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||||
?>
|
?>
|
||||||
|
@ -122,17 +126,19 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Menus Available</div>
|
<div class="panel-heading">Menus Available</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<table id="example" class="display table table-striped table-hover" width="100%" cellspacing="0">
|
<table id="topMenuGrid" class="display table table-striped table-hover" width="100%" cellspacing="0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
|
<th>Type</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
|
<th>Type</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
@ -142,7 +148,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="menuItems" class="tab-pane fade" >
|
<div id="menuItems" class="tab-pane fade">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 showWhenHaveId" style="display: none;">
|
<div class="col-md-8 showWhenHaveId" style="display: none;">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
@ -156,7 +162,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
|
|
||||||
<input type="hidden" class="form-control" id="menuItemId">
|
<input type="hidden" class="form-control" id="menuItemId">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="title" >Title:</label>
|
<label for="title">Title:</label>
|
||||||
<input type="text" class="form-control" id="title">
|
<input type="text" class="form-control" id="title">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -273,6 +279,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.js"></script>
|
<script type="text/javascript" src="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
var typeName = <?php echo json_encode(Menu::$typeName); ?>;
|
||||||
var currentItem = [];
|
var currentItem = [];
|
||||||
|
|
||||||
function checkIfHasId() {
|
function checkIfHasId() {
|
||||||
|
@ -319,11 +326,11 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
|
|
||||||
function startSortable() {
|
function startSortable() {
|
||||||
$("#sortable").sortable({
|
$("#sortable").sortable({
|
||||||
stop: function (event, ui) {
|
stop: function(event, ui) {
|
||||||
var menu = {};
|
var menu = {};
|
||||||
var itens = [];
|
var itens = [];
|
||||||
menu.id = $('#menuId').val();
|
menu.id = $('#menuId').val();
|
||||||
$('#sortable li').each(function () {
|
$('#sortable li').each(function() {
|
||||||
itens.push($(this).attr('itemId'));
|
itens.push($(this).attr('itemId'));
|
||||||
});
|
});
|
||||||
menu.itens = itens;
|
menu.itens = itens;
|
||||||
|
@ -335,7 +342,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
"itens": menu.itens
|
"itens": menu.itens
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
}
|
}
|
||||||
|
@ -349,12 +356,12 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
clearMenuItemForm();
|
clearMenuItemForm();
|
||||||
$('#sortable').sortable("destroy");
|
$('#sortable').sortable("destroy");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: webSiteRootURL+'plugin/TopMenu/menuItems.json.php',
|
url: webSiteRootURL + 'plugin/TopMenu/menuItems.json.php',
|
||||||
data: {
|
data: {
|
||||||
"menuId": menu_id
|
"menuId": menu_id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
console.log(response.data.length);
|
console.log(response.data.length);
|
||||||
currentItem = response.data;
|
currentItem = response.data;
|
||||||
|
@ -381,12 +388,12 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
id = $(t).parent('li').attr('itemid');
|
id = $(t).parent('li').attr('itemid');
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: webSiteRootURL+'plugin/TopMenu/menuItemDelete.json.php',
|
url: webSiteRootURL + 'plugin/TopMenu/menuItemDelete.json.php',
|
||||||
data: {
|
data: {
|
||||||
"menuItemId": id
|
"menuItemId": id
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
$('#item' + id).fadeOut();
|
$('#item' + id).fadeOut();
|
||||||
|
@ -439,9 +446,9 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$(".nav-tabs a[data-toggle=tab]").on("click", function (e) {
|
$(".nav-tabs a[data-toggle=tab]").on("click", function(e) {
|
||||||
if ($(this).parent().hasClass("disabled")) {
|
if ($(this).parent().hasClass("disabled")) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
|
@ -449,7 +456,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#pageType').change(function () {
|
$('#pageType').change(function() {
|
||||||
console.log($(this).val());
|
console.log($(this).val());
|
||||||
if ($(this).val() == 'url' || $(this).val() == 'urlIframe') {
|
if ($(this).val() == 'url' || $(this).val() == 'urlIframe') {
|
||||||
$('#divText').slideUp();
|
$('#divText').slideUp();
|
||||||
|
@ -462,24 +469,33 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
|
|
||||||
$('#pageType').trigger('change');
|
$('#pageType').trigger('change');
|
||||||
|
|
||||||
var table = $('#example').DataTable({
|
var table = $('#topMenuGrid').DataTable({
|
||||||
"ajax": webSiteRootURL+"plugin/TopMenu/menus.json.php",
|
"ajax": webSiteRootURL + "plugin/TopMenu/menus.json.php",
|
||||||
"columns": [
|
"columns": [{
|
||||||
{"data": "menuName"},
|
"data": "menuName"
|
||||||
{"data": "status"}
|
},
|
||||||
|
{
|
||||||
|
"data": "status"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"data": "type",
|
||||||
|
"render": function(data, type, row, meta) {
|
||||||
|
return typeName[data] || data;
|
||||||
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
select: true,
|
select: true,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnNewMenu').click(function () {
|
$('#btnNewMenu').click(function() {
|
||||||
clearMenuForm();
|
clearMenuForm();
|
||||||
});
|
});
|
||||||
$('#btnNewMenuItem').click(function () {
|
$('#btnNewMenuItem').click(function() {
|
||||||
clearMenuItemForm();
|
clearMenuItemForm();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#example tbody').on('click', 'tr', function () {
|
$('#topMenuGrid tbody').on('click', 'tr', function() {
|
||||||
var data = table.row(this).data();
|
var data = table.row(this).data();
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$('#menuId').val(data.id);
|
$('#menuId').val(data.id);
|
||||||
|
@ -492,10 +508,10 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
$('#users_groups_id').val(data.users_groups_id);
|
$('#users_groups_id').val(data.users_groups_id);
|
||||||
$("#menuIcon").val(data.icon);
|
$("#menuIcon").val(data.icon);
|
||||||
$("#menuIcon").trigger('change');
|
$("#menuIcon").trigger('change');
|
||||||
if(data.type == 8){
|
if (data.type == 8) {
|
||||||
$("#menuItemIconDiv").hide();
|
$("#menuItemIconDiv").hide();
|
||||||
$("#menuItemIconMobileDiv").show();
|
$("#menuItemIconMobileDiv").show();
|
||||||
}else{
|
} else {
|
||||||
$("#menuItemIconDiv").show();
|
$("#menuItemIconDiv").show();
|
||||||
$("#menuItemIconMobileDiv").hide();
|
$("#menuItemIconMobileDiv").hide();
|
||||||
}
|
}
|
||||||
|
@ -505,7 +521,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
|
|
||||||
startSortable();
|
startSortable();
|
||||||
$("#sortable").disableSelection();
|
$("#sortable").disableSelection();
|
||||||
$('#btnSaveMenu').click(function () {
|
$('#btnSaveMenu').click(function() {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuSave.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuSave.json.php',
|
||||||
|
@ -521,7 +537,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
"icon": $("#menuIcon").val()
|
"icon": $("#menuIcon").val()
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
table.ajax.reload();
|
table.ajax.reload();
|
||||||
|
@ -529,7 +545,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSaveMenuItem').click(function () {
|
$('#btnSaveMenuItem').click(function() {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuItemSave.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuItemSave.json.php',
|
||||||
|
@ -549,14 +565,14 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
"mobileicon": $("#menuItemIconMobile").val()
|
"mobileicon": $("#menuItemIconMobile").val()
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
loadItems($('#menuId').val());
|
loadItems($('#menuId').val());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnDeleteMenu').click(function () {
|
$('#btnDeleteMenu').click(function() {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuDelete.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>plugin/TopMenu/menuDelete.json.php',
|
||||||
|
@ -564,7 +580,7 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
"menuId": $('#menuId').val()
|
"menuId": $('#menuId').val()
|
||||||
},
|
},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
modal.hidePleaseWait();
|
modal.hidePleaseWait();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
table.ajax.reload();
|
table.ajax.reload();
|
||||||
|
@ -572,11 +588,12 @@ $groups = UserGroups::getAllUsersGroups();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnEditMenuItens').click(function () {
|
$('#btnEditMenuItens').click(function() {
|
||||||
$('#menuItemsTabButton').tab('show');
|
$('#menuItemsTabButton').tab('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
BIN
view/.rnd
Normal file
BIN
view/.rnd
Normal file
Binary file not shown.
|
@ -87,42 +87,51 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#aboutArea #aboutAreaPreContent{
|
#aboutArea #aboutAreaPreContent {
|
||||||
max-height: 120px;
|
max-height: 120px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: max-height 0.25s ease-out;
|
transition: max-height 0.25s ease-out;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#aboutAreaPreContent{
|
|
||||||
|
#aboutAreaPreContent {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
#aboutArea.expanded #aboutAreaPreContent{
|
|
||||||
|
#aboutArea.expanded #aboutAreaPreContent {
|
||||||
max-height: 1500px;
|
max-height: 1500px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
transition: max-height 0.25s ease-in;
|
transition: max-height 0.25s ease-in;
|
||||||
}
|
}
|
||||||
#aboutAreaShowMoreBtn{
|
|
||||||
|
#aboutAreaShowMoreBtn {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
#aboutArea .showMore{
|
|
||||||
|
#aboutArea .showMore {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#aboutArea .showLess{
|
|
||||||
|
#aboutArea .showLess {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#aboutArea.expanded .showMore{
|
|
||||||
|
#aboutArea.expanded .showMore {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#aboutArea.expanded .showLess{
|
|
||||||
|
#aboutArea.expanded .showLess {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#channelHome{
|
|
||||||
|
#channelHome {
|
||||||
background-color: rgb(<?php echo $obj->backgroundRGB; ?>);
|
background-color: rgb(<?php echo $obj->backgroundRGB; ?>);
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.feedDropdown{
|
|
||||||
|
.feedDropdown {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -130,7 +139,7 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="gallery" >
|
<div class="gallery">
|
||||||
<div class="row clearfix">
|
<div class="row clearfix">
|
||||||
<div class="col-lg-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-sm-12 col-xs-12">
|
||||||
<center style="margin:5px;">
|
<center style="margin:5px;">
|
||||||
|
@ -155,7 +164,7 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
-moz-background-size: cover;
|
-moz-background-size: cover;
|
||||||
-o-background-size: cover;
|
-o-background-size: cover;
|
||||||
background-size: cover;">
|
background-size: cover;">
|
||||||
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;"/>
|
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;" />
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
|
@ -163,7 +172,7 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
?>
|
?>
|
||||||
<div class="clearfix" style="clear: both;"></div>
|
<div class="clearfix" style="clear: both;"></div>
|
||||||
<a href="<?php echo User::getWebsite($user_id); ?>" target="_blank">
|
<a href="<?php echo User::getWebsite($user_id); ?>" target="_blank">
|
||||||
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;"/>
|
<img src="<?php echo User::getPhoto($user_id); ?>" alt="<?php echo $user->_getName(); ?>" class="img img-responsive img-thumbnail" style="max-width: 100px;" />
|
||||||
</a>
|
</a>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -178,6 +187,29 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
<?php
|
<?php
|
||||||
echo User::getEmailVerifiedIcon($user_id)
|
echo User::getEmailVerifiedIcon($user_id)
|
||||||
?></h2>
|
?></h2>
|
||||||
|
<?php
|
||||||
|
$socialMedia = CustomizeUser::getSocialMedia();
|
||||||
|
?>
|
||||||
|
<ul class="social-network social-circle">
|
||||||
|
<?php
|
||||||
|
foreach ($socialMedia as $platform => $details) {
|
||||||
|
if ($details['isActive']) {
|
||||||
|
$url = User::getSocialMediaURL($platform, $user_id);
|
||||||
|
if (!empty($url)) {
|
||||||
|
?>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo $url; ?>" target="_blank" class="<?php echo $details['class']; ?>" title="<?php echo $details['label']; ?>" data-toggle="tooltip">
|
||||||
|
<i class="<?php echo $details['icon']; ?>"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<?php
|
<?php
|
||||||
echo getUserOnlineLabel($user_id, 'pull-right', 'padding: 0 5px;');
|
echo getUserOnlineLabel($user_id, 'pull-right', 'padding: 0 5px;');
|
||||||
|
@ -214,7 +246,7 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
if ($('#aboutArea').height() < $('#aboutAreaContent').height()) {
|
if ($('#aboutArea').height() < $('#aboutAreaContent').height()) {
|
||||||
$('#aboutAreaShowMoreBtn').show();
|
$('#aboutAreaShowMoreBtn').show();
|
||||||
}
|
}
|
||||||
|
@ -316,7 +348,7 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
$active = '';
|
$active = '';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="tab-pane <?php echo $active; ?>" id="channelLive" >
|
<div class="tab-pane <?php echo $active; ?>" id="channelLive">
|
||||||
<?php
|
<?php
|
||||||
//createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = false, $screenColsLarge = 0, $screenColsMedium = 0, $screenColsSmall = 0, $screenColsXSmall = 0, $galeryDetails = true)
|
//createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = false, $screenColsLarge = 0, $screenColsMedium = 0, $screenColsSmall = 0, $screenColsXSmall = 0, $galeryDetails = true)
|
||||||
//var_dump($screenColsLarge, $screenColsMedium);exit;
|
//var_dump($screenColsLarge, $screenColsMedium);exit;
|
||||||
|
@ -334,10 +366,12 @@ $showChannelProgramsTab = $advancedCustomUser->showChannelProgramsTab && !empty(
|
||||||
}
|
}
|
||||||
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
$obj = AVideoPlugin::getObjectData("YouPHPFlix2");
|
||||||
?>
|
?>
|
||||||
<style>#bigVideo{
|
<style>
|
||||||
|
#bigVideo {
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
}</style>
|
}
|
||||||
<div class="tab-pane <?php echo $active; ?>" id="channelHome" >
|
</style>
|
||||||
|
<div class="tab-pane <?php echo $active; ?>" id="channelHome">
|
||||||
<?php
|
<?php
|
||||||
$obj->BigVideo = true;
|
$obj->BigVideo = true;
|
||||||
$obj->PlayList = false;
|
$obj->PlayList = false;
|
||||||
|
|
|
@ -24,7 +24,9 @@ ul.social-network li {
|
||||||
.social-network a.icoWhatsapp:hover {
|
.social-network a.icoWhatsapp:hover {
|
||||||
background-color: #25D366;
|
background-color: #25D366;
|
||||||
}
|
}
|
||||||
|
.social-network a.icoInstagram:hover {
|
||||||
|
background-color: #E4405F;
|
||||||
|
}
|
||||||
.social-network a.icoFacebook:hover {
|
.social-network a.icoFacebook:hover {
|
||||||
background-color: #3B5998;
|
background-color: #3B5998;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue