fix all level 1 and 3 bugs.
This commit is contained in:
+37
-15
@@ -32,16 +32,6 @@ class api extends control
|
||||
*/
|
||||
public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0)
|
||||
{
|
||||
/* Get all api doc libraries. */
|
||||
$libs = $this->doc->getApiLibs();
|
||||
|
||||
/* Generate bread crumbs dropMenu. */
|
||||
if($libs)
|
||||
{
|
||||
if($libID == 0) $libID = key($libs);
|
||||
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID, $release);
|
||||
}
|
||||
$this->setMenu($libID);
|
||||
|
||||
/* Get an api doc. */
|
||||
if($apiID > 0)
|
||||
@@ -67,9 +57,20 @@ class api extends control
|
||||
$this->view->apiList = $apiList;
|
||||
}
|
||||
|
||||
/* Get all api doc libraries. */
|
||||
$libs = $this->doc->getApiLibs();
|
||||
|
||||
/* Generate bread crumbs dropMenu. */
|
||||
if($libs)
|
||||
{
|
||||
if($libID == 0) $libID = key($libs);
|
||||
$this->lang->modulePageNav = $this->generateLibsDropMenu($libs, $libID, $release);
|
||||
}
|
||||
$this->setMenu($libID);
|
||||
|
||||
$this->view->isRelease = $release > 0;
|
||||
$this->view->release = $release;
|
||||
$this->view->title = $this->lang->api->title;
|
||||
$this->view->title = $this->lang->api->pageTitle;
|
||||
$this->view->libID = $libID;
|
||||
$this->view->apiID = $apiID;
|
||||
$this->view->libs = $libs;
|
||||
@@ -208,6 +209,7 @@ class api extends control
|
||||
$userId = $this->app->user->account;
|
||||
$data = fixer::input('post')
|
||||
->add('lib', $libID)
|
||||
->skipSpecial('attribute')
|
||||
->add('addedBy', $userId)
|
||||
->add('addedDate', $now)
|
||||
->add('editedBy', $userId)
|
||||
@@ -219,7 +221,7 @@ class api extends control
|
||||
$this->action->create('apistruct', $id, 'Created');
|
||||
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'editStruct', "libID=$libID&structID=$id")));
|
||||
return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID=$libID")));
|
||||
}
|
||||
|
||||
$options = array();
|
||||
@@ -229,6 +231,7 @@ class api extends control
|
||||
}
|
||||
$this->view->typeOptions = $options;
|
||||
$this->view->title = $this->lang->api->createStruct;
|
||||
$this->view->gobackLink = $this->createLink('api', 'struct', "libID=$libID");
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -251,6 +254,7 @@ class api extends control
|
||||
$now = helper::now();
|
||||
$userId = $this->app->user->account;
|
||||
$data = fixer::input('post')
|
||||
->skipSpecial('attribute')
|
||||
->add('lib', $struct->lib)
|
||||
->add('editedBy', $userId)
|
||||
->add('editedDate', $now)
|
||||
@@ -381,7 +385,7 @@ class api extends control
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->doc->confirmDeleteLib, $this->createLink('api', 'deleteLib', "libID=$libID&confirm=yes")));
|
||||
die(js::confirm($this->lang->api->confirmDeleteLib, $this->createLink('api', 'deleteLib', "libID=$libID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -413,6 +417,7 @@ class api extends control
|
||||
$userId = $this->app->user->account;
|
||||
$params = fixer::input('post')
|
||||
->remove('type')
|
||||
->skipSpecial('params,response')
|
||||
->add('addedBy', $userId)
|
||||
->add('addedDate', $now)
|
||||
->add('editedBy', $userId)
|
||||
@@ -447,6 +452,7 @@ class api extends control
|
||||
$options[] = array('label' => $item, 'value' => $key);
|
||||
}
|
||||
$this->view->typeOptions = $options;
|
||||
$this->view->gobackLink = $this->createLink('api', 'index', "libID={$api->lib}&moduleID={$api->module}");
|
||||
$this->view->user = $this->app->user->account;
|
||||
$this->view->allUsers = $this->loadModel('user')->getPairs('devfirst|noclosed');;
|
||||
$this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($api->lib, 'api', $startModuleID = 0);
|
||||
@@ -472,6 +478,7 @@ class api extends control
|
||||
$now = helper::now();
|
||||
$params = fixer::input('post')
|
||||
->remove('type')
|
||||
->skipSpecial('params,response')
|
||||
->add('addedBy', $this->app->user->account)
|
||||
->add('addedDate', $now)
|
||||
->add('editedBy', $this->app->user->account)
|
||||
@@ -499,6 +506,7 @@ class api extends control
|
||||
$example = json_encode($example, JSON_PRETTY_PRINT);
|
||||
|
||||
$this->getTypeOptions($libID);
|
||||
$this->view->gobackLink = $this->createLink('api', 'index', "libID=$libID&moduleID=$moduleID");
|
||||
$this->view->user = $this->app->user->account;
|
||||
$this->view->allUsers = $this->loadModel('user')->getPairs('devfirst|noclosed');
|
||||
$this->view->libID = $libID;
|
||||
@@ -593,6 +601,21 @@ class api extends control
|
||||
$this->sendSuccess(array('info' => $info));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get all child module.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetChild($libID, $type = 'module')
|
||||
{
|
||||
$this->loadModel('tree');
|
||||
$childModules = $this->tree->getOptionMenu($libID, 'api');
|
||||
$select = ($type == 'module') ? html::select('module', $childModules, '', "class='form-control chosen'") : html::select('parent', $childModules, '', "class='form-control chosen'");
|
||||
die($select);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set doc menu by method name.
|
||||
*
|
||||
@@ -600,8 +623,7 @@ class api extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
private
|
||||
function setMenu($libID = 0)
|
||||
private function setMenu($libID = 0)
|
||||
{
|
||||
common::setMenuVars('doc', $libID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user