Skip to content

Commit

Permalink
On demand resource publishing, pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 17, 2018
1 parent 3924a74 commit 942fec1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/base/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getTitle(): string
*/
public function getBodyHtml()
{
$url = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/cp/dist', true, 'images/prg.jpg');
$url = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/cp/dist', false, 'images/prg.jpg');

return <<<EOD
<div style="margin: 0 -24px -24px;">
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public function actionGetPluginLicenseInfo(): Response
$licenseInfo = Craft::$app->getApi()->getLicenseInfo(['plugins']);
$result = [];
if (!empty($licenseInfo['pluginLicenses'])) {
$defaultIconUrl = Craft::$app->getAssetManager()->getPublishedUrl('@app/icons/default-plugin.svg', true);
$defaultIconUrl = Craft::$app->getAssetManager()->getPublishedUrl('@app/icons/default-plugin.svg');
foreach ($licenseInfo['pluginLicenses'] as $pluginLicenseInfo) {
if (isset($pluginLicenseInfo['plugin'])) {
$pluginInfo = $pluginLicenseInfo['plugin'];
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function actionPreviewFile(): Response
$imageUrl = $asset->getUrl();
} else {
$source = $asset->getTransformSource();
$imageUrl = Craft::$app->getAssetManager()->getPublishedUrl($source, true);
$imageUrl = Craft::$app->getAssetManager()->getPublishedUrl($source);
}

$width = $asset->getWidth();
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/PluginStoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ public function actionCraftData(): Response
$data['CraftPro'] = Craft::Pro;

// Logos
$data['craftLogo'] = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/pluginstore/dist/', true, 'images/craft.svg');
$data['poweredByStripe'] = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/pluginstore/dist/', true, 'images/powered_by_stripe.svg');
$data['craftLogo'] = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/pluginstore/dist/', false, 'images/craft.svg');
$data['poweredByStripe'] = Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/pluginstore/dist/', false, 'images/powered_by_stripe.svg');

return $this->asJson($data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/elements/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ public function getThumbUrl(int $size)
return Craft::$app->getAssets()->getThumbUrl($photo, $size, $size, false);
}

return Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/cp/dist', true, 'images/user.svg');
return Craft::$app->getAssetManager()->getPublishedUrl('@app/web/assets/cp/dist', false, 'images/user.svg');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/services/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public function getThumbUrl(Asset $asset, int $width, int $height = null, bool $
// Publish the thumb directory (if necessary) and return the thumb's published URL
$dir = dirname($path);
$name = pathinfo($path, PATHINFO_BASENAME);
return Craft::$app->getAssetManager()->getPublishedUrl($dir, true, $name);
return Craft::$app->getAssetManager()->getPublishedUrl($dir, false, $name);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/web/twig/variables/Rebrand.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getImageVariable(string $type)
$path = $this->_getImagePath($type);

if ($path !== false) {
$url = Craft::$app->getAssetManager()->getPublishedUrl($path, true);
$url = Craft::$app->getAssetManager()->getPublishedUrl($path);
$this->_imageVariables[$type] = new Image($path, $url);
} else {
$this->_imageVariables[$type] = false;
Expand Down

0 comments on commit 942fec1

Please sign in to comment.