mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
Merge branch 'develop' into db-search-operator
This commit is contained in:
commit
f8ed3b49f2
22 changed files with 132 additions and 81 deletions
|
|
@ -58,7 +58,7 @@ class ExtraVar
|
||||||
|
|
||||||
foreach($extra_keys as $val)
|
foreach($extra_keys as $val)
|
||||||
{
|
{
|
||||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid);
|
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value ?? null, $val->eid);
|
||||||
$this->keys[$val->idx] = $obj;
|
$this->keys[$val->idx] = $obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -754,7 +754,7 @@ class ModuleObject extends BaseObject
|
||||||
if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON')
|
if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON')
|
||||||
{
|
{
|
||||||
$oAPI = getAPI($this->module_info->module);
|
$oAPI = getAPI($this->module_info->module);
|
||||||
if(method_exists($oAPI, $this->act))
|
if($oAPI instanceof ModuleObject && method_exists($oAPI, $this->act))
|
||||||
{
|
{
|
||||||
$oAPI->{$this->act}($this);
|
$oAPI->{$this->act}($this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -420,6 +420,11 @@ class DB
|
||||||
$output = $this->setError(-1, $e->getMessage());
|
$output = $this->setError(-1, $e->getMessage());
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
catch (\PDOException $e)
|
||||||
|
{
|
||||||
|
$output = $this->setError(-1, $e->getMessage());
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
// Collect various counts used in the page calculation.
|
// Collect various counts used in the page calculation.
|
||||||
list($is_expression, $list_count) = $query->navigation->list_count->getValue($args);
|
list($is_expression, $list_count) = $query->navigation->list_count->getValue($args);
|
||||||
|
|
@ -477,17 +482,24 @@ class DB
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array();
|
try
|
||||||
$index = $last_index;
|
|
||||||
$step = $last_index !== 0 ? -1 : 1;
|
|
||||||
|
|
||||||
while ($row = $stmt->fetchObject())
|
|
||||||
{
|
{
|
||||||
$result[$index] = $row;
|
$result = array();
|
||||||
$index += $step;
|
$index = $last_index;
|
||||||
|
$step = $last_index !== 0 ? -1 : 1;
|
||||||
|
|
||||||
|
while ($row = $stmt->fetchObject())
|
||||||
|
{
|
||||||
|
$result[$index] = $row;
|
||||||
|
$index += $step;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt->closeCursor();
|
||||||
|
}
|
||||||
|
catch (\PDOException $e)
|
||||||
|
{
|
||||||
|
throw new Exceptions\DBError($e->getMessage(), 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->closeCursor();
|
|
||||||
|
|
||||||
if ($result_type === 'auto' && $last_index === 0 && count($result) === 1)
|
if ($result_type === 'auto' && $last_index === 0 && count($result) === 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,11 @@ class VariableBase
|
||||||
{
|
{
|
||||||
list($is_expression, $value) = $this->getDefaultValue();
|
list($is_expression, $value) = $this->getDefaultValue();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$is_expression = null;
|
||||||
|
$value = null;
|
||||||
|
}
|
||||||
|
|
||||||
return [$is_expression, $value];
|
return [$is_expression, $value];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,8 @@ class boardView extends board
|
||||||
{
|
{
|
||||||
$this->page_count = $this->module_info->page_count;
|
$this->page_count = $this->module_info->page_count;
|
||||||
}
|
}
|
||||||
$this->except_notice = $this->module_info->except_notice == 'N' ? FALSE : TRUE;
|
$this->except_notice = ($this->module_info->except_notice ?? '') == 'N' ? FALSE : TRUE;
|
||||||
$this->include_modules = $this->module_info->include_modules ? explode(',', $this->module_info->include_modules) : [];
|
$this->include_modules = ($this->module_info->include_modules ?? []) ? explode(',', $this->module_info->include_modules) : [];
|
||||||
if (count($this->include_modules) && !in_array($this->module_info->module_srl, $this->include_modules))
|
if (count($this->include_modules) && !in_array($this->module_info->module_srl, $this->include_modules))
|
||||||
{
|
{
|
||||||
$this->include_modules[] = $this->module_info->module_srl;
|
$this->include_modules[] = $this->module_info->module_srl;
|
||||||
|
|
@ -546,7 +546,7 @@ class boardView extends board
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup the list count to be serach list count, if the category or search keyword has been set
|
// setup the list count to be serach list count, if the category or search keyword has been set
|
||||||
if($args->category_srl || $args->search_keyword)
|
if($args->category_srl ?? null || $args->search_keyword ?? null)
|
||||||
{
|
{
|
||||||
$args->list_count = $this->search_list_count;
|
$args->list_count = $this->search_list_count;
|
||||||
}
|
}
|
||||||
|
|
@ -602,15 +602,10 @@ class boardView extends board
|
||||||
foreach ($document_list as $document)
|
foreach ($document_list as $document)
|
||||||
{
|
{
|
||||||
$module_srl = $document->get('module_srl');
|
$module_srl = $document->get('module_srl');
|
||||||
if (isset($map[$module_srl]))
|
if ($document->get('mid') === null)
|
||||||
{
|
{
|
||||||
$document->add('module_title', $map[$module_srl]->browser_title);
|
$document->add('module_title', isset($map[$module_srl]) ? $map[$module_srl]->browser_title : $this->module_info->browser_title);
|
||||||
$document->add('mid', $map[$module_srl]->mid);
|
$document->add('mid', isset($map[$module_srl]) ? $map[$module_srl]->mid : $this->module_info->mid);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$document->add('module_title', $this->module_info->browser_title);
|
|
||||||
$document->add('mid', $this->module_info->mid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -618,8 +613,11 @@ class boardView extends board
|
||||||
{
|
{
|
||||||
foreach ($document_list as $document)
|
foreach ($document_list as $document)
|
||||||
{
|
{
|
||||||
$document->add('module_title', $this->module_info->browser_title);
|
if ($document->get('mid') === null)
|
||||||
$document->add('mid', $this->module_info->mid);
|
{
|
||||||
|
$document->add('module_title', $this->module_info->browser_title);
|
||||||
|
$document->add('mid', $this->module_info->mid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</select>
|
</select>
|
||||||
<input type="search" name="search_keyword" value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" />
|
<input type="search" name="search_keyword" value="{escape($search_keyword, false)}" title="{$lang->cmd_search}" />
|
||||||
<button type="submit" class="shbn" title="{$lang->cmd_search}"></button>
|
<button type="submit" class="shbn" title="{$lang->cmd_search}"></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
<input type="hidden" name="vid" value="{$vid}" />
|
<input type="hidden" name="vid" value="{$vid}" />
|
||||||
<input type="hidden" name="mid" value="{$mid}" />
|
<input type="hidden" name="mid" value="{$mid}" />
|
||||||
<input type="hidden" name="category" value="{$category}" />
|
<input type="hidden" name="category" value="{$category}" />
|
||||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" class="iText" />
|
<input type="text" name="search_keyword" value="{escape($search_keyword, false)}" title="{$lang->cmd_search}" class="iText" />
|
||||||
<select name="search_target">
|
<select name="search_target">
|
||||||
<option loop="$search_option=>$key,$val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
|
<option loop="$search_option=>$key,$val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@
|
||||||
</select>
|
</select>
|
||||||
<div class="search_input">
|
<div class="search_input">
|
||||||
<i class="xi-magnifier"></i>
|
<i class="xi-magnifier"></i>
|
||||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" class="iText" />
|
<input type="text" name="search_keyword" value="{escape($search_keyword, false)}" title="{$lang->cmd_search}" class="iText" />
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn" onclick="xGetElementById('board_search').submit();return false;">{$lang->cmd_search}</button>
|
<button type="submit" class="btn" onclick="xGetElementById('board_search').submit();return false;">{$lang->cmd_search}</button>
|
||||||
<a cond="$last_division" href="{getUrl('page',1,'document_srl','','division',$last_division,'last_division','')}" class="btn">{$lang->cmd_search_next}</a>
|
<a cond="$last_division" href="{getUrl('page',1,'document_srl','','division',$last_division,'last_division','')}" class="btn">{$lang->cmd_search_next}</a>
|
||||||
|
|
|
||||||
|
|
@ -728,7 +728,7 @@ class commentModel extends comment
|
||||||
*/
|
*/
|
||||||
public static function _arrangeComment(&$comment_list, $list, $depth, $parent = NULL)
|
public static function _arrangeComment(&$comment_list, $list, $depth, $parent = NULL)
|
||||||
{
|
{
|
||||||
if(!count($list))
|
if(!is_array($list) || !count($list))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ class communicationView extends communication
|
||||||
Context::set('message', $message);
|
Context::set('message', $message);
|
||||||
Context::set('message_files', CommunicationModel::getMessageFiles($message));
|
Context::set('message_files', CommunicationModel::getMessageFiles($message));
|
||||||
|
|
||||||
if(Mobile::isFromMobilePhone())
|
if(Mobile::isFromMobilePhone() && file_exists($this->getTemplatePath() . 'read_message.html'))
|
||||||
{
|
{
|
||||||
$template_filename = 'read_message';
|
$template_filename = 'read_message';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1651,8 +1651,8 @@ class documentController extends document
|
||||||
*/
|
*/
|
||||||
function declaredDocument($document_srl, $declare_message = '')
|
function declaredDocument($document_srl, $declare_message = '')
|
||||||
{
|
{
|
||||||
// Fail if session information already has a reported document
|
// Fail if session already tried to report the document
|
||||||
if($_SESSION['declared_document'][$document_srl])
|
if(isset($_SESSION['declared_document'][$document_srl]))
|
||||||
{
|
{
|
||||||
return new BaseObject(-1, 'failed_declared');
|
return new BaseObject(-1, 'failed_declared');
|
||||||
}
|
}
|
||||||
|
|
@ -1687,7 +1687,7 @@ class documentController extends document
|
||||||
// Pass if the author's IP address is as same as visitor's.
|
// Pass if the author's IP address is as same as visitor's.
|
||||||
if($oDocument->get('ipaddress') == \RX_CLIENT_IP)
|
if($oDocument->get('ipaddress') == \RX_CLIENT_IP)
|
||||||
{
|
{
|
||||||
$_SESSION['declared_document'][$document_srl] = true;
|
$_SESSION['declared_document'][$document_srl] = false;
|
||||||
return new BaseObject(-1, 'failed_declared');
|
return new BaseObject(-1, 'failed_declared');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1700,7 +1700,7 @@ class documentController extends document
|
||||||
// Pass after registering a session if author's information is same as the currently logged-in user's.
|
// Pass after registering a session if author's information is same as the currently logged-in user's.
|
||||||
if($member_srl && $member_srl == abs($oDocument->get('member_srl')))
|
if($member_srl && $member_srl == abs($oDocument->get('member_srl')))
|
||||||
{
|
{
|
||||||
$_SESSION['declared_document'][$document_srl] = true;
|
$_SESSION['declared_document'][$document_srl] = false;
|
||||||
return new BaseObject(-1, 'failed_declared');
|
return new BaseObject(-1, 'failed_declared');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1719,7 +1719,7 @@ class documentController extends document
|
||||||
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
||||||
if($output->data->count)
|
if($output->data->count)
|
||||||
{
|
{
|
||||||
$_SESSION['declared_document'][$document_srl] = true;
|
$_SESSION['declared_document'][$document_srl] = false;
|
||||||
return new BaseObject(-1, 'failed_declared');
|
return new BaseObject(-1, 'failed_declared');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1835,7 +1835,7 @@ class documentController extends document
|
||||||
|
|
||||||
if($output->data->count <= 0 || !isset($output->data->count))
|
if($output->data->count <= 0 || !isset($output->data->count))
|
||||||
{
|
{
|
||||||
$_SESSION['declared_document'][$document_srl] = false;
|
unset($_SESSION['declared_document'][$document_srl]);
|
||||||
return new BaseObject(-1, 'failed_declared_cancel');
|
return new BaseObject(-1, 'failed_declared_cancel');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1911,7 +1911,7 @@ class documentController extends document
|
||||||
$trigger_obj->declared_count = $declared_count - 1;
|
$trigger_obj->declared_count = $declared_count - 1;
|
||||||
ModuleHandler::triggerCall('document.declaredDocumentCancel', 'after', $trigger_obj);
|
ModuleHandler::triggerCall('document.declaredDocumentCancel', 'after', $trigger_obj);
|
||||||
|
|
||||||
$_SESSION['declared_document'][$document_srl] = false;
|
unset($_SESSION['declared_document'][$document_srl]);
|
||||||
|
|
||||||
$this->setMessage('success_declared_cancel');
|
$this->setMessage('success_declared_cancel');
|
||||||
}
|
}
|
||||||
|
|
@ -2463,7 +2463,7 @@ class documentController extends document
|
||||||
$list[$category_srl] = $category_list[$i];
|
$list[$category_srl] = $category_list[$i];
|
||||||
}
|
}
|
||||||
// Create the xml file without node data if no data is obtained
|
// Create the xml file without node data if no data is obtained
|
||||||
if(!$list)
|
if(!isset($list) || !$list)
|
||||||
{
|
{
|
||||||
$xml_buff = "<root />";
|
$xml_buff = "<root />";
|
||||||
FileHandler::writeFile($xml_file, $xml_buff);
|
FileHandler::writeFile($xml_file, $xml_buff);
|
||||||
|
|
|
||||||
|
|
@ -558,7 +558,7 @@ class documentItem extends BaseObject
|
||||||
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
|
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $_SESSION['declared_document'][$this->document_srl] = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTitle($cut_size = 0, $tail = '...')
|
function getTitle($cut_size = 0, $tail = '...')
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,26 @@ class documentModel extends document
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->module_srl = $obj->module_srl;
|
$args->module_srl = $obj->module_srl;
|
||||||
$args->category_srl = $obj->category_srl ?? null;
|
$args->category_srl = $obj->category_srl ?? null;
|
||||||
$output = executeQueryArray('document.getNoticeList', $args, $columnList);
|
|
||||||
|
// Call trigger (before)
|
||||||
|
// This trigger can be used to set an alternative output using a different search method
|
||||||
|
unset($args->use_alternate_output);
|
||||||
|
$output = ModuleHandler::triggerCall('document.getNoticeList', 'before', $args);
|
||||||
|
if ($output instanceof BaseObject && !$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If an alternate output is set, use it instead of running the default queries
|
||||||
|
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
|
||||||
|
{
|
||||||
|
$output = $args->use_alternate_output;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$output = executeQueryArray('document.getNoticeList', $args, $columnList);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$output->toBool() || !$result = $output->data)
|
if(!$output->toBool() || !$result = $output->data)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
@ -322,7 +341,10 @@ class documentModel extends document
|
||||||
$output->data[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
$output->data[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl];
|
||||||
}
|
}
|
||||||
self::setToAllDocumentExtraVars();
|
self::setToAllDocumentExtraVars();
|
||||||
|
|
||||||
|
// Call trigger (after)
|
||||||
|
// This trigger can be used to modify search results
|
||||||
|
ModuleHandler::triggerCall('document.getNoticeList', 'after', $output);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -707,7 +729,10 @@ class documentModel extends document
|
||||||
|
|
||||||
// Cleanup of category
|
// Cleanup of category
|
||||||
$document_category = array();
|
$document_category = array();
|
||||||
self::_arrangeCategory($document_category, $menu->list, 0);
|
if (isset($menu) && isset($menu->list))
|
||||||
|
{
|
||||||
|
self::_arrangeCategory($document_category, $menu->list, 0);
|
||||||
|
}
|
||||||
return $document_category;
|
return $document_category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ var auto_saved_msg = "{$lang->msg_auto_saved}";
|
||||||
|
|
||||||
{@ $css_content = "" }
|
{@ $css_content = "" }
|
||||||
|
|
||||||
<!--@if($enable_autosave && isset($saved_doc) && $saved_doc)-->
|
<!--@if($enable_autosave)-->
|
||||||
<input type="hidden" name="_saved_doc_title" value="{escape($saved_doc->title)}" />
|
<input type="hidden" name="_saved_doc_title" value="{(isset($saved_doc) && $saved_doc) ? escape($saved_doc->title) : ''}" />
|
||||||
<input type="hidden" name="_saved_doc_content" value="{escape($saved_doc->content)}" />
|
<input type="hidden" name="_saved_doc_content" value="{(isset($saved_doc) && $saved_doc) ? escape($saved_doc->content) : ''}" />
|
||||||
<input type="hidden" name="_saved_doc_document_srl" value="{$saved_doc->document_srl}" />
|
<input type="hidden" name="_saved_doc_document_srl" value="{(isset($saved_doc) && $saved_doc) ? $saved_doc->document_srl : ''}" />
|
||||||
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
|
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class fileAdminModel extends file
|
||||||
* Initialization
|
* Initialization
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function init()
|
public function init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ class fileAdminModel extends file
|
||||||
* @param array $columnList Column list to get from DB
|
* @param array $columnList Column list to get from DB
|
||||||
* @return Object Object contains query result
|
* @return Object Object contains query result
|
||||||
*/
|
*/
|
||||||
function getFileList($obj, $columnList = array())
|
public function getFileList($obj, $columnList = array())
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$this->_makeSearchParam($obj, $args);
|
$this->_makeSearchParam($obj, $args);
|
||||||
|
|
@ -75,9 +75,9 @@ class fileAdminModel extends file
|
||||||
elseif($obj->direct_download == 'N') $args->direct_download= 'N';
|
elseif($obj->direct_download == 'N') $args->direct_download= 'N';
|
||||||
// Set variables
|
// Set variables
|
||||||
$args->sort_index = $obj->sort_index;
|
$args->sort_index = $obj->sort_index;
|
||||||
$args->page = $obj->page?$obj->page:1;
|
$args->page = isset($obj->page) ? ($obj->page ? $obj->page : 1) : 1;
|
||||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
$args->list_count = isset($obj->list_count) ? ($obj->list_count? $obj->list_count : 20) : 20;
|
||||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
$args->page_count = isset($obj->page_count) ? ($obj->page_count? $obj->page_count : 10) : 10;
|
||||||
$args->s_module_srl = $obj->module_srl;
|
$args->s_module_srl = $obj->module_srl;
|
||||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||||
if(toBool($obj->exclude_secret))
|
if(toBool($obj->exclude_secret))
|
||||||
|
|
@ -124,7 +124,7 @@ class fileAdminModel extends file
|
||||||
* @param object $obj Search options (not used...)
|
* @param object $obj Search options (not used...)
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getFilesCountByGroupValid($obj = '')
|
public function getFilesCountByGroupValid($obj = '')
|
||||||
{
|
{
|
||||||
//$this->_makeSearchParam($obj, $args);
|
//$this->_makeSearchParam($obj, $args);
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ class fileAdminModel extends file
|
||||||
* @param string $date Date string
|
* @param string $date Date string
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function getFilesCountByDate($date = '')
|
public function getFilesCountByDate($date = '')
|
||||||
{
|
{
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
if($date)
|
if($date)
|
||||||
|
|
@ -162,18 +162,17 @@ class fileAdminModel extends file
|
||||||
* @param object $args Result searach options
|
* @param object $args Result searach options
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function _makeSearchParam(&$obj, &$args)
|
protected function _makeSearchParam(&$obj, &$args)
|
||||||
{
|
{
|
||||||
// Search options
|
// Search options
|
||||||
$search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target'));
|
$search_target = isset($obj->search_target)? ($obj->search_target? $obj->search_target : trim(Context::get('search_target'))) : trim(Context::get('search_target'));
|
||||||
$search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword'));
|
$search_keyword = isset($obj->search_keyword)? ($obj->search_keyword? $obj->search_keyword : trim(Context::get('search_keyword'))) : trim(Context::get('search_keyword'));
|
||||||
|
|
||||||
if($search_target && $search_keyword)
|
if($search_target && $search_keyword)
|
||||||
{
|
{
|
||||||
switch($search_target)
|
switch($search_target)
|
||||||
{
|
{
|
||||||
case 'filename' :
|
case 'filename' :
|
||||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
|
||||||
$args->s_filename = $search_keyword;
|
$args->s_filename = $search_keyword;
|
||||||
break;
|
break;
|
||||||
case 'filesize_more' :
|
case 'filesize_more' :
|
||||||
|
|
|
||||||
|
|
@ -857,7 +857,7 @@ class fileController extends file
|
||||||
$args->module_srl = $module_srl;
|
$args->module_srl = $module_srl;
|
||||||
$args->upload_target_srl = $upload_target_srl;
|
$args->upload_target_srl = $upload_target_srl;
|
||||||
$args->download_count = $download_count;
|
$args->download_count = $download_count;
|
||||||
$args->member_srl = Rhymix\Framework\Session::getMemberSrl();
|
$args->member_srl = Rhymix\Framework\Session::getMemberSrl() ?: 0;
|
||||||
$args->source_filename = $file_info['name'];
|
$args->source_filename = $file_info['name'];
|
||||||
$args->sid = Rhymix\Framework\Security::getRandom(32, 'hex');
|
$args->sid = Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||||
$args->mime_type = $file_info['type'];
|
$args->mime_type = $file_info['type'];
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,15 @@
|
||||||
<condition operation="equal" column="files.direct_download" var="direct_download" pipe="and" />
|
<condition operation="equal" column="files.direct_download" var="direct_download" pipe="and" />
|
||||||
<condition operation="below" column="files.regdate" var="regdate_before" pipe="and" />
|
<condition operation="below" column="files.regdate" var="regdate_before" pipe="and" />
|
||||||
<group pipe="and">
|
<group pipe="and">
|
||||||
<condition operation="like" column="files.source_filename" var="s_filename" pipe="or" />
|
<condition operation="search" column="files.source_filename" var="s_filename" pipe="or" />
|
||||||
<condition operation="more" column="files.file_size" var="s_filesize_more" pipe="or" />
|
<condition operation="more" column="files.file_size" var="s_filesize_more" pipe="or" />
|
||||||
<condition operation="less" column="files.file_size" var="s_filesize_less" pipe="or" />
|
<condition operation="less" column="files.file_size" var="s_filesize_less" pipe="or" />
|
||||||
<condition operation="more" column="files.download_count" var="s_download_count" pipe="or" />
|
<condition operation="more" column="files.download_count" var="s_download_count" pipe="or" />
|
||||||
<condition operation="like_prefix" column="files.regdate" var="s_regdate" pipe="or" />
|
<condition operation="like_prefix" column="files.regdate" var="s_regdate" pipe="or" />
|
||||||
<condition operation="like_prefix" column="files.ipaddress" var="s_ipaddress" pipe="or" />
|
<condition operation="like_prefix" column="files.ipaddress" var="s_ipaddress" pipe="or" />
|
||||||
<condition operation="like" column="member.user_id" var="s_user_id" pipe="or" />
|
<condition operation="search" column="member.user_id" var="s_user_id" pipe="or" />
|
||||||
<condition operation="like" column="member.user_name" var="s_user_name" pipe="or" />
|
<condition operation="search" column="member.user_name" var="s_user_name" pipe="or" />
|
||||||
<condition operation="like" column="member.nick_name" var="s_nick_name" pipe="or" />
|
<condition operation="search" column="member.nick_name" var="s_nick_name" pipe="or" />
|
||||||
</group>
|
</group>
|
||||||
</conditions>
|
</conditions>
|
||||||
<navigation>
|
<navigation>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<query id="getFileList" action="select">
|
<query id="getFileListByTargetStatus" action="select">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="files" alias="files" />
|
<table name="files" alias="files" />
|
||||||
<table name="member" type="left join">
|
<table name="member" type="left join">
|
||||||
|
|
@ -35,15 +35,15 @@
|
||||||
<condition operation="null" column="comments.is_secret" pipe="or" />
|
<condition operation="null" column="comments.is_secret" pipe="or" />
|
||||||
</group>
|
</group>
|
||||||
<group pipe="and">
|
<group pipe="and">
|
||||||
<condition operation="like" column="files.source_filename" var="s_filename" pipe="or" />
|
<condition operation="search" column="files.source_filename" var="s_filename" pipe="or" />
|
||||||
<condition operation="more" column="files.file_size" var="s_filesize_more" pipe="or" />
|
<condition operation="more" column="files.file_size" var="s_filesize_more" pipe="or" />
|
||||||
<condition operation="less" column="files.file_size" var="s_filesize_less" pipe="or" />
|
<condition operation="less" column="files.file_size" var="s_filesize_less" pipe="or" />
|
||||||
<condition operation="more" column="files.download_count" var="s_download_count" pipe="or" />
|
<condition operation="more" column="files.download_count" var="s_download_count" pipe="or" />
|
||||||
<condition operation="like_prefix" column="files.regdate" var="s_regdate" pipe="or" />
|
<condition operation="like_prefix" column="files.regdate" var="s_regdate" pipe="or" />
|
||||||
<condition operation="like_prefix" column="files.ipaddress" var="s_ipaddress" pipe="or" />
|
<condition operation="like_prefix" column="files.ipaddress" var="s_ipaddress" pipe="or" />
|
||||||
<condition operation="like" column="member.user_id" var="s_user_id" pipe="or" />
|
<condition operation="search" column="member.user_id" var="s_user_id" pipe="or" />
|
||||||
<condition operation="like" column="member.user_name" var="s_user_name" pipe="or" />
|
<condition operation="search" column="member.user_name" var="s_user_name" pipe="or" />
|
||||||
<condition operation="like" column="member.nick_name" var="s_nick_name" pipe="or" />
|
<condition operation="search" column="member.nick_name" var="s_nick_name" pipe="or" />
|
||||||
</group>
|
</group>
|
||||||
</conditions>
|
</conditions>
|
||||||
<navigation>
|
<navigation>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<query id="getFilesCount" action="select">
|
<query id="getFilesCountByGroupValid" action="select">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="files" />
|
<table name="files" />
|
||||||
</tables>
|
</tables>
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<condition operation="equal" column="isvalid" var="isvalid" pipe="and" />
|
<condition operation="equal" column="isvalid" var="isvalid" pipe="and" />
|
||||||
<condition operation="equal" column="direct_download" var="direct_download" pipe="and" />
|
<condition operation="equal" column="direct_download" var="direct_download" pipe="and" />
|
||||||
<group pipe="and">
|
<group pipe="and">
|
||||||
<condition operation="like" column="source_filename" var="s_filename" pipe="or" />
|
<condition operation="search" column="source_filename" var="s_filename" pipe="or" />
|
||||||
<condition operation="more" column="file_size" var="s_filesize_more" pipe="or" />
|
<condition operation="more" column="file_size" var="s_filesize_more" pipe="or" />
|
||||||
<condition operation="less" column="file_size" var="s_filesize_less" pipe="or" />
|
<condition operation="less" column="file_size" var="s_filesize_less" pipe="or" />
|
||||||
<condition operation="more" column="download_count" var="s_download_count" pipe="or" />
|
<condition operation="more" column="download_count" var="s_download_count" pipe="or" />
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,6 @@ class installController extends install
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
var_dump($e);exit;
|
|
||||||
throw new Rhymix\Framework\Exception($e->getMessage());
|
throw new Rhymix\Framework\Exception($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class integration_searchView extends integration_search
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function init()
|
public function init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ class integration_searchView extends integration_search
|
||||||
*
|
*
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
function IS()
|
public function IS()
|
||||||
{
|
{
|
||||||
$oFile = getClass('file');
|
$oFile = getClass('file');
|
||||||
$oModuleModel = getModel('module');
|
$oModuleModel = getModel('module');
|
||||||
|
|
@ -114,7 +114,8 @@ class integration_searchView extends integration_search
|
||||||
|
|
||||||
// Set a variable for search keyword
|
// Set a variable for search keyword
|
||||||
$is_keyword = Context::get('is_keyword');
|
$is_keyword = Context::get('is_keyword');
|
||||||
$is_keyword = escape(trim(utf8_normalize_spaces($is_keyword)));
|
// As the variables from GET or POST will be escaped by setRequestArguments method at Context class, the double_escape variable should be "FALSE", and also the escape function might be useful when this method was called from the other way (for not escaped keyword).
|
||||||
|
$is_keyword = escape(trim(utf8_normalize_spaces($is_keyword)), false);
|
||||||
if (mb_strlen($is_keyword, 'UTF-8') > 250)
|
if (mb_strlen($is_keyword, 'UTF-8') > 250)
|
||||||
{
|
{
|
||||||
$is_keyword = mb_substr($is_keyword, 0, 250);
|
$is_keyword = mb_substr($is_keyword, 0, 250);
|
||||||
|
|
|
||||||
|
|
@ -1674,13 +1674,19 @@ class menuAdminController extends menu
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$exposure = explode(',', $exposure);
|
if(is_array($exposure))
|
||||||
|
{
|
||||||
|
$exposure = implode(',', $exposure);
|
||||||
|
}
|
||||||
|
|
||||||
if(in_array($exposure, array('-1','-3')))
|
if(in_array($exposure, array('-1','-3')))
|
||||||
{
|
{
|
||||||
$args->group_srls = $exposure;
|
$args->group_srls = $exposure;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if($exposure) $args->group_srls = implode(',', $exposure);
|
{
|
||||||
|
$args->group_srls = implode(',', array_map('intval', explode(',', $exposure)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = $this->_updateMenuItem($args);
|
$output = $this->_updateMenuItem($args);
|
||||||
|
|
@ -1929,8 +1935,6 @@ class menuAdminController extends menu
|
||||||
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn);
|
if($active_btn && strncasecmp('./files/attach/menu_button', $active_btn, 26) === 0) $active_btn = escape($active_btn);
|
||||||
else $active_btn = '';
|
else $active_btn = '';
|
||||||
|
|
||||||
$group_srls = ($node->group_srls) ? $node->group_srls : '';
|
|
||||||
|
|
||||||
if($normal_btn)
|
if($normal_btn)
|
||||||
{
|
{
|
||||||
if($hover_btn) $hover_str = sprintf('onmouseover="this.src=\'%s\'"', $hover_btn); else $hover_str = '';
|
if($hover_btn) $hover_str = sprintf('onmouseover="this.src=\'%s\'"', $hover_btn); else $hover_str = '';
|
||||||
|
|
@ -1943,8 +1947,9 @@ class menuAdminController extends menu
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the value of node->group_srls exists
|
// If the value of node->group_srls exists
|
||||||
if($group_srls) {
|
if($node->group_srls) {
|
||||||
$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
|
$group_srls_exported = json_encode(array_values(is_array($node->group_srls) ? $node->group_srls : array_map('intval', explode(',', $node->group_srls))));
|
||||||
|
$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, %s)))||($is_logged&&%s))', $group_srls_exported, $node->group_srls == '-1' ? 1 : 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2035,8 +2040,15 @@ class menuAdminController extends menu
|
||||||
if($node->url) $child_output['url_list'][] = $node->url;
|
if($node->url) $child_output['url_list'][] = $node->url;
|
||||||
$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
|
$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
|
||||||
// If node->group_srls value exists
|
// If node->group_srls value exists
|
||||||
if($node->group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged && %s))',$node->group_srls,$node->group_srls == -1?1:0);
|
if($node->group_srls)
|
||||||
else $group_check_code = "true";
|
{
|
||||||
|
$group_srls_exported = json_encode(array_values(is_array($node->group_srls) ? $node->group_srls : array_map('intval', explode(',', $node->group_srls))));
|
||||||
|
$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, %s)))||($is_logged && %s))', $group_srls_exported, $node->group_srls == '-1' ? 1 : 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$group_check_code = 'true';
|
||||||
|
}
|
||||||
|
|
||||||
// List variables
|
// List variables
|
||||||
$href = escape($node->href ?? '', false);
|
$href = escape($node->href ?? '', false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue