This commit is contained in:
2024-01-31 11:36:25 +07:00
parent caef156a05
commit 4561bd68d1
125 changed files with 9117 additions and 58 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Hura8\Components\User\Controller;
use Hura8\Components\Customer\PublicController\UCustomerLoginController;
use Hura8\Components\User\AdminController\AUserController;
use Hura8\Components\User\Model\UserUploadModel;
use Hura8\System\Controller\aEntityBaseController;
class bUserUploadController extends aEntityBaseController
{
protected $web_user_id = '';
protected $customer_id = 0;
protected $item_type = '';
protected $item_id = '';
public function __construct($item_type='', $item_id=0) {
$this->web_user_id = AUserController::getWebUserId();
$this->customer_id = UCustomerLoginController::getLoggedInCustomerId();
$this->item_type = $item_type;
$this->item_id = $item_id;
parent::__construct(new UserUploadModel($this->web_user_id, $this->customer_id, $item_type, $item_id));
}
protected function deleteFileBeforeDeleteItem($item_id): bool
{
// delete thumb files
$item_info = $this->getInfo($item_id);
if($item_info['file_path']) {
$file_local_path = PUBLIC_DIR . "/". $item_info['file_path'];
@unlink($file_local_path);
}
// ok
return true;
}
}