Skip to content

Commit 4801bdc

Browse files
author
nifeng
committed
Merge branch 'release/7.3.8' into 'master'
Release/7.3.8 See merge request !3703
2 parents ce6f434 + 41c98ee commit 4801bdc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+230
-232
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
CHANGELOG
22
=========
3+
7.3.8(2016-12-23)
4+
新增:移动端接口支持
5+
36
7.3.7 (2016-12-22)
47
新增:后台订单新增手机号、邮箱检索
58
新增:班级添加课程,新增翻页

api/src/Topxia/Api/Filter/UserFilter.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
namespace Topxia\Api\Filter;
4+
use Codeages\PluginBundle\System\PluginConfigurationManager;
45
use Topxia\Service\Common\ServiceKernel;
5-
use Topxia\Common\PluginToolkit;
66

77
class UserFilter implements Filter
88
{
@@ -24,7 +24,7 @@ public function filter(array &$data)
2424
unset($data['verifiedMobile']);
2525
}
2626

27-
if (PluginToolkit::isPluginInstalled('Vip')) {
27+
if ($this->isPluginInstalled('Vip')) {
2828
$userVip = $this->getVipService()->getMemberByUserId($data['id']);
2929

3030
if (!empty($userVip)) {
@@ -147,6 +147,12 @@ public function convertAbsoluteUrl($host, $html)
147147

148148
}
149149

150+
protected function isPluginInstalled($code)
151+
{
152+
$pluginManager = new PluginConfigurationManager(ServiceKernel::instance()->getParameter('kernel.root_dir'));
153+
return $pluginManager->isPluginInstalled($code);
154+
}
155+
150156
protected function getVipLevelService()
151157
{
152158
return ServiceKernel::instance()->createService('Vip:Vip.LevelService');

api/src/Topxia/Api/Resource/BaseResource.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function getFileUrl($path)
177177
if (empty($path)) {
178178
return '';
179179
}
180-
if (strpos($path, "http://") !== false) {
180+
if (strpos($path, $this->getHttpHost()."://") !== false) {
181181
return $path;
182182
}
183183
$path = str_replace('public://', '', $path);
@@ -198,7 +198,16 @@ protected function getAssetUrl($path)
198198

199199
protected function getHttpHost()
200200
{
201-
return "http://{$_SERVER['HTTP_HOST']}";
201+
return $this->getSchema()."://{$_SERVER['HTTP_HOST']}";
202+
}
203+
204+
protected function getSchema()
205+
{
206+
$https = $_SERVER['HTTPS'];
207+
if(!empty($https) && 'off' !== strtolower($https)) {
208+
return 'https';
209+
}
210+
return 'http';
202211
}
203212

204213
protected function generateUrl($route, $parameters = array())

app/config/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ framework:
2525
fragments: ~
2626
http_method_override: true
2727
assets:
28-
version: '7.3.7'
28+
version: '7.3.8'
2929

3030
# Twig Configuration
3131
twig:
@@ -68,10 +68,13 @@ parameters:
6868
topxia.upload.public_directory: "%kernel.root_dir%/../web/files"
6969
topxia.upload.public_url_path: "/files"
7070
topxia.upload.private_directory: "%kernel.root_dir%/data/private_files"
71-
templating.asset.path_package.class: Topxia\WebBundle\Twig\Asset\PathPackage
7271

7372
services:
7473

74+
assets.path_package:
75+
class: Topxia\WebBundle\Twig\Asset\PathPackage
76+
arguments: ["", "", "@assets.context"]
77+
7578
app.locale_listener:
7679
class: Topxia\WebBundle\Listener\LocaleListener
7780
arguments: ['%kernel.default_locale%']

src/MaterialLib/Service/MaterialLib/Impl/MaterialLibServiceImpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public function getByGlobalId($globalId)
1919
return $this->getUploadFileService()->getFileByGlobalId($globalId);
2020
}
2121

22-
public function player($globalId)
22+
public function player($globalId, $ssl = false)
2323
{
24-
return $this->getCloudFileService()->player($globalId);
24+
return $this->getCloudFileService()->player($globalId, $ssl);
2525
}
2626

2727
public function edit($fileId, $fields)

src/MaterialLib/Service/MaterialLib/MaterialLibService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getDefaultHumbnails($globalId);
2828

2929
public function getThumbnail($globalId, $options);
3030

31-
public function player($globalId);
31+
public function player($globalId, $ssl = false);
3232

3333
public function synData();
3434

src/Topxia/AdminBundle/Resources/public/js/controller/user/edit-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ define(function(require, exports, module) {
6060
validator.addItem({
6161
element: '[name="site"]',
6262
rule: 'url',
63-
errormessageUrl: Translator.trans('网站地址不正确,须以http://开头。')
63+
errormessageUrl: Translator.trans('网站地址不正确,须以http://或https://开头。')
6464
});
6565

6666
validator.addItem({

src/Topxia/AdminBundle/Resources/translations/messages.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ Key生成失败,请检查服务器网络后,重试!: 'Key created failed,p
18171817
'新用户添加失败': 'New user add failed'
18181818
用户信息保存成功: 'User information saved successfully'
18191819
'网站地址不正确,须以http://weibo.com开头。': 'The website address is not correct which should starts with http://weibo.com.'
1820-
'网站地址不正确,须以http://开头。': 'The website address is not correct which should starts with http://.'
1820+
'网站地址不正确,须以http://或者https://开头。': 'The website address is not correct which should starts with http://.'
18211821
'已经导入:%progressNum%': '%progressNum% already imported'
18221822
'%data%完成': '%data% completed'
18231823
真的要%title%吗?: 'Are you sure want %title%?'

src/Topxia/AdminBundle/Resources/views/Block/Tag/imglink.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="form-group">
2020
<label class="control-label col-md-3 col-xs-3" for="data[{{ code }}][{{ dataId }}][href]">{{'图片链接'|trans}}</label>
2121
<div class="col-md-8 col-xs-8">
22-
<input class="form-control" type="text" name="data[{{ code }}][{{ dataId }}][href]" id="data[{{ code }}][{{ dataId }}][href]" value="{{ data.href|default('') }}" placeholder="http://">
22+
<input class="form-control" type="text" name="data[{{ code }}][{{ dataId }}][href]" id="data[{{ code }}][{{ dataId }}][href]" value="{{ data.href|default('') }}" placeholder="{{ app.request.getScheme() }}://">
2323
</div>
2424
</div>
2525

src/Topxia/AdminBundle/Resources/views/Block/Tag/link.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="form-group">
88
<label class="control-label col-md-3 col-xs-3" for="data[{{ code }}][{{ dataId }}][href]">{{'链接地址'|trans}}</label>
99
<div class="col-md-9 col-xs-9">
10-
<input class="form-control" type="text" name="data[{{ code }}][{{ dataId }}][href]" value="{{ data.href|default('') }}" placeholder="http://" >
10+
<input class="form-control" type="text" name="data[{{ code }}][{{ dataId }}][href]" value="{{ data.href|default('') }}" placeholder="{{ app.request.getScheme() }}://" >
1111
</div>
1212
</div>
1313
<div class="form-group">

0 commit comments

Comments
 (0)