uawdijnntqw1x1x1
IP : 216.73.216.107
Hostname : toronto-dev2
Kernel : Linux toronto-dev2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
srv
/
users
/
craft4
/
apps
/
craft4-newsite-space
/
vendor
/
craftcms
/
.
/
.
/
cms
/
src
/
.
/
elements
/
actions
/
View.php
/
/
<?php /** * @link https://craftcms.com/ * @copyright Copyright (c) Pixel & Tonic, Inc. * @license https://craftcms.github.io/license/ */ namespace craft\elements\actions; use Craft; use craft\base\ElementAction; /** * View represents a View element action. * * @author Pixel & Tonic, Inc. <support@pixelandtonic.com> * @since 3.0.0 */ class View extends ElementAction { /** * @var string|null The trigger label */ public ?string $label = null; /** * @inheritdoc */ public function init(): void { if (!isset($this->label)) { $this->label = Craft::t('app', 'View'); } } /** * @inheritdoc */ public function getTriggerLabel(): string { return $this->label; } /** * @inheritdoc */ public function getTriggerHtml(): ?string { Craft::$app->getView()->registerJsWithVars(fn($type) => <<<JS (() => { new Craft.ElementActionTrigger({ type: $type, bulk: false, validateSelection: \$selectedItems => { const \$element = \$selectedItems.find('.element'); return ( \$element.data('url') && (\$element.data('status') === 'enabled' || \$element.data('status') === 'live') ); }, activate: \$selectedItems => { window.open(\$selectedItems.find('.element').data('url')); }, }); })(); JS, [static::class]); return null; } }
/srv/users/craft4/apps/craft4-newsite-space/vendor/craftcms/././cms/src/./elements/actions/View.php