#904 autoinstall without ftp, change some UI

This commit is contained in:
akasima 2014-08-21 16:20:38 +09:00 committed by bnu
parent ab48d7cc63
commit e95bf4a64a
5 changed files with 76 additions and 58 deletions

View file

@ -316,7 +316,7 @@ class autoinstallAdminModel extends autoinstall
} }
} }
$installedPackage = $oModel->getInstalledPackage($package_srl); $installedPackage = $oModel->getInstalledPackage($packageSrl);
if($installedPackage) if($installedPackage)
{ {
$package->installed = TRUE; $package->installed = TRUE;
@ -386,7 +386,7 @@ class autoinstallAdminModel extends autoinstall
while($path_list) while($path_list)
{ {
$check_path = $real_path . implode('/', $path_list); $check_path = realpath($real_path . implode('/', $path_list));
if(FileHandler::isDir($check_path)) if(FileHandler::isDir($check_path))
{ {
break; break;

View file

@ -369,6 +369,10 @@ class autoinstallAdminView extends autoinstall
} }
$output = $oAdminModel->checkUseDirectModuleInstall($package); $output = $oAdminModel->checkUseDirectModuleInstall($package);
if($output->toBool()==TRUE)
{
Context::set('show_ftp_note', FALSE);
}
Context::set('directModuleInstall', $output); Context::set('directModuleInstall', $output);
$this->setTemplateFile('install'); $this->setTemplateFile('install');
@ -534,6 +538,10 @@ class autoinstallAdminView extends autoinstall
} }
$output = $oAdminModel->checkUseDirectModuleInstall($installedPackage); $output = $oAdminModel->checkUseDirectModuleInstall($installedPackage);
if($output->toBool()==TRUE)
{
Context::set('show_ftp_note', FALSE);
}
Context::set('directModuleInstall', $output); Context::set('directModuleInstall', $output);
$params["act"] = "getResourceapiPackages"; $params["act"] = "getResourceapiPackages";

View file

@ -9,6 +9,7 @@
<div cond="$XE_VALIDATOR_MESSAGE && isset($from_id[$XE_VALIDATOR_ID])" class="message {$XE_VALIDATOR_MESSAGE_TYPE}"> <div cond="$XE_VALIDATOR_MESSAGE && isset($from_id[$XE_VALIDATOR_ID])" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p> <p>{$XE_VALIDATOR_MESSAGE}</p>
</div> </div>
<!--
<form action="" method="post"> <form action="" method="post">
<input type="hidden" name="module" value="autoinstall" /> <input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUpdateinfo" /> <input type="hidden" name="act" value="procAutoinstallAdminUpdateinfo" />
@ -22,4 +23,5 @@
{sprintf($lang->description_update, $btnUpdate)} {sprintf($lang->description_update, $btnUpdate)}
</p> </p>
</form> </form>
-->
<include target="list.html" /> <include target="list.html" />

View file

@ -6,30 +6,37 @@
<h4>{$lang->msg_update_core_title}</h4> <h4>{$lang->msg_update_core_title}</h4>
<p>{$lang->msg_update_core}</p> <p>{$lang->msg_update_core}</p>
</div> </div>
<div class="x_well"> <div cond="$package->installed" class="x_well">
<p cond="$package->installed">{$lang->current_version}: {$package->cur_version} <block cond="$package->need_update">({$lang->require_update})</block></p> <p>{$lang->current_version}: {$package->cur_version} <block cond="$package->need_update">({$lang->require_update})</block></p>
<p cond="!$package->installed">{$lang->require_installation}</p> </div>
<block cond="$package->depends"> <div cond="$package->depends && (!$package->installed || $package->need_update)" class="x_well">
<p>{$lang->about_depending_programs}</p> <p>{$lang->about_depending_programs}</p>
<ul> <p>{$lang->description_install}</p>
<li loop="$package->depends => $dep"> <ul>
{$dep->title} ver. {$dep->version} - <li loop="$package->depends => $dep">
<block cond="$dep->installed">{$lang->current_version}: {$dep->cur_version} <block cond="$dep->need_update">({$lang->require_update})</block></block> {$dep->title} ver. {$dep->version} -
<block cond="!$dep->installed">{$lang->require_installation}</block> <block cond="$dep->installed">{$lang->current_version}: {$dep->cur_version} <block cond="$dep->need_update">({$lang->require_update})</block></block>
<block cond="$show_ftp_note && ($dep->need_update || !$dep->installed)"> <block cond="!$dep->installed">{$lang->require_installation}</block>
<a href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$dep->package_srl}">{$lang->cmd_download}</a> ({$lang->path}: {$dep->path}) <block cond="$show_ftp_note && ($dep->need_update || !$dep->installed)">
</block> <a href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$dep->package_srl}">{$lang->cmd_download}</a> ({$lang->path}: {$dep->path})
</li> </block>
</ul> </li>
<p>{$lang->description_install}</p> </ul>
</block>
</div> </div>
<block cond="!$package->installed || $package->need_update"> <block cond="!$package->installed || $package->need_update">
<div cond="$show_ftp_note" class="x_well x_clearfix"> <div cond="!$directModuleInstall->toBool() || $show_ftp_note" class="x_well x_clearfix">
<p>{$lang->description_download}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p> <block cond="!$directModuleInstall->toBool()">
<p>{$lang->path}: {$package->path}</p> <p>{$lang->msg_direct_install_not_supported}</p>
<p><a class="x_btn x_btn-primary x_pull-right" href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$package->package_srl}">{$lang->cmd_download}</a> <ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<block cond="$show_ftp_note" >
<p>{$lang->description_download}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
<p>{$lang->path}: {$package->path}</p>
<p><a class="x_btn x_btn-primary x_pull-right" href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$package->package_srl}">{$lang->cmd_download}</a>
</block>
</div> </div>
<div cond="!$show_ftp_note"> <div cond="!$show_ftp_note">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/install/1'" class="message error"> <div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/install/1'" class="message error">
@ -52,12 +59,6 @@
</div> </div>
</div> </div>
</block> </block>
<block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p>
<ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul>
</block>
<div class="x_clearfix btnArea"> <div class="x_clearfix btnArea">
<div class="x_pull-right"> <div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$package->installed?$lang->update:$lang->install}" /> <input class="x_btn x_btn-primary" type="submit" value="{$package->installed?$lang->update:$lang->install}" />

