public function setUp() { date_default_timezone_set('America/New_York'); $assetHelper = new AssetHelper(dirname(__FILE__)); $this->xmlResponse = $assetHelper->getAsset(sprintf(self::RESPONSE_NAME, self::SERVICE)); $this->adWordsUser = new AdWordsUser($assetHelper->getAssetPath('auth.ini')); }
/** * Sets the configuration for the Asset Helper * * @param array $config key value pairs of configurations * - 'host' string: URL of the static asset host. eg: 'http://static.example.org' * - 'timestamp' boolean: Whether or not to automatically append the timestamp of * the files for cache-busting. * @return void */ public static function config(array $config) { self::$_config = array_merge(self::$_config, $config); }
Route::get('tags', 'Tags@view'); Route::post('tags', 'Tags@add'); Route::delete('tags/{tag}', 'Tags@remove'); Route::get('relations', 'Relations@index'); Route::post('relations/{related}', 'Relations@store'); Route::delete('relations/{related}', 'Relations@destroy'); Route::get('acl', 'Acl@index'); Route::put('acl', 'Acl@update'); Route::post('acl/{group}', 'Acl@store'); Route::delete('acl/{group}', 'Acl@destroy'); Route::get('', 'PageController@getIndex'); }); }); }); }); Route::group(['prefix' => 'asset'], function () { Route::get('version/{id}/{width?}/{height?}', ['as' => 'asset-version', 'middleware' => ['web', Middleware\RequireLogin::class], 'uses' => function ($versionId, $width = null, $height = null) { $asset = Asset::findByVersionId($versionId); return App::make(AssetHelper::controller($asset), [$asset])->view($width, $height); }]); Route::get('{asset}/download', ['asset' => 'asset-download', 'middleware' => [Middleware\LogAssetDownload::class], 'uses' => function ($asset) { return App::make(AssetHelper::controller($asset), [$asset])->download(); }]); Route::get('{asset}/{action}.{extension}', ['as' => 'asset', 'middleware' => [Middleware\CheckAssetETag::class], 'uses' => function ($asset, $action = 'view', $width = null, $height = null) { return App::make(AssetHelper::controller($asset), [$asset])->{$action}($width, $height); }])->where(['action' => '[a-z]+', 'extension' => '[a-z]+']); Route::get('{asset}/{action?}/{width?}/{height?}', ['as' => 'asset', 'middleware' => [Middleware\CheckAssetETag::class], 'uses' => function ($asset, $action = 'view', $width = null, $height = null) { return App::make(AssetHelper::controller($asset), [$asset])->{$action}($width, $height); }]); }); Route::any('{location}.{format?}', ['middleware' => ['web', Middleware\RoutePage::class, Middleware\CheckPageAcl::class, Middleware\InsertCMSToolbar::class], 'uses' => 'BoomCMS\\Http\\Controllers\\PageController@show'])->where(['location' => '(.*?)', 'format' => '([a-z]+)']);
<div> <h2><?php echo trans('boomcms::asset.search.type'); ?> </h2> <select id="b-assets-types" name="type"> <option value="0">Filter by type</option> <?php foreach (array_keys(AssetHelper::types()) as $type) { ?> <option value="<?php echo $type; ?> "<?php if (isset($selected) && $selected == $type) { ?> selected="selected"<?php } ?> > <?php echo trans('boomcms::asset.type.' . $type); ?> </option> <?php } ?> </select> </div>
public static function i($image, $attributes = array()) { $attributes['src'] = AssetHelper::image_path($image); $attributes += array('alt' => ''); return self::empty_tag('img', $attributes); }