Skip to content

Commit

Permalink
Merge pull request #1682 from voltan/develop
Browse files Browse the repository at this point in the history
Work on user section
  • Loading branch information
voltan authored Jan 27, 2021
2 parents d1e7691 + fbfec1a commit c644d55
Show file tree
Hide file tree
Showing 30 changed files with 1,141 additions and 781 deletions.
7 changes: 7 additions & 0 deletions usr/module/system/config/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
'filter' => 'number_int',
'value' => 1,
],
'show_video' => [
'title' => _a('Display video'),
'description' => '',
'edit' => 'checkbox',
'filter' => 'number_int',
'value' => 1,
],
],
],

Expand Down
2 changes: 1 addition & 1 deletion usr/module/system/config/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'description' =>
_a('For administration of core functions of the site.'),
// Version number, required
'version' => '3.6.10',
'version' => '3.6.11',
// Distribution license, required
'license' => 'New BSD',
// Logo image, for admin, optional
Expand Down
15 changes: 15 additions & 0 deletions usr/module/system/src/Block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static function userbar($options = [])
'show_credit' => $options['show_credit'],
'show_support' => $options['show_support'],
'show_favourite' => $options['show_favourite'],
'show_video' => $options['show_video'],
'count' => 0,
];

Expand Down Expand Up @@ -341,6 +342,20 @@ public static function userbar($options = [])
}
}

// Set videos
if ($options['show_video'] && Pi::service('module')->isActive('video')) {
$user['video_url'] = Pi::url(
Pi::service('url')->assemble(
'video',
[
'module' => 'video',
'controller' => 'dashboard',
'action' => 'purchased',
]
)
);
}

// Set user information to result
$result['user'] = $user;

Expand Down
3 changes: 1 addition & 2 deletions usr/module/system/src/Controller/Front/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ public function processAction()
if (empty($values['redirect'])) {
$redirect = ['route' => 'home'];
} else {
//$redirect = urldecode($values['redirect']);
$redirect = ['route' => 'home'];
$redirect = urldecode($values['redirect']);
}

// Trigger login event
Expand Down
6 changes: 6 additions & 0 deletions usr/module/system/template/block/user-bar.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ EOT;
</a>
<?php } ?>
<?php } ?>
<?php if (isset($block['user']['video_url'])) { ?>
<a class="dropdown-item" href="<?php echo $block['user']['video_url']; ?>" title="<?php echo _b('Purchased Videos'); ?>">
<i class="fas fa-video"></i>
<?php echo _b('Purchased Videos'); ?>
</a>
<?php } ?>
<?php if (isset($block['user']['support_url'])) { ?>
<a class="dropdown-item <?php echo $module == 'support' ? 'active' : '' ?>" href="<?php echo $block['user']['support_url']; ?>"
title="<?php echo _b('Support'); ?>">
Expand Down
8 changes: 4 additions & 4 deletions usr/module/user/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
'title' => _a('Login by google'),
'description' => sprintf(
__('Callback urls is : %s'),
Pi::url('user/oauth/callback/provider-google')
Pi::url('user/oauth/callback/provider/google')
),
'edit' => 'checkbox',
'filter' => 'number_int',
Expand Down Expand Up @@ -743,7 +743,7 @@
'title' => _a('Login by twitter'),
'description' => sprintf(
__('Callback urls is : %s'),
Pi::url('user/oauth/callback/provider-twitter')
Pi::url('user/oauth/callback/provider/twitter')
),
'edit' => 'checkbox',
'filter' => 'number_int',
Expand Down Expand Up @@ -771,7 +771,7 @@
'title' => _a('Login by facebook'),
'description' => sprintf(
__('Callback urls is : %s'),
Pi::url('user/oauth/callback/provider-facebook')
Pi::url('user/oauth/callback/provider/facebook')
),
'edit' => 'checkbox',
'filter' => 'number_int',
Expand Down Expand Up @@ -799,7 +799,7 @@
'title' => _a('Login by github'),
'description' => sprintf(
__('Callback urls is : %s'),
Pi::url('user/oauth/callback/provider-github')
Pi::url('user/oauth/callback/provider/github')
),
'edit' => 'checkbox',
'filter' => 'number_int',
Expand Down
2 changes: 1 addition & 1 deletion usr/module/user/config/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'meta' => [
'title' => _a('User'),
'description' => _a('User profile and services.'),
'version' => '1.8.1',
'version' => '1.8.2',
'license' => 'New BSD',
'demo' => 'http://demo.piengine.org',
'icon' => 'fa-user',
Expand Down
4 changes: 2 additions & 2 deletions usr/module/user/config/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,13 @@
'edit' => 'locale',
],

// Profile: mobile phone number
// Profile: mobile number
'mobile' => [
'name' => 'mobile',
'title' => _a('Mobile phone'),
],

// Profile: phone
// Profile: phone number
'phone' => [
'name' => 'phone',
'title' => _a('Telephone'),
Expand Down
Binary file modified usr/module/user/locale/en/admin.mo
Binary file not shown.
Loading

0 comments on commit c644d55

Please sign in to comment.