mirror of
https://github.com/webmasterskaya/joomla-oauth-server.git
synced 2024-11-24 02:44:51 +03:00
Удаление клиента
This commit is contained in:
parent
6e14adfc86
commit
23a1d42c8c
@ -22,3 +22,5 @@ COM_OAUTHSERVER_CLIENTS_HEADING_SECRET = "Ключ"
|
||||
COM_OAUTHSERVER_CLIENTS_HEADING_PUBLIC = "Публичный"
|
||||
|
||||
COM_OAUTHSERVER_SAVE_AND_RESET = "Сохранить и сбросить"
|
||||
|
||||
COM_OAUTHSERVER_CLIENTS = "Клиенты"
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Webmasterskaya\Component\OauthServer\Administrator\Controller;
|
||||
|
||||
use Joomla\CMS\MVC\Controller\AdminController;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
|
||||
class ClientsController extends AdminController
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_OAUTHSERVER_CLIENT';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return \Joomla\CMS\MVC\Model\BaseDatabaseModel The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Client', $prefix = 'Administrator', $config = array('ignore_request' => true)): BaseDatabaseModel
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
}
|
@ -129,9 +129,11 @@ class HtmlView extends \Joomla\CMS\MVC\View\HtmlView
|
||||
$toolbar->addNew('client.add');
|
||||
}
|
||||
|
||||
// Add actions dropdown
|
||||
if (!$this->isEmptyState) {
|
||||
// TODO: Что мы тут в дропдаун пихаем?
|
||||
if ($canDo->get('core.delete')) {
|
||||
$toolbar->delete('clients.delete')
|
||||
->text('JTOOLBAR_DELETE')
|
||||
->message('JGLOBAL_CONFIRM_DELETE')
|
||||
->listCheck(true);
|
||||
}
|
||||
|
||||
// Add preferences button
|
||||
|
@ -49,16 +49,16 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
||||
<td class="w-1 text-center">
|
||||
<?php echo HTMLHelper::_('grid.checkall'); ?>
|
||||
</td>
|
||||
<th scope="col">
|
||||
<th scope="col" class="w-15">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_OAUTHSERVER_CLIENTS_HEADING_NAME', 'client.name', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<th scope="col" class="w-30 col-4">
|
||||
<?php echo Text::_('COM_OAUTHSERVER_CLIENTS_HEADING_IDENTIFIER'); ?>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<th scope="col" class="w-30 col-4">
|
||||
<?php echo Text::_('COM_OAUTHSERVER_CLIENTS_HEADING_SECRET'); ?>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<th scope="col" class="w-5">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_OAUTHSERVER_CLIENTS_HEADING_PUBLIC', 'client.public', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" class="w-5 d-none d-md-table-cell">
|
||||
@ -74,22 +74,37 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || is_null($item->checked_out);
|
||||
$canChange = $user->authorise('core.edit.state', 'com_oauthserver.clients') && $canCheckin; ?>
|
||||
<tr class="row<?php echo $i % 2; ?>">
|
||||
<td class="text-center">
|
||||
<td class="w-1 text-center">
|
||||
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->name); ?>
|
||||
</td>
|
||||
<td class="small text-start">
|
||||
<?php echo $item->name; ?>
|
||||
</td>
|
||||
<td class="small text-center d-none d-md-table-cell">
|
||||
<th scope="row" class="has-context">
|
||||
<div>
|
||||
<?php if ($item->checked_out) : ?>
|
||||
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'clients.', $canCheckin); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($canEdit) : ?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_oauthserver&task=client.edit&id=' . (int)$item->id); ?>"
|
||||
title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->name); ?>">
|
||||
<?php echo $this->escape($item->name); ?></a>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($item->name); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</th>
|
||||
<td class="d-none d-md-table-cell">
|
||||
<code>
|
||||
<?php echo $item->identifier; ?>
|
||||
</code>
|
||||
</td>
|
||||
<td class="small d-none d-md-table-cell">
|
||||
<?php echo $item->secret; ?>
|
||||
<td class="d-none d-md-table-cell">
|
||||
<code>
|
||||
<?php echo !empty($item->secret) ? substr($item->secret, 0, 29) . '...' : ''; ?>
|
||||
</code>
|
||||
</td>
|
||||
<td class="small d-none d-md-table-cell">
|
||||
<?php echo Text::_((bool) $item->public ? 'JYES' : 'JNO'); ?>
|
||||
<td class="d-none d-md-table-cell">
|
||||
<?php echo Text::_((bool)$item->public ? 'JYES' : 'JNO'); ?>
|
||||
</td>
|
||||
<td class="small text-center">
|
||||
<td class="w-1 text-center">
|
||||
<?php echo $item->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user