merger from branch luminous (~r11576)

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11580 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-10-04 05:04:23 +00:00
commit 51bb8d1985
91 changed files with 1157 additions and 703 deletions

View file

@ -70,6 +70,9 @@
$this->updateCategory($xmlDoc);
$this->updatePackages($xmlDoc);
$this->checkInstalled();
$oAdminController = &getAdminController('admin');
$output = $oAdminController->cleanFavorite();
}
/**

View file

@ -260,10 +260,23 @@
$res = array();
foreach($package_list as $package_srl => $package)
{
$res[] = $item_list[$package_srl];
if($item_list[$package_srl])
{
$res[] = $item_list[$package_srl];
}
}
Context::set('item_list', $res);
}
if(count($package_list) != count($res))
{
$localPackageSrls = array_keys($package_list);
$remotePackageSrls = array_keys($item_list);
$targetPackageSrls = array_diff($localPackageSrls, $remotePackageSrls);
$countDiff = count($targetPackageSrls);
$output->page_navigation->total_count -= $countDiff;
}
Context::set('page_navigation', $output->page_navigation);
$this->setTemplateFile('index');

View file

@ -150,11 +150,14 @@
$schema_dir = sprintf('%s/schemas/', $this->package->path);
$schema_files = FileHandler::readDir($schema_dir);
$oDB =& DB::getInstance();
foreach($schema_files as $file)
if(is_array($schema_files))
{
$filename_arr = explode(".", $file);
$filename = array_shift($filename_arr);
$oDB->dropTable($filename);
foreach($schema_files as $file)
{
$filename_arr = explode(".", $file);
$filename = array_shift($filename_arr);
$oDB->dropTable($filename);
}
}
return new Object();
}
@ -399,22 +402,25 @@
if(!$output->toBool()) return $output;
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
foreach($file_list as $k => $file){
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$pathname = dirname($target_dir."/".$file);
if(is_array($file_list))
{
foreach($file_list as $k => $file){
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$pathname = dirname($target_dir."/".$file);
if(!file_exists(FileHandler::getRealPath($real_path)))
{
ssh2_sftp_mkdir($this->sftp, $pathname, 0755, true);
}
if(!file_exists(FileHandler::getRealPath($real_path)))
{
ssh2_sftp_mkdir($this->sftp, $pathname, 0755, true);
}
ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file);
}
ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file);
}
}
return new Object();
}
}
@ -550,54 +556,57 @@
}
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
foreach($file_list as $k => $file){
if(!$file) continue;
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$path_list = explode('/', dirname($this->target_path."/".$file));
if(is_array($file_list))
{
foreach($file_list as $k => $file){
if(!$file) continue;
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$path_list = explode('/', dirname($this->target_path."/".$file));
$real_path = "./";
$ftp_path = $this->ftp_info->ftp_root_path;
$real_path = "./";
$ftp_path = $this->ftp_info->ftp_root_path;
for($i=0;$i<count($path_list);$i++)
{
if($path_list=="") continue;
$real_path .= $path_list[$i]."/";
$ftp_path .= $path_list[$i]."/";
if(!file_exists(FileHandler::getRealPath($real_path)))
{
if(!@ftp_mkdir($this->connection, $ftp_path))
{
return new Object(-1, "msg_make_directory_failed");
}
for($i=0;$i<count($path_list);$i++)
{
if($path_list=="") continue;
$real_path .= $path_list[$i]."/";
$ftp_path .= $path_list[$i]."/";
if(!file_exists(FileHandler::getRealPath($real_path)))
{
if(!@ftp_mkdir($this->connection, $ftp_path))
{
return new Object(-1, "msg_make_directory_failed");
}
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
{
if (function_exists('ftp_chmod')) {
if(!ftp_chmod($this->connection, 0755, $ftp_path))
{
return new Object(-1, "msg_permission_adjust_failed");
}
}
else
{
if(!ftp_site($this->connection, "CHMOD 755 ".$ftp_path))
{
return new Object(-1, "msg_permission_adjust_failed");
}
}
}
}
}
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
{
return new Object(-1, "msg_ftp_upload_failed");
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
{
if (function_exists('ftp_chmod')) {
if(!ftp_chmod($this->connection, 0755, $ftp_path))
{
return new Object(-1, "msg_permission_adjust_failed");
}
}
else
{
if(!ftp_site($this->connection, "CHMOD 755 ".$ftp_path))
{
return new Object(-1, "msg_permission_adjust_failed");
}
}
}
}
}
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
{
return new Object(-1, "msg_ftp_upload_failed");
}
}
}
}
$this->_close();
return new Object();
}
@ -718,31 +727,34 @@
$oFtp =& $this->oFtp;
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
foreach($file_list as $k => $file){
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$path_list = explode('/', dirname($this->target_path."/".$file));
if(is_array($file_list))
{
foreach($file_list as $k => $file){
$org_file = $file;
if($this->package->path == ".")
{
$file = substr($file,3);
}
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
$path_list = explode('/', dirname($this->target_path."/".$file));
$real_path = "./";
$ftp_path = $this->ftp_info->ftp_root_path;
$real_path = "./";
$ftp_path = $this->ftp_info->ftp_root_path;
for($i=0;$i<count($path_list);$i++)
{
if($path_list=="") continue;
$real_path .= $path_list[$i]."/";
$ftp_path .= $path_list[$i]."/";
if(!file_exists(FileHandler::getRealPath($real_path)))
{
$oFtp->ftp_mkdir($ftp_path);
$oFtp->ftp_site("CHMOD 755 ".$ftp_path);
}
}
$oFtp->ftp_put($target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file));
}
for($i=0;$i<count($path_list);$i++)
{
if($path_list=="") continue;
$real_path .= $path_list[$i]."/";
$ftp_path .= $path_list[$i]."/";
if(!file_exists(FileHandler::getRealPath($real_path)))
{
$oFtp->ftp_mkdir($ftp_path);
$oFtp->ftp_site("CHMOD 755 ".$ftp_path);
}
}
$oFtp->ftp_put($target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file));
}
}
$this->_close();

View file

@ -1,6 +1,6 @@
<include target="category.html" />
<div class="table even easyList">
<div class="table even easyList dsTg">
<table width="100%" border="1" cellspacing="0">
<caption>
<block cond="$current_category">{$current_category}</block>
@ -28,11 +28,12 @@
<a href="{getUrl('order_target','download','order_type',$_download_order_type)}">{$lang->order_download}<!--@if($order_target == 'download')--><!--@if($_download_order_type == 'asc')--><!--@else--><!--@end--><!--@end--></a> |
<a href="{getUrl('order_target','popular','order_type',$_popular_order_type)}">{$lang->order_popular}<!--@if($order_target == 'popular')--><!--@if($_popular_order_type == 'asc')--><!--@else--><!--@end--><!--@end--></a>
</span>
<span class="side"><button type="button" class="text"><span class="hide">{$lang->simple_view}</span><span class="show">{$lang->detail_view}</span></button></span>
</caption>
<thead>
<tr>
<th scope="col" class="nowr">{$lang->category}</th>
<th scope="col">{$lang->thumbnail}</th>
<th scope="col" class="thumb">{$lang->thumbnail}</th>
<th scope="col" class="title">{$lang->name}</th>
<th scope="col" class="nowr">{$lang->distribute_version}</th>
<th scope="col" class="nowr">{$lang->current_version}</th>
@ -43,7 +44,7 @@
<tr loop="$item_list => $key, $item">
{@ $target_url = $original_site."?mid=download&package_srl=".$item->package_srl; }
<td class="nowr">{$item->category}</td>
<td><img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" /></td>
<td class="thumb"><img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" /></td>
<td class="title">
<p><a href="{$target_url}">{htmlspecialchars($item->title)}</a></p>
<p>{cut_str(htmlspecialchars($item->package_description),200)}</p>