* [story #131253, done] refactor api-struct page for docApp.
This commit is contained in:
@@ -39,9 +39,11 @@ $config->api->dtable->struct->fieldList['actions']['fixed'] = 'right';
|
||||
$config->api->dtable->struct->fieldList['actions']['name'] = 'actions';
|
||||
$config->api->dtable->struct->fieldList['actions']['menu'] = array('editStruct', 'deleteStruct');
|
||||
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['icon'] = 'edit';
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['hint'] = $lang->api->editStruct;
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['url'] = helper::createLink('api', 'editStruct', 'lib={lib}&id={id}');
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['icon'] = 'edit';
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['hint'] = $lang->api->editStruct;
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['data-toggle'] = 'modal';
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['data-size'] = 'lg';
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['editStruct']['url'] = helper::createLink('api', 'editStruct', 'lib={lib}&id={id}');
|
||||
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['deleteStruct']['icon'] = 'trash';
|
||||
$config->api->dtable->struct->fieldList['actions']['list']['deleteStruct']['hint'] = $lang->api->deleteStruct;
|
||||
|
||||
@@ -342,7 +342,7 @@ class api extends control
|
||||
$this->api->createStruct($formData);
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID=$libID")));
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID=$libID"), 'docApp' => array('executeCommand', 'loadLazyContent', array('.api-struct-list'))));
|
||||
}
|
||||
|
||||
$options = array();
|
||||
@@ -380,7 +380,7 @@ class api extends control
|
||||
$this->api->updateStruct($formData);
|
||||
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID={$struct->lib}")));
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID={$struct->lib}"), 'docApp' => array('executeCommand', 'loadLazyContent', array('.api-struct-list'))));
|
||||
}
|
||||
|
||||
$options = array();
|
||||
@@ -409,7 +409,7 @@ class api extends control
|
||||
$this->api->delete(TABLE_APISTRUCT, $structID);
|
||||
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
return $this->sendSuccess(array('load' => inlink('struct', "libID=$libID")));
|
||||
return $this->sendSuccess(array('load' => inlink('struct', "libID=$libID"), 'docApp' => array('executeCommand', 'loadLazyContent', array('.api-struct-list'))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#featureBar .divider {color: #D9D9D9;float: left; height: 20px; margin: 4px 15px 4px 8px; border-left: 1px solid rgba(0,0,0,.1);}
|
||||
|
||||
@@ -10,35 +10,20 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
featureBar
|
||||
(
|
||||
li(backBtn(setClass('ghost'), set::icon('back'), $lang->goback)),
|
||||
div(setClass('divider')),
|
||||
li
|
||||
(
|
||||
set::className('nav-item'),
|
||||
$lang->struct->list
|
||||
)
|
||||
);
|
||||
|
||||
toolbar
|
||||
(
|
||||
hasPriv('api', 'createStruct') ? item(set(array
|
||||
(
|
||||
'icon' => 'plus',
|
||||
'text' => $lang->api->createStruct,
|
||||
'class' => 'primary',
|
||||
'url' => createLink('api', 'createStruct', "libID=$libID"),
|
||||
))) : null
|
||||
);
|
||||
|
||||
$structs = initTableData($structs, $config->api->dtable->struct->fieldList, $this->api);
|
||||
$cols = array_values($config->api->dtable->struct->fieldList);
|
||||
$data = array_values($structs);
|
||||
dtable
|
||||
|
||||
div
|
||||
(
|
||||
set::cols($cols),
|
||||
set::data($data),
|
||||
set::userMap($users),
|
||||
set::footPager(usePager())
|
||||
dtable
|
||||
(
|
||||
set::_className(''),
|
||||
set::cols($cols),
|
||||
set::data($data),
|
||||
set::userMap($users),
|
||||
set::footPager(usePager()),
|
||||
set::loadPartial(),
|
||||
set::loadOptions(array('zui-command' => 'updateLazyContent', 'data-lazy-target' => '#table-api-struct'))
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user