View file

@ -8,48 +8,55 @@
<div class="x_alert x_alert-block"> <div class="x_alert x_alert-block">
<p>{$lang->description_uninstall}</p> <p>{$lang->description_uninstall}</p>
</div> </div>
<div class="x_well x_clearfix">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message error">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" class="x_form-horizontal" method="post" ruleset="ftp">
<input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUninstallPackage" />
<input type="hidden" name="package_srl" value="{$package_srl}" />
<input type="hidden" name="return_url" value="{$return_url}" />
<input cond="!$need_password || $directModuleInstall->toBool()" type="hidden" name="ftp_password" value="dummy" />
<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/uninstall/1" />
<block cond="$need_password && !$directModuleInstall->toBool()">
<div class="x_control-group">
<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
<div class="x_controls">
<input type="password" name="ftp_password" id="ftp_password" value="" />
<span class="x_help-block">{$lang->about_ftp_password}</span>
</div>
</div>
</block>
<block cond="!$directModuleInstall->toBool()"> <block cond="!$directModuleInstall->toBool()">
<p>{$lang->msg_direct_install_not_supported}</p> <p>{$lang->msg_direct_install_not_supported}</p>
<ul> <ul>
<li loop="$directModuleInstall->get('path') => $path">{$path}</li> <li loop="$directModuleInstall->get('path') => $path">{$path}</li>
</ul> </ul>
</block> </block>
<div class="x_clearfix btnArea"> <block cond="$show_ftp_note">
<div class="x_pull-right"> <p>{$lang->ftp_form_title}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_delete}" /> </block>
</div> </div>
<div cond="!$show_ftp_note">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message error">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div> </div>
</form> <form action="./" class="x_form-horizontal" method="post" ruleset="ftp">
<input type="hidden" name="module" value="autoinstall" />
<input type="hidden" name="act" value="procAutoinstallAdminUninstallPackage" />
<input type="hidden" name="package_srl" value="{$package_srl}" />
<input type="hidden" name="return_url" value="{$return_url}" />
<input cond="!$need_password || $directModuleInstall->toBool()" type="hidden" name="ftp_password" value="dummy" />
<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/uninstall/1" />
<block cond="$need_password && !$directModuleInstall->toBool()">
<div class="x_control-group">
<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
<div class="x_controls">
<input type="password" name="ftp_password" id="ftp_password" value="" />
<span class="x_help-block">{$lang->about_ftp_password}</span>
</div>
</div>
</block>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_delete}" />
</div>
</div>
</form>
</div>
</block> </block>
<block cond="!$package->avail_remove"> <block cond="!$package->avail_remove">
<div class="x_alert x_alert-error"> <div class="x_alert x_alert-error">
<p cond="$package->deps">{$lang->msg_dependency_package}</p> <p cond="$package->deps">{$lang->msg_dependency_package}</p>
<p cond="!$package->deps">{$lang->msg_does_not_support_delete}</p> <p cond="!$package->deps">{$lang->msg_does_not_support_delete}</p>
</div> </div>
<div class="x_well"> <div cond="$package->deps" class="x_well">
<p cond="$package->deps">{$lang->dependant_list}:</p> <p>{$lang->dependant_list}:</p>
<ul cond="$package->deps"> <ul>
<li loop="$package->deps => $dep_package_srl">{$installed[$dep_package_srl]->title}</li> <li loop="$package->deps => $dep_package_srl">{$installed[$dep_package_srl]->title}</li>
</ul> </ul>
</div> </div>