* code for task#1541.
This commit is contained in:
@@ -4,6 +4,7 @@ $lang->editor->api = 'API';
|
||||
$lang->editor->index = 'Index';
|
||||
$lang->editor->newMethod = 'New method';
|
||||
$lang->editor->extend = 'Extend';
|
||||
$lang->editor->api = 'API';
|
||||
$lang->editor->newLang = 'New language';
|
||||
$lang->editor->newConfig = 'New config';
|
||||
$lang->editor->newHook = 'New hook';
|
||||
|
||||
@@ -4,6 +4,7 @@ $lang->editor->api = 'API';
|
||||
$lang->editor->index = '首页';
|
||||
$lang->editor->newMethod = '新增方法';
|
||||
$lang->editor->extend = '扩展';
|
||||
$lang->editor->api = 'API';
|
||||
$lang->editor->newLang = '新增语言';
|
||||
$lang->editor->newConfig = '新增配置';
|
||||
$lang->editor->newHook = '新增钩子';
|
||||
|
||||
+18
-2
@@ -334,9 +334,11 @@ class editorModel extends model
|
||||
$parentDir = basename(dirname($filePath));
|
||||
$action = 'extendOther';
|
||||
if($parentDir == 'control.php') $action = 'extendControl';
|
||||
if($parentDir == 'model.php') $action = 'extendModel';
|
||||
if($parentDir == 'model.php') $action = 'extendModel';
|
||||
|
||||
$tree .= "$file " . html::a($this->getExtendLink($filePath, $action), $this->lang->editor->extend, 'editWin');
|
||||
if($parentDir == 'lang') $tree .= html::a($this->getExtendLink($filePath, "new" . str_replace('-', '_', basename($filePath, '.php'))), $this->lang->editor->newLang, 'editWin');
|
||||
if($action != 'extendOther') $tree .= html::a($this->getAPILink($filePath, $action), $this->lang->editor->api, 'editWin');
|
||||
if($parentDir == 'lang') $tree .= html::a($this->getExtendLink($filePath, "new" . str_replace('-', '_', basename($filePath, '.php'))), $this->lang->editor->newLang, 'editWin');
|
||||
if(basename($filePath) == 'config.php') $tree .= html::a($this->getExtendLink($filePath, "newConfig"), $this->lang->editor->newConfig, 'editWin');
|
||||
}
|
||||
return $tree;
|
||||
@@ -356,6 +358,20 @@ class editorModel extends model
|
||||
return inlink('edit', "filePath=" . helper::safe64Encode($filePath) . "&action=$action&isExtends=$isExtends");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get api link.
|
||||
*
|
||||
* @param int $filePath
|
||||
* @param int $action
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getAPILink($filePath, $action)
|
||||
{
|
||||
return helper::createLink('api', 'view', "filePath=" . helper::safe64Encode($filePath) . "&action=$action");
|
||||
}
|
||||
|
||||
/**
|
||||
* Save file to extension.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user