* Fix error of comment.

This commit is contained in:
zhaoke
2023-08-01 17:49:52 +08:00
parent 69c6c9285d
commit c64e004f13
5 changed files with 85 additions and 3 deletions
+2
View File
@@ -92,3 +92,5 @@ $config->trash->search['params']['objectName'] = array('operator' => 'include',
$config->trash->search['params']['objectID'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->trash->search['params']['actor'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->trash->search['params']['date'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->action->newPageModule = array('repo', 'mr', 'host', 'account', 'serverroom', 'instance', 'store', 'space', 'host');
+4
View File
@@ -347,6 +347,10 @@ class action extends control
{
return $this->send(array('status' => 'success', 'data' => $actionID));
}
elseif(in_array($objectType, $this->config->action->newPageModule))
{
return $this->send(array('status' => 'success', 'closeModal' => true, 'load' => true));
}
else
{
echo js::reload('parent');
+70
View File
@@ -3667,6 +3667,76 @@ EOF;
return static::apiError($result);
}
/**
* Post method of API.
*
* @param string $url
* @param array|object $data
* @param array $headers example: array("key1:value1", "key2:value2")
* @access public
* @return object
*/
public static function apiPost($url, $data, $headers = array())
{
$result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'POST'), $headers, 'json'));
if($result && $result->code == 200) return $result;
return static::apiError($result);
}
/**
* Put method of API.
*
* @param string $url
* @param array|object $data
* @param array $headers example: array("key1:value1", "key2:value2")
* @access public
* @return object
*/
public static function apiPut($url, $data, $headers = array())
{
$result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'PUT'), $headers, 'json'));
if($result && $result->code == 200) return $result;
return static::apiError($result);
}
/**
* Delete method of API.
*
* @param string $url
* @param array|object $data
* @param array $headers example: array("key1:value1", "key2:value2")
* @access public
* @return object
*/
public static function apiDelete($url, $data, $headers = array())
{
$result = json_decode(commonModel::http($url, $data, array(CURLOPT_CUSTOMREQUEST => 'DELETE'), $headers, 'json'));
if($result && $result->code == 200) return $result;
return static::apiError($result);
}
/**
* Return error object of api server.
*
* @param object|null $result
* @access protected
* @return object
*/
protected static function apiError($result)
{
global $lang;
if($result && $result->code) return $result;
$error = new stdclass;
$error->code = 600;
$error->message = $lang->error->httpServerError;
return $error;
}
/**
* Check object priv.
*
+5 -1
View File
@@ -198,6 +198,10 @@ div
div
(
setClass('basis-auto'),
history()
history
(
set::commentBtn(true),
set::commentUrl(createLink('action', 'comment', array('objectType' => 'instance', 'objectID' => $instance->id))),
)
)
);
+4 -2
View File
@@ -52,9 +52,11 @@ class search extends control
$this->view->style = empty($style) ? 'full' : $style;
$this->view->onMenuBar = empty($onMenuBar) ? 'no' : $onMenuBar;
if(!in_array($module, array('repo', 'mr', 'host', 'account', 'serverroom', 'instance', 'store', 'space', 'host')))
$this->app->loadModuleConfig('action');
$_GET['zin'] = 0;
if(in_array($module, $this->config->action->newPageModule))
{
$_GET['zin'] = 0;
$_GET['zin'] = 1;
$this->view->formSession = $_SESSION[$module . 'Form'];
}
$this->display();