코드 개선

This commit is contained in:
hanssem@forppl.com 2020-08-10 13:45:01 +09:00
parent 2ff0cea9c3
commit 52f317a429
3 changed files with 10 additions and 27 deletions

View file

@ -423,32 +423,15 @@ class autoinstallAdminModel extends autoinstall
public function getAutoInstallAdminModuleConfig()
{
$oModuleModel = getModel('module');
$module_info = $oModuleModel->getModuleConfig('autoinstall');
$config_info = $oModuleModel->getModuleConfig('autoinstall');
$_location_site = 'https://xe1.xpressengine.com/';
$_download_server = 'https://download.xpressengine.com/';
if($module_info->location_site && $module_info->download_server)
{
$location_site = $module_info->location_site;
$download_server = $module_info->download_server;
}
else
{
$args = new stdClass();
$args->location_site = $_location_site;
$args->download_server = $_download_server;
$oModuleController = getController('module');
$output = $oModuleController->updateModuleConfig('autoinstall', $args);
$location_site = $module_info->location_site;
$download_server = $module_info->download_server;
}
$obj = new stdClass();
$obj->location_site = $location_site ? $location_site : $_location_site;
$obj->download_server = $download_server ? $download_server : $_download_server;
$config = new stdClass();
$config->location_site = $config_info->location_site ? $config_info->location_site : $_location_site;
$config->download_server = $config_info->download_server ? $config_info->download_server : $_download_server;
return $obj;
return $config;
}
}

View file

@ -617,9 +617,9 @@ class autoinstallAdminView extends autoinstall
*/
function dispAutoinstallAdminConfig()
{
$oModuleModel = getModel('module');
$module_info = $oModuleModel->getModuleConfig('autoinstall');
Context::set('config', $module_info);
$oAdminModel = getAdminModel('autoinstall');
$config = $oAdminModel->getAutoInstallAdminModuleConfig();
Context::set('config', $config);
$this->setTemplateFile('config');
}
}

View file

@ -18,14 +18,14 @@
<div class="x_control-group">
<label class="x_control-label" for="location_site">{$lang->location_site}</label>
<div class="x_controls">
<input type="url" id="location_site" name="location_site" style="min-width:90%" value="{$config->location_site ? $config->location_site : 'https://xe1.xpressengine.com/'}" />
<input type="url" id="location_site" name="location_site" style="min-width:90%" value="{$config->location_site}" />
<p class="x_help-block">{$lang->about_location_site}</p>
</div>
</div>
<div class="x_control-group">
<label class="x_control-label" for="download_server">{$lang->download_server}</label>
<div class="x_controls">
<input type="url" id="download_server" name="download_server" style="min-width:90%" value="{$config->download_server ? $config->download_server : 'https://download.xpressengine.com/'}" />
<input type="url" id="download_server" name="download_server" style="min-width:90%" value="{$config->download_server}" />
<p class="x_help-block">{$lang->about_download_server}</p>
</div>
</div>