some fix
This commit is contained in:
@ -8,10 +8,6 @@ use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\app_modules\tag\models\Tag;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\models\Menu;
|
||||
use kernel\modules\menu\table\columns\MenuDeleteActionColumn;
|
||||
use kernel\modules\menu\table\columns\MenuEditActionColumn;
|
||||
use kernel\modules\menu\table\columns\MenuViewActionColumn;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider(Tag::class, [
|
||||
'currentPage' => $page_number,
|
||||
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\menu\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class MenuDeleteActionColumn extends ActionColumn
|
||||
{
|
||||
|
||||
protected string $prefix = "/delete/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-danger'>Удалить</a> ";
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\menu\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class MenuEditActionColumn extends ActionColumn
|
||||
{
|
||||
|
||||
protected string $prefix = "/update/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\menu\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class MenuViewActionColumn extends ActionColumn
|
||||
{
|
||||
|
||||
protected string $prefix = "/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
|
||||
}
|
||||
}
|
@ -6,11 +6,11 @@
|
||||
|
||||
use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\IGTabel\action_column\DeleteActionColumn;
|
||||
use kernel\IGTabel\action_column\EditActionColumn;
|
||||
use kernel\IGTabel\action_column\ViewActionColumn;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\models\Menu;
|
||||
use kernel\modules\menu\table\columns\MenuDeleteActionColumn;
|
||||
use kernel\modules\menu\table\columns\MenuEditActionColumn;
|
||||
use kernel\modules\menu\table\columns\MenuViewActionColumn;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider(Menu::class, [
|
||||
'currentPage' => $page_number,
|
||||
@ -28,8 +28,8 @@ $table->beforePrint(function () {
|
||||
return PrimaryBtn::create("Создать", "/admin/settings/menu/create")->fetch();
|
||||
//return (new PrimaryBtn("Создать", "/admin/user/create"))->fetch();
|
||||
});
|
||||
$table->addAction(MenuViewActionColumn::class);
|
||||
$table->addAction(MenuEditActionColumn::class);
|
||||
$table->addAction(MenuDeleteActionColumn::class);
|
||||
$table->addAction(ViewActionColumn::class);
|
||||
$table->addAction(EditActionColumn::class);
|
||||
$table->addAction(DeleteActionColumn::class);
|
||||
$table->create();
|
||||
$table->render();
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionDeleteActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/delete/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-danger'>Удалить</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionEditActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/update/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\option\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class OptionViewActionColumn extends ActionColumn
|
||||
{
|
||||
|
||||
protected string $prefix = "/";
|
||||
|
||||
public function fetch()
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
|
||||
}
|
||||
|
||||
}
|
@ -6,11 +6,11 @@
|
||||
|
||||
use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\IGTabel\action_column\DeleteActionColumn;
|
||||
use kernel\IGTabel\action_column\EditActionColumn;
|
||||
use kernel\IGTabel\action_column\ViewActionColumn;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\modules\option\models\Option;
|
||||
use kernel\modules\option\table\columns\OptionDeleteActionColumn;
|
||||
use kernel\modules\option\table\columns\OptionEditActionColumn;
|
||||
use kernel\modules\option\table\columns\OptionViewActionColumn;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider(Option::class, [
|
||||
'current_page' => $page_number,
|
||||
@ -31,8 +31,8 @@ $table->columns([
|
||||
}]
|
||||
]);
|
||||
|
||||
$table->addAction(OptionViewActionColumn::class);
|
||||
$table->addAction(OptionEditActionColumn::class);
|
||||
$table->addAction(OptionDeleteActionColumn::class);
|
||||
$table->addAction(ViewActionColumn::class);
|
||||
$table->addAction(EditActionColumn::class);
|
||||
$table->addAction(DeleteActionColumn::class);
|
||||
$table->create();
|
||||
$table->render();
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\post\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class PostDeleteActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/delete/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-danger'>Удалить</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\post\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class PostEditActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/update/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\post\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class PostViewActionColumn extends actionColumn
|
||||
{
|
||||
protected string $prefix = "/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
|
||||
}
|
||||
}
|
@ -5,14 +5,11 @@
|
||||
* @var int $page_number
|
||||
*/
|
||||
|
||||
use kernel\IGTabel\action_column\DeleteActionColumn;
|
||||
use kernel\IGTabel\action_column\EditActionColumn;
|
||||
use kernel\IGTabel\action_column\ViewActionColumn;
|
||||
use kernel\modules\post\models\Post;
|
||||
use kernel\modules\post\table\columns\PostDeleteActionColumn;
|
||||
use kernel\modules\post\table\columns\PostEditActionColumn;
|
||||
use kernel\modules\post\table\columns\PostViewActionColumn;
|
||||
use kernel\modules\user\models\User;
|
||||
//use app\tables\columns\post\PostDeleteActionColumn;
|
||||
//use app\tables\columns\post\PostEditActionColumn;
|
||||
//use app\tables\columns\post\PostViewActionColumn;
|
||||
use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
@ -46,8 +43,8 @@ $table->beforePrint(function () {
|
||||
return PrimaryBtn::create("Создать", "/admin/post/create")->fetch();
|
||||
//return (new PrimaryBtn("Создать", "/admin/user/create"))->fetch();
|
||||
});
|
||||
$table->addAction(PostViewActionColumn::class);
|
||||
$table->addAction(PostEditActionColumn::class);
|
||||
$table->addAction(PostDeleteActionColumn::class);
|
||||
$table->addAction(ViewActionColumn::class);
|
||||
$table->addAction(EditActionColumn::class);
|
||||
$table->addAction(DeleteActionColumn::class);
|
||||
$table->create();
|
||||
$table->render();
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\user\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class UserDeleteActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/delete/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-danger'>Удалить</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\user\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class UserEditActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/update/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-success'>Редактировать</a> ";
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace kernel\modules\user\table\columns;
|
||||
|
||||
use Itguild\Tables\ActionColumn\ActionColumn;
|
||||
|
||||
class UserViewActionColumn extends ActionColumn
|
||||
{
|
||||
protected string $prefix = "/";
|
||||
|
||||
public function fetch(): string
|
||||
{
|
||||
$link = $this->baseUrl . $this->prefix . $this->id;
|
||||
return " <a href='$link' class='btn btn-primary'>Просмотр</a> ";
|
||||
}
|
||||
}
|
@ -7,11 +7,11 @@
|
||||
|
||||
use Itguild\EloquentTable\EloquentDataProvider;
|
||||
use Itguild\EloquentTable\ListEloquentTable;
|
||||
use kernel\IGTabel\action_column\DeleteActionColumn;
|
||||
use kernel\IGTabel\action_column\EditActionColumn;
|
||||
use kernel\IGTabel\action_column\ViewActionColumn;
|
||||
use kernel\IGTabel\btn\PrimaryBtn;
|
||||
use kernel\modules\user\models\User;
|
||||
use kernel\modules\user\table\columns\UserDeleteActionColumn;
|
||||
use kernel\modules\user\table\columns\UserEditActionColumn;
|
||||
use kernel\modules\user\table\columns\UserViewActionColumn;
|
||||
|
||||
$table = new ListEloquentTable(new EloquentDataProvider(User::class, [
|
||||
'currentPage' => $page_number,
|
||||
@ -45,8 +45,8 @@ $table->beforePrint(function () {
|
||||
return PrimaryBtn::create("Создать", "/admin/user/create")->fetch();
|
||||
//return (new PrimaryBtn("Создать", "/admin/user/create"))->fetch();
|
||||
});
|
||||
$table->addAction(UserViewActionColumn::class);
|
||||
$table->addAction(UserEditActionColumn::class);
|
||||
$table->addAction(UserDeleteActionColumn::class);
|
||||
$table->addAction(ViewActionColumn::class);
|
||||
$table->addAction(EditActionColumn::class);
|
||||
$table->addAction(DeleteActionColumn::class);
|
||||
$table->create();
|
||||
$table->render();
|
@ -346,6 +346,9 @@ class ModuleService
|
||||
$fileHelper->copy_folder(APP_DIR . '/modules/' . $moduleName, $tmpModuleDirFull . 'app/');
|
||||
$fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $tmpModuleDirFull . 'kernel/');
|
||||
|
||||
if (!is_dir(RESOURCES_DIR . '/tmp/module')) {
|
||||
mkdir(RESOURCES_DIR . '/tmp/modules', 0777, true);
|
||||
}
|
||||
$fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.itguild');
|
||||
|
||||
$fileHelper->recursiveRemoveDir($tmpModuleDirFull);
|
||||
|
Reference in New Issue
Block a user