Fixes #856 - Implement a linking policy, defaults to relative
This commit is contained in:
parent
09532b6e36
commit
610ea932fc
|
|
@ -92,6 +92,7 @@ The following methods have changed:
|
|||
|
||||
### Things to do
|
||||
|
||||
- Remove "Cron" package, drop + create relevant tables
|
||||
- Implement registerSchedule() in PluginBase
|
||||
- Remove "Cron" package, test new "jobs" table
|
||||
- Test scheduler
|
||||
- Remove deprecated code
|
||||
- Fix unit tests
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php namespace Backend\Classes;
|
||||
|
||||
use URL;
|
||||
use Url;
|
||||
use Config;
|
||||
use Request;
|
||||
use October\Rain\Router\Helper as RouterHelper;
|
||||
|
|
@ -19,7 +19,7 @@ class BackendHelper
|
|||
public function url($path = null, $parameters = array(), $secure = null)
|
||||
{
|
||||
$backendUri = Config::get('cms.backendUri');
|
||||
return URL::to($backendUri . '/' . $path, $parameters, $secure);
|
||||
return Url::to($backendUri . '/' . $path, $parameters, $secure);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class BackendHelper
|
|||
public function skinAsset($path = null)
|
||||
{
|
||||
$skinPath = Skin::getActive()->getPath($path, true);
|
||||
return URL::asset($skinPath);
|
||||
return Url::asset($skinPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1046,14 +1046,14 @@ class Controller
|
|||
$themePath = Config::get('cms.themesDir').'/'.$this->getTheme()->getDirName();
|
||||
|
||||
if (is_array($url)) {
|
||||
$_url = Request::getBaseUrl();
|
||||
$_url .= CombineAssets::combine($url, $themePath);
|
||||
$_url = URL::to(CombineAssets::combine($url, $themePath));
|
||||
}
|
||||
else {
|
||||
$_url = Request::getBasePath().$themePath;
|
||||
$_url = $themePath;
|
||||
if ($url !== null) {
|
||||
$_url .= '/'.$url;
|
||||
}
|
||||
$_url = URL::asset($_url);
|
||||
}
|
||||
|
||||
return $_url;
|
||||
|
|
@ -1085,8 +1085,9 @@ class Controller
|
|||
}
|
||||
|
||||
foreach ($this->partialComponentStack as $componentInfo) {
|
||||
if ($componentInfo['name'] == $name)
|
||||
if ($componentInfo['name'] == $name) {
|
||||
return $componentInfo['obj'];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ class CombineAssets
|
|||
return URL::action($combineAction, [$outputFilename], false);
|
||||
}
|
||||
else {
|
||||
return Request::getBasePath().'/combine/'.$outputFilename;
|
||||
return '/combine/'.$outputFilename;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ return [
|
|||
'October\Rain\Database\DatabaseServiceProvider',
|
||||
'October\Rain\Filesystem\FilesystemServiceProvider',
|
||||
'October\Rain\Html\HtmlServiceProvider',
|
||||
'October\Rain\Html\UrlServiceProvider',
|
||||
'October\Rain\Network\NetworkServiceProvider',
|
||||
'October\Rain\Scaffold\ScaffoldServiceProvider',
|
||||
'October\Rain\Flash\FlashServiceProvider',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php namespace System\Traits;
|
||||
|
||||
use Url;
|
||||
use Html;
|
||||
use File;
|
||||
use Request;
|
||||
use System\Models\Parameters;
|
||||
use System\Models\PluginVersion;
|
||||
use SystemException;
|
||||
|
|
@ -271,7 +271,7 @@ trait AssetMaker
|
|||
}
|
||||
|
||||
if (substr($asset, 0, 1) == '/') {
|
||||
$asset = Request::getBasePath() . $asset;
|
||||
$asset = Url::asset($asset);
|
||||
}
|
||||
|
||||
return $asset;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class WidgetMakerTest extends TestCase
|
|||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$traitName = 'Backend\Traits\WidgetMaker';
|
||||
$this->traitObject = $this->getObjectForTrait($traitName);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue