mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Fix #1604 warnings and errors in PHP 8.0 in dispFileAdminList
This commit is contained in:
parent
c97edded9d
commit
2cf2ce2d67
2 changed files with 42 additions and 29 deletions
|
|
@ -68,39 +68,52 @@ class fileAdminModel extends file
|
|||
$this->_makeSearchParam($obj, $args);
|
||||
|
||||
// Set valid/invalid state
|
||||
if($obj->isvalid == 'Y') $args->isvalid = 'Y';
|
||||
elseif($obj->isvalid == 'N') $args->isvalid = 'N';
|
||||
if(isset($obj->isvalid) && in_array($obj->isvalid, ['Y', 'N']))
|
||||
{
|
||||
$args->isvalid = $obj->isvalid;
|
||||
}
|
||||
|
||||
// Set multimedia/common file
|
||||
if($obj->direct_download == 'Y') $args->direct_download = 'Y';
|
||||
elseif($obj->direct_download == 'N') $args->direct_download= 'N';
|
||||
if(isset($obj->direct_download) && in_array($obj->direct_download, ['Y', 'N']))
|
||||
{
|
||||
$args->direct_download = $obj->direct_download;
|
||||
}
|
||||
|
||||
// Set variables
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->sort_index = $obj->sort_index ?? null;
|
||||
$args->page = isset($obj->page) ? ($obj->page ? $obj->page : 1) : 1;
|
||||
$args->list_count = isset($obj->list_count) ? ($obj->list_count? $obj->list_count : 20) : 20;
|
||||
$args->page_count = isset($obj->page_count) ? ($obj->page_count? $obj->page_count : 10) : 10;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
if(toBool($obj->exclude_secret))
|
||||
$args->s_module_srl = $obj->module_srl ?? null;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl ?? null;
|
||||
if(toBool($obj->exclude_secret ?? null))
|
||||
{
|
||||
$args->document_status = array('PUBLIC');
|
||||
$args->comment_is_secret = array('N');
|
||||
$output = executeQuery('file.getFileListByTargetStatus', $args, $columnList);
|
||||
$output = executeQueryArray('file.getFileListByTargetStatus', $args, $columnList);
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('file.getFileList', $args, $columnList);
|
||||
$output = executeQueryArray('file.getFileList', $args, $columnList);
|
||||
}
|
||||
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
$oFileModel = getModel('file');
|
||||
if(!$output->toBool() || !count($output->data))
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
foreach($output->data as $key => $file)
|
||||
{
|
||||
if($_SESSION['file_management'][$file->file_srl]) $file->isCarted = true;
|
||||
else $file->isCarted = false;
|
||||
|
||||
$file->download_url = $oFileModel->getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
|
||||
if(isset($_SESSION['file_management'][$file->file_srl]) && $_SESSION['file_management'][$file->file_srl])
|
||||
{
|
||||
$file->isCarted = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$file->isCarted = false;
|
||||
}
|
||||
$file->download_url = FileModel::getDownloadUrl($file->file_srl, $file->sid, $file->module_srl);
|
||||
$output->data[$key] = $file;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class fileAdminView extends file
|
|||
|
||||
$doc_srls = array();
|
||||
$com_srls = array();
|
||||
$mod_srls= array();
|
||||
$mod_srls = array();
|
||||
|
||||
foreach($output->data as $file)
|
||||
{
|
||||
|
|
@ -60,15 +60,15 @@ class fileAdminView extends file
|
|||
if(!$file->upload_target_type)
|
||||
{
|
||||
// Pass if upload_target_type is already found
|
||||
if($document_list[$target_srl])
|
||||
if(isset($document_list[$target_srl]))
|
||||
{
|
||||
$file->upload_target_type = 'doc';
|
||||
}
|
||||
else if($comment_list[$target_srl])
|
||||
elseif(isset($comment_list[$target_srl]))
|
||||
{
|
||||
$file->upload_target_type = 'com';
|
||||
}
|
||||
else if($module_list[$target_srl])
|
||||
elseif(isset($module_list[$target_srl]))
|
||||
{
|
||||
$file->upload_target_type = 'mod';
|
||||
}
|
||||
|
|
@ -106,27 +106,27 @@ class fileAdminView extends file
|
|||
$module_list[$module->comment_srl] = $module;
|
||||
}
|
||||
}
|
||||
if($file_update_args->upload_target_type)
|
||||
if(isset($file_update_args->upload_target_type) && $file_update_args->upload_target_type)
|
||||
{
|
||||
executeQuery('file.updateFileTargetType', $file_update_args);
|
||||
}
|
||||
}
|
||||
// Check if data is already obtained
|
||||
for($i = 0; $i < $com_srls_count; ++$i)
|
||||
foreach($com_srls as $i => $com_srl)
|
||||
{
|
||||
if($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
|
||||
if(isset($comment_list[$com_srl])) unset($com_srls[$i]);
|
||||
}
|
||||
for($i = 0; $i < $doc_srls_count; ++$i)
|
||||
foreach($doc_srls as $i => $doc_srl)
|
||||
{
|
||||
if($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
|
||||
if(isset($document_list[$doc_srl])) unset($doc_srls[$i]);
|
||||
}
|
||||
for($i = 0; $i < $mod_srls_count; ++$i)
|
||||
foreach($mod_srls as $i => $mod_srl)
|
||||
{
|
||||
if($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
|
||||
if(isset($module_list[$mod_srl])) unset($mod_srls[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if($file->upload_target_type && is_array(${$file->upload_target_type.'_srls'}))
|
||||
if($file->upload_target_type && isset(${$file->upload_target_type.'_srls'}) && is_array(${$file->upload_target_type.'_srls'}))
|
||||
{
|
||||
if(!in_array($file->upload_target_srl, ${$file->upload_target_type.'_srls'}))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue