diff --git a/.github/workflows/code_samples.yaml b/.github/workflows/code_samples.yaml deleted file mode 100644 index 8dd6e356957..00000000000 --- a/.github/workflows/code_samples.yaml +++ /dev/null @@ -1,164 +0,0 @@ -name: "Check code samples" - -on: - pull_request: ~ - -jobs: - code-samples-validation: - name: Validate code samples - runs-on: "ubuntu-26.04" - strategy: - fail-fast: false - matrix: - php: - - "8.4" # Upper supported version - - "8.3" # Lower supported version - steps: - - uses: actions/checkout@v7 - - - name: Setup PHP Action - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: "pdo_sqlite, gd" - tools: cs2pr - - - name: Generate token - id: generate_token - uses: actions/create-github-app-token@v3 - with: - app-id: ${{ secrets.AUTOMATION_CLIENT_ID }} - private-key: ${{ secrets.AUTOMATION_CLIENT_SECRET }} - owner: ${{ github.repository_owner }} - - - name: Add composer keys for private packagist - run: | - composer config --global http-basic.updates.ibexa.co $SATIS_NETWORK_KEY $SATIS_NETWORK_TOKEN - composer config --global github-oauth.github.com $GITHUB_TOKEN - env: - SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }} - SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }} - GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - - - uses: ramsey/composer-install@v4 - with: - dependency-versions: highest - - - name: Run code sample quality tests - id: phpstan - run: composer test --ansi - env: - PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php == '8.4' && '1' || '' }} - - - code-samples-inclusion-check: - name: Check code samples inclusion - runs-on: ubuntu-26.04 - if: github.event_name == 'pull_request' - permissions: - # Needed to manage the comment - pull-requests: write - - steps: - - name: List modified files - id: list - run: | - URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" - echo 'CODE_SAMPLES_CHANGE<> "$GITHUB_OUTPUT" - curl -s -X GET -G $URL | jq -r '.[] | .filename,.previous_filename' | grep '^code_samples/' | tr '\n' ' ' >> "$GITHUB_OUTPUT" - echo '' >> "$GITHUB_OUTPUT" - echo 'CODE_SAMPLES_CHANGE_DELIMITER' >> "$GITHUB_OUTPUT" - - - name: Checkout target branch (base_ref) - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - uses: actions/checkout@v7 - with: - ref: ${{ github.base_ref }} - - name: Log target branch code_samples usage - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - env: - HEAD_REF: ${{ github.head_ref }} - CODE_SAMPLES_CHANGE: ${{ steps.list.outputs.CODE_SAMPLES_CHANGE }} - run: | - git fetch origin --depth=1 "$HEAD_REF" - git checkout "origin/$HEAD_REF" -- tools/code_samples/code_samples_usage.php - php tools/code_samples/code_samples_usage.php $CODE_SAMPLES_CHANGE > $HOME/code_samples_usage_target.txt - - - name: Checkout source branch (head_ref) - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - - name: Log source branch code_samples usage - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - env: - CODE_SAMPLES_CHANGE: ${{ steps.list.outputs.CODE_SAMPLES_CHANGE }} - run: php tools/code_samples/code_samples_usage.php $CODE_SAMPLES_CHANGE > $HOME/code_samples_usage_source.txt - - - name: Compare code_samples usages (diff --unified) - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - # diff returns 1 if there is a difference, this is normal but seen as an error by the job. - continue-on-error: true - run: | - source_length=`wc -l < $HOME/code_samples_usage_source.txt` - target_length=`wc -l < $HOME/code_samples_usage_target.txt` - diff -U $(( source_length > target_length ? source_length : target_length )) $HOME/code_samples_usage_target.txt $HOME/code_samples_usage_source.txt > $HOME/code_samples_usage.diff - - name: Check for differences - id: diff - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' - run: | - echo "CODE_SAMPLES_DIFF=$(wc -l < $HOME/code_samples_usage.diff | xargs)" >> "$GITHUB_OUTPUT" - - name: Convert code_samples usages differences (diff2html) - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0' - run: | - npm install -g diff2html-cli - diff2html -f html -s side -t 'code_samples/ changes report' --su hidden --fct false -o stdout -i file -- $HOME/code_samples_usage.diff > $HOME/code_samples_usage.diff.html - - name: Upload code_samples usages differences artifact - id: artifact - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0' - uses: actions/upload-artifact@v7 - with: - name: code_samples_usage.diff.html - path: ~/code_samples_usage.diff.html - overwrite: true - - name: Convert code_samples usages for comment - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0' - run: | - title='# code_samples/ change report' - link='Download colorized diff' - echo "$title" > code_samples_usage.diff.md - echo '' >> code_samples_usage.diff.md - php tools/code_samples/code_samples_usage_diff2html.php $HOME/code_samples_usage.diff >> code_samples_usage.diff.md - echo "$link" >> code_samples_usage.diff.md - if [[ `wc -m < code_samples_usage.diff.md | xargs` -ge $((2**16)) ]]; then - echo "$title" > code_samples_usage.diff.md - echo '' >> code_samples_usage.diff.md - echo "Report's diff is too long to be displayed in a comment." >> code_samples_usage.diff.md - echo '' >> code_samples_usage.diff.md - echo "$link" >> code_samples_usage.diff.md - fi - - name: Find Comment - id: find-comment - uses: peter-evans/find-comment@v4 - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: 'code_samples/ change report' - - name: Delete comment - if: steps.find-comment.outputs.comment-id != '' - uses: actions/github-script@v9 - with: - script: | - github.rest.issues.deleteComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ steps.find-comment.outputs.comment-id }} - }) - - name: Create comment - if: steps.list.outputs.CODE_SAMPLES_CHANGE != '' && steps.diff.outputs.CODE_SAMPLES_DIFF != '0' - uses: peter-evans/create-or-update-comment@v5 - with: - issue-number: ${{ github.event.pull_request.number }} - body-path: code_samples_usage.diff.md - edit-mode: replace diff --git a/.php-cs-fixer-factory.php b/.php-cs-fixer-factory.php deleted file mode 100644 index 37d0c0807ae..00000000000 --- a/.php-cs-fixer-factory.php +++ /dev/null @@ -1,15 +0,0 @@ - false, -]; - -return [new InternalConfigFactory(), $commonRules]; diff --git a/.php-cs-fixer-inline.php b/.php-cs-fixer-inline.php deleted file mode 100644 index b30b9978a58..00000000000 --- a/.php-cs-fixer-inline.php +++ /dev/null @@ -1,29 +0,0 @@ -withRules(array_merge($commonRules, [ - 'psr_autoloading' => false, - 'AdamWojs/phpdoc_force_fqcn_fixer' => false, -])); - -return $configFactory - ->buildConfig() - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__ . '/code_samples/_inline_php') - ->files()->name('*.php') - ); diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index 9796c76101d..00000000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,25 +0,0 @@ -withRules($commonRules); - -return $configFactory - ->buildConfig() - ->setFinder( - PhpCsFixer\Finder::create() - ->in( - array_filter([ - __DIR__ . '/code_samples', - __DIR__ . '/tests', - ], 'is_dir') - ) - ->exclude('_inline_php') // handled separately by .php-cs-fixer-inline.php - ->files()->name('*.php') - ); diff --git a/code_samples/ai_actions/config/services.yaml b/code_samples/ai_actions/config/services.yaml deleted file mode 100644 index 68ae24c7061..00000000000 --- a/code_samples/ai_actions/config/services.yaml +++ /dev/null @@ -1,81 +0,0 @@ -# This file is the entry point to configure your own services. -# Files in the packages/ subdirectory configure your dependencies. - -# Put parameters here that don't need to change on each machine where the app is deployed -# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration -parameters: - -services: - # default configuration for services in *this* file - _defaults: - autowire: true # Automatically injects dependencies in your services. - autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. - - # makes classes in src/ available to be used as services - # this creates a service per class whose id is the fully-qualified class name - App\: - resource: '../src/' - exclude: - - '../src/DependencyInjection/' - - '../src/Entity/' - - '../src/Kernel.php' - - # add more service definitions when explicit configuration is needed - # please note that last definitions always *replace* previous ones - - App\Command\AddMissingAltTextCommand: - arguments: - $binaryDataHandler: '@Ibexa\Core\IO\IOBinarydataHandler\SiteAccessDependentBinaryDataHandler' - - App\AI\Handler\LLaVATextToTextActionHandler: - tags: - - { name: ibexa.ai.action.handler, priority: 0 } - - { name: ibexa.ai.action.handler.text_to_text, priority: 0 } - - app.connector_ai.action_configuration.handler.llava_text_to_text.form_mapper.options: - class: Ibexa\Bundle\ConnectorAi\Form\FormMapper\ActionConfiguration\ActionHandlerOptionsFormMapper - arguments: - $formType: 'App\Form\Type\TextToTextOptionsType' - tags: - - name: ibexa.connector_ai.action_configuration.form_mapper.options - type: !php/const \App\AI\Handler\LLaVaTextToTextActionHandler::IDENTIFIER - - App\AI\ActionType\TranscribeAudioActionType: - arguments: - $actionHandlers: !tagged_iterator - tag: app.connector_ai.action.handler.audio_to_text - default_index_method: getIdentifier - index_by: key - tags: - - { name: ibexa.ai.action.type, identifier: !php/const \App\AI\ActionType\TranscribeAudioActionType::IDENTIFIER } - - app.connector_ai.action_configuration.handler.transcribe_audio.form_mapper.options: - class: Ibexa\Bundle\ConnectorAi\Form\FormMapper\ActionConfiguration\ActionTypeOptionsFormMapper - arguments: - $formType: 'App\Form\Type\TranscribeAudioOptionsType' - tags: - - name: ibexa.connector_ai.action_configuration.form_mapper.action_type_options - type: !php/const \App\AI\ActionType\TranscribeAudioActionType::IDENTIFIER - - App\AI\Handler\WhisperAudioToTextActionHandler: - tags: - - { name: ibexa.ai.action.handler, priority: 0 } - - { name: app.connector_ai.action.handler.audio_to_text, priority: 0 } - - Ibexa\Contracts\ConnectorAi\ActionConfiguration\OptionsFormatterInterface: - alias: Ibexa\ConnectorAi\ActionConfiguration\JsonOptionsFormatter - -#REST services - App\AI\REST\Input\Parser\TranscribeAudio: - parent: Ibexa\Rest\Server\Common\Parser - tags: - - { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.ai.TranscribeAudio } - - App\AI\REST\Output\Resolver\AudioTextResolver: - tags: - - { name: ibexa.ai.action.mime_type, key: application/vnd.ibexa.api.ai.AudioText } - - App\AI\REST\Output\ValueObjectVisitor\AudioText: - parent: Ibexa\Contracts\Rest\Output\ValueObjectVisitor - tags: - - { name: ibexa.rest.output.value_object.visitor, type: App\AI\REST\Value\AudioText } diff --git a/code_samples/ai_actions/src/AI/Action/TranscribeAudioAction.php b/code_samples/ai_actions/src/AI/Action/TranscribeAudioAction.php deleted file mode 100644 index 6ab3027e0f7..00000000000 --- a/code_samples/ai_actions/src/AI/Action/TranscribeAudioAction.php +++ /dev/null @@ -1,30 +0,0 @@ -audio; - } - - public function getActionTypeIdentifier(): string - { - return 'transcribe_audio'; - } -} diff --git a/code_samples/ai_actions/src/AI/ActionType/TranscribeAudioActionType.php b/code_samples/ai_actions/src/AI/ActionType/TranscribeAudioActionType.php deleted file mode 100644 index d6b4b87f481..00000000000 --- a/code_samples/ai_actions/src/AI/ActionType/TranscribeAudioActionType.php +++ /dev/null @@ -1,65 +0,0 @@ - $actionHandlers*/ - public function __construct(private iterable $actionHandlers) - { - } - - public function getIdentifier(): string - { - return self::IDENTIFIER; - } - - public function getName(): string - { - return 'Transcribe audio'; - } - - public function getInputIdentifier(): string - { - return Audio::getIdentifier(); - } - - public function getOutputIdentifier(): string - { - return Text::getIdentifier(); - } - - public function getOptions(): array - { - return []; - } - - public function createAction(DataType $input, array $parameters = []): ActionInterface - { - if (!$input instanceof Audio) { - throw new InvalidArgumentException( - 'audio', - 'expected \App\AI\DataType\Audio type, ' . get_debug_type($input) . ' given.' - ); - } - - return new TranscribeAudioAction($input); - } - - public function getActionHandlers(): iterable - { - return $this->actionHandlers; - } -} diff --git a/code_samples/ai_actions/src/AI/DataType/Audio.php b/code_samples/ai_actions/src/AI/DataType/Audio.php deleted file mode 100644 index bea562a1c97..00000000000 --- a/code_samples/ai_actions/src/AI/DataType/Audio.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -final class Audio implements DataType -{ - /** - * @param non-empty-array $base64 - */ - public function __construct(private array $base64) - { - } - - public function getBase64(): string - { - return reset($this->base64); - } - - public function getList(): array - { - return $this->base64; - } - - public static function getIdentifier(): string - { - return 'audio'; - } -} diff --git a/code_samples/ai_actions/src/AI/Handler/LLaVaTextToTextActionHandler.php b/code_samples/ai_actions/src/AI/Handler/LLaVaTextToTextActionHandler.php deleted file mode 100644 index 547a00aa724..00000000000 --- a/code_samples/ai_actions/src/AI/Handler/LLaVaTextToTextActionHandler.php +++ /dev/null @@ -1,76 +0,0 @@ -getInput(); - $text = $this->sanitizeInput($input->getText()); - - $systemMessage = $action->hasActionContext() ? $action->getActionContext()->getActionHandlerOptions()->get('system_prompt', '') : ''; - - $response = $this->client->request( - 'POST', - sprintf('%s/v1/chat/completions', $this->host), - [ - 'headers' => [ - 'Authorization: Bearer no-key', - ], - 'json' => [ - 'model' => 'LLaMA_CPP', - 'messages' => [ - (object)[ - 'role' => 'system', - 'content' => $systemMessage, - ], - (object)[ - 'role' => 'user', - 'content' => $text, - ], - ], - 'temperature' => 0.7, - ], - ] - ); - - $output = strip_tags((string) json_decode($response->getContent(), true)['choices'][0]['message']['content']); - - return new TextResponse(new Text([$output])); - } - - public static function getIdentifier(): string - { - return self::IDENTIFIER; - } - - private function sanitizeInput(string $text): string - { - return str_replace(["\n", "\r"], ' ', $text); - } -} diff --git a/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php b/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php deleted file mode 100644 index 0e6781204ef..00000000000 --- a/code_samples/ai_actions/src/AI/Handler/WhisperAudioToTextActionHandler.php +++ /dev/null @@ -1,88 +0,0 @@ - \d{2}:\d{2}\.\d{3}]\s*/'; - - public function supports(ActionInterface $action): bool - { - return $action->getActionTypeIdentifier() === TranscribeAudioActionType::IDENTIFIER; - } - - public function handle(ActionInterface $action, array $context = []): ActionResponseInterface - { - /** @var \App\AI\DataType\Audio $input */ - $input = $action->getInput(); - - $path = $this->saveInputToFile($input->getBase64()); - - $arguments = ['whisper']; - - $language = $action->getRuntimeContext()?->get('languageCode'); - if ($language !== null) { - $arguments[] = sprintf('--language=%s', substr((string) $language, 0, 2)); - } - - $arguments[] = '--output_format=txt'; - $arguments[] = $path; - - $process = new Process($arguments); - $process->run(); - - if (!$process->isSuccessful()) { - unlink($path); - throw new ProcessFailedException($process); - } - - $output = $process->getOutput(); - - $includeTimestamps = $action->getActionContext() - ?->getActionTypeOptions() - ->get('include_timestamps', false) - ?? false; - - if (!$includeTimestamps) { - $output = $this->removeTimestamps($output); - } - - unlink($path); - - return new TextResponse(new Text([$output])); - } - - public static function getIdentifier(): string - { - return 'whisper_audio_to_text'; - } - - private function removeTimestamps(string $text): string - { - $lines = explode(PHP_EOL, $text); - - $processedLines = array_map(static fn (string $line): string => preg_replace(self::TIMESTAMP_FORMAT, '', (string) $line) ?? '', $lines); - - return implode(PHP_EOL, $processedLines); - } - - private function saveInputToFile(string $audioEncodedInBase64): string - { - $filename = uniqid('audio'); - $path = sys_get_temp_dir() . \DIRECTORY_SEPARATOR . $filename; - file_put_contents($path, base64_decode($audioEncodedInBase64)); - - return $path; - } -} diff --git a/code_samples/ai_actions/src/AI/REST/Input/Parser/TranscribeAudio.php b/code_samples/ai_actions/src/AI/REST/Input/Parser/TranscribeAudio.php deleted file mode 100644 index 78520a1e4ec..00000000000 --- a/code_samples/ai_actions/src/AI/REST/Input/Parser/TranscribeAudio.php +++ /dev/null @@ -1,52 +0,0 @@ - $data */ - public function parse(array $data, ParsingDispatcher $parsingDispatcher): TranscribeAudioAction - { - $this->assertInputIsValid($data); - $runtimeContext = $this->getRuntimeContext($data); - - return new TranscribeAudioAction( - new AudioDataType([$data[self::AUDIO_KEY][self::BASE64_KEY]]), - $runtimeContext - ); - } - - /** @param array $data */ - private function assertInputIsValid(array $data): void - { - if (!array_key_exists(self::AUDIO_KEY, $data)) { - throw new \InvalidArgumentException('Missing audio key'); - } - - if (!array_key_exists(self::BASE64_KEY, $data[self::AUDIO_KEY])) { - throw new \InvalidArgumentException('Missing base64 key'); - } - } - - /** - * @param array $data - */ - private function getRuntimeContext(array $data): RuntimeContext - { - return new RuntimeContext( - $data[Action::RUNTIME_CONTEXT_KEY] ?? [] - ); - } -} diff --git a/code_samples/ai_actions/src/AI/REST/Output/Resolver/AudioTextResolver.php b/code_samples/ai_actions/src/AI/REST/Output/Resolver/AudioTextResolver.php deleted file mode 100644 index 3ac6ece67b7..00000000000 --- a/code_samples/ai_actions/src/AI/REST/Output/Resolver/AudioTextResolver.php +++ /dev/null @@ -1,20 +0,0 @@ -getOutput() - ); - } -} diff --git a/code_samples/ai_actions/src/AI/REST/Output/ValueObjectVisitor/AudioText.php b/code_samples/ai_actions/src/AI/REST/Output/ValueObjectVisitor/AudioText.php deleted file mode 100644 index 1c8277f5851..00000000000 --- a/code_samples/ai_actions/src/AI/REST/Output/ValueObjectVisitor/AudioText.php +++ /dev/null @@ -1,30 +0,0 @@ -getOutput(); - - $generator->startObjectElement(self::OBJECT_IDENTIFIER, $mediaType); - $visitor->setHeader('Content-Type', $generator->getMediaType($mediaType)); - - $visitor->visitValueObject($text); - - $generator->endObjectElement(self::OBJECT_IDENTIFIER); - } -} diff --git a/code_samples/ai_actions/src/AI/REST/Value/AudioText.php b/code_samples/ai_actions/src/AI/REST/Value/AudioText.php deleted file mode 100644 index d9f2cbc4175..00000000000 --- a/code_samples/ai_actions/src/AI/REST/Value/AudioText.php +++ /dev/null @@ -1,11 +0,0 @@ -input; - } - - public function getRuntimeContext(): RuntimeContext - { - return $this->runtimeContext; - } -} diff --git a/code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php b/code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php deleted file mode 100644 index 0c6ef19854e..00000000000 --- a/code_samples/ai_actions/src/Command/ActionConfigurationCreateCommand.php +++ /dev/null @@ -1,80 +0,0 @@ -addArgument('user', InputArgument::OPTIONAL, 'Login of the user executing the actions', 'admin'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $input->getArgument('user'); - $this->permissionResolver->setCurrentUserReference($this->userService->loadUserByLogin($user)); - - $refineTextActionType = $this->actionTypeRegistry->getActionType('refine_text'); - - $actionConfigurationCreateStruct = new ActionConfigurationCreateStruct('rewrite_casual'); - - $actionConfigurationCreateStruct->setType($refineTextActionType); - $actionConfigurationCreateStruct->setName('eng-GB', 'Rewrite in casual tone'); - $actionConfigurationCreateStruct->setDescription('eng-GB', 'Rewrites the text using a casual tone'); - $actionConfigurationCreateStruct->setActionHandler('openai-text-to-text'); - $actionConfigurationCreateStruct->setActionHandlerOptions(new ArrayMap([ - 'max_tokens' => 4000, - 'temperature' => 1, - 'prompt' => 'Rewrite this content to improve readability. Preserve meaning and crucial information but use casual language accessible to a broader audience.', - 'model' => 'gpt-4-turbo', - ])); - $actionConfigurationCreateStruct->setEnabled(true); - - $this->actionConfigurationService->createActionConfiguration($actionConfigurationCreateStruct); - - $action = new RefineTextAction(new Text([ -<<actionConfigurationService->getActionConfiguration('rewrite_casual'); - $actionResponse = $this->actionService->execute($action, $actionConfiguration)->getOutput(); - - assert($actionResponse instanceof Text); - - $output->writeln($actionResponse->getText()); - - return Command::SUCCESS; - } -} diff --git a/code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php b/code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php deleted file mode 100644 index dee23735e97..00000000000 --- a/code_samples/ai_actions/src/Command/AddMissingAltTextCommand.php +++ /dev/null @@ -1,143 +0,0 @@ -addArgument('user', InputArgument::OPTIONAL, 'Login of the user executing the actions', 'admin'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $this->setUser($input->getArgument('user')); - - $modifiedImages = $this->getModifiedImages(); - $output->writeln(sprintf('Found %d modified image in the last 24h', $modifiedImages->getTotalCount())); - - /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ - foreach ($modifiedImages as $content) { - /** @var \Ibexa\Core\FieldType\Image\Value $value */ - $value = $content->getFieldValue(self::IMAGE_FIELD_IDENTIFIER); - - if ($value === null || !$this->shouldGenerateAltText($value)) { - $output->writeln(sprintf('Image %s has the image field empty, the file cannot be accessed, or the alternative text is already specified. Skipping.', $content->getName())); - continue; - } - - $contentUpdateStruct = $this->contentService->newContentUpdateStruct(); - $value->alternativeText = $this->getSuggestedAltText($this->convertImageToBase64($value->uri), $content->getDefaultLanguageCode()); - $contentUpdateStruct->setField(self::IMAGE_FIELD_IDENTIFIER, $value); - - $updatedContent = $this->contentService->updateContent( - $this->contentService->createContentDraft($content->getContentInfo())->getVersionInfo(), - $contentUpdateStruct - ); - $this->contentService->publishVersion($updatedContent->getVersionInfo()); - } - - return Command::SUCCESS; - } - - private function getSuggestedAltText(string $imageEncodedInBase64, string $languageCode): string - { - $action = new GenerateAltTextAction(new Image([$imageEncodedInBase64])); - - $action->setRuntimeContext(new RuntimeContext(['languageCode' => $languageCode])); - $action->setActionContext( - new ActionContext( - new ActionConfigurationOptions(['default_locale_fallback' => 'en']), // System context - new ActionConfigurationOptions(['max_lenght' => 100]), // Action Type options - new ActionConfigurationOptions( // Action Handler options - [ - 'prompt' => 'Generate the alt text for this image in less than 100 characters.', - 'temperature' => 0.7, - 'max_tokens' => 4096, - 'model' => 'gpt-4o-mini', - ] - ) - ) - ); - - $output = $this->actionService->execute($action)->getOutput(); - - assert($output instanceof Text); - - return $output->getText(); - } - - private function convertImageToBase64(string $uri): string - { - $id = $this->binaryDataHandler->getIdFromUri($uri); - $file = $this->binaryDataHandler->getContents($id); - - return 'data:image/jpeg;base64,' . base64_encode($file); - } - - private function getModifiedImages(): ContentList - { - $filter = (new Filter()) - ->withCriterion( - new DateMetadata(DateMetadata::MODIFIED, Operator::GTE, strtotime('-1 day')) - ) - ->andWithCriterion(new ContentTypeIdentifier('image')); - - return $this->contentService->find($filter); - } - - /** @phpstan-assert-if-true string $value->uri */ - private function shouldGenerateAltText(Value $value): bool - { - return $this->fieldTypeService->getFieldType('ibexa_image')->isEmptyValue($value) === false && - $value->isAlternativeTextEmpty() && - $value->uri !== null; - } - - private function setUser(string $userLogin): void - { - $this->permissionResolver->setCurrentUserReference($this->userService->loadUserByLogin($userLogin)); - } -} diff --git a/code_samples/ai_actions/src/Form/Type/TextToTextOptionsType.php b/code_samples/ai_actions/src/Form/Type/TextToTextOptionsType.php deleted file mode 100644 index bc2d4306d32..00000000000 --- a/code_samples/ai_actions/src/Form/Type/TextToTextOptionsType.php +++ /dev/null @@ -1,32 +0,0 @@ -add('system_prompt', TextareaType::class, [ - 'required' => true, - 'disabled' => $options['translation_mode'], - 'label' => 'System message', - ]); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'translation_domain' => 'app_ai', - 'translation_mode' => false, - ]); - - $resolver->setAllowedTypes('translation_mode', 'bool'); - } -} diff --git a/code_samples/ai_actions/src/Form/Type/TranscribeAudioOptionsType.php b/code_samples/ai_actions/src/Form/Type/TranscribeAudioOptionsType.php deleted file mode 100644 index c387716b261..00000000000 --- a/code_samples/ai_actions/src/Form/Type/TranscribeAudioOptionsType.php +++ /dev/null @@ -1,32 +0,0 @@ -add('include_timestamps', CheckboxType::class, [ - 'required' => false, - 'disabled' => $options['translation_mode'], - 'label' => 'Include timestamps', - ]); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'translation_domain' => 'app_ai', - 'translation_mode' => false, - ]); - - $resolver->setAllowedTypes('translation_mode', 'bool'); - } -} diff --git a/code_samples/ai_actions/src/Query/Search.php b/code_samples/ai_actions/src/Query/Search.php deleted file mode 100644 index 2069f838994..00000000000 --- a/code_samples/ai_actions/src/Query/Search.php +++ /dev/null @@ -1,25 +0,0 @@ -findActionConfigurations($query); diff --git a/code_samples/ai_actions/templates/themes/admin/admin/ui/fieldtype/edit/form_fields_binary_ai.html.twig b/code_samples/ai_actions/templates/themes/admin/admin/ui/fieldtype/edit/form_fields_binary_ai.html.twig deleted file mode 100644 index 7ef572c4065..00000000000 --- a/code_samples/ai_actions/templates/themes/admin/admin/ui/fieldtype/edit/form_fields_binary_ai.html.twig +++ /dev/null @@ -1,29 +0,0 @@ -{% extends '@ibexadesign/ui/field_type/edit/ibexa_binaryfile.html.twig' %} - -{% block ibexa_binaryfile_preview %} - {{ parent() }} - - {% import '@ibexadesign/connector_ai/ui/ai_module/macros.html.twig' as ai_macros %} - - {% set transcriptFieldIdentifier = 'transcript' %} - {% set fieldTypeIdentifiers = form.parent.parent.vars.value|keys %} - - {% if transcriptFieldIdentifier in fieldTypeIdentifiers %} - {% set use_ai_btn_attr = { - class: 'btn ibexa-btn ibexa-btn--secondary ibexa-ai-component--custom-btn', - module_id: 'TranscribeAudio', - scroll_selector: '.ibexa-edit-content', - container_selector: '.ibexa-edit-content', - input_selector: '.ibexa-field-edit-preview__action--preview', - output_selector: '#ezplatform_content_forms_content_edit_fieldsData_transcript_value', - ai_config_id: 'transcribe_audio', - } %} - - - {% endif %} -{% endblock %} diff --git a/code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php b/code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php deleted file mode 100644 index aa2fcd2659f..00000000000 --- a/code_samples/api/graphql/src/DependencyInjection/Compiler/MyCustomTypeGraphQLCompilerPass.php +++ /dev/null @@ -1,23 +0,0 @@ -hasParameter('ibexa.graphql.schema.content.mapping.field_definition_type')) { - return; - } - - $mapping = $container->getParameter('ibexa.graphql.schema.content.mapping.field_definition_type'); - $mapping['my_custom_fieldtype'] = [ - 'value_type' => 'MyCustomFieldValue', - 'definition_type' => 'MyCustomFieldDefinition', - 'value_resolver' => 'field.someProperty', - ]; - } -} diff --git a/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php b/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php deleted file mode 100644 index b2a4432f869..00000000000 --- a/code_samples/api/graphql/src/GraphQL/Schema/MyFieldDefinitionMapper.php +++ /dev/null @@ -1,38 +0,0 @@ -canMap($fieldDefinition)) { - return parent::mapToFieldValueInputType($contentType, $fieldDefinition); - } - - return $this->nameMyFieldInputType($contentType, $fieldDefinition); - } - - private function nameMyFieldInputType(ContentType $contentType, FieldDefinition $fieldDefinition): string - { - $converter = new CamelCaseToSnakeCaseNameConverter(null, false); - - return sprintf( - '%s%sInput', - $converter->denormalize($contentType->identifier), - $converter->denormalize($fieldDefinition->identifier) - ); - } -} diff --git a/code_samples/api/migration/src/Command/MigrationCommand.php b/code_samples/api/migration/src/Command/MigrationCommand.php deleted file mode 100644 index 7f4938bbeaa..00000000000 --- a/code_samples/api/migration/src/Command/MigrationCommand.php +++ /dev/null @@ -1,44 +0,0 @@ -migrationService->add( - new Migration( - 'new_migration.yaml', - $string_with_migration_content - ) - ); - - foreach ($this->migrationService->listMigrations() as $migration) { - $output->writeln($migration->getName()); - } - - $migration_name = $this->migrationService->listMigrations()[0]->getName(); - $my_migration = $this->migrationService->findOneByName($migration_name); - - $this->migrationService->executeOne($my_migration); - $this->migrationService->executeAll('admin'); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/AttributeCommand.php b/code_samples/api/product_catalog/src/Command/AttributeCommand.php deleted file mode 100644 index 397feb4ee1b..00000000000 --- a/code_samples/api/product_catalog/src/Command/AttributeCommand.php +++ /dev/null @@ -1,79 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $attributeTypes = $this->attributeTypeService->getAttributeTypes(); - - foreach ($attributeTypes as $attributeType) { - $output->writeln('Attribute type ' . $attributeType->getIdentifier() . ' with name ' . $attributeType->getName()); - } - - $attributeGroupCreateStruct = $this->localAttributeGroupService->newAttributeGroupCreateStruct('dimensions'); - $attributeGroupCreateStruct->setNames(['eng-GB' => 'Size']); - - $this->localAttributeGroupService->createAttributeGroup($attributeGroupCreateStruct); - - $attributeGroup = $this->attributeGroupService->getAttributeGroup('dimensions'); - - $attributeGroupUpdateStruct = $this->localAttributeGroupService->newAttributeGroupUpdateStruct($attributeGroup); - $attributeGroupUpdateStruct->setNames(['eng-GB' => 'Dimensions']); - $attributeGroupUpdateStruct->setIdentifier('dimensions'); - $attributeGroupUpdateStruct->setPosition(0); - - $attribute = $this->attributeDefinitionService->getAttributeDefinition('length'); - $output->writeln($attribute->getName()); - - $attributeType = $this->attributeTypeService->getAttributeType('checkbox'); - - $attributeCreateStruct = $this->localAttributeDefinitionService->newAttributeDefinitionCreateStruct('size'); - $attributeCreateStruct->setType($attributeType); - $attributeCreateStruct->setName('eng-GB', 'Size'); - $attributeCreateStruct->setGroup($attributeGroup); - - $this->localAttributeDefinitionService->createAttributeDefinition($attributeCreateStruct); - - $this->localAttributeGroupService->updateAttributeGroup($attributeGroup, $attributeGroupUpdateStruct); - - $attributeGroups = $this->attributeGroupService->findAttributeGroups(); - - foreach ($attributeGroups as $attributeGroup) { - $output->writeln('Attribute group ' . $attributeGroup->getIdentifier() . ' with name ' . $attributeGroup->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/CatalogCommand.php b/code_samples/api/product_catalog/src/Command/CatalogCommand.php deleted file mode 100644 index eef9eb1d629..00000000000 --- a/code_samples/api/product_catalog/src/Command/CatalogCommand.php +++ /dev/null @@ -1,88 +0,0 @@ -setDefinition([ - new InputArgument('catalogIdentifier', InputArgument::REQUIRED, 'Catalog identifier'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $catalogIdentifier = $input->getArgument('catalogIdentifier'); - - // Create catalog - $catalogCriterion = new Criterion\LogicalAnd( - [ - new Criterion\ProductType(['desk']), - new Criterion\ProductAvailability(true), - ] - ); - - $catalogCreateStruct = new CatalogCreateStruct( - $catalogIdentifier, - $catalogCriterion, - ['eng-GB' => 'Desk promo'], - ['eng-GB' => 'Desk promo description'], - ); - - $this->catalogService->createCatalog($catalogCreateStruct); - - // Get catalog - $catalog = $this->catalogService->getCatalogByIdentifier($catalogIdentifier); - $output->writeln($catalog->getName()); - - // Get products in catalog - $productQuery = new ProductQuery(null, $catalog->getQuery()); - $products = $this->productService->findProducts($productQuery); - - foreach ($products as $product) { - $output->writeln($product->getName()); - } - - // Update catalog - $catalogUpdateStruct = new CatalogUpdateStruct($catalog->getId()); - $catalogUpdateStruct->setTransition(Status::PUBLISH_TRANSITION); - - $this->catalogService->updateCatalog($catalog, $catalogUpdateStruct); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/CurrencyCommand.php b/code_samples/api/product_catalog/src/Command/CurrencyCommand.php deleted file mode 100644 index 8162fadedea..00000000000 --- a/code_samples/api/product_catalog/src/Command/CurrencyCommand.php +++ /dev/null @@ -1,67 +0,0 @@ -setDefinition([ - new InputArgument('currencyCode', InputArgument::REQUIRED, 'Currency code'), - new InputArgument('newCurrencyCode', InputArgument::REQUIRED, 'New currency code'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $currencyCode = $input->getArgument('currencyCode'); - $newCurrencyCode = $input->getArgument('newCurrencyCode'); - - $currency = $this->currencyService->getCurrencyByCode($currencyCode); - $output->writeln('Currency ID: ' . $currency->getId()); - - $currencies = $this->currencyService->findCurrencies(); - - foreach ($currencies as $currency) { - $output->writeln('Currency ' . $currency->getId() . ' with code ' . $currency->getCode()); - } - - $currencyUpdateStruct = new CurrencyUpdateStruct(); - $currencyUpdateStruct->setCode('MOD'); - $currencyUpdateStruct->setSubunits(4); - - $this->currencyService->updateCurrency($currency, $currencyUpdateStruct); - - $currencyCreateStruct = new CurrencyCreateStruct($newCurrencyCode, 2, true); - - $this->currencyService->createCurrency($currencyCreateStruct); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/ProductAssetCommand.php b/code_samples/api/product_catalog/src/Command/ProductAssetCommand.php deleted file mode 100644 index aa9ed43d9e9..00000000000 --- a/code_samples/api/product_catalog/src/Command/ProductAssetCommand.php +++ /dev/null @@ -1,62 +0,0 @@ -setDefinition([ - new InputArgument('productCode', InputArgument::REQUIRED, 'Product code'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $productCode = $input->getArgument('productCode'); - $product = $this->productService->getProduct($productCode); - - $singleAsset = $this->assetService->getAsset($product, '1'); - $output->writeln($singleAsset->getName()); - - $assetCollection = $this->assetService->findAssets($product); - - foreach ($assetCollection as $asset) { - $output->writeln($asset->getIdentifier() . ': ' . $asset->getName()); - $tags = $asset->getTags(); - foreach ($tags as $tag) { - $output->writeln($tag); - } - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/ProductCommand.php b/code_samples/api/product_catalog/src/Command/ProductCommand.php deleted file mode 100644 index b94753257bc..00000000000 --- a/code_samples/api/product_catalog/src/Command/ProductCommand.php +++ /dev/null @@ -1,120 +0,0 @@ -setDefinition([ - new InputArgument('productCode', InputArgument::REQUIRED, 'Product code'), - new InputArgument('productType', InputArgument::REQUIRED, 'Product type'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $productCode = $input->getArgument('productCode'); - $productType = $input->getArgument('productType'); - - $product = $this->productService->getProduct($productCode); - - $output->writeln('Product with code ' . $product->getCode() . ' is ' . $product->getName()); - - $criteria = new Criterion\ProductType([$productType]); - $sortClauses = [new SortClause\ProductName(ProductQuery::SORT_ASC)]; - - $productQuery = new ProductQuery(null, $criteria, $sortClauses); - - $products = $this->productService->findProducts($productQuery); - - foreach ($products as $product) { - $output->writeln($product->getName() . ' of type ' . $product->getProductType()->getName()); - } - - $productType = $this->productTypeService->getProductType($productType); - - $createStruct = $this->localProductService->newProductCreateStruct($productType, 'eng-GB'); - $createStruct->setCode('NEWPRODUCT'); - $createStruct->setField('name', 'New Product'); - - $this->localProductService->createProduct($createStruct); - - $product = $this->productService->getProduct('NEWPRODUCT'); - - $productUpdateStruct = $this->localProductService->newProductUpdateStruct($product); - $productUpdateStruct->setCode('NEWMODIFIEDPRODUCT'); - - $this->localProductService->updateProduct($productUpdateStruct); - - $product = $this->productService->getProduct('NEWMODIFIEDPRODUCT'); - - $productAvailabilityCreateStruct = new ProductAvailabilityCreateStruct($product, false, true); - - $this->productAvailabilityService->createProductAvailability($productAvailabilityCreateStruct); - - if ($this->productAvailabilityService->hasAvailability($product)) { - $availability = $this->productAvailabilityService->getAvailability($product); - - $output->writeln($availability->getAvailability() ? 'Available flag: true' : 'Available flag: false'); - $output->writeln($availability->getComputedAvailability() ? 'Can be ordered: true' : 'Can be ordered: false'); - $output->writeln('Stock: ' . $availability->getStock()); - - $productAvailabilityUpdateStruct = new ProductAvailabilityUpdateStruct($product, true, false, 80); - - $this->productAvailabilityService->updateProductAvailability($productAvailabilityUpdateStruct); - - $output->writeln($availability->getAvailability() ? 'Available flag: true' : 'Available flag: false'); - $output->writeln($availability->getComputedAvailability() ? 'Can be ordered: true' : 'Can be ordered: false'); - $output->writeln(' available now with stock ' . $availability->getStock()); - } - - $availability = $this->productAvailabilityService->getAvailability( - $product, - new PurchasableWithoutStockAvailabilityContext() - ); - - $canBeOrdered = $availability->getComputedAvailability(); - $output->writeln('Can be ordered: ' . ($canBeOrdered ? 'true' : 'false') . ', Stock: ' . $availability->getStock()); - - $this->localProductService->deleteProduct($product); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/ProductPriceCommand.php b/code_samples/api/product_catalog/src/Command/ProductPriceCommand.php deleted file mode 100644 index 0a3c40ecbbb..00000000000 --- a/code_samples/api/product_catalog/src/Command/ProductPriceCommand.php +++ /dev/null @@ -1,104 +0,0 @@ -setDefinition([ - new InputArgument('productCode', InputArgument::REQUIRED, 'Product code'), - new InputArgument('currencyCode', InputArgument::REQUIRED, 'Currency code'), - new InputArgument('newCurrencyCode', InputArgument::REQUIRED, 'New currency code'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $productCode = $input->getArgument('productCode'); - $product = $this->productService->getProduct($productCode); - $currencyCode = $input->getArgument('currencyCode'); - $currency = $this->currencyService->getCurrencyByCode($currencyCode); - - $productPrice = $product->getPrice(); - - $output->writeln('Price for ' . $product->getName() . ' is ' . $productPrice); - - $productPrice = $this->productPriceService->getPriceByProductAndCurrency($product, $currency); - - $output->writeln('Price for ' . $product->getName() . ' in ' . $currencyCode . ' is ' . $productPrice); - - $newCurrencyCode = $input->getArgument('newCurrencyCode'); - $newCurrency = $this->currencyService->getCurrencyByCode($newCurrencyCode); - - $money = new Money\Money(50000, new Money\Currency($newCurrencyCode)); - $priceCreateStruct = new ProductPriceCreateStruct($product, $newCurrency, $money, null, null); - - $this->productPriceService->createProductPrice($priceCreateStruct); - - $output->writeln('Created new price in currency ' . $newCurrencyCode); - - $prices = $this->productPriceService->findPricesByProductCode($productCode)->getPrices(); - - $output->writeln('All prices for ' . $product->getName() . ':'); - foreach ($prices as $price) { - $output->writeln((string) $price); - } - - $priceCriteria = [ - new CurrencyCriterion($this->currencyService->getCurrencyByCode('USD')), - new CustomerGroup('customer_group_1'), - new Product('ergo_desk'), - ]; - - $priceQuery = new PriceQuery(new LogicalOr(...$priceCriteria)); - $prices = $this->productPriceService->findPrices($priceQuery); - - $output->writeln(sprintf('Found %d prices with provided criteria', $prices->getTotalCount())); - - $context = new PriceContext($currency); - $price = $this->priceResolver->resolvePrice($product, $context); - - $output->writeln('Price in ' . $currency->getCode() . ' for ' . $product->getName() . ' is ' . $price); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/ProductTypeCommand.php b/code_samples/api/product_catalog/src/Command/ProductTypeCommand.php deleted file mode 100644 index a544245d40a..00000000000 --- a/code_samples/api/product_catalog/src/Command/ProductTypeCommand.php +++ /dev/null @@ -1,95 +0,0 @@ -setDefinition([ - new InputArgument('productTypeIdentifier', InputArgument::REQUIRED, 'Product type identifier'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $productTypeIdentifier = $input->getArgument('productTypeIdentifier'); - - $productTypeCreateStruct = $this->localProductTypeService->newProductTypeCreateStruct( - 'digital_product', - 'eng-GB' - ); - - $productTypeCreateStruct->setNames([ - 'eng-GB' => 'Digital Product', - 'pol-PL' => 'Produkt Cyfrowy', - ]); - - $productTypeCreateStruct->setVirtual(true); - - $contentTypeCreateStruct = $productTypeCreateStruct->getContentTypeCreateStruct(); - - $marketingDescriptionFieldDefinition = $this->contentTypeService->newFieldDefinitionCreateStruct( - 'marketing_description', - 'ibexa_string' - ); - $marketingDescriptionFieldDefinition->names = ['eng-GB' => 'Marketing Description']; - $marketingDescriptionFieldDefinition->position = 100; - $contentTypeCreateStruct->addFieldDefinition($marketingDescriptionFieldDefinition); - - $sizeAttribute = $this->attributeDefinitionService->getAttributeDefinition('size'); - - $attributeAssignment = new AssignAttributeDefinitionStruct( - $sizeAttribute, - false, - false - ); - - $productTypeCreateStruct->setAssignedAttributesDefinitions([$attributeAssignment]); - - $newProductType = $this->localProductTypeService->createProductType($productTypeCreateStruct); - - $productType = $this->productTypeService->getProductType($productTypeIdentifier); - - $output->writeln($productType->getName()); - - $productTypes = $this->productTypeService->findProductTypes(); - - foreach ($productTypes as $productType) { - $output->writeln($productType->getName() . ' with identifier ' . $productType->getIdentifier()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/ProductVariantCommand.php b/code_samples/api/product_catalog/src/Command/ProductVariantCommand.php deleted file mode 100644 index 92c7dab42d0..00000000000 --- a/code_samples/api/product_catalog/src/Command/ProductVariantCommand.php +++ /dev/null @@ -1,108 +0,0 @@ -setDefinition([ - new InputArgument('productCode', InputArgument::REQUIRED, 'Product code'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $productCode = $input->getArgument('productCode'); - $product = $this->productService->getProduct($productCode); - - // Get variants filtered by variant codes - $codeQuery = new ProductVariantQuery(); - $codeQuery->setVariantCodes(['DESK-red', 'DESK-blue']); - $specificVariants = $this->productService->findProductVariants($product, $codeQuery)->getVariants(); - - // Get variants with specific attributes - $combinedQuery = new ProductVariantQuery(); - $combinedQuery->setAttributesCriterion( - new ProductCriterionAdapter( - new Criterion\LogicalAnd([ - new Criterion\ColorAttribute('color', ['red', 'blue']), - new Criterion\IntegerAttribute('size', 42), - ]) - ) - ); - $filteredVariants = $this->productService->findProductVariants($product, $combinedQuery)->getVariants(); - - foreach ($specificVariants as $variant) { - $output->writeln($variant->getName()); - $attributes = $variant->getDiscriminatorAttributes(); - foreach ($attributes as $attribute) { - $output->writeln($attribute->getIdentifier() . ': ' . $attribute->getValue() . ' '); - } - } - - // Create a variant - $variantCreateStructs = [ - new ProductVariantCreateStruct(['color' => 'oak', 'frame_color' => 'white'], 'DESK-red'), - new ProductVariantCreateStruct(['color' => 'white', 'frame_color' => 'black'], 'DESK-blue'), - ]; - - $this->localProductService->createProductVariants($product, $variantCreateStructs); - - // Search variants across all products - $query = new ProductVariantQuery(); - $query->setVariantCodes(['DESK-red', 'DESK-blue']); - $variantList = $this->productService->findVariants($query); - - foreach ($variantList->getVariants() as $variant) { - $output->writeln($variant->getName()); - } - - // Search variants with attribute criterion - $colorQuery = new ProductVariantQuery(); - $colorQuery->setAttributesCriterion( - new ProductCriterionAdapter( - new Criterion\ColorAttribute('color', ['red']) - ) - ); - $redVariants = $this->productService->findVariants($colorQuery); - - foreach ($redVariants->getVariants() as $variant) { - $output->writeln($variant->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/product_catalog/src/Command/VatCommand.php b/code_samples/api/product_catalog/src/Command/VatCommand.php deleted file mode 100644 index fc5ee046c60..00000000000 --- a/code_samples/api/product_catalog/src/Command/VatCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -setDefinition([ - new InputArgument('productCode', InputArgument::REQUIRED, 'Product code'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $region = $this->regionService->getRegion('poland'); - - $vatCategories = $this->vatService->getVatCategories($region); - - foreach ($vatCategories as $category) { - $output->writeln($category->getIdentifier() . ': ' . $category->getVatValue()); - } - - $vatCategory = $this->vatService->getVatCategoryByIdentifier($region, 'reduced'); - - $output->writeln((string) $vatCategory->getVatValue()); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/AddLanguageCommand.php b/code_samples/api/public_php_api/src/Command/AddLanguageCommand.php deleted file mode 100644 index 94f045dbb81..00000000000 --- a/code_samples/api/public_php_api/src/Command/AddLanguageCommand.php +++ /dev/null @@ -1,46 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $languageList = $this->languageService->loadLanguages(); - - foreach ($languageList as $language) { - $output->writeln($language->languageCode . ': ' . $language->name); - } - - $languageCreateStruct = $this->languageService->newLanguageCreateStruct(); - $languageCreateStruct->languageCode = 'pol-PL'; - $languageCreateStruct->name = 'Polish'; - $this->languageService->createLanguage($languageCreateStruct); - $output->writeln('Added language Polish with language code pol-PL.'); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php b/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php deleted file mode 100644 index 4b5d4728f54..00000000000 --- a/code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php +++ /dev/null @@ -1,59 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'Content ID'), - new InputArgument('parentLocationId', InputArgument::REQUIRED, 'Parent Location ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $parentLocationId = (int) $input->getArgument('parentLocationId'); - $contentId = (int) $input->getArgument('contentId'); - - $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId); - - $locationCreateStruct->priority = 500; - $locationCreateStruct->hidden = true; - - $contentInfo = $this->contentService->loadContentInfo($contentId); - $newLocation = $this->locationService->createLocation($contentInfo, $locationCreateStruct); - - $output->writeln('Added hidden location ' . $newLocation->id . ' to content item: ' . $contentInfo->name); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/BookmarkCommand.php b/code_samples/api/public_php_api/src/Command/BookmarkCommand.php deleted file mode 100644 index 4032f40133c..00000000000 --- a/code_samples/api/public_php_api/src/Command/BookmarkCommand.php +++ /dev/null @@ -1,59 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, 'Location id'), - ]) - ->addOption('delete', 'd', InputOption::VALUE_NONE, 'Delete the created bookmark?', null); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $locationId = (int) $input->getArgument('locationId'); - $location = $this->locationService->loadLocation($locationId); - - $this->bookmarkService->createBookmark($location); - - $output->writeln('Added bookmark to ' . $location->getContentInfo()->name); - - $bookmarkList = $this->bookmarkService->loadBookmarks(); - - $output->writeln('Total bookmarks: ' . $bookmarkList->totalCount); - - foreach ($bookmarkList->items as $bookmark) { - $output->writeln($bookmark->getContentInfo()->name); - } - - if ($input->getOption('delete')) { - $this->bookmarkService->deleteBookmark($location); - $output->writeln('Deleted bookmark from ' . $location->getContentInfo()->name); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php b/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php deleted file mode 100644 index 9f88f6ee9eb..00000000000 --- a/code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php +++ /dev/null @@ -1,51 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, 'Location ID to browse from'), - ]); - } - - private function browseLocation(Location $location, OutputInterface $output, int $depth = 0): void - { - $output->writeln($location->contentInfo->name); - - $children = $this->locationService->loadLocationChildren($location); - foreach ($children->locations as $child) { - $this->browseLocation($child, $output, $depth + 1); - } - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $locationId = (int) $input->getArgument('locationId'); - - $location = $this->locationService->loadLocation($locationId); - $this->browseLocation($location, $output); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/CalendarCommand.php b/code_samples/api/public_php_api/src/Command/CalendarCommand.php deleted file mode 100644 index 4a48eedfaf9..00000000000 --- a/code_samples/api/public_php_api/src/Command/CalendarCommand.php +++ /dev/null @@ -1,61 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $dateFrom = new \DateTimeImmutable('2023-01-01T10:00:00+00:00'); - $dateTo = new \DateTimeImmutable('2023-12-31T10:0:00+00:00'); - $dateRange = new Calendar\DateRange($dateFrom, $dateTo); - - $eventQuery = new Calendar\EventQuery($dateRange, 10); - - $eventList = $this->calendarService->getEvents($eventQuery); - - foreach ($eventList as $event) { - $output->writeln($event->getName() . '; date: ' . $event->getDateTime()->format('T Y-m-d H:i:s')); - } - - $eventCollection = $eventList->getEvents(); - $output->writeln('First event: ' . $eventCollection->first()->getName() . '; date: ' . $eventCollection->first()->getDateTime()->format('T Y-m-d H:i:s')); - - $newCollection = $eventCollection->slice(3, 5); - foreach ($newCollection as $event) { - $output->writeln('New collection: ' . $event->getName() . '; date: ' . $event->getDateTime()->format('T Y-m-d H:i:s')); - } - - $newDate = new \DateTimeImmutable('2023-12-06T13:00:00+00:00'); - $context = new RescheduleEventActionContext($eventCollection, $newDate); - - $this->calendarService->executeAction($context); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/CreateContentCommand.php b/code_samples/api/public_php_api/src/Command/CreateContentCommand.php deleted file mode 100644 index 620c0932c6d..00000000000 --- a/code_samples/api/public_php_api/src/Command/CreateContentCommand.php +++ /dev/null @@ -1,69 +0,0 @@ -setDefinition([ - new InputArgument('parentLocationId', InputArgument::REQUIRED, 'Parent Location ID'), - new InputArgument('contentType', InputArgument::REQUIRED, 'Identifier of a content type with a Name and Description Field'), - new InputArgument('name', InputArgument::REQUIRED, 'Content for the Name field'), - ]) - ->addOption('publish', 'p', InputOption::VALUE_NONE, 'Do you want to publish the content item?'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $parentLocationId = (int) $input->getArgument('parentLocationId'); - $contentTypeIdentifier = $input->getArgument('contentType'); - $name = $input->getArgument('name'); - - $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier); - $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, 'eng-GB'); - $contentCreateStruct->setField('name', $name); - - $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId); - - $draft = $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]); - - $output->writeln('Created a draft of ' . $contentType->getName() . ' with name ' . $draft->getName()); - - if ($input->getOption('publish')) { - $content = $this->contentService->publishVersion($draft->versionInfo); - $output->writeln('Published content item ' . $content->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php b/code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php deleted file mode 100644 index 2f9a9b694a1..00000000000 --- a/code_samples/api/public_php_api/src/Command/CreateContentTypeCommand.php +++ /dev/null @@ -1,100 +0,0 @@ -setDefinition([ - new InputArgument('identifier', InputArgument::REQUIRED, 'Content type identifier'), - new InputArgument('group_identifier', InputArgument::REQUIRED, 'Content type group identifier'), - new InputArgument('copy_identifier', InputArgument::OPTIONAL, 'Identifier of the CT copy'), - ]) - ->addOption('copy', 'c', InputOption::VALUE_NONE, 'Do you want to make a copy of the content type?'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $groupIdentifier = $input->getArgument('group_identifier'); - $contentTypeIdentifier = $input->getArgument('identifier'); - if ($input->getArgument('copy_identifier')) { - $copyIdentifier = $input->getArgument('copy_identifier'); - } - - try { - $contentTypeGroup = $this->contentTypeService->loadContentTypeGroupByIdentifier($groupIdentifier); - } catch (NotFoundException) { - $output->writeln("Content type group with identifier $groupIdentifier not found"); - - return self::FAILURE; - } - - $contentTypeCreateStruct = $this->contentTypeService->newContentTypeCreateStruct($contentTypeIdentifier); - $contentTypeCreateStruct->mainLanguageCode = 'eng-GB'; - $contentTypeCreateStruct->nameSchema = ''; - - $contentTypeCreateStruct->names = [ - 'eng-GB' => $contentTypeIdentifier, - ]; - - $titleFieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct('name', 'ibexa_string'); - $titleFieldCreateStruct->names = ['eng-GB' => 'Name']; - $titleFieldCreateStruct->descriptions = ['eng-GB' => 'The name']; - $titleFieldCreateStruct->fieldGroup = 'content'; - $titleFieldCreateStruct->position = 10; - $titleFieldCreateStruct->isTranslatable = true; - $titleFieldCreateStruct->isRequired = true; - $titleFieldCreateStruct->isSearchable = true; - - $contentTypeCreateStruct->addFieldDefinition($titleFieldCreateStruct); - - $contentTypeDraft = $this->contentTypeService->createContentType( - $contentTypeCreateStruct, - [$contentTypeGroup] - ); - - $this->contentTypeService->publishContentTypeDraft($contentTypeDraft); - $output->writeln("Content type '$contentTypeIdentifier' with ID $contentTypeDraft->id created"); - - if ($input->getOption('copy')) { - $contentTypeToCopy = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier); - - $copy = $this->contentTypeService->copyContentType($contentTypeToCopy); - $copyDraft = $this->contentTypeService->createContentTypeDraft($copy); - $copyUpdateStruct = $this->contentTypeService->newContentTypeUpdateStruct(); - $copyUpdateStruct->identifier = $copyIdentifier; - $copyUpdateStruct->names = ['eng-GB' => $copyIdentifier]; - $this->contentTypeService->updateContentTypeDraft($copyDraft, $copyUpdateStruct); - $this->contentTypeService->publishContentTypeDraft($copyDraft); - $output->writeln('Copy of the new CT created with identifier ' . $copyIdentifier); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/CreateImageCommand.php b/code_samples/api/public_php_api/src/Command/CreateImageCommand.php deleted file mode 100644 index 201b1d980b7..00000000000 --- a/code_samples/api/public_php_api/src/Command/CreateImageCommand.php +++ /dev/null @@ -1,78 +0,0 @@ -setDefinition([ - new InputArgument('name', InputArgument::REQUIRED, 'Content for the Name field'), - new InputArgument('file', InputArgument::REQUIRED, 'Content for the Image field'), - ]) - ->addOption('publish', 'p', InputOption::VALUE_NONE, 'Do you want to publish the content item?'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $name = $input->getArgument('name'); - $file = $input->getArgument('file'); - $publish = $input->getOption('publish'); - - $contentType = $this->contentTypeService->loadContentTypeByIdentifier('image'); - $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, 'eng-GB'); - $contentCreateStruct->setField('name', $name); - $imageValue = new Value( - [ - 'path' => $file, - 'fileSize' => filesize($file), - 'fileName' => basename((string) $file), - 'alternativeText' => $name, - ] - ); - $contentCreateStruct->setField('image', $imageValue); - - $locationCreateStruct = $this->locationService->newLocationCreateStruct(51); - - $draft = $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]); - - $output->writeln('Created a draft of ' . $contentType->getName() . ' with name ' . $draft->getName()); - - if ($publish == true) { - $content = $this->contentService->publishVersion($draft->versionInfo); - $output->writeln('Published content item ' . $content->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php b/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php deleted file mode 100644 index 6c58ceeea63..00000000000 --- a/code_samples/api/public_php_api/src/Command/DeleteContentCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, 'Location to delete'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $locationId = (int) $input->getArgument('locationId'); - - $location = $this->locationService->loadLocation($locationId); - - $this->locationService->deleteLocation($location); - - $output->writeln('Location ' . $locationId . ' deleted.'); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FilterCommand.php b/code_samples/api/public_php_api/src/Command/FilterCommand.php deleted file mode 100644 index 09f1afdd357..00000000000 --- a/code_samples/api/public_php_api/src/Command/FilterCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -setDefinition([ - new InputArgument('parentLocationId', InputArgument::REQUIRED, 'ID of the parent Location'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $parentLocationId = (int)$input->getArgument('parentLocationId'); - - $filter = new Filter(); - $filter - ->withCriterion(new Criterion\ParentLocationId($parentLocationId)) - ->withSortClause(new SortClause\ContentName(Query::SORT_DESC)); - - $result = $this->contentService->find($filter, []); - - $output->writeln('Found ' . $result->getTotalCount() . ' items'); - - foreach ($result as $content) { - $output->writeln($content->getName() ?? 'No content name'); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php b/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php deleted file mode 100644 index f1f05b5b237..00000000000 --- a/code_samples/api/public_php_api/src/Command/FilterLocationCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -setDefinition([ - new InputArgument('parentLocationId', InputArgument::REQUIRED, 'ID of the parent Location'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $parentLocationId = (int)$input->getArgument('parentLocationId'); - - $filter = new Filter(); - $filter - ->withCriterion(new Criterion\ParentLocationId($parentLocationId)) - ->withSortClause(new SortClause\ContentName(Query::SORT_DESC)); - - $result = $this->locationService->find($filter, []); - - $output->writeln('Found ' . $result->getTotalCount() . ' items'); - - foreach ($result as $content) { - $output->writeln($content->getContent()->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php b/code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php deleted file mode 100644 index 4d0af395359..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindByTaxonomyEmbeddingCommand.php +++ /dev/null @@ -1,69 +0,0 @@ -embeddingProviderResolver->resolve(); - $embedding = $embeddingProvider->getEmbedding('example_content'); - - $query = EmbeddingQueryBuilder::create() - ->withEmbedding(new TaxonomyEmbedding($embedding)) - ->setFilter(new ContentTypeIdentifier('article')) - ->setLimit(10) - ->setOffset(0) - ->setPerformCount(true) - ->build(); - - $result = $this->searchService->findContent($query); - - $io->success(sprintf('Found %d items.', $result->totalCount)); - - foreach ($result->searchHits as $searchHit) { - assert($searchHit instanceof SearchHit); - - /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ - $content = $searchHit->valueObject; - $contentInfo = $content->versionInfo->contentInfo; - - $io->writeln(sprintf( - '%d: %s', - $contentInfo->id, - $contentInfo->name - )); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindComplexCommand.php b/code_samples/api/public_php_api/src/Command/FindComplexCommand.php deleted file mode 100644 index a60e28a59c4..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindComplexCommand.php +++ /dev/null @@ -1,69 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, ''), - new InputArgument('contentTypeIdentifier', InputArgument::REQUIRED, 'Content type identifier'), - new InputArgument('text', InputArgument::REQUIRED, ''), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $locationId = (int) $input->getArgument('locationId'); - $contentTypeIdentifier = $input->getArgument('contentTypeIdentifier'); - $text = $input->getArgument('text'); - - $query = new LocationQuery(); - - $query->query = new Criterion\LogicalAnd([ - new Criterion\Subtree($this->locationService->loadLocation($locationId)->pathString), - new Criterion\ContentTypeIdentifier($contentTypeIdentifier), - new Criterion\FullText($text), - new Criterion\LogicalNot( - new Criterion\SectionIdentifier('Media') - ), - ]); - - $query->sortClauses = [ - new SortClause\DatePublished(LocationQuery::SORT_ASC), - new SortClause\ContentName(LocationQuery::SORT_DESC), - ]; - - $result = $this->searchService->findContentInfo($query); - $output->writeln('Found ' . $result->totalCount . ' items'); - foreach ($result->searchHits as $searchHit) { - $output->writeln($searchHit->valueObject->name); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindContentCommand.php b/code_samples/api/public_php_api/src/Command/FindContentCommand.php deleted file mode 100644 index ff72d55a46a..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindContentCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -setDefinition([ - new InputArgument('contentTypeIdentifier', InputArgument::REQUIRED, 'Content type identifier'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $contentTypeIdentifier = $input->getArgument('contentTypeIdentifier'); - - $query = new LocationQuery(); - $query->filter = new Criterion\ContentTypeIdentifier($contentTypeIdentifier); - - $result = $this->searchService->findContentInfo($query); - - $output->writeln('Found ' . $result->totalCount . ' items'); - foreach ($result->searchHits as $searchHit) { - $output->writeln($searchHit->valueObject->name); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindContentTypeCommand.php b/code_samples/api/public_php_api/src/Command/FindContentTypeCommand.php deleted file mode 100644 index d8287a0229d..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindContentTypeCommand.php +++ /dev/null @@ -1,55 +0,0 @@ -contentTypeService->findContentTypes($query); - - $output->writeln('Found ' . $searchResult->getTotalCount() . ' content type(s):'); - - foreach ($searchResult->getContentTypes() as $contentType) { - $output->writeln(sprintf( - '- [%d] %s (identifier: %s)', - $contentType->id, - $contentType->getName(), - $contentType->identifier - )); - } - - return Command::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php b/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php deleted file mode 100644 index c663e929175..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindInTrashCommand.php +++ /dev/null @@ -1,46 +0,0 @@ -setDefinition([ - new InputArgument('contentTypeId', InputArgument::REQUIRED, 'Content type ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $contentTypeId = (int) $input->getArgument('contentTypeId'); - - $query = new Query(); - - $query->filter = new Query\Criterion\ContentTypeId($contentTypeId); - $results = $this->trashService->findTrashItems($query); - foreach ($results->items as $trashedLocation) { - $output->writeln($trashedLocation->getContentInfo()->name); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindUrlCommand.php b/code_samples/api/public_php_api/src/Command/FindUrlCommand.php deleted file mode 100644 index d9535189b3e..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindUrlCommand.php +++ /dev/null @@ -1,57 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $query = new URLQuery(); - - $query->filter = new Criterion\LogicalAnd( - [ - new Criterion\SectionIdentifier(['standard']), - new Criterion\Validity(true), - ] - ); - $query->sortClauses = [ - new SortClause\URL(SortClause::SORT_DESC), - ]; - $query->offset = 0; - $query->limit = 25; - - $results = $this->urlService->findUrls($query); - - foreach ($results->items as $result) { - $output->writeln($result->getUrl()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php b/code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php deleted file mode 100644 index 664d0a85fbd..00000000000 --- a/code_samples/api/public_php_api/src/Command/FindWithAggregationCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -query = new Criterion\ParentLocationId(2); - - $contentTypeTermAggregation = new ContentTypeTermAggregation('content_type'); - $contentTypeTermAggregation->setLimit(5); - $contentTypeTermAggregation->setMinCount(10); - - $query->aggregations[] = $contentTypeTermAggregation; - $query->aggregations[] = new SelectionTermAggregation('selection', 'blog_post', 'topic'); - - $results = $this->searchService->findContentInfo($query); - - $contentByType = $results->aggregations->get('content_type'); - $contentBySelection = $results->aggregations->get('selection'); - - foreach ($contentByType as $contentType => $count) { - $output->writeln($contentType->getName() . ': ' . $count); - } - - foreach ($contentBySelection as $selection => $count) { - $output->writeln($selection . ': ' . $count); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php b/code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php deleted file mode 100644 index 54589ca95dc..00000000000 --- a/code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php +++ /dev/null @@ -1,67 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $content = $this->contentService->loadContent(143); - $contentInfo = $content->contentInfo; - - $formValue = $content->getFieldValue('form', 'eng-GB')->getFormValue(); - $data = [ - ['id' => 7, 'identifier' => 'single_line', 'name' => 'Line', 'value' => 'The name'], - ['id' => 8, 'identifier' => 'number', 'name' => 'Number', 'value' => 123], - ['id' => 9, 'identifier' => 'checkbox', 'name' => 'Checkbox', 'value' => 0], - ]; - - $this->formSubmissionService->create( - $contentInfo, - 'eng-GB', - $formValue, - $data - ); - - $submissions = $this->formSubmissionService->loadByContent($contentInfo); - - $output->writeln('Total number of submissions: ' . $submissions->getTotalCount()); - foreach ($submissions as $sub) { - $output->write($sub->getId() . '. submitted on '); - $output->write($sub->getCreated()->format('Y-m-d H:i:s') . ' by '); - $output->writeln((string) $this->userService->loadUser($sub->getUserId())->getName()); - foreach ($sub->getValues() as $value) { - $output->writeln('- ' . $value->getIdentifier() . ': ' . $value->getDisplayValue()); - } - } - - $submission = $this->formSubmissionService->loadById(29); - $this->formSubmissionService->delete($submission); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/HideLocationCommand.php b/code_samples/api/public_php_api/src/Command/HideLocationCommand.php deleted file mode 100644 index 2ad1d224ad5..00000000000 --- a/code_samples/api/public_php_api/src/Command/HideLocationCommand.php +++ /dev/null @@ -1,53 +0,0 @@ -setDefinition([ - new InputArgument('location_id', InputArgument::REQUIRED, 'Location ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $locationId = (int) $input->getArgument('location_id'); - - $location = $this->locationService->loadLocation($locationId); - - $this->locationService->hideLocation($location); - $output->writeln('Location hidden: ' . $locationId); - - $this->locationService->unhideLocation($location); - $output->writeln('Location revealed: ' . $locationId); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/MoveContentCommand.php b/code_samples/api/public_php_api/src/Command/MoveContentCommand.php deleted file mode 100644 index 50b760fa962..00000000000 --- a/code_samples/api/public_php_api/src/Command/MoveContentCommand.php +++ /dev/null @@ -1,52 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, 'Location to copy'), - new InputArgument('targetLocationId', InputArgument::REQUIRED, 'Target to copy or move to'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $locationId = (int) $input->getArgument('locationId'); - $targetLocationId = (int) $input->getArgument('targetLocationId'); - - $sourceLocation = $this->locationService->loadLocation($locationId); - $targetLocation = $this->locationService->loadLocation($targetLocationId); - $this->locationService->moveSubtree($sourceLocation, $targetLocation); - $output->writeln('Location ' . $locationId . ' moved to ' . $targetLocationId . ' with its subtree.'); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php b/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php deleted file mode 100644 index 5c133c6743c..00000000000 --- a/code_samples/api/public_php_api/src/Command/ObjectStateCommand.php +++ /dev/null @@ -1,84 +0,0 @@ -setDefinition([ - new InputArgument('objectStateGroupIdentifier', InputArgument::REQUIRED, 'Identifier of new OG group to create'), - new InputArgument('objectStateIdentifier', InputArgument::REQUIRED, 'Identifier(s) of a new Object State'), - new InputArgument('contentID', InputArgument::OPTIONAL, 'Content ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier('ibexa_lock'); - $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, 'locked'); - - $output->writeln($objectStateGroup->getName()); - $output->writeln($objectState->getName()); - - $objectStateGroupIdentifier = $input->getArgument('objectStateGroupIdentifier'); - $objectStateIdentifierList = explode(',', (string) $input->getArgument('objectStateIdentifier')); - - $objectStateGroupStruct = $this->objectStateService->newObjectStateGroupCreateStruct($objectStateGroupIdentifier); - $objectStateGroupStruct->defaultLanguageCode = 'eng-GB'; - $objectStateGroupStruct->names = ['eng-GB' => $objectStateGroupIdentifier]; - $newObjectStateGroup = $this->objectStateService->createObjectStateGroup($objectStateGroupStruct); - - foreach ($objectStateIdentifierList as $objectStateIdentifier) { - $stateStruct = $this->objectStateService->newObjectStateCreateStruct($objectStateIdentifier); - $stateStruct->defaultLanguageCode = 'eng-GB'; - $stateStruct->names = ['eng-GB' => $objectStateIdentifier]; - $this->objectStateService->createObjectState($newObjectStateGroup, $stateStruct); - } - - $output->writeln('Created new Object state group ' . $newObjectStateGroup->identifier . ' with Object states:'); - foreach ($this->objectStateService->loadObjectStates($newObjectStateGroup) as $objectState) { - $output->writeln('* ' . $objectState->getName()); - } - - if ($input->getArgument('contentID')) { - $contentId = (int) $input->getArgument('contentID'); - $objectStateToAssign = $objectStateIdentifierList[0]; - $contentInfo = $this->contentService->loadContentInfo($contentId); - $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier($objectStateGroupIdentifier); - $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, $objectStateToAssign); - - $this->objectStateService->setContentState($contentInfo, $objectStateGroup, $objectState); - $output->writeln('Content ' . $contentInfo->name . ' assigned state ' . $objectState->getName()); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/SectionCommand.php b/code_samples/api/public_php_api/src/Command/SectionCommand.php deleted file mode 100644 index 2ee4e31d2a9..00000000000 --- a/code_samples/api/public_php_api/src/Command/SectionCommand.php +++ /dev/null @@ -1,84 +0,0 @@ -setDefinition([ - new InputArgument('sectionName', InputArgument::REQUIRED, 'Name of the new Section'), - new InputArgument('sectionIdentifier', InputArgument::REQUIRED, 'Identifier of the new Section'), - new InputArgument('contentId', InputArgument::REQUIRED, 'Content id'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $sectionName = $input->getArgument('sectionName'); - $sectionIdentifier = $input->getArgument('sectionIdentifier'); - $contentId = (int) $input->getArgument('contentId'); - - $sectionCreateStruct = $this->sectionService->newSectionCreateStruct(); - $sectionCreateStruct->name = $sectionName; - $sectionCreateStruct->identifier = $sectionIdentifier; - $this->sectionService->createSection($sectionCreateStruct); - $output->writeln('Created new Section ' . $sectionName); - - $section = $this->sectionService->loadSectionByIdentifier($sectionIdentifier); - $contentInfo = $this->contentService->loadContentInfo($contentId); - $this->sectionService->assignSection($contentInfo, $section); - $output->writeln('Content ' . $contentInfo->name . ' assigned to Section ' . $sectionName); - - $query = new LocationQuery(); - $query->filter = new Criterion\SectionId([ - $section->id, - ]); - - $result = $this->searchService->findContentInfo($query); - - $output->writeln(( - $this->sectionService->isSectionUsed($section) - ? 'This section is in use.' - : 'This section is not in use.' - )); - $output->writeln('Content in this section: ' . $result->totalCount); - - foreach ($result->searchHits as $searchResult) { - $output->writeln('* ' . $searchResult->valueObject->name); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/SegmentCommand.php b/code_samples/api/public_php_api/src/Command/SegmentCommand.php deleted file mode 100644 index 64c2c4d95cb..00000000000 --- a/code_samples/api/public_php_api/src/Command/SegmentCommand.php +++ /dev/null @@ -1,71 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $segmentGroupCreateStruct = new SegmentGroupCreateStruct([ - 'name' => 'Custom Group', - 'identifier' => 'custom_group', - 'createSegments' => [], - ]); - - $newSegmentGroup = $this->segmentationService->createSegmentGroup($segmentGroupCreateStruct); - - $segmentCreateStruct = new SegmentCreateStruct([ - 'name' => 'Segment 1', - 'identifier' => 'segment_1', - 'group' => $newSegmentGroup, - ]); - - $newSegment = $this->segmentationService->createSegment($segmentCreateStruct); - - $segmentGroup = $this->segmentationService->loadSegmentGroupByIdentifier('custom_group'); - - $segments = $this->segmentationService->loadSegmentsAssignedToGroup($segmentGroup); - - foreach ($segments as $segment) { - $output->writeln('Segment identifier: ' . $segment->getIdentifier() . ', name: ' . $segment->getName()); - } - - $segment = $this->segmentationService->loadSegmentByIdentifier('segment_1'); - - $this->segmentationService->assignUserToSegment($user, $segment); - - $output->writeln(( - $this->segmentationService->isUserAssignedToSegment($user, $segment) - ? 'The user is assigned to the segment.' - : 'The user is not assigned to the segment.' - )); - - $this->segmentationService->removeSegmentGroup($segmentGroup); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php b/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php deleted file mode 100644 index 081cbabcc50..00000000000 --- a/code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'The Content ID'), - new InputArgument('locationId', InputArgument::REQUIRED, 'One of the Locations of the Content'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $contentId = (int) $input->getArgument('contentId'); - $locationId = (int) $input->getArgument('locationId'); - - $contentInfo = $this->contentService->loadContentInfo($contentId); - - $contentUpdateStruct = $this->contentService->newContentMetadataUpdateStruct(); - $contentUpdateStruct->mainLocationId = $locationId; - - $this->contentService->updateContentMetadata($contentInfo, $contentUpdateStruct); - - $output->writeln('Location ' . $locationId . ' is now the main Location for ' . $contentInfo->name); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/TaxonomyCommand.php b/code_samples/api/public_php_api/src/Command/TaxonomyCommand.php deleted file mode 100644 index 2b98a23b6eb..00000000000 --- a/code_samples/api/public_php_api/src/Command/TaxonomyCommand.php +++ /dev/null @@ -1,56 +0,0 @@ -userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $allEntries = $this->taxonomyService->loadAllEntries(null, 50); - - $entry = $this->taxonomyService->loadEntryByIdentifier('desks'); - - $output->writeln($entry->name . ' with parent ' . $entry->parent->name); - - // Loads first 10 children - $entryChildren = $this->taxonomyService->loadEntryChildren($entry, 10); - - foreach ($entryChildren as $child) { - $output->writeln($child->name); - } - - $entryToMove = $this->taxonomyService->loadEntryByIdentifier('standing_desks'); - $newParent = $this->taxonomyService->loadEntryByIdentifier('desks'); - - $this->taxonomyService->moveEntry($entryToMove, $newParent); - - $sibling = $this->taxonomyService->loadEntryByIdentifier('school_desks'); - $this->taxonomyService->moveEntryRelativeToSibling($entryToMove, $sibling, TaxonomyServiceInterface::MOVE_POSITION_PREV); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php b/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php deleted file mode 100644 index c599ca0bbee..00000000000 --- a/code_samples/api/public_php_api/src/Command/TranslateContentCommand.php +++ /dev/null @@ -1,67 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'ID of content to be updated'), - new InputArgument('language', InputArgument::REQUIRED, 'Language to add'), - new InputArgument('nameInNewLanguage', InputArgument::REQUIRED, 'Content name in new language'), - new InputArgument('secondaryLanguage', InputArgument::OPTIONAL, 'Secondary language to add'), - new InputArgument('nameInSecondaryLanguage', InputArgument::OPTIONAL, 'Content name in secondary language'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $contentId = (int) $input->getArgument('contentId'); - $language = $input->getArgument('language'); - $newName = $input->getArgument('nameInNewLanguage'); - $secondaryLanguage = $input->getArgument('secondaryLanguage'); - $nameInSecondaryLanguage = $input->getArgument('nameInSecondaryLanguage'); - - $contentInfo = $this->contentService->loadContentInfo($contentId); - $contentDraft = $this->contentService->createContentDraft($contentInfo); - - $contentUpdateStruct = $this->contentService->newContentUpdateStruct(); - $contentUpdateStruct->initialLanguageCode = $language; - $contentUpdateStruct->setField('name', $newName); - - if ($nameInSecondaryLanguage !== null) { - $contentUpdateStruct->setField('name', $nameInSecondaryLanguage, $secondaryLanguage); - } - - $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct); - $this->contentService->publishVersion($contentDraft->versionInfo); - $output->writeln('Translated ' . $contentInfo->name . ' to ' . $language . ' as ' . $newName); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/TrashContentCommand.php b/code_samples/api/public_php_api/src/Command/TrashContentCommand.php deleted file mode 100644 index 23bcdf7ad4a..00000000000 --- a/code_samples/api/public_php_api/src/Command/TrashContentCommand.php +++ /dev/null @@ -1,67 +0,0 @@ -setDefinition([ - new InputArgument('locationId', InputArgument::REQUIRED, 'Location to trash'), - new InputArgument('newParentId', InputArgument::OPTIONAL, 'New Location to restore under'), - ]) - ->addOption('restore', 'r', InputOption::VALUE_NONE, 'Do you want to restore the content item?'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $locationId = (int) $input->getArgument('locationId'); - if ($input->getArgument('newParentId')) { - $newParentId = (int) $input->getArgument('newParentId'); - } - - $location = $this->locationService->loadLocation($locationId); - - $this->trashService->trash($location); - $output->writeln('Location ' . $locationId . ' moved to trash.'); - - if ($input->getOption('restore')) { - if ($input->getArgument('newParentId')) { - $newParent = $this->locationService->loadLocation($newParentId); - } else { - $newParent = null; - } - $trashItem = $this->trashService->loadTrashItem($locationId); - $this->trashService->recover($trashItem, $newParent); - $output->writeln('Restored from trash.'); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php b/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php deleted file mode 100644 index 5783097e29e..00000000000 --- a/code_samples/api/public_php_api/src/Command/UpdateContentCommand.php +++ /dev/null @@ -1,59 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'Content ID'), - new InputArgument('newName', InputArgument::REQUIRED, 'New name for the updated content item'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $contentId = (int) $input->getArgument('contentId'); - $newName = $input->getArgument('newName'); - - $contentInfo = $this->contentService->loadContentInfo($contentId); - $contentDraft = $this->contentService->createContentDraft($contentInfo); - - $contentUpdateStruct = $this->contentService->newContentUpdateStruct(); - $contentUpdateStruct->initialLanguageCode = 'eng-GB'; - $contentUpdateStruct->setField('name', $newName); - - $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct); - $this->contentService->publishVersion($contentDraft->versionInfo); - - $output->writeln('Content item ' . $contentId . ' updated with new name: ' . $newName); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/ViewContentCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentCommand.php deleted file mode 100644 index 0af99757e71..00000000000 --- a/code_samples/api/public_php_api/src/Command/ViewContentCommand.php +++ /dev/null @@ -1,54 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'Location ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $contentId = (int) $input->getArgument('contentId'); - - $content = $this->contentService->loadContent($contentId); - $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId); - - foreach ($contentType->fieldDefinitions as $fieldDefinition) { - $output->writeln('Field: ' . $fieldDefinition->identifier); - $fieldType = $this->fieldTypeService->getFieldType($fieldDefinition->fieldTypeIdentifier); - $field = $content->getFieldValue($fieldDefinition->identifier); - $valueHash = $fieldType->toHash($field); - $output->writeln('Value:'); - $output->writeln($valueHash); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php b/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php deleted file mode 100644 index 69f197bd3a1..00000000000 --- a/code_samples/api/public_php_api/src/Command/ViewContentMetaDataCommand.php +++ /dev/null @@ -1,122 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'An existing content ID'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $user = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($user); - - $contentId = (int) $input->getArgument('contentId'); - - // Metadata - $contentInfo = $this->contentService->loadContentInfo($contentId); - - $output->writeln("Name: $contentInfo->name"); - $output->writeln('Last modified: ' . $contentInfo->modificationDate->format('Y-m-d')); - $output->writeln('Published: ' . $contentInfo->publishedDate->format('Y-m-d')); - $output->writeln("RemoteId: $contentInfo->remoteId"); - $output->writeln("Main Language: $contentInfo->mainLanguageCode"); - $output->writeln('Always available: ' . ($contentInfo->alwaysAvailable ? 'Yes' : 'No')); - - // Locations - $locations = $this->locationService->loadLocations($contentInfo); - - foreach ($locations as $location) { - $output->writeln('Location: ' . $location->pathString); - $urlAlias = $this->urlAliasService->reverseLookup($location); - $output->writeln('URL alias: ' . $urlAlias->path); - } - - // Content type - $content = $this->contentService->loadContent($contentId); - $output->writeln('Content type: ' . $content->getContentType()->getName()); - - // Versions - $versionInfos = $this->contentService->loadVersions($contentInfo); - foreach ($versionInfos as $versionInfo) { - $output->write("Version $versionInfo->versionNo"); - $output->write(' by ' . $versionInfo->getCreator()->getName()); - $output->writeln(' in ' . $versionInfo->getInitialLanguage()->name); - } - - $versionInfoArray = iterator_to_array($this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED)); - if (count($versionInfoArray)) { - $output->writeln('Archived versions:'); - foreach ($versionInfoArray as $versionInfo) { - $creator = $this->userService->loadUser($versionInfo->creatorId); - $output->write("Version $versionInfo->versionNo"); - $output->write(' by ' . $creator->contentInfo->name); - $output->writeln(' in ' . $versionInfo->initialLanguageCode); - } - } - - // Relations - $versionInfo = $this->contentService->loadVersionInfo($contentInfo); - $relationListIterator = new BatchIterator( - new RelationListIteratorAdapter( - $this->contentService, - $versionInfo - ) - ); - foreach ($relationListIterator as $relationListItem) { - $name = $relationListItem->hasRelation() ? $relationListItem->getRelation()->destinationContentInfo->name : '(Unauthorized)'; - $output->writeln("Relation to content '$name'"); - } - - // Owner - $output->writeln('Owner: ' . $contentInfo->getOwner()->getName()); - - // Section - $output->writeln('Section: ' . $contentInfo->getSection()->name); - - // Object states - $stateGroups = $this->objectStateService->loadObjectStateGroups(); - foreach ($stateGroups as $stateGroup) { - $state = $this->objectStateService->getContentState($contentInfo, $stateGroup); - $output->writeln("Object state: $state->identifier"); - } - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Command/WorkflowCommand.php b/code_samples/api/public_php_api/src/Command/WorkflowCommand.php deleted file mode 100644 index 7ed4d01efc8..00000000000 --- a/code_samples/api/public_php_api/src/Command/WorkflowCommand.php +++ /dev/null @@ -1,69 +0,0 @@ -setDefinition([ - new InputArgument('contentId', InputArgument::REQUIRED, 'Content ID'), - new InputArgument('workflowName', InputArgument::REQUIRED, 'Workflow identifier'), - new InputArgument('transitionName', InputArgument::REQUIRED, 'Transition name'), - ]); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $contentId = (int) $input->getArgument('contentId'); - $workflowName = $input->getArgument('workflowName'); - $transitionName = $input->getArgument('transitionName'); - - $content = $this->contentService->loadContent($contentId); - - $supportedWorkflows = $this->workflowRegistry->getSupportedWorkflows($content); - foreach ($supportedWorkflows as $supportedWorkflow) { - $output->writeln('Supports workflow: ' . $supportedWorkflow->getName()); - } - - $this->workflowService->start($content, $workflowName); - $workflowMetadata = $this->workflowService->loadWorkflowMetadataForContent($content, $workflowName); - - foreach ($workflowMetadata->markings as $marking) { - $output->writeln($content->getName() . ' is in stage ' . $marking->name . ' in workflow ' . $workflowMetadata->workflow->getName()); - } - - if ($this->workflowService->can($workflowMetadata, $transitionName)) { - $workflow = $this->workflowRegistry->getWorkflow($workflowName); - $workflow->apply($workflowMetadata->content, $transitionName, ['message' => 'done', 'reviewerId' => 14]); - $output->writeln('Moved ' . $content->getName() . ' through transition ' . $transitionName); - } - - $versionInfo = $content->getVersionInfo(); - $workflowMetadataByVersion = $this->workflowService->loadWorkflowMetadataForVersionInfo($versionInfo, $workflowName); - - return self::SUCCESS; - } -} diff --git a/code_samples/api/public_php_api/src/Controller/CustomController.php b/code_samples/api/public_php_api/src/Controller/CustomController.php deleted file mode 100644 index 1f00f315719..00000000000 --- a/code_samples/api/public_php_api/src/Controller/CustomController.php +++ /dev/null @@ -1,32 +0,0 @@ -filter = new Criterion\ParentLocationId($locationId); - - $results = $this->searchService->findContentInfo($query); - $items = []; - foreach ($results->searchHits as $searchHit) { - $items[] = $searchHit; - } - - return $this->render('@ibexadesign/full/custom.html.twig', [ - 'items' => $items, - ]); - } -} diff --git a/code_samples/api/public_php_api/src/Controller/CustomFilterController.php b/code_samples/api/public_php_api/src/Controller/CustomFilterController.php deleted file mode 100644 index 07c057262d9..00000000000 --- a/code_samples/api/public_php_api/src/Controller/CustomFilterController.php +++ /dev/null @@ -1,31 +0,0 @@ -withCriterion(new ParentLocationId($view->getLocation()->id)); - - $view->setParameters( - [ - 'items' => $this->contentService->find($filter), - ] - ); - - return $view; - } -} diff --git a/code_samples/api/public_php_api/src/Controller/PaginationController.php b/code_samples/api/public_php_api/src/Controller/PaginationController.php deleted file mode 100644 index ea6fad86946..00000000000 --- a/code_samples/api/public_php_api/src/Controller/PaginationController.php +++ /dev/null @@ -1,39 +0,0 @@ -filter = new Criterion\ParentLocationId($locationId); - - $pager = new Pagerfanta( - new ContentSearchAdapter($query, $this->searchService) - ); - $pager->setMaxPerPage(3); - $pager->setCurrentPage($request->get('page', 1)); - - return $this->render( - '@ibexadesign/full/custom_pagination.html.twig', - [ - 'totalItemCount' => $pager->getNbResults(), - 'pagerItems' => $pager, - ] - ); - } -} diff --git a/code_samples/api/public_php_api/src/EventSubscriber/MyEventSubcriber.php b/code_samples/api/public_php_api/src/EventSubscriber/MyEventSubcriber.php deleted file mode 100644 index 6b6c76e6713..00000000000 --- a/code_samples/api/public_php_api/src/EventSubscriber/MyEventSubcriber.php +++ /dev/null @@ -1,21 +0,0 @@ - ['onCopyContent', 0], - ]; - } - - public function onCopyContent(CopyContentEvent $event): void - { - // your implementation - } -} diff --git a/code_samples/api/public_php_api/src/embedding_fields.php b/code_samples/api/public_php_api/src/embedding_fields.php deleted file mode 100644 index 6276bab30eb..00000000000 --- a/code_samples/api/public_php_api/src/embedding_fields.php +++ /dev/null @@ -1,11 +0,0 @@ -create(); -echo $embeddingField->getType(); // for example, "ibexa_dense_vector_model_123" - -// Create a custom embedding field with a specific type -$customField = $factory->create('custom_embedding_type'); -echo $customField->getType(); // "custom_embedding_type" diff --git a/code_samples/api/public_php_api/src/perform_count.php b/code_samples/api/public_php_api/src/perform_count.php deleted file mode 100644 index db61e36d736..00000000000 --- a/code_samples/api/public_php_api/src/perform_count.php +++ /dev/null @@ -1,18 +0,0 @@ -performCount = false; - -$locationResult = $searchService->findLocations($locationQuery); - -// For content searches -$contentQuery = new Query(); -$contentQuery->performCount = false; - -$contentResult = $searchService->findContent($contentQuery); diff --git a/code_samples/api/public_php_api/templates/themes/standard/full/custom.html.twig b/code_samples/api/public_php_api/templates/themes/standard/full/custom.html.twig deleted file mode 100644 index 4c2c6755ef2..00000000000 --- a/code_samples/api/public_php_api/templates/themes/standard/full/custom.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in items %} -

{{ item.valueObject.name }}

-{% endfor %} diff --git a/code_samples/api/public_php_api/templates/themes/standard/full/custom_filter.html.twig b/code_samples/api/public_php_api/templates/themes/standard/full/custom_filter.html.twig deleted file mode 100644 index 916de8609ad..00000000000 --- a/code_samples/api/public_php_api/templates/themes/standard/full/custom_filter.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in items %} -

{{ item.name }}

-{% endfor %} diff --git a/code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig b/code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig deleted file mode 100644 index ae9d3a2bdea..00000000000 --- a/code_samples/api/public_php_api/templates/themes/standard/full/custom_pagination.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% for item in pagerItems %} -

{{ ibexa_content_name(item) }}

-{% endfor %} - -{% if pagerItems.haveToPaginate() %} - {{ pagerfanta(pagerItems, 'ibexa') }} -{% endif %} diff --git a/code_samples/api/rest_api/create_image.json.php b/code_samples/api/rest_api/create_image.json.php deleted file mode 100644 index 501931004e1..00000000000 --- a/code_samples/api/rest_api/create_image.json.php +++ /dev/null @@ -1,144 +0,0 @@ - []\n"; - exit(1); -} - -if (!is_file($argv[1])) { - echo "{$argv[1]} doesn't exist or is not a file.\n"; - exit(2); -} - -// URL to Ibexa DXP installation and its REST API -$host = 'api.example.com'; -$scheme = 'https'; -$api = '/api/ibexa/v2'; -$baseUrl = "{$scheme}://{$host}{$api}"; - -// User credentials -$username = 'admin'; -$password = 'publish'; - -// Targets -$contentTypeId = 5; // "Image" -$parentLocationPath = '1/43/51'; // "Media > Images" -$sectionId = 3; // "Media" - -// Request payload -$data = [ - 'ContentCreate' => [ - 'ContentType' => [ - '_href' => "$api/content/types/$contentTypeId", - ], - 'mainLanguageCode' => 'eng-GB', - 'LocationCreate' => [ - 'ParentLocation' => [ - '_href' => "$api/content/locations/$parentLocationPath", - ], - 'sortField' => 'PATH', - 'sortOrder' => 'ASC', - ], - 'Section' => [ - '_href' => "$api/content/sections/$sectionId", - ], - 'fields' => [ - 'field' => [ - [ - 'fieldDefinitionIdentifier' => 'name', - 'fieldValue' => $argv[2] ?? basename($argv[1]), - ], - [ - 'fieldDefinitionIdentifier' => 'image', - 'fieldValue' => [ - // Original file name - 'fileName' => basename($argv[1]), - // File size in bytes - 'fileSize' => filesize($argv[1]), - // File content must be encoded as Base64 - 'data' => base64_encode(file_get_contents($argv[1])), - ], - ], - ], - ], - ], -]; - -$client = HttpClient::createForBaseUri($baseUrl, [ - 'auth_basic' => [$username, $password], -]); - -try { - $response = $client->request('POST', "$baseUrl/content/objects", [ - 'headers' => [ - 'Content-Type: application/vnd.ibexa.api.ContentCreate+json', - 'Accept: application/vnd.ibexa.api.ContentInfo+json', - ], - 'json' => $data, - ]); -} catch (HttpException\TransportExceptionInterface $exception) { - echo "Client error: {$exception->getMessage()}\n"; - exit(3); -} - -if (201 !== $responseCode = $response->getStatusCode()) { - try { - $responseArray = $response->toArray(false); - if (array_key_exists('ErrorMessage', $responseArray)) { - echo "Server error: {$responseArray['ErrorMessage']['errorCode']} {$responseArray['ErrorMessage']['errorMessage']}\n"; - echo "\t{$responseArray['ErrorMessage']['errorDescription']}\n"; - exit(4); - } - } catch (HttpException\DecodingExceptionInterface) { - } - $responseHeaders = $response->getInfo('response_headers'); - $error = $responseHeaders[0] ?? $responseCode; - echo "Server error: $error\n"; - exit(5); -} - -$response = $response->toArray(); - -if (!(array_key_exists('Content', $response) && array_key_exists('_id', $response['Content']))) { - echo "Response error: Unexpected response structure\n"; - exit(6); -} - -$contentId = $response['Content']['_id']; - -try { - $response = $client->request('PUBLISH', "$baseUrl/content/objects/$contentId/versions/1", [ - 'headers' => [ - 'Accept: application/json', - ], - ]); -} catch (HttpException\TransportExceptionInterface $exception) { - echo "Client error: {$exception->getMessage()}\n"; - exit(7); -} - -if (204 !== $responseCode = $response->getStatusCode()) { - try { - $responseArray = $response->toArray(false); - if (array_key_exists('ErrorMessage', $responseArray)) { - echo "Server error: {$responseArray['ErrorMessage']['errorCode']} {$responseArray['ErrorMessage']['errorMessage']}\n"; - echo "\t{$responseArray['ErrorMessage']['errorDescription']}\n"; - exit(8); - } - } catch (HttpException\DecodingExceptionInterface) { - } - $responseHeaders = $response->getInfo('response_headers'); - $error = $responseHeaders[0] ?? $responseCode; - echo "Server error: $error\n"; - exit(9); -} - -echo "Success: Image content item created with ID $contentId and published.\n"; - -exit(0); diff --git a/code_samples/api/rest_api/create_image.xml.php b/code_samples/api/rest_api/create_image.xml.php deleted file mode 100644 index 4522d9fd9ec..00000000000 --- a/code_samples/api/rest_api/create_image.xml.php +++ /dev/null @@ -1,138 +0,0 @@ - []\n"; - exit(1); -} - -if (!is_file($argv[1])) { - echo "{$argv[1]} doesn't exist or is not a file.\n"; - exit(2); -} - -// URL to Ibexa DXP installation and its REST API -$host = 'api.example.com'; -$scheme = 'https'; -$api = '/api/ibexa/v2'; -$baseUrl = "{$scheme}://{$host}{$api}"; - -// User credentials -$username = 'admin'; -$password = 'publish'; - -// Targets -$contentTypeId = 5; // "Image" -$parentLocationPath = '1/43/51'; // "Media > Images" -$sectionId = 3; // "Media" - -$fileName = basename($argv[1]); -$fileSize = filesize($argv[1]); -$fileContent = base64_encode(file_get_contents($argv[1])); -$name = $argv[2] ?? $fileName; - -// Request payload -$data = << - - - eng-GB - - - PATH - ASC - -
- - - name - $name - - - caption - -

$name

]]> - - - - image - - $fileName - $fileSize - - - - -
-XML; - -$client = HttpClient::createForBaseUri($baseUrl, [ - 'auth_basic' => [$username, $password], -]); -$doc = new DOMDocument(); - -try { - $response = $client->request('POST', "$baseUrl/content/objects", [ - 'headers' => [ - 'Content-Type: application/vnd.ibexa.api.ContentCreate+xml', - 'Accept: application/vnd.ibexa.api.ContentInfo+xml', - ], - 'body' => $data, - ]); -} catch (HttpException\TransportExceptionInterface $exception) { - echo "Client error: {$exception->getMessage()}\n"; - exit(3); -} - -if (201 !== $responseCode = $response->getStatusCode()) { - if (!empty($response->getContent(false)) && $doc->loadXML($response->getContent(false)) && 'ErrorMessage' === $doc->firstChild->nodeName) { - echo "Server error: {$doc->getElementsByTagName('errorCode')->item(0)->nodeValue} {$doc->getElementsByTagName('errorMessage')->item(0)->nodeValue}\n"; - echo "\t{$doc->getElementsByTagName('errorDescription')->item(0)->nodeValue}\n"; - exit(4); - } - $responseHeaders = $response->getInfo('response_headers'); - $error = $responseHeaders[0] ?? $responseCode; - echo "Server error: $error\n"; - exit(5); -} - -$doc->loadXML($response->getContent()); - -if ('Content' !== $doc->firstChild->nodeName || !$doc->firstChild->hasAttribute('id')) { - echo "Response error: Unexpected response structure\n"; - exit(6); -} - -$contentId = $doc->firstChild->getAttribute('id'); - -try { - $response = $client->request('PUBLISH', "$baseUrl/content/objects/$contentId/versions/1", [ - 'headers' => [ - 'Accept: application/xml', - ], - ]); -} catch (HttpException\TransportExceptionInterface $exception) { - echo "Client error: {$exception->getMessage()}\n"; - exit(7); -} - -if (204 !== $responseCode = $response->getStatusCode()) { - if (!empty($response->getContent(false)) && $doc->loadXML($response->getContent(false)) && 'ErrorMessage' === $doc->firstChild->nodeName) { - echo "Server error: {$doc->getElementsByTagName('errorCode')->item(0)->nodeValue} {{$doc->getElementsByTagName('errorMessage')->item(0)->nodeValue}\n"; - echo "\t{$doc->getElementsByTagName('errorDescription')->item(0)->nodeValue}\n"; - exit(8); - } - $responseHeaders = $response->getInfo('response_headers'); - $error = $responseHeaders[0] ?? $responseCode; - echo "Server error: $error\n"; - exit(9); -} - -echo "Success: Image content item created with ID $contentId and published.\n"; - -exit(0); diff --git a/code_samples/api/rest_api/load_content.php b/code_samples/api/rest_api/load_content.php deleted file mode 100644 index 3e7cd7063a9..00000000000 --- a/code_samples/api/rest_api/load_content.php +++ /dev/null @@ -1,9 +0,0 @@ -request('GET', $resource, [ - 'headers' => ['Accept: application/vnd.ibexa.api.ContentInfo+json'], -]); -var_dump($response->getStatusCode(), $response->getHeaders(), $response->toArray()); diff --git a/code_samples/api/rest_api/src/Rest/Controller/DefaultController.php b/code_samples/api/rest_api/src/Rest/Controller/DefaultController.php deleted file mode 100644 index 0cfa960a63c..00000000000 --- a/code_samples/api/rest_api/src/Rest/Controller/DefaultController.php +++ /dev/null @@ -1,25 +0,0 @@ -getMethod()) { - return $this->inputDispatcher->parse( - new Message( - ['Content-Type' => $request->headers->get('Content-Type')], - $request->getContent() - ) - ); - } - - return new Greeting(); - } -} diff --git a/code_samples/api/rest_api/src/Rest/InputParser/GreetingInput.php b/code_samples/api/rest_api/src/Rest/InputParser/GreetingInput.php deleted file mode 100644 index da1bb5a3467..00000000000 --- a/code_samples/api/rest_api/src/Rest/InputParser/GreetingInput.php +++ /dev/null @@ -1,20 +0,0 @@ -visitors = []; - foreach ($visitors as $type => $visitor) { - $this->visitors[$type] = $visitor; - } - } - - public function setOutputVisitor(Visitor $outputVisitor): void - { - $this->outputVisitor = $outputVisitor; - $this->valueObjectVisitorDispatcher->setOutputVisitor($outputVisitor); - } - - public function setOutputGenerator(Generator $outputGenerator): void - { - $this->outputGenerator = $outputGenerator; - $this->valueObjectVisitorDispatcher->setOutputGenerator($outputGenerator); - } - - public function visit($data) - { - $className = $data::class; - if (isset($this->visitors[$className])) { - return $this->visitors[$className]->visit($this->outputVisitor, $this->outputGenerator, $data); - } - - return $this->valueObjectVisitorDispatcher->visit($data); - } -} diff --git a/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/Greeting.php b/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/Greeting.php deleted file mode 100644 index dc2562caf71..00000000000 --- a/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/Greeting.php +++ /dev/null @@ -1,24 +0,0 @@ -setHeader('Content-Type', $generator->getMediaType('Greeting')); - $generator->startObjectElement('Greeting'); - $generator->attribute('href', $this->router->generate('app.rest.greeting')); - $generator->valueElement('Salutation', $data->salutation); - $generator->valueElement('Recipient', $data->recipient); - $generator->valueElement('Sentence', "{$data->salutation} {$data->recipient}"); - $generator->endObjectElement('Greeting'); - } -} diff --git a/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php b/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php deleted file mode 100644 index fcc739e4ffd..00000000000 --- a/code_samples/api/rest_api/src/Rest/ValueObjectVisitor/RestLocation.php +++ /dev/null @@ -1,43 +0,0 @@ -startObjectElement to not have the XML Generator adding its own media-type attribute with the default vendor - $generator->startHashElement('Location'); - $generator->attribute( - 'media-type', - 'application/app.api.Location+' . strtolower((new \ReflectionClass($generator))->getShortName()) - ); - $generator->attribute( - 'href', - $this->router->generate( - 'ibexa.rest.load_location', - ['locationPath' => trim($data->location->pathString, '/')] - ) - ); - parent::visit($visitor, $generator, $data); - $visitor->visitValueObject(new URLAliasRefList(array_merge( - $this->urlAliasService->listLocationAliases($data->location, false), - $this->urlAliasService->listLocationAliases($data->location, true) - ), $this->router->generate( - 'ibexa.rest.list_location_url_aliases', - ['locationPath' => trim($data->location->pathString, '/')] - ))); - $generator->endHashElement('Location'); - } -} diff --git a/code_samples/api/rest_api/src/Rest/Values/Greeting.php b/code_samples/api/rest_api/src/Rest/Values/Greeting.php deleted file mode 100644 index 696289feab7..00000000000 --- a/code_samples/api/rest_api/src/Rest/Values/Greeting.php +++ /dev/null @@ -1,12 +0,0 @@ -createEvent('April Fools', new DateTime('2024-04-01')); - - $items = json_decode(file_get_contents(__DIR__ . \DIRECTORY_SEPARATOR . 'holidays.json'), true); - foreach ($items as $item) { - $eventCollectionArray[] = $this->createEvent($item['name'], new DateTime($item['date'])); - } - - $collection = new EventCollection($eventCollectionArray); - - return new InMemoryEventSource($collection); - } - - private function createEvent(string $id, DateTimeInterface $dateTime): Event - { - return new Event($id, $dateTime, $this->eventType); - } -} diff --git a/code_samples/back_office/calendar/src/Calendar/Holidays/EventType.php b/code_samples/back_office/calendar/src/Calendar/Holidays/EventType.php deleted file mode 100644 index dc6be1db5ea..00000000000 --- a/code_samples/back_office/calendar/src/Calendar/Holidays/EventType.php +++ /dev/null @@ -1,39 +0,0 @@ -actions = new EventActionCollection($actions); - } - - public function getTypeIdentifier(): string - { - return self::EVENT_TYPE_IDENTIFIER; - } - - public function getTypeLabel(): string - { - return 'Holidays'; - } - - public function getEventName(Event $event): string - { - return $event->getId(); - } - - public function getActions(): EventActionCollection - { - return $this->actions; - } -} diff --git a/code_samples/back_office/components/MyComponent.php b/code_samples/back_office/components/MyComponent.php deleted file mode 100644 index 42bbecfc786..00000000000 --- a/code_samples/back_office/components/MyComponent.php +++ /dev/null @@ -1,18 +0,0 @@ - 'onAnchorMenuConfigure']; - } - - public function onAnchorMenuConfigure(ConfigureMenuEvent $event): void - { - // access anchor menu root item - $menu = $event->getMenu(); - - // if you need to access "Content" tab, use ITEM__CONTENT constant: - $contentTab = $menu[ContentEditAnchorMenuBuilder::ITEM__CONTENT]; - - // if you need to access "Meta" tab, use ITEM__META constant: - $metaTab = $menu[ContentEditAnchorMenuBuilder::ITEM__META]; - - // Adding new tab called "New tab" - $menu->addChild('New tab', ['attributes' => ['data-target-id' => 'ibexa-edit-content-sections-new-tab']]); - - // Add second level item "2nd level item" to previously created "New tab" tab - $menu['New tab']->addChild('2nd level item', ['attributes' => ['data-target-id' => 'ibexa-edit-content-sections-new-tab-item_2']]); - } -} diff --git a/code_samples/back_office/content_type/templates/themes/admin/content_type/edit/custom_tab.html.twig b/code_samples/back_office/content_type/templates/themes/admin/content_type/edit/custom_tab.html.twig deleted file mode 100644 index 216cc29a506..00000000000 --- a/code_samples/back_office/content_type/templates/themes/admin/content_type/edit/custom_tab.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends '@ibexadesign/ui/component/anchor_navigation/section_group.html.twig' %} - -{% set data_id = 'ibexa-edit-content-sections-new-tab' %} - -{% block sections %} - {% embed '@ibexadesign/ui/component/anchor_navigation/section.html.twig' %} - {% set data_id = 'ibexa-edit-content-sections-new-tab-item_2' %} - {% block content %} - Contents of custom secondary section - {% endblock %} - {% endembed %} -{% endblock %} diff --git a/code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php b/code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php deleted file mode 100644 index 9a54be1d5c1..00000000000 --- a/code_samples/back_office/dashboard/article_tab/src/Tab/Dashboard/Everyone/EveryoneArticleTab.php +++ /dev/null @@ -1,68 +0,0 @@ -sortClauses = [new SortClause\DateModified(LocationQuery::SORT_DESC)]; - $query->query = new Criterion\LogicalAnd([ - new Criterion\ContentTypeIdentifier('article'), - ]); - - $pager = new Pagerfanta( - new LocationSearchAdapter( - $query, - $this->searchService - ) - ); - $pager->setMaxPerPage($limit); - $pager->setCurrentPage($page); - - return $this->twig->render('@ibexadesign/ui/dashboard/tab/all_content.html.twig', [ - 'data' => $this->pagerLocationToDataMapper->map($pager, true), - ]); - } -} diff --git a/code_samples/back_office/dashboard/src/Command/DashboardCommand.php b/code_samples/back_office/dashboard/src/Command/DashboardCommand.php deleted file mode 100644 index 6e4616b788e..00000000000 --- a/code_samples/back_office/dashboard/src/Command/DashboardCommand.php +++ /dev/null @@ -1,71 +0,0 @@ -locationService = $repository->getLocationService(); - $this->contentService = $repository->getContentService(); - $this->userService = $repository->getUserService(); - $this->permissionResolver = $repository->getPermissionResolver(); - - parent::__construct(); - } - - public function configure(): void - { - $this - ->addArgument('dashboard', InputArgument::REQUIRED, 'Location ID of the dashboard model') - ->addArgument('group', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'User Group Content ID(s)'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $dashboardModelLocationId = (int)$input->getArgument('dashboard'); - $userGroupLocationIdList = array_map(intval(...), $input->getArgument('group')); - - foreach ($userGroupLocationIdList as $userGroupLocationId) { - try { - $admin = $this->userService->loadUserByLogin('admin'); - $this->permissionResolver->setCurrentUserReference($admin); - foreach ($this->userService->loadUsersOfUserGroup($this->userService->loadUserGroup($userGroupLocationId)) as $user) { - $this->permissionResolver->setCurrentUserReference($user); - $dashboardDraft = $this->dashboardService->createCustomDashboardDraft($this->locationService->loadLocation($dashboardModelLocationId)); - $this->contentService->publishVersion($dashboardDraft->getVersionInfo()); - } - } catch (\Throwable $throwable) { - dump($throwable); - } - } - - return self::SUCCESS; - } -} diff --git a/code_samples/back_office/images/src/Connector/Dam/Handler/WikimediaCommonsHandler.php b/code_samples/back_office/images/src/Connector/Dam/Handler/WikimediaCommonsHandler.php deleted file mode 100644 index a6ecdac15c2..00000000000 --- a/code_samples/back_office/images/src/Connector/Dam/Handler/WikimediaCommonsHandler.php +++ /dev/null @@ -1,102 +0,0 @@ -getPhrase()) - . '&sroffset=' . $offset - . '&srlimit=' . $limit - ; - - $opts = [ - 'http' => [ - 'method' => 'GET', - 'header' => [ - 'User-Agent: ' . self::USER_AGENT, - ], - ], - ]; - - $jsonResponse = file_get_contents($searchUrl, false, stream_context_create($opts)); - if ($jsonResponse === false) { - return new AssetSearchResult(0, new AssetCollection([])); - } - - $response = json_decode($jsonResponse, true); - if (!isset($response['query']['search'])) { - return new AssetSearchResult(0, new AssetCollection([])); - } - - $assets = []; - foreach ($response['query']['search'] as $result) { - $identifier = str_replace('File:', '', $result['title']); - $assets[] = $this->fetchAsset($identifier); - } - - return new AssetSearchResult( - (int) ($response['query']['searchinfo']['totalhits'] ?? 0), - new AssetCollection($assets) - ); - } - - public function fetchAsset(string $id): Asset - { - $metadataUrl = 'https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&format=json' - . '&titles=File%3a' . urlencode($id) - ; - - $opts = [ - 'http' => [ - 'method' => 'GET', - 'header' => [ - 'User-Agent: ' . self::USER_AGENT, - ], - ], - ]; - - $jsonResponse = file_get_contents($metadataUrl, false, stream_context_create($opts)); - if ($jsonResponse === false) { - throw new \RuntimeException('Couldn\'t retrieve asset metadata'); - } - - $response = json_decode($jsonResponse, true); - if (!isset($response['query']['pages'])) { - throw new \RuntimeException('Couldn\'t parse asset metadata'); - } - - $pageData = array_values($response['query']['pages'])[0] ?? null; - if (!isset($pageData['imageinfo'][0]['extmetadata'])) { - throw new \RuntimeException('Couldn\'t parse image asset metadata'); - } - - $imageInfo = $pageData['imageinfo'][0]['extmetadata']; - - return new Asset( - new AssetIdentifier($id), - new AssetSource('commons'), - new AssetUri('https://commons.wikimedia.org/w/index.php?title=Special:Redirect/file/' . urlencode($id)), - new AssetMetadata([ - 'page_url' => "https://commons.wikimedia.org/wiki/File:$id", - 'author' => $imageInfo['Artist']['value'] ?? null, - 'license' => $imageInfo['LicenseShortName']['value'] ?? null, - 'license_url' => $imageInfo['LicenseUrl']['value'] ?? null, - ]) - ); - } -} diff --git a/code_samples/back_office/images/src/Connector/Dam/Transformation/WikimediaCommonsTransformationFactory.php b/code_samples/back_office/images/src/Connector/Dam/Transformation/WikimediaCommonsTransformationFactory.php deleted file mode 100644 index f900da52c3f..00000000000 --- a/code_samples/back_office/images/src/Connector/Dam/Transformation/WikimediaCommonsTransformationFactory.php +++ /dev/null @@ -1,36 +0,0 @@ - $transformationParameters */ - public function build(?string $transformationName = null, array $transformationParameters = []): Transformation - { - if (null === $transformationName) { - return new Transformation(null, array_map(strval(...), $transformationParameters)); - } - - $transformations = $this->buildAll(); - - if (array_key_exists($transformationName, $transformations)) { - return $transformations[$transformationName]; - } - - throw new \InvalidArgumentException(sprintf('Unknown transformation "%s".', $transformationName)); - } - - public function buildAll(): array - { - return [ - 'reference' => new Transformation('reference', []), - 'tiny' => new Transformation('tiny', ['width' => '30']), - 'small' => new Transformation('small', ['width' => '100']), - 'medium' => new Transformation('medium', ['width' => '200']), - 'large' => new Transformation('large', ['width' => '300']), - ]; - } -} diff --git a/code_samples/back_office/images/src/Event/RemovePngquantOptimizer.php b/code_samples/back_office/images/src/Event/RemovePngquantOptimizer.php deleted file mode 100644 index 91d30ab9a7a..00000000000 --- a/code_samples/back_office/images/src/Event/RemovePngquantOptimizer.php +++ /dev/null @@ -1,22 +0,0 @@ - 'onConfigureOptimizers', - ]; - } - - public function onConfigureOptimizers(ConfigureImageOptimizersEvent $event): void - { - $event->removeOptimizer(Pngquant::class); - } -} diff --git a/code_samples/back_office/images/src/SvgController.php b/code_samples/back_office/images/src/SvgController.php deleted file mode 100644 index 3d44e5b33b4..00000000000 --- a/code_samples/back_office/images/src/SvgController.php +++ /dev/null @@ -1,72 +0,0 @@ -query->has('version')) { - $version = (int)$request->query->get('version'); - } - - $content = $this->contentService->loadContent($contentId, null, $version); - $language = $request->query->has('inLanguage') ? $request->query->get('inLanguage') : null; - $field = $this->translationHelper->getTranslatedField($content, $fieldIdentifier, $language); - - if (!$field instanceof Field) { - throw new InvalidArgumentException( - sprintf( - "%s field not present in content %d '%s'", - $fieldIdentifier, - $content->contentInfo->id, - $content->contentInfo->name - ) - ); - } - - $binaryFile = $this->ioService->loadBinaryFile($field->value->id); - $response = new Response($this->ioService->getFileContents($binaryFile)); - $disposition = $response->headers->makeDisposition( - ResponseHeaderBag::DISPOSITION_INLINE, - $filename - ); - - $response->headers->set('Content-Disposition', $disposition); - $response->headers->set('Content-Type', self::CONTENT_TYPE_HEADER); - - return $response; - } -} diff --git a/code_samples/back_office/images/src/SvgExtension.php b/code_samples/back_office/images/src/SvgExtension.php deleted file mode 100644 index 351661e476c..00000000000 --- a/code_samples/back_office/images/src/SvgExtension.php +++ /dev/null @@ -1,28 +0,0 @@ -router->generate('app.svg_download', [ - 'contentId' => $contentId, - 'fieldIdentifier' => $fieldIdentifier, - 'filename' => $filename, - ]); - } -} diff --git a/code_samples/back_office/images/templates/themes/standard/commons_asset_view.html.twig b/code_samples/back_office/images/templates/themes/standard/commons_asset_view.html.twig deleted file mode 100644 index 33affc33628..00000000000 --- a/code_samples/back_office/images/templates/themes/standard/commons_asset_view.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% extends '@ibexadesign/ui/field_type/image_asset_view.html.twig' %} - -{% block asset_preview %} - {{ parent() }} -
- Image - {% if asset.assetMetadata.author %} by {{ asset.assetMetadata.author|striptags }}{% endif %} - {% if asset.assetMetadata.license and asset.assetMetadata.license_url %} - under {{ asset.assetMetadata.license }} - {% endif %}. -
-{% endblock %} diff --git a/code_samples/back_office/images/templates/themes/standard/svg_helper.html.twig b/code_samples/back_office/images/templates/themes/standard/svg_helper.html.twig deleted file mode 100644 index c522a431f65..00000000000 --- a/code_samples/back_office/images/templates/themes/standard/svg_helper.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set svgField = ibexa_field(content, 'file') %} - - diff --git a/code_samples/back_office/limitation/src/Controller/CustomController.php b/code_samples/back_office/limitation/src/Controller/CustomController.php deleted file mode 100644 index 4e60672cf5c..00000000000 --- a/code_samples/back_office/limitation/src/Controller/CustomController.php +++ /dev/null @@ -1,61 +0,0 @@ -getCustomLimitationValue()) { - // Action only for user having the custom limitation checked - } - - return new Response('...'); - } - - private function getCustomLimitationValue(): bool - { - $hasAccess = $this->permissionResolver->hasAccess('custom_module', 'custom_function_2'); - - if (is_bool($hasAccess)) { - return $hasAccess; - } - - $customLimitationValues = $this->permissionChecker->getRestrictions( - $hasAccess, - CustomLimitationValue::class - ); - - return $customLimitationValues['value'] ?? false; - } - - #[\Override] - public function performAccessCheck(): void - { - $this->traitPerformAccessCheck(); - $this->denyAccessUnlessGranted(new Attribute('custom_module', 'custom_function_2')); - } -} diff --git a/code_samples/back_office/limitation/src/Kernel.php b/code_samples/back_office/limitation/src/Kernel.php deleted file mode 100644 index 954b6c2b9c5..00000000000 --- a/code_samples/back_office/limitation/src/Kernel.php +++ /dev/null @@ -1,27 +0,0 @@ -getExtension('ibexa'); - - // Add the policy provider, you can register multiple providers by calling the method repeatedly - $ibexaExtension->addPolicyProvider(new FormPolicyProvider()); - $ibexaExtension->addPolicyProvider(new MyPolicyProvider()); - } -} diff --git a/code_samples/back_office/limitation/src/Security/Form/FormSubmissionServiceDecorator.php b/code_samples/back_office/limitation/src/Security/Form/FormSubmissionServiceDecorator.php deleted file mode 100644 index 2f0328b8765..00000000000 --- a/code_samples/back_office/limitation/src/Security/Form/FormSubmissionServiceDecorator.php +++ /dev/null @@ -1,101 +0,0 @@ -innerService->create($content, $languageCode, $form, $data); - } - - public function loadById(int $id): FormSubmission - { - $submissions = $this->gateway->loadById($id); // First manual data fetch - - if (empty($submissions)) { - throw new NotFoundException('FormSubmission', $id); - } - - $content = $this->contentService->loadContent($submissions[0]['content_id']); - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); // Permission check - } - - return $this->innerService->loadById($id); // Second data fetch through inner service - } - - // The same permission check pattern is repeated in the methods below - - public function delete(FormSubmission $submission): void - { - $submissionId = $submission->getId(); - $submissions = $this->gateway->loadById($submissionId); - - if (empty($submissions)) { - throw new NotFoundException('FormSubmission', $submissionId); - } - - $content = $this->contentService->loadContent($submissions[0]['content_id']); - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); - } - - $this->innerService->delete($submission); - } - - public function loadByContent(ContentInfo $content, ?string $languageCode = null, int $offset = 0, int $limit = 25): FormSubmissionList - { - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); - } - - return $this->innerService->loadByContent($content, $languageCode, $offset, $limit); - } - - public function loadAllByContentForExport(ContentInfo $content, ?string $languageCode = null): array - { - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); - } - - return $this->innerService->loadAllByContentForExport($content, $languageCode); - } - - public function loadHeaders(ContentInfo $content, ?string $languageCode = null): array - { - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); - } - - return $this->innerService->loadHeaders($content, $languageCode); - } - - public function getCount(ContentInfo $content, ?string $languageCode = null): int - { - if (!$this->permissionResolver->canUser('form', 'read_submissions', $content)) { - throw new UnauthorizedException('form', 'read_submissions', ['contentId' => $content->getId()]); - } - - return $this->innerService->getCount($content, $languageCode); - } -} diff --git a/code_samples/back_office/limitation/src/Security/Form/FormSubmissionsTabDecorator.php b/code_samples/back_office/limitation/src/Security/Form/FormSubmissionsTabDecorator.php deleted file mode 100644 index ea0f249f8fb..00000000000 --- a/code_samples/back_office/limitation/src/Security/Form/FormSubmissionsTabDecorator.php +++ /dev/null @@ -1,69 +0,0 @@ -innerTab->getIdentifier(); - } - - #[\Override] - public function getName(): string - { - return $this->innerTab->getName(); - } - - #[\Override] - public function renderView(array $parameters): string - { - return $this->innerTab->renderView($parameters); - } - - #[\Override] - public function evaluate(array $parameters): bool - { - /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ - $content = $parameters['content']; - - return $this->innerTab->evaluate($parameters) && - $this->permissionResolver->canUser('form', 'read_submissions', $content); - } - - #[\Override] - public function getOrder(): int - { - return $this->innerTab->getOrder(); - } -} diff --git a/code_samples/back_office/limitation/src/Security/FormPolicyProvider.php b/code_samples/back_office/limitation/src/Security/FormPolicyProvider.php deleted file mode 100644 index 4396cfe02c8..00000000000 --- a/code_samples/back_office/limitation/src/Security/FormPolicyProvider.php +++ /dev/null @@ -1,29 +0,0 @@ -addConfig([ - 'form' => [ - 'read_submissions' => null, - ], - ]); - } - - public static function getTranslationMessages(): array - { - return [ - (new Message('role.policy.form', 'forms'))->setDesc('Forms'), - (new Message('role.policy.form.all_functions', 'forms'))->setDesc('Forms / All functions'), - (new Message('role.policy.form.read_submissions', 'forms'))->setDesc('Forms / Read submissions'), - ]; - } -} diff --git a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php b/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php deleted file mode 100644 index cb31e875009..00000000000 --- a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationType.php +++ /dev/null @@ -1,82 +0,0 @@ -limitationValues)) { - $validationErrors[] = new ValidationError("limitationValues['value'] is missing."); - } elseif (!is_bool($limitationValue->limitationValues['value'])) { - $validationErrors[] = new ValidationError("limitationValues['value'] is not a boolean."); - } - - return $validationErrors; - } - - public function buildValue(array $limitationValues): CustomLimitationValue - { - $value = false; - if (array_key_exists('value', $limitationValues)) { - $value = $limitationValues['value']; - } elseif (count($limitationValues)) { - $value = (bool)$limitationValues[0]; - } - - return new CustomLimitationValue(['limitationValues' => ['value' => $value]]); - } - - /** - * @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets - * - * @return bool|null - */ - public function evaluate(Limitation $value, UserReference $currentUser, object $object, ?array $targets = null): ?bool - { - if (!$value instanceof CustomLimitationValue) { - throw new InvalidArgumentException('$value', 'Must be of type: CustomLimitationValue'); - } - - if ($value->limitationValues['value']) { - return Type::ACCESS_GRANTED; - } - - // If the limitation value is not set to `true`, then $currentUser, $object and/or $targets could be challenged to determine if the access is granted or not; Here or elsewhere. When passing the baton, a limitation can return Type::ACCESS_ABSTAIN - return Type::ACCESS_DENIED; - } - - public function getCriterion(Limitation $value, UserReference $currentUser): CriterionInterface - { - throw new NotImplementedException(__METHOD__); - } - - public function valueSchema(): never - { - throw new NotImplementedException(__METHOD__); - } -} diff --git a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationValue.php b/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationValue.php deleted file mode 100644 index 8dc99a0c9ed..00000000000 --- a/code_samples/back_office/limitation/src/Security/Limitation/CustomLimitationValue.php +++ /dev/null @@ -1,15 +0,0 @@ -add('limitationValues', CheckboxType::class, [ - 'label' => LimitationIdentifierToLabelConverter::convert($data->getIdentifier()), - 'required' => false, - 'data' => $data->limitationValues['value'], - 'property_path' => 'limitationValues[value]', - ]); - } - - public function getFormTemplate(): string - { - return '@ibexadesign/limitation/custom_limitation_form.html.twig'; - } - - public function filterLimitationValues(Limitation $limitation): void - { - } -} diff --git a/code_samples/back_office/limitation/src/Security/Limitation/Mapper/CustomLimitationValueMapper.php b/code_samples/back_office/limitation/src/Security/Limitation/Mapper/CustomLimitationValueMapper.php deleted file mode 100644 index 634059dc298..00000000000 --- a/code_samples/back_office/limitation/src/Security/Limitation/Mapper/CustomLimitationValueMapper.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ - public function mapLimitationValue(Limitation $limitation): array - { - return [$limitation->limitationValues['value']]; - } -} diff --git a/code_samples/back_office/limitation/src/Security/MyPolicyProvider.php b/code_samples/back_office/limitation/src/Security/MyPolicyProvider.php deleted file mode 100644 index 69c9c4a43b2..00000000000 --- a/code_samples/back_office/limitation/src/Security/MyPolicyProvider.php +++ /dev/null @@ -1,18 +0,0 @@ -{{ is_set ? 'Yes' : 'No' }} -{% endblock %} diff --git a/code_samples/back_office/menu/menu_item/src/Controller/AllContentListController.php b/code_samples/back_office/menu/menu_item/src/Controller/AllContentListController.php deleted file mode 100644 index dd07d01498a..00000000000 --- a/code_samples/back_office/menu/menu_item/src/Controller/AllContentListController.php +++ /dev/null @@ -1,41 +0,0 @@ -query = new Criterion\Visibility(Criterion\Visibility::VISIBLE); - - $paginator = new Pagerfanta( - new LocationSearchAdapter($query, $this->searchService) - ); - $paginator->setMaxPerPage(8); - $paginator->setCurrentPage($page); - $editForm = $this->formFactory->contentEdit(); - - return $this->render('@ibexadesign/all_content_list.html.twig', [ - 'totalCount' => $paginator->getNbResults(), - 'articles' => $paginator, - 'form_edit' => $editForm, - ]); - } -} diff --git a/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php b/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php deleted file mode 100644 index 7a97326ba6c..00000000000 --- a/code_samples/back_office/menu/menu_item/src/EventSubscriber/HelpMenuSubscriber.php +++ /dev/null @@ -1,53 +0,0 @@ - 'onHelpMenuConfigure', - ]; - } - - public function onHelpMenuConfigure(ConfigureMenuEvent $event): void - { - $menu = $event->getMenu(); - - // Remove roadmap menu item - if ($menu->getChild('help__general')) { - $generalSection = $menu->getChild('help__general'); - if ($generalSection->getChild('help__product_roadmap')) { - $generalSection->removeChild('help__product_roadmap'); - } - } - - // Add videos tab, shown only in production - if ($this->kernelDebug === false) { - $resourcesSection = $menu->addChild('help__videos', [ - 'label' => 'Product videos', - ]); - - $resourcesSection->addChild('help__webinar_v5', [ - 'label' => 'Webinar: Introducing Ibexa DXP v5', - 'uri' => 'https://www.youtube.com/watch?v=qWaBHG2LRm8', - 'extras' => [ - 'isHighlighted' => false, - 'icon' => 'https://doc.ibexa.co/en/6.0/templating/twig_function_reference/img/icons/video.svg.png', - 'description' => 'Discover new features and improvements brought by Ibexa DXP v5.', - ], - ]); - } - } -} diff --git a/code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php b/code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php deleted file mode 100644 index be803e3d9d7..00000000000 --- a/code_samples/back_office/menu/menu_item/src/EventSubscriber/MyMenuSubscriber.php +++ /dev/null @@ -1,50 +0,0 @@ - ['onMainMenuConfigure', 0], - ]; - } - - public function onMainMenuConfigure(ConfigureMenuEvent $event): void - { - $menu = $event->getMenu(); - - $customMenuItem = $menu[MainMenuBuilder::ITEM_CONTENT]->addChild( - 'main__content__custom_menu', - [ - 'extras' => [ - 'orderNumber' => 100, - ], - ], - ); - - $customMenuItem->addChild( - 'all_content_list', - [ - 'label' => 'Content List', - 'route' => 'all_content_list.list', - 'attributes' => [ - 'class' => 'custom-menu-item', - ], - 'linkAttributes' => [ - 'class' => 'custom-menu-item-link', - ], - ] - ); - - $menu->removeChild('main__bookmarks'); - - $menu->getChild('main__admin') - ->setExtra('icon_path', '/bundles/ibexaadminuiassets/vendors/ids-assets/dist/img/all-icons.svg#alert-error'); - } -} diff --git a/code_samples/back_office/menu/menu_item/templates/themes/admin/all_content_list.html.twig b/code_samples/back_office/menu/menu_item/templates/themes/admin/all_content_list.html.twig deleted file mode 100644 index 79d307c713f..00000000000 --- a/code_samples/back_office/menu/menu_item/templates/themes/admin/all_content_list.html.twig +++ /dev/null @@ -1,77 +0,0 @@ -{% extends '@ibexadesign/ui/layout.html.twig' %} - -{% block title %}{{ 'Content List'|trans }}{% endblock %} - -{%- block breadcrumbs -%} - {% include '@ibexadesign/ui/breadcrumbs.html.twig' with { items: [ - { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, - { value: 'url.list'|trans|desc('Content List') } - ]} %} -{%- endblock -%} - -{%- block header -%} - {% include '@ibexadesign/ui/page_title.html.twig' with { - title: 'url.list'|trans|desc('Content List'), - } %} -{%- endblock -%} - -{%- block content -%} -
- {% set body_rows = [] %} - {% for article in articles.currentPageResults %} - - {% set col_edit %} - - {% endset %} - - {% set body_rows = body_rows|merge([{ - cols: [ - { content: article.contentInfo.name }, - { content: article.contentInfo.contentType.name }, - { content: article.contentInfo.modificationDate|ibexa_full_datetime }, - { content: article.contentInfo.publishedDate|ibexa_full_datetime }, - { content: col_edit, raw: true }, - ], - }]) %} - {% endfor %} - - {% include '@ibexadesign/ui/component/table/table.html.twig' with { - headline: 'Content List', - head_cols: [ - { content: 'Content name'|trans }, - { content: 'Content type'|trans }, - { content: 'Modified'|trans }, - { content: 'Published'|trans }, - { content: '' }, - ], - class: 'ibexa-table', - body_rows - } %} - - {% if articles.haveToPaginate %} - {% include '@ibexadesign/ui/pagination.html.twig' with { - 'pager': articles - } %} - {% endif %} -
- {{ form_start(form_edit, { - 'action': path('ibexa.content.edit'), - 'attr': - { 'class': 'ibexa-edit-content-form'} - }) }} - {{ form_widget(form_edit.language, {'attr': {'hidden': 'hidden', 'class': 'language-input'}}) }} - {{ form_end(form_edit) }} - {% include '@ibexadesign/content/modal/version_conflict.html.twig' %} -{%- endblock -%} - -{% block javascripts %} - {{ encore_entry_script_tags('ibexa-admin-ui-dashboard-js', null, 'ibexa') }} -{%- endblock -%} diff --git a/code_samples/back_office/notifications/src/EventListener/ContentPublishEventListener.php b/code_samples/back_office/notifications/src/EventListener/ContentPublishEventListener.php deleted file mode 100644 index c1447f80ba0..00000000000 --- a/code_samples/back_office/notifications/src/EventListener/ContentPublishEventListener.php +++ /dev/null @@ -1,36 +0,0 @@ - 'onPublishVersion']; - } - - public function onPublishVersion(PublishVersionEvent $event): void - { - $data = [ - 'content_name' => $event->getContent()->getName(), - 'content_id' => $event->getContent()->id, - 'message' => 'published', - ]; - - $notification = new CreateStruct(); - $notification->ownerId = $event->getContent()->contentInfo->ownerId; - $notification->type = 'ContentPublished'; - $notification->data = $data; - - $this->notificationService->createNotification($notification); - } -} diff --git a/code_samples/back_office/notifications/src/Notification/ListRenderer.php b/code_samples/back_office/notifications/src/Notification/ListRenderer.php deleted file mode 100644 index 4c7153a5820..00000000000 --- a/code_samples/back_office/notifications/src/Notification/ListRenderer.php +++ /dev/null @@ -1,54 +0,0 @@ -requestStack->getCurrentRequest(); - if ($currentRequest && $currentRequest->attributes->getBoolean('render_all')) { - $templateToExtend = '@ibexadesign/account/notifications/list_item_all.html.twig'; - } - - return $this->twig->render('@ibexadesign/notification.html.twig', [ - 'notification' => $notification, - 'template_to_extend' => $templateToExtend, - ]); - } - - public function generateUrl(Notification $notification): ?string - { - if (array_key_exists('content_id', $notification->data)) { - return $this->router->generate('ibexa.content.view', [ - 'contentId' => $notification->data['content_id'], - ]); - } - - return null; - } - - public function getTypeLabel(): string - { - return /** @Desc("Workflow stage changed") */ - $this->translator->trans( - 'workflow.notification.stage_change.label', - [], - 'ibexa_workflow' - ); - } -} diff --git a/code_samples/back_office/notifications/src/Notification/MyRenderer.php b/code_samples/back_office/notifications/src/Notification/MyRenderer.php deleted file mode 100644 index 0c2d38ccd45..00000000000 --- a/code_samples/back_office/notifications/src/Notification/MyRenderer.php +++ /dev/null @@ -1,47 +0,0 @@ -twig->render('@ibexadesign/notification.html.twig', [ - 'notification' => $notification, - 'template_to_extend' => $templateToExtend, - ]); - } - - public function generateUrl(Notification $notification): ?string - { - if (array_key_exists('content_id', $notification->data)) { - return $this->router->generate('ibexa.content.view', ['contentId' => $notification->data['content_id']]); - } - - return null; - } - - public function getTypeLabel(): string - { - return /** @Desc("Workflow stage changed") */ - $this->translator->trans( - 'workflow.notification.stage_change.label', - [], - 'ibexa_workflow' - ); - } -} diff --git a/code_samples/back_office/notifications/templates/themes/admin/notification.html.twig b/code_samples/back_office/notifications/templates/themes/admin/notification.html.twig deleted file mode 100644 index 7156d8f9fa2..00000000000 --- a/code_samples/back_office/notifications/templates/themes/admin/notification.html.twig +++ /dev/null @@ -1,27 +0,0 @@ -{% extends template_to_extend %} - -{% trans_default_domain 'custom_notification' %} - -{% set wrapper_additional_classes = 'css-class-custom' %} - -{% block icon %} - - - - - -{% endblock %} - -{% block notification_type %} - - {{ 'Notice'|trans|desc('Notice') }} - -{% endblock %} - -{% block message %} - {% embed '@ibexadesign/ui/component/table/table_body_cell.html.twig' with { class: 'ibexa-notifications-modal__description' } %} - {% block content %} -

{{ notification.data.content_name }} {{ notification.data.message }}

- {% endblock %} - {% endembed %} -{% endblock %} diff --git a/code_samples/back_office/online_editor/custom_tags/acronym/templates/themes/standard/field_type/ezrichtext/custom_tags/acronym.html.twig b/code_samples/back_office/online_editor/custom_tags/acronym/templates/themes/standard/field_type/ezrichtext/custom_tags/acronym.html.twig deleted file mode 100644 index 555b7dc18fe..00000000000 --- a/code_samples/back_office/online_editor/custom_tags/acronym/templates/themes/standard/field_type/ezrichtext/custom_tags/acronym.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ content }} diff --git a/code_samples/back_office/online_editor/custom_tags/factbox/templates/themes/standard/field_type/ibexa_richtext/custom_tags/factbox.html.twig b/code_samples/back_office/online_editor/custom_tags/factbox/templates/themes/standard/field_type/ibexa_richtext/custom_tags/factbox.html.twig deleted file mode 100644 index 7a8170e35f2..00000000000 --- a/code_samples/back_office/online_editor/custom_tags/factbox/templates/themes/standard/field_type/ibexa_richtext/custom_tags/factbox.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{{ encore_entry_link_tags('factbox') }} - -
-

{{ params.name }}

-
- {{ content|raw }} -
-
diff --git a/code_samples/back_office/online_editor/custom_tags/linktag/templates/themes/standard/field_type/ibexa_richtext/custom_tags/linktag.html.twig b/code_samples/back_office/online_editor/custom_tags/linktag/templates/themes/standard/field_type/ibexa_richtext/custom_tags/linktag.html.twig deleted file mode 100644 index 562a7d7e2cd..00000000000 --- a/code_samples/back_office/online_editor/custom_tags/linktag/templates/themes/standard/field_type/ibexa_richtext/custom_tags/linktag.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -

Custom link

-{% for attr_name, attr_value in params %} -
{{ attr_name }}: {{ attr_value }}
-{% endfor %} diff --git a/code_samples/back_office/online_editor/src/event/subscriber/RichTextBlockSubscriber.php b/code_samples/back_office/online_editor/src/event/subscriber/RichTextBlockSubscriber.php deleted file mode 100644 index 924e92ea452..00000000000 --- a/code_samples/back_office/online_editor/src/event/subscriber/RichTextBlockSubscriber.php +++ /dev/null @@ -1,49 +0,0 @@ - 'onBlockPreRender', - ]; - } - - /** - * @param \Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent $event - */ - public function onBlockPreRender(PreRenderEvent $event): void - { - $renderRequest = $event->getRenderRequest(); - if (!$renderRequest instanceof TwigRenderRequest) { - return; - } - $parameters = $renderRequest->getParameters(); - $parameters['document'] = null; - $xml = $event->getBlockValue()->getAttribute('content')->getValue(); - if (!empty($xml)) { - $parameters['document'] = $this->domDocumentFactory->loadXMLString($xml); - } - $renderRequest->setParameters($parameters); - } -} diff --git a/code_samples/back_office/product_tour/src/EventSubscriber/NotificationScenarioSubscriber.php b/code_samples/back_office/product_tour/src/EventSubscriber/NotificationScenarioSubscriber.php deleted file mode 100644 index 78ae51c261b..00000000000 --- a/code_samples/back_office/product_tour/src/EventSubscriber/NotificationScenarioSubscriber.php +++ /dev/null @@ -1,62 +0,0 @@ - ['onRenderScenario'], - ]; - } - - public function onRenderScenario(RenderProductTourScenarioEvent $event): void - { - $scenario = $event->getScenario(); - $steps = $scenario->getSteps(); - - if ($scenario->getIdentifier() !== 'notifications') { - return; - } - - foreach ($steps as $step) { - $scenario->removeStep($step); - } - - if (!$this->hasUnreadNotifications()) { - return; - } - - $customStep = new ProductTourStep(); - $customStep->setIdentifier('custom_step_identifier'); - $customStep->setInteractionMode('clickable'); - $customStep->setTarget('.ibexa-header-user-menu__notifications-toggler'); - $customStep->setTitle('You have unread notifications'); - $customStep->addBlock(new TextBlock('Click here to preview your unread notifications.')); - $customStep->addBlock(new LinkBlock( - 'https://doc.ibexa.co/projects/userguide/en/latest/getting_started/notifications/', - 'Learn more about notifications' - )); - - $scenario->addStep($customStep); - } - - private function hasUnreadNotifications(): bool - { - return $this->notificationService->getPendingNotificationCount() > 0; - } -} diff --git a/code_samples/back_office/search/src/EventSubscriber/MySuggestionEventSubscriber.php b/code_samples/back_office/search/src/EventSubscriber/MySuggestionEventSubscriber.php deleted file mode 100644 index 05fe585da86..00000000000 --- a/code_samples/back_office/search/src/EventSubscriber/MySuggestionEventSubscriber.php +++ /dev/null @@ -1,72 +0,0 @@ - ['onBuildSuggestionCollectionEvent', -1], - ]; - } - - public function onBuildSuggestionCollectionEvent(BuildSuggestionCollectionEvent $event): BuildSuggestionCollectionEvent - { - $suggestionQuery = $event->getQuery(); - $suggestionCollection = $event->getSuggestionCollection(); - - $text = $suggestionQuery->getQuery(); - $words = explode(' ', (string) preg_replace('/\s+/', ' ', $text)); - $limit = $suggestionQuery->getLimit(); - - try { - $productQuery = new ProductQuery(null, new Criterion\LogicalOr([ - new Criterion\ProductName(implode(' ', array_map(static fn (string $word): string => "$word*", $words))), - new Criterion\ProductCode($words), - new Criterion\ProductType($words), - ]), [], 0, $limit); - $searchResult = $this->productService->findProducts($productQuery); - - if ($searchResult->getTotalCount()) { - $maxScore = 0.0; - $suggestionsByContentIds = []; - /** @var \Ibexa\Contracts\Search\Model\Suggestion\ContentSuggestion $suggestion */ - foreach ($suggestionCollection as $suggestion) { - $maxScore = max($suggestion->getScore(), $maxScore); - $suggestionsByContentIds[$suggestion->getContent()->id] = $suggestion; - } - - /** @var \Ibexa\ProductCatalog\Local\Repository\Values\Product $product */ - foreach ($searchResult as $product) { - $contentId = $product->getContent()->id; - if (array_key_exists($contentId, $suggestionsByContentIds)) { - $suggestionCollection->remove($suggestionsByContentIds[$contentId]); - } - - $productSuggestion = new ProductSuggestion($maxScore + 1, $product); - $suggestionCollection->append($productSuggestion); - } - } - } catch (\Throwable $throwable) { - $this->logger->error($throwable); - } - - return $event; - } -} diff --git a/code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php b/code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php deleted file mode 100644 index adde49a43ea..00000000000 --- a/code_samples/back_office/search/src/Query/DateTimeAttributeQuery.php +++ /dev/null @@ -1,13 +0,0 @@ -setOperator(FieldValueCriterion::COMPARISON_EQ); -$query->setFilter($filter); -/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */ -$results = $productService->findProducts($query); diff --git a/code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php b/code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php deleted file mode 100644 index f8016aa3773..00000000000 --- a/code_samples/back_office/search/src/Query/DateTimeAttributeRangeQuery.php +++ /dev/null @@ -1,10 +0,0 @@ -setFilter(new DateTimeAttributeRange('event_date', new DateTimeImmutable('2025-01-01'))); -/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */ -$results = $productService->findProducts($query); diff --git a/code_samples/back_office/search/src/Query/ProductCategorySubtreeQuery.php b/code_samples/back_office/search/src/Query/ProductCategorySubtreeQuery.php deleted file mode 100644 index d050f96bed3..00000000000 --- a/code_samples/back_office/search/src/Query/ProductCategorySubtreeQuery.php +++ /dev/null @@ -1,12 +0,0 @@ -setQuery($criteria); -$results = $productService->findProducts($productQuery); diff --git a/code_samples/back_office/search/src/Query/SymbolAttributeTypeQuery.php b/code_samples/back_office/search/src/Query/SymbolAttributeTypeQuery.php deleted file mode 100644 index 2c449d97b85..00000000000 --- a/code_samples/back_office/search/src/Query/SymbolAttributeTypeQuery.php +++ /dev/null @@ -1,9 +0,0 @@ -setFilter(new SymbolAttribute('ean', ['5023920187205'])); -/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService */ -$results = $productService->findProducts($query); diff --git a/code_samples/back_office/search/src/Query/UpdatedAtQuery.php b/code_samples/back_office/search/src/Query/UpdatedAtQuery.php deleted file mode 100644 index e30aeecc407..00000000000 --- a/code_samples/back_office/search/src/Query/UpdatedAtQuery.php +++ /dev/null @@ -1,16 +0,0 @@ -setQuery($criteria); -$results = $productService->findProducts($productQuery); diff --git a/code_samples/back_office/search/src/Query/UpdatedAtRangeQuery.php b/code_samples/back_office/search/src/Query/UpdatedAtRangeQuery.php deleted file mode 100644 index 49c5461ecb7..00000000000 --- a/code_samples/back_office/search/src/Query/UpdatedAtRangeQuery.php +++ /dev/null @@ -1,15 +0,0 @@ -setQuery($criteria); -$results = $productService->findProducts($productQuery); diff --git a/code_samples/back_office/search/src/Search/Model/Suggestion/ProductSuggestion.php b/code_samples/back_office/search/src/Search/Model/Suggestion/ProductSuggestion.php deleted file mode 100644 index 6e8be68e4d4..00000000000 --- a/code_samples/back_office/search/src/Search/Model/Suggestion/ProductSuggestion.php +++ /dev/null @@ -1,24 +0,0 @@ -getName()); - $this->product = $product; - } - - public function getProduct(): Product - { - return $this->product; - } -} diff --git a/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php b/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php deleted file mode 100644 index 8291280647c..00000000000 --- a/code_samples/back_office/search/src/Search/Serializer/Normalizer/Suggestion/ProductSuggestionNormalizer.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ - public function normalize($object, ?string $format = null, array $context = []): array - { - /** @var \App\Search\Model\Suggestion\ProductSuggestion $object */ - return [ - 'type' => 'product', - 'name' => $object->getName(), - 'productCode' => $object->getProduct()->getCode(), - 'productTypeIdentifier' => $object->getProduct()->getProductType()->getIdentifier(), - 'productTypeName' => $object->getProduct()->getProductType()->getName(), - ]; - } - - public function supportsNormalization($data, ?string $format = null, array $context = []): bool - { - return $data instanceof ProductSuggestion; - } - - public function getSupportedTypes(?string $format): array - { - return [ - ProductSuggestion::class => true, - ]; - } -} diff --git a/code_samples/back_office/search/src/Search/SortingDefinition/Provider/SectionNameSortingDefinitionProvider.php b/code_samples/back_office/search/src/Search/SortingDefinition/Provider/SectionNameSortingDefinitionProvider.php deleted file mode 100644 index 82db0c90ef5..00000000000 --- a/code_samples/back_office/search/src/Search/SortingDefinition/Provider/SectionNameSortingDefinitionProvider.php +++ /dev/null @@ -1,48 +0,0 @@ -translator->trans('sort_definition.section_name_asc.label'), - [ - new SortClause\SectionName(Query::SORT_ASC), - ], - 333 - ), - new SortingDefinition( - 'section_desc', - $this->translator->trans('sort_definition.section_name_desc.label'), - [ - new SortClause\SectionName(Query::SORT_DESC), - ], - 369 - ), - ]; - } - - public static function getTranslationMessages(): array - { - return [ - (new Message('sort_definition.section_name_asc.label'))->setDesc('Sort by section A-Z'), - (new Message('sort_definition.section_name_desc.label'))->setDesc('Sort by section Z-A'), - ]; - } -} diff --git a/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_item.html.twig b/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_item.html.twig deleted file mode 100644 index c4f8db57549..00000000000 --- a/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_item.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -
  • - -
    - {{ product_name }} -
    - {{ product_code }} -
    -
    -
    -
    - - - - - {{ product_type_name }} - -
    -
    -
    -
  • diff --git a/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_template.html.twig b/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_template.html.twig deleted file mode 100644 index 0001e432671..00000000000 --- a/code_samples/back_office/search/templates/themes/admin/ui/global_search_autocomplete_product_template.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -
    -
    diff --git a/code_samples/back_office/settings/src/Setting/Group/MyGroup.php b/code_samples/back_office/settings/src/Setting/Group/MyGroup.php deleted file mode 100644 index ecdfa802b9f..00000000000 --- a/code_samples/back_office/settings/src/Setting/Group/MyGroup.php +++ /dev/null @@ -1,24 +0,0 @@ - 'Metric', - self::IMPERIAL_OPTION => 'Imperial', - default => throw new InvalidArgumentException( - '$storageValue', - sprintf('There is no \'%s\' option', $storageValue) - ), - }; - } - - public function getDefaultValue(): string - { - return 'metric'; - } - - public function mapFieldForm(FormBuilderInterface $formBuilder, ValueDefinitionInterface $value): FormBuilderInterface - { - $choices = [ - 'Metric' => self::METRIC_OPTION, - 'Imperial' => self::IMPERIAL_OPTION, - ]; - - return $formBuilder->create( - 'value', - ChoiceType::class, - [ - 'multiple' => false, - 'required' => true, - 'label' => $this->getDescription(), - 'choices' => $choices, - ] - ); - } -} diff --git a/code_samples/back_office/settings/templates/themes/admin/user/setting/update_unit.html.twig b/code_samples/back_office/settings/templates/themes/admin/user/setting/update_unit.html.twig deleted file mode 100644 index d1fb37d3269..00000000000 --- a/code_samples/back_office/settings/templates/themes/admin/user/setting/update_unit.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{% extends '@ibexadesign/account/settings/update.html.twig' %} - -{% block form %} - {{ parent() }} - -{% endblock %} diff --git a/code_samples/back_office/thumbnails/src/Strategy/StaticThumbnailStrategy.php b/code_samples/back_office/thumbnails/src/Strategy/StaticThumbnailStrategy.php deleted file mode 100644 index a9e7b350b76..00000000000 --- a/code_samples/back_office/thumbnails/src/Strategy/StaticThumbnailStrategy.php +++ /dev/null @@ -1,24 +0,0 @@ - $this->staticThumbnail, - ]); - } -} diff --git a/code_samples/background_tasks/src/Message/SomeMessage.php b/code_samples/background_tasks/src/Message/SomeMessage.php deleted file mode 100644 index 8f906c23b3d..00000000000 --- a/code_samples/background_tasks/src/Message/SomeMessage.php +++ /dev/null @@ -1,8 +0,0 @@ -tag($view); // When working with a view - -/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */ -$responseTagger->tag($content->getContentInfo()); // When working with a content item - -/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $location */ -$responseTagger->tag($location); // When working with a location diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php deleted file mode 100644 index ae4fb7d78e3..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Form/PercentValueFormMapper.php +++ /dev/null @@ -1,42 +0,0 @@ -getAttributeDefinition(); - - $options = [ - 'disabled' => $context['translation_mode'] ?? false, - 'label' => $definition->getName(), - 'block_prefix' => 'percentage_attribute_value', - 'required' => $assignment->isRequired(), - 'constraints' => [ - new AttributeValue([ - 'definition' => $definition, - ]), - ], - ]; - - if ($assignment->isRequired()) { - $options['constraints'][] = new Assert\NotBlank(); - } - - $builder->add($name, PercentType::class, $options); - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentAttributeOptionsType.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentAttributeOptionsType.php deleted file mode 100644 index 558f3d67434..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentAttributeOptionsType.php +++ /dev/null @@ -1,36 +0,0 @@ -add('min', PercentType::class, [ - 'disabled' => $options['translation_mode'], - 'label' => 'Minimum Value', - 'required' => false, - ]); - - $builder->add('max', PercentType::class, [ - 'disabled' => $options['translation_mode'], - 'label' => 'Maximum Value', - 'required' => false, - ]); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'translation_mode' => false, - ]); - $resolver->setAllowedTypes('translation_mode', 'bool'); - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php deleted file mode 100644 index f437fcf294d..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsFormMapper.php +++ /dev/null @@ -1,22 +0,0 @@ -add($name, PercentAttributeOptionsType::class, [ - 'constraints' => [ - new AttributeDefinitionOptions(['type' => $context['type']]), - ], - 'translation_mode' => $context['translation_mode'], - ]); - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsValidator.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsValidator.php deleted file mode 100644 index b110ac4289e..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentOptionsValidator.php +++ /dev/null @@ -1,26 +0,0 @@ -get('min'); - $max = $options->get('max'); - - if ($min !== null && $max !== null && $min > $max) { - return [ - new OptionsValidatorError('[max]', 'Maximum value should be greater than minimum value'), - ]; - } - - return []; - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueFormatter.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueFormatter.php deleted file mode 100644 index b15ffd5f5a2..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueFormatter.php +++ /dev/null @@ -1,27 +0,0 @@ -getValue(); - if ($value === null) { - return null; - } - - $formatter = $parameters['formatter'] ?? null; - if ($formatter === null) { - $formatter = new NumberFormatter('', NumberFormatter::PERCENT); - } - - return $formatter->format($value); - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueValidator.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueValidator.php deleted file mode 100644 index ad784b00331..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/PercentValueValidator.php +++ /dev/null @@ -1,38 +0,0 @@ -getOptions(); - - $min = $options->get('min'); - if ($min !== null && $value < $min) { - $errors[] = new ValueValidationError(null, 'Percentage should be greater or equal to %min%', [ - '%min%' => $min, - ]); - } - - $max = $options->get('max'); - if ($max !== null && $value > $max) { - $errors[] = new ValueValidationError(null, 'Percentage should be lesser or equal to %max%', [ - '%max%' => $max, - ]); - } - - return $errors; - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageConverter.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageConverter.php deleted file mode 100644 index 6ee2a72701f..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageConverter.php +++ /dev/null @@ -1,28 +0,0 @@ - $value, - ]; - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageDefinition.php b/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageDefinition.php deleted file mode 100644 index 15c92964164..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Attribute/Percent/Storage/PercentStorageDefinition.php +++ /dev/null @@ -1,21 +0,0 @@ - Types::FLOAT, - ]; - } - - public function getTableName(): string - { - return 'app_product_specification_attribute_percent'; - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php b/code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php deleted file mode 100644 index f9f55fa4429..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/DependencyInjection/AddFloatStorageDefinitionTag.php +++ /dev/null @@ -1,21 +0,0 @@ -getDefinition(StorageDefinition::class) - ->addTag('ibexa.product_catalog.attribute.storage_definition', ['type' => 'percent']); - } -} diff --git a/code_samples/catalog/custom_attribute_type/src/Kernel.php b/code_samples/catalog/custom_attribute_type/src/Kernel.php deleted file mode 100644 index 464772c47c1..00000000000 --- a/code_samples/catalog/custom_attribute_type/src/Kernel.php +++ /dev/null @@ -1,20 +0,0 @@ -addCompilerPass(new AddFloatStorageDefinitionTag()); - } -} diff --git a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php b/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php deleted file mode 100644 index 8a7837a023b..00000000000 --- a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/DataTransformer/ProductNameCriterionTransformer.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -final class ProductNameCriterionTransformer implements DataTransformerInterface -{ - public function transform($value): ?string - { - if (null === $value) { - return null; - } - - if (!$value instanceof ProductName) { - throw new TransformationFailedException('Expected a ' . ProductName::class . ' object.'); - } - - return $value->getName(); - } - - public function reverseTransform($value): ?ProductName - { - if ($value === null) { - return null; - } - - if (!is_string($value)) { - throw new TransformationFailedException('Invalid data, expected a string value'); - } - - return new ProductName($value); - } -} diff --git a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/ProductNameFilter.php b/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/ProductNameFilter.php deleted file mode 100644 index 533b0d258b6..00000000000 --- a/code_samples/catalog/custom_catalog_filter/src/CatalogFilter/ProductNameFilter.php +++ /dev/null @@ -1,37 +0,0 @@ -add( - $filterDefinition->getIdentifier(), - TagifyType::class, - [ - 'label' => 'Product name', - 'block_prefix' => 'catalog_criteria_product_name', - 'translation_domain' => 'product_catalog', - ] - ); - - $builder->get($filterDefinition->getIdentifier()) - ->addModelTransformer( - new DataTransformer\ProductNameCriterionTransformer() - ); - } - - public function supports(FilterDefinitionInterface $filterDefinition): bool - { - return $filterDefinition instanceof ProductNameFilter; - } -} diff --git a/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/catalog_filters_blocks.html.twig b/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/catalog_filters_blocks.html.twig deleted file mode 100644 index b1e5fbe92a6..00000000000 --- a/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/catalog_filters_blocks.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block catalog_criteria_product_name_values %} - {% include '@ibexadesign/product_catalog/catalog/edit/list_filter_taggify.html.twig' with { criteria } %} -{% endblock %} diff --git a/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/form_field_override.html.twig b/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/form_field_override.html.twig deleted file mode 100644 index d9b6cdeed11..00000000000 --- a/code_samples/catalog/custom_catalog_filter/templates/themes/admin/product_catalog/form_field_override.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% extends '@ibexadesign/product_catalog/form_fields.html.twig' %} - -{%- block catalog_criteria_product_name_row -%} - {{- block('catalog_taggify_panel') -}} -{%- endblock -%} diff --git a/code_samples/catalog/custom_code_generator_strategy/src/CodeGenerator/Strategy/CustomIncrementalCodeGenerator.php b/code_samples/catalog/custom_code_generator_strategy/src/CodeGenerator/Strategy/CustomIncrementalCodeGenerator.php deleted file mode 100644 index d2b4b163908..00000000000 --- a/code_samples/catalog/custom_code_generator_strategy/src/CodeGenerator/Strategy/CustomIncrementalCodeGenerator.php +++ /dev/null @@ -1,25 +0,0 @@ -hasBaseProduct()) { - throw new InvalidArgumentException('$context', 'missing base product'); - } - - if (!$context->hasIndex()) { - throw new InvalidArgumentException('$context', 'missing index'); - } - - return $context->getBaseProduct()->getCode() . 'v' . $context->getIndex(); - } -} diff --git a/code_samples/catalog/percent_name_schema_strategy/NameSchema/PercentNameSchemaStrategy.php b/code_samples/catalog/percent_name_schema_strategy/NameSchema/PercentNameSchemaStrategy.php deleted file mode 100644 index d567d474d3b..00000000000 --- a/code_samples/catalog/percent_name_schema_strategy/NameSchema/PercentNameSchemaStrategy.php +++ /dev/null @@ -1,19 +0,0 @@ -getType()->getIdentifier() === 'percent'; - } -} diff --git a/code_samples/customer_portal/src/Corporate/EventSubscriber/ApplicationDetailsViewSubscriber.php b/code_samples/customer_portal/src/Corporate/EventSubscriber/ApplicationDetailsViewSubscriber.php deleted file mode 100644 index a3aa6250197..00000000000 --- a/code_samples/customer_portal/src/Corporate/EventSubscriber/ApplicationDetailsViewSubscriber.php +++ /dev/null @@ -1,44 +0,0 @@ -getApplication(); - - $view->addParameters([ - 'verify_form' => $this->formFactory->create( - VerifyType::class, - [ - 'application' => $application->getId(), - ] - )->createView(), - ]); - } - - protected function supports(View $view): bool - { - return $view instanceof ApplicationDetailsView; - } -} diff --git a/code_samples/customer_portal/src/Corporate/EventSubscriber/VerifyStateEventSubscriber.php b/code_samples/customer_portal/src/Corporate/EventSubscriber/VerifyStateEventSubscriber.php deleted file mode 100644 index 54a85470e12..00000000000 --- a/code_samples/customer_portal/src/Corporate/EventSubscriber/VerifyStateEventSubscriber.php +++ /dev/null @@ -1,66 +0,0 @@ - 'mapApplicationWorkflowForm', - ApplicationWorkflowEvents::getStateEvent(self::VERIFY_STATE) => 'applicationVerify', - ]; - } - - public function mapApplicationWorkflowForm(MapApplicationWorkflowFormEvent $event): void - { - if ($event->getState() === self::VERIFY_STATE) { - $form = $this->formFactory->create(VerifyType::class, $event->getData()); - - $event->setForm($form); - } - } - - public function applicationVerify(ApplicationWorkflowFormEvent $event): void - { - $data = $event->getData(); - - if (!is_array($data)) { - return; - } - - $applicationStateUpdateStruct = new ApplicationStateUpdateStruct($event->getApplicationState()->getId()); - $applicationStateUpdateStruct->state = self::VERIFY_STATE; - - $this->applicationStateHandler->update($applicationStateUpdateStruct); - - $this->notificationHandler->success( - /** @Desc("Application moved to Verification state") */ - 'application.state.verify.notification', - [], - 'corporate_account_application' - ); - } -} diff --git a/code_samples/customer_portal/src/Form/VerifyType.php b/code_samples/customer_portal/src/Form/VerifyType.php deleted file mode 100644 index 0326c304ac0..00000000000 --- a/code_samples/customer_portal/src/Form/VerifyType.php +++ /dev/null @@ -1,32 +0,0 @@ -add(self::FIELD_APPLICATION, HiddenType::class) - ->add('new_field', TextType::class) - ->add(self::FIELD_NOTES, TextareaType::class, [ - 'required' => false, - ]) - ->add(self::FIELD_VERIFY, SubmitType::class); - } -} diff --git a/code_samples/customer_portal/templates/themes/admin/corporate_account/application/details.html.twig b/code_samples/customer_portal/templates/themes/admin/corporate_account/application/details.html.twig deleted file mode 100644 index f7efaa70060..00000000000 --- a/code_samples/customer_portal/templates/themes/admin/corporate_account/application/details.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "@IbexaCorporateAccount/themes/admin/corporate_account/application/details.html.twig" %} - -{% block content %} - {{ form_start(verify_form, { action: path('ibexa.corporate_account.application.workflow.state', { - state: 'verify', - applicationId: application.id, - }), method: 'POST'}) }} - {{ form_row(verify_form.notes) }} - -
    - {{ form_widget(verify_form.verify, { attr: { - class: 'ibexa-btn ibexa-btn--primary ibexa-ca-application-workflow-extra-actions__btn', - }}) }} -
    - {{ form_end(verify_form) }} - - {{ parent() }} -{% endblock %} diff --git a/code_samples/data_migration/config/custom_services.yaml b/code_samples/data_migration/config/custom_services.yaml deleted file mode 100644 index ccbf2c68f12..00000000000 --- a/code_samples/data_migration/config/custom_services.yaml +++ /dev/null @@ -1,26 +0,0 @@ -services: - App\Migrations\Action\AssignSectionDenormalizer: - autoconfigure: false - tags: - - { name: 'ibexa.migrations.serializer.normalizer' } - - App\Migrations\Action\AssignSectionExecutor: - tags: - - { name: 'ibexa.migrations.executor.action.content', key: !php/const App\Migrations\Action\AssignSection::TYPE } - - App\Migrations\Matcher\SectionIdentifierNormalizer: - tags: - - { name: 'ibexa.migrations.serializer.normalizer' } - - App\Migrations\Matcher\SectionIdentifierGenerator: - tags: - - { name: 'ibexa.migrations.generator.criterion_generator.content' } - - App\Migrations\Step\ReplaceNameStepNormalizer: - tags: - - 'ibexa.migrations.serializer.step_normalizer' - - 'ibexa.migrations.serializer.normalizer' - - App\Migrations\Step\ReplaceNameStepExecutor: - tags: - - 'ibexa.migrations.step_executor' diff --git a/code_samples/data_migration/src/Migrations/Action/AssignSection.php b/code_samples/data_migration/src/Migrations/Action/AssignSection.php deleted file mode 100644 index 876c51491ad..00000000000 --- a/code_samples/data_migration/src/Migrations/Action/AssignSection.php +++ /dev/null @@ -1,29 +0,0 @@ -sectionIdentifier; - } - - public function getSupportedType(): string - { - return self::TYPE; - } -} diff --git a/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php b/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php deleted file mode 100644 index 96f067a99e8..00000000000 --- a/code_samples/data_migration/src/Migrations/Action/AssignSectionDenormalizer.php +++ /dev/null @@ -1,31 +0,0 @@ - $data - * @param string $type - * @param string|null $format - * @param array $context - * - * @return \App\Migrations\Action\AssignSection - */ - public function denormalize($data, string $type, ?string $format = null, array $context = []): AssignSection - { - Assert::keyExists($data, 'value'); - - return new AssignSection($data['value']); - } -} diff --git a/code_samples/data_migration/src/Migrations/Action/AssignSectionExecutor.php b/code_samples/data_migration/src/Migrations/Action/AssignSectionExecutor.php deleted file mode 100644 index 258f3f0d5dc..00000000000 --- a/code_samples/data_migration/src/Migrations/Action/AssignSectionExecutor.php +++ /dev/null @@ -1,29 +0,0 @@ -contentService->loadContentInfo($content->id); - $section = $this->sectionService->loadSectionByIdentifier($action->getValue()); - $this->sectionService->assignSection($contentInfo, $section); - } -} diff --git a/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierGenerator.php b/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierGenerator.php deleted file mode 100644 index 6c37bcc49a6..00000000000 --- a/code_samples/data_migration/src/Migrations/Matcher/SectionIdentifierGenerator.php +++ /dev/null @@ -1,21 +0,0 @@ - $data - * @param array $context - */ - protected function createCriterion(array $data, string $type, ?string $format, array $context): FilteringCriterion - { - Assert::keyExists($data, 'value'); - - return new Criterion\SectionIdentifier($data['value']); - } - - public function supportsNormalization($data, ?string $format = null, array $context = []): bool - { - return $data instanceof Criterion\SectionIdentifier; - } -} diff --git a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStep.php b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStep.php deleted file mode 100644 index 64bbe53d682..00000000000 --- a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStep.php +++ /dev/null @@ -1,22 +0,0 @@ -replacement = $replacement ?? 'New Company Name'; - } - - public function getReplacement(): string - { - return $this->replacement; - } -} diff --git a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepExecutor.php b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepExecutor.php deleted file mode 100644 index 394e3dfd018..00000000000 --- a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepExecutor.php +++ /dev/null @@ -1,59 +0,0 @@ -contentService->find(new Filter()); - - foreach ($contentItems as $contentItem) { - $struct = $this->contentService->newContentUpdateStruct(); - - foreach ($contentItem->getFields() as $field) { - if ($field->fieldTypeIdentifier !== 'ibexa_string') { - continue; - } - - if ($field->fieldDefIdentifier === 'identifier') { - continue; - } - - if (str_contains((string) $field->value, 'Company Name')) { - $newValue = str_replace('Company Name', $step->getReplacement(), $field->value); - $struct->setField($field->fieldDefIdentifier, new Value($newValue)); - } - } - - try { - $content = $this->contentService->createContentDraft($contentItem->contentInfo); - $content = $this->contentService->updateContent($content->getVersionInfo(), $struct); - $this->contentService->publishVersion($content->getVersionInfo()); - } catch (\Throwable) { - // Ignore - } - } - - return null; - } - - public function canHandle(StepInterface $step): bool - { - return $step instanceof ReplaceNameStep; - } -} diff --git a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php b/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php deleted file mode 100644 index 55b5ace82d9..00000000000 --- a/code_samples/data_migration/src/Migrations/Step/ReplaceNameStepNormalizer.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -final class ReplaceNameStepNormalizer extends AbstractStepNormalizer -{ - protected function normalizeStep( - StepInterface $object, - ?string $format = null, - array $context = [] - ): array { - assert($object instanceof ReplaceNameStep); - - return [ - 'replacement' => $object->getReplacement(), - ]; - } - - protected function denormalizeStep( - $data, - string $type, - string $format, - array $context = [] - ): ReplaceNameStep { - return new ReplaceNameStep($data['replacement'] ?? null); - } - - public function getHandledClassType(): string - { - return ReplaceNameStep::class; - } - - public function getType(): string - { - return 'company_name'; - } - - public function getMode(): string - { - return 'replace'; - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php b/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php deleted file mode 100644 index 2219c9ae36d..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Type.php +++ /dev/null @@ -1,48 +0,0 @@ - [ - 'type' => 'string', - 'default' => '(%x%, %y%)', - ], - ]; - } - - public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void - { - $definition = $data->getFieldDefinition(); - $fieldForm->add('value', Point2DType::class, [ - 'required' => $definition->isRequired, - 'label' => $definition->getName(), - ]); - } - - public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, FieldDefinitionData $data): void - { - $fieldDefinitionForm->add('fieldSettings', Point2DSettingsType::class, [ - 'label' => false, - ]); - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php b/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php deleted file mode 100644 index 894181613db..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/Value.php +++ /dev/null @@ -1,43 +0,0 @@ -x; - } - - public function setX(?float $x): void - { - $this->x = $x; - } - - public function getY(): ?float - { - return $this->y; - } - - public function setY(?float $y): void - { - $this->y = $y; - } - - public function __toString(): string - { - return "({$this->x}, {$this->y})"; - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/ValueFinal.php b/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/ValueFinal.php deleted file mode 100644 index 2c8a4dac8d8..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/FieldType/Point2D/ValueFinal.php +++ /dev/null @@ -1,50 +0,0 @@ - $coords */ - public function __construct(array $coords = []) - { - if (!empty($coords)) { - $this->x = $coords[0]; - $this->y = $coords[1]; - } - } - - public function getX(): ?float - { - return $this->x; - } - - public function setX(?float $x): void - { - $this->x = $x; - } - - public function getY(): ?float - { - return $this->y; - } - - public function setY(?float $y): void - { - $this->y = $y; - } - - public function __toString(): string - { - return "({$this->x}, {$this->y})"; - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DSettingsType.php b/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DSettingsType.php deleted file mode 100644 index 75432dcc1e4..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DSettingsType.php +++ /dev/null @@ -1,16 +0,0 @@ -add('format', TextType::class); - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DType.php b/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DType.php deleted file mode 100644 index 1f4227ae7a9..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/Form/Type/Point2DType.php +++ /dev/null @@ -1,26 +0,0 @@ -add('x', NumberType::class); - $builder->add('y', NumberType::class); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'data_class' => Value::class, - ]); - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php deleted file mode 100644 index f4037480158..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueDenormalizer.php +++ /dev/null @@ -1,32 +0,0 @@ - true, - ]; - } -} diff --git a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php b/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php deleted file mode 100644 index bc7fea2b9c6..00000000000 --- a/code_samples/field_types/2dpoint_ft/src/Serializer/Point2D/ValueNormalizer.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - public function normalize($object, ?string $format = null, array $context = []): array - { - return [ - $object->getX(), - $object->getY(), - ]; - } - - public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool - { - return $data instanceof Value; - } - - public function getSupportedTypes(?string $format): array - { - return [ - Value::class => true, - ]; - } -} diff --git a/code_samples/field_types/2dpoint_ft/steps/step_1/Value.php b/code_samples/field_types/2dpoint_ft/steps/step_1/Value.php deleted file mode 100644 index 7b5b1936962..00000000000 --- a/code_samples/field_types/2dpoint_ft/steps/step_1/Value.php +++ /dev/null @@ -1,40 +0,0 @@ -x; - } - - public function setX(?float $x): void - { - $this->x = $x; - } - - public function getY(): ?float - { - return $this->y; - } - - public function setY(?float $y): void - { - $this->y = $y; - } - - public function __toString(): string - { - return "({$this->x}, {$this->y})"; - } -} diff --git a/code_samples/field_types/2dpoint_ft/steps/step_2/Type.php b/code_samples/field_types/2dpoint_ft/steps/step_2/Type.php deleted file mode 100644 index 5d6fd717d2f..00000000000 --- a/code_samples/field_types/2dpoint_ft/steps/step_2/Type.php +++ /dev/null @@ -1,14 +0,0 @@ -add('x', NumberType::class); - $builder->add('y', NumberType::class); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'data_class' => Value::class, - ]); - } -} diff --git a/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php b/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php deleted file mode 100644 index 9e0bbc346d9..00000000000 --- a/code_samples/field_types/2dpoint_ft/steps/step_3/Type.php +++ /dev/null @@ -1,27 +0,0 @@ -getFieldDefinition(); - $fieldForm->add('value', Point2DType::class, [ - 'required' => $definition->isRequired, - 'label' => $definition->getName(), - ]); - } -} diff --git a/code_samples/field_types/2dpoint_ft/steps/step_4/point2d_field.html.twig b/code_samples/field_types/2dpoint_ft/steps/step_4/point2d_field.html.twig deleted file mode 100644 index 83f401e9a12..00000000000 --- a/code_samples/field_types/2dpoint_ft/steps/step_4/point2d_field.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block point2d_field %} - ({{ field.value.getX() }}, {{ field.value.getY() }}) -{% endblock %} diff --git a/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php b/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php deleted file mode 100644 index 617411f67e7..00000000000 --- a/code_samples/field_types/2dpoint_ft/steps/step_6/Type.php +++ /dev/null @@ -1,37 +0,0 @@ - [ - 'type' => 'string', - 'default' => '(%x%, %y%)', - ], - ]; - } - - public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void - { - $definition = $data->getFieldDefinition(); - $fieldForm->add('value', Point2DType::class, [ - 'required' => $definition->isRequired, - 'label' => $definition->getName(), - ]); - } -} diff --git a/code_samples/field_types/2dpoint_ft/templates/point2d_field.html.twig b/code_samples/field_types/2dpoint_ft/templates/point2d_field.html.twig deleted file mode 100644 index 02af5535d0b..00000000000 --- a/code_samples/field_types/2dpoint_ft/templates/point2d_field.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% block point2d_field %} - {{ fieldSettings.format|replace({ - '%x%': field.value.x, - '%y%': field.value.y - }) }} -{% endblock %} \ No newline at end of file diff --git a/code_samples/field_types/2dpoint_ft/templates/point2d_field_type_definition.html.twig b/code_samples/field_types/2dpoint_ft/templates/point2d_field_type_definition.html.twig deleted file mode 100644 index 6630478765c..00000000000 --- a/code_samples/field_types/2dpoint_ft/templates/point2d_field_type_definition.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% block point2d_field_definition_edit %} -
    - {{- form_label(form.fieldSettings.format) -}} - {{- form_errors(form.fieldSettings.format) -}} - {{- form_widget(form.fieldSettings.format) -}} -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Comparable.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Comparable.php deleted file mode 100644 index 3a85463f208..00000000000 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Comparable.php +++ /dev/null @@ -1,22 +0,0 @@ - new StringComparisonValue([ - 'value' => $value->getName(), - ]), - ]); - } -} diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonEngine.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonEngine.php deleted file mode 100644 index 60fdf5ca716..00000000000 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonEngine.php +++ /dev/null @@ -1,36 +0,0 @@ -stringValueComparisonEngine->compareValues($comparisonDataA->name, $comparisonDataB->name) - ); - } - - /** - * @param \App\FieldType\HelloWorld\Comparison\Value $comparisonDataA - * @param \App\FieldType\HelloWorld\Comparison\Value $comparisonDataB - */ - public function shouldRunComparison(FieldTypeComparisonValue $comparisonDataA, FieldTypeComparisonValue $comparisonDataB): bool - { - return $comparisonDataA->name->value !== $comparisonDataB->name->value; - } -} diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonResult.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonResult.php deleted file mode 100644 index a8bab2d2f7e..00000000000 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/HelloWorldComparisonResult.php +++ /dev/null @@ -1,25 +0,0 @@ -stringDiff; - } - - public function isChanged(): bool - { - return $this->stringDiff->isChanged(); - } -} diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Value.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Value.php deleted file mode 100644 index b820682ec84..00000000000 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Comparison/Value.php +++ /dev/null @@ -1,13 +0,0 @@ -getFieldDefinition(); - - $fieldForm->add('value', HelloWorldType::class, [ - 'required' => $definition->isRequired, - 'label' => $definition->getName(), - ]); - } -} diff --git a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Value.php b/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Value.php deleted file mode 100644 index 5810b423043..00000000000 --- a/code_samples/field_types/generic_ft/src/FieldType/HelloWorld/Value.php +++ /dev/null @@ -1,29 +0,0 @@ -name; - } - - public function setName(?string $name): void - { - $this->name = $name; - } - - public function __toString(): string - { - return "Hello {$this->name}!"; - } -} diff --git a/code_samples/field_types/generic_ft/src/Form/Type/HelloWorldType.php b/code_samples/field_types/generic_ft/src/Form/Type/HelloWorldType.php deleted file mode 100644 index 6a0cbf5e9b2..00000000000 --- a/code_samples/field_types/generic_ft/src/Form/Type/HelloWorldType.php +++ /dev/null @@ -1,26 +0,0 @@ -add('name', TextType::class); - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'data_class' => Value::class, - ]); - } -} diff --git a/code_samples/field_types/generic_ft/templates/themes/admin/field_types/field_type_comparison.html.twig b/code_samples/field_types/generic_ft/templates/themes/admin/field_types/field_type_comparison.html.twig deleted file mode 100644 index e8a97d97bd0..00000000000 --- a/code_samples/field_types/generic_ft/templates/themes/admin/field_types/field_type_comparison.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends '@ibexadesign/version_comparison/comparison_result_blocks.html.twig' %} - -{% block hello_world_field_comparison %} - {% apply spaceless %} - - {% with { - 'comparison_result': comparison_result.getHelloWorldDiff() - } %} - {{ block('string_diff_render') }} - {% endwith %} - - {% endapply %} -{% endblock %} diff --git a/code_samples/field_types/generic_ft/templates/themes/standard/field_types/field_type.html.twig b/code_samples/field_types/generic_ft/templates/themes/standard/field_types/field_type.html.twig deleted file mode 100644 index 40ce50b3a62..00000000000 --- a/code_samples/field_types/generic_ft/templates/themes/standard/field_types/field_type.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% block hello_world_field %} - Hello {{ field.value.getName() }}! -{% endblock %} diff --git a/code_samples/forms/custom_form_attribute/src/FormBuilder/FieldType/Field/Mapper/CheckboxWithRichtextDescriptionFieldMapper.php b/code_samples/forms/custom_form_attribute/src/FormBuilder/FieldType/Field/Mapper/CheckboxWithRichtextDescriptionFieldMapper.php deleted file mode 100644 index 015ee0e76ef..00000000000 --- a/code_samples/forms/custom_form_attribute/src/FormBuilder/FieldType/Field/Mapper/CheckboxWithRichtextDescriptionFieldMapper.php +++ /dev/null @@ -1,22 +0,0 @@ -getAttributeValue('label'); - $options['richtext_description'] = $field->getAttributeValue('richtext_description'); - - return $options; - } -} diff --git a/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/CheckboxWithRichtextDescriptionType.php b/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/CheckboxWithRichtextDescriptionType.php deleted file mode 100644 index a5603b63f6c..00000000000 --- a/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/CheckboxWithRichtextDescriptionType.php +++ /dev/null @@ -1,48 +0,0 @@ -setDefaults([ - 'richtext_description' => '', - ]); - $resolver->setAllowedTypes('richtext_description', ['null', 'string']); - } - - public function buildView(FormView $view, FormInterface $form, array $options): void - { - // pass the Dom object of the richtext doc to the template - $dom = new \DOMDocument(); - if (!empty($options['richtext_description'])) { - $dom->loadXML($options['richtext_description']); - } - $view->vars['richtextDescription'] = $dom; - } -} diff --git a/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/FieldAttribute/AttributeRichtextDescriptionType.php b/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/FieldAttribute/AttributeRichtextDescriptionType.php deleted file mode 100644 index 4162e9471b9..00000000000 --- a/code_samples/forms/custom_form_attribute/src/FormBuilder/Form/Type/FieldAttribute/AttributeRichtextDescriptionType.php +++ /dev/null @@ -1,27 +0,0 @@ - - {% set udw_context = { - 'languageCode': 'en', - } %} - {{ form_errors(form) }} - - - - - {{ form_row(form) }} - - {{ encore_entry_script_tags('formbuilder-richtext-checkbox-js') }} - -{% endblock %} \ No newline at end of file diff --git a/code_samples/forms/custom_form_attribute/templates/themes/standard/formtheme/formbuilder_checkbox_with_richtext_description.html.twig b/code_samples/forms/custom_form_attribute/templates/themes/standard/formtheme/formbuilder_checkbox_with_richtext_description.html.twig deleted file mode 100644 index adbb13d6a18..00000000000 --- a/code_samples/forms/custom_form_attribute/templates/themes/standard/formtheme/formbuilder_checkbox_with_richtext_description.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% block checkbox_with_richtext_description_row %} - {{ form_label(form)}} - {{ form_errors(form) }} - {{ form_widget(form) }} - {{ form.vars.richtextDescription|ibexa_richtext_to_html5() }} -{% endblock %} \ No newline at end of file diff --git a/code_samples/forms/custom_form_field/src/EventSubscriber/FormFieldDefinitionSubscriber.php b/code_samples/forms/custom_form_field/src/EventSubscriber/FormFieldDefinitionSubscriber.php deleted file mode 100644 index ec96fa38c91..00000000000 --- a/code_samples/forms/custom_form_field/src/EventSubscriber/FormFieldDefinitionSubscriber.php +++ /dev/null @@ -1,29 +0,0 @@ - 'onSingleLineFieldDefinition', - ]; - } - - public function onSingleLineFieldDefinition(FieldDefinitionEvent $event): void - { - $isReadOnlyAttribute = new FieldAttributeDefinitionBuilder(); - $isReadOnlyAttribute->setIdentifier('custom'); - $isReadOnlyAttribute->setName('Custom attribute'); - $isReadOnlyAttribute->setType('string'); - - $definitionBuilder = $event->getDefinitionBuilder(); - $definitionBuilder->addAttribute($isReadOnlyAttribute->buildDefinition()); - } -} diff --git a/code_samples/forms/custom_form_field/src/FormBuilder/Field/Mapper/CountryFieldMapper.php b/code_samples/forms/custom_form_field/src/FormBuilder/Field/Mapper/CountryFieldMapper.php deleted file mode 100644 index 32d4b9774a5..00000000000 --- a/code_samples/forms/custom_form_field/src/FormBuilder/Field/Mapper/CountryFieldMapper.php +++ /dev/null @@ -1,19 +0,0 @@ -getAttributeValue('label'); - $options['help'] = $field->getAttributeValue('help'); - - return $options; - } -} diff --git a/code_samples/front/add_design/templates/themes/standard/full/article.html.twig b/code_samples/front/add_design/templates/themes/standard/full/article.html.twig deleted file mode 100644 index 37f5b3deb2c..00000000000 --- a/code_samples/front/add_design/templates/themes/standard/full/article.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% extends '@ibexadesign/pagelayout.html.twig' %} - -{% block content %} -{% endblock %} diff --git a/code_samples/front/add_design/templates/themes/standard/pagelayout.html.twig b/code_samples/front/add_design/templates/themes/standard/pagelayout.html.twig deleted file mode 100644 index 42fdd33bfb8..00000000000 --- a/code_samples/front/add_design/templates/themes/standard/pagelayout.html.twig +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - {% if content is defined and title is not defined %} - {% set title = ibexa_content_name( content ) %} - {% endif %} - {{ title|default( 'Home' ) }} - - {% if content is defined and content.contentInfo.mainLocationId %} - - {% endif %} - - {% block stylesheets %} - {{ encore_entry_link_tags('app') }} - {% endblock %} - - - -{% include '@ibexadesign/parts/header.html.twig' %} - -{% block content %} -{% endblock %} - -{% include '@ibexadesign/parts/footer.html.twig' %} - -{% block javascripts %} - {{ encore_entry_script_tags('app') }} -{% endblock %} - - diff --git a/code_samples/front/add_design/templates/themes/standard/parts/footer.html.twig b/code_samples/front/add_design/templates/themes/standard/parts/footer.html.twig deleted file mode 100644 index a4515eae6a8..00000000000 --- a/code_samples/front/add_design/templates/themes/standard/parts/footer.html.twig +++ /dev/null @@ -1 +0,0 @@ -
    Copyright Acme SA
    diff --git a/code_samples/front/add_design/templates/themes/standard/parts/header.html.twig b/code_samples/front/add_design/templates/themes/standard/parts/header.html.twig deleted file mode 100644 index 32d44270784..00000000000 --- a/code_samples/front/add_design/templates/themes/standard/parts/header.html.twig +++ /dev/null @@ -1 +0,0 @@ - diff --git a/code_samples/front/add_design/templates/themes/summersale/parts/header.html.twig b/code_samples/front/add_design/templates/themes/summersale/parts/header.html.twig deleted file mode 100644 index 41a454f349c..00000000000 --- a/code_samples/front/add_design/templates/themes/summersale/parts/header.html.twig +++ /dev/null @@ -1 +0,0 @@ - diff --git a/code_samples/front/custom_query_type/src/QueryType/LatestContentQueryType.php b/code_samples/front/custom_query_type/src/QueryType/LatestContentQueryType.php deleted file mode 100644 index 2c73561ddcb..00000000000 --- a/code_samples/front/custom_query_type/src/QueryType/LatestContentQueryType.php +++ /dev/null @@ -1,36 +0,0 @@ - new Query\Criterion\LogicalAnd($criteria), - 'sortClauses' => [ - new Query\SortClause\DatePublished(Query::SORT_DESC), - ], - 'limit' => $parameters['limit'] ?? 10, - ]); - } - - public function getSupportedParameters() - { - return ['contentType', 'limit']; - } -} diff --git a/code_samples/front/custom_query_type/src/QueryType/OptionsBasedLatestContentQueryType.php b/code_samples/front/custom_query_type/src/QueryType/OptionsBasedLatestContentQueryType.php deleted file mode 100644 index 3b0060bfc1c..00000000000 --- a/code_samples/front/custom_query_type/src/QueryType/OptionsBasedLatestContentQueryType.php +++ /dev/null @@ -1,41 +0,0 @@ - new Query\Criterion\LogicalAnd($criteria), - 'sortClauses' => [ - new Query\SortClause\DatePublished(Query::SORT_DESC), - ], - 'limit' => $parameters['limit'] ?? 10, - ]); - } - - protected function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefined(['contentType', 'limit']); - $resolver->setAllowedTypes('contentType', 'array'); - $resolver->setAllowedTypes('limit', 'int'); - $resolver->setDefault('limit', 10); - } -} diff --git a/code_samples/front/custom_query_type/templates/themes/my_theme/full/latest.html.twig b/code_samples/front/custom_query_type/templates/themes/my_theme/full/latest.html.twig deleted file mode 100644 index 259ae8aea0a..00000000000 --- a/code_samples/front/custom_query_type/templates/themes/my_theme/full/latest.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in latest %} - {{ ibexa_render(item.valueObject) }} -{% endfor %} diff --git a/code_samples/front/embed_content/src/Controller/RelationController.php b/code_samples/front/embed_content/src/Controller/RelationController.php deleted file mode 100644 index 58dc2d4af73..00000000000 --- a/code_samples/front/embed_content/src/Controller/RelationController.php +++ /dev/null @@ -1,47 +0,0 @@ -getParameter('accepted_content_types'); - - $location = $this->locationService->loadLocation($locationId); - $contentInfo = $location->getContentInfo(); - $versionInfo = $this->contentService->loadVersionInfo($contentInfo); - $relationListIterator = new BatchIterator( - new RelationListIteratorAdapter( - $this->contentService, - $versionInfo - ) - ); - - $items = []; - - foreach ($relationListIterator as $relationListItem) { - if ($relationListItem->hasRelation() && in_array($relationListItem->getRelation()->getDestinationContentInfo()->getContentType()->identifier, $acceptedContentTypes)) { - $items[] = $this->contentService->loadContentByContentInfo($relationListItem->getRelation()->getDestinationContentInfo()); - } - } - - $view->addParameters([ - 'items' => $items, - ]); - - return $view; - } -} diff --git a/code_samples/front/embed_content/templates/themes/my_theme/full/article.html.twig b/code_samples/front/embed_content/templates/themes/my_theme/full/article.html.twig deleted file mode 100644 index 26507d0438b..00000000000 --- a/code_samples/front/embed_content/templates/themes/my_theme/full/article.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% block content %} -

    {{ ibexa_content_name(content) }}

    -
      - {% for item in items %} - {{ ibexa_render(item, {'viewType': 'embed'} ) }} - {% endfor %} -
    -{% endblock %} diff --git a/code_samples/front/embed_content/templates/themes/my_theme/full/blog_post.html.twig b/code_samples/front/embed_content/templates/themes/my_theme/full/blog_post.html.twig deleted file mode 100644 index 5a3512396e4..00000000000 --- a/code_samples/front/embed_content/templates/themes/my_theme/full/blog_post.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{{ ibexa_content_name(content) }} -{% for item in items.searchHits %} - {{ ibexa_render(item.valueObject, {'viewType': 'line'}) }} -{% endfor %} diff --git a/code_samples/front/layouts/breadcrumbs/src/Controller/BreadcrumbController.php b/code_samples/front/layouts/breadcrumbs/src/Controller/BreadcrumbController.php deleted file mode 100644 index b82a4feeede..00000000000 --- a/code_samples/front/layouts/breadcrumbs/src/Controller/BreadcrumbController.php +++ /dev/null @@ -1,38 +0,0 @@ -query = new Criterion\Ancestor([$this->locationService->loadLocation($locationId)->pathString]); - - $results = $this->searchService->findLocations($query); - $breadcrumbs = []; - foreach ($results->searchHits as $searchHit) { - $breadcrumbs[] = $searchHit; - } - - return $this->render( - '@ibexadesign/parts/breadcrumbs.html.twig', - [ - 'breadcrumbs' => $breadcrumbs, - ] - ); - } -} diff --git a/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/pagelayout.html.twig b/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/pagelayout.html.twig deleted file mode 100644 index 54ad26fb5a3..00000000000 --- a/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/pagelayout.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{{ render( - controller( - "App\\Controller\\BreadcrumbController::showBreadcrumbsAction", - { - 'locationId': locationId, - } - ) -) }} - -{% block content %} -{% endblock %} diff --git a/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/parts/breadcrumbs.html.twig b/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/parts/breadcrumbs.html.twig deleted file mode 100644 index fe58dc30551..00000000000 --- a/code_samples/front/layouts/breadcrumbs/templates/themes/my_theme/parts/breadcrumbs.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% for breadcrumb in breadcrumbs %} - {% if not loop.first %} -> {% endif %} - {% if not loop.last %} - {{ breadcrumb.valueObject.contentInfo.name }} - {% else %} - {{ breadcrumb.valueObject.contentInfo.name }} - {% endif %} -{% endfor %} diff --git a/code_samples/front/layouts/menu/src/Menu/MenuBuilder.php b/code_samples/front/layouts/menu/src/Menu/MenuBuilder.php deleted file mode 100644 index 9266372cf2f..00000000000 --- a/code_samples/front/layouts/menu/src/Menu/MenuBuilder.php +++ /dev/null @@ -1,28 +0,0 @@ -factory->createItem('root'); - - $menu->addChild('Home', ['route' => 'ibexa.url.alias', 'routeParameters' => [ - 'locationId' => 2, - ]]); - $menu->addChild('Blog', ['route' => 'ibexa.url.alias', 'routeParameters' => [ - 'locationId' => 67, - ]]); - $menu->addChild('Search', ['route' => 'ibexa.search']); - - return $menu; - } -} diff --git a/code_samples/front/layouts/menu/src/QueryType/MenuQueryType.php b/code_samples/front/layouts/menu/src/QueryType/MenuQueryType.php deleted file mode 100644 index 67fa2ad7940..00000000000 --- a/code_samples/front/layouts/menu/src/QueryType/MenuQueryType.php +++ /dev/null @@ -1,37 +0,0 @@ - $criteria, - 'sortClauses' => [ - new SortClause\Location\Priority(LocationQuery::SORT_ASC), - ], - ]; - - return new LocationQuery($options); - } - - public static function getName() - { - return 'Menu'; - } - - public function getSupportedParameters() - { - return []; - } -} diff --git a/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout.html.twig b/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout.html.twig deleted file mode 100644 index fbdcf7cea91..00000000000 --- a/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{{ ibexa_render_content_query({ - 'query': { - 'query_type': 'Menu', - 'assign_results_to': 'menuItems' - }, - 'template': '@ibexadesign/pagelayout_menu.html.twig', -}) }} - -{{ knp_menu_render('root') }} - -{% block content %} -{% endblock %} diff --git a/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout_menu.html.twig b/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout_menu.html.twig deleted file mode 100644 index 8b49cf21fd2..00000000000 --- a/code_samples/front/layouts/menu/templates/themes/my_theme/pagelayout_menu.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if menuItems is defined and menuItems is not empty %} - {% for item in menuItems %} -
  • {{ ibexa_content_name(item.valueObject.contentInfo) }}
  • - {% endfor %} -{% endif %} diff --git a/code_samples/front/list_content/templates/themes/my_theme/full/blog_post.html.twig b/code_samples/front/list_content/templates/themes/my_theme/full/blog_post.html.twig deleted file mode 100644 index 87af6188e7f..00000000000 --- a/code_samples/front/list_content/templates/themes/my_theme/full/blog_post.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in items.searchHits %} - {{ ibexa_render(item.valueObject, {'viewType': 'line'}) }} -{% endfor %} diff --git a/code_samples/front/list_content/templates/themes/my_theme/full/folder.html.twig b/code_samples/front/list_content/templates/themes/my_theme/full/folder.html.twig deleted file mode 100644 index 87af6188e7f..00000000000 --- a/code_samples/front/list_content/templates/themes/my_theme/full/folder.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% for item in items.searchHits %} - {{ ibexa_render(item.valueObject, {'viewType': 'line'}) }} -{% endfor %} diff --git a/code_samples/front/query_pagination/templates/themes/my_theme/full/folder.html.twig b/code_samples/front/query_pagination/templates/themes/my_theme/full/folder.html.twig deleted file mode 100644 index bb3b901cc1b..00000000000 --- a/code_samples/front/query_pagination/templates/themes/my_theme/full/folder.html.twig +++ /dev/null @@ -1,8 +0,0 @@ -{% for item in items %} - {{ ibexa_render(item.valueObject) }} -{% endfor %} - -{{ pagerfanta(items, 'twitter_bootstrap5', { - 'routeName': 'ibexa.url.alias', - 'routeParams': {'location': location } -}) }} diff --git a/code_samples/front/render_content/templates/themes/my_theme/fields/author.html.twig b/code_samples/front/render_content/templates/themes/my_theme/fields/author.html.twig deleted file mode 100644 index be851ae3c41..00000000000 --- a/code_samples/front/render_content/templates/themes/my_theme/fields/author.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% block ibexa_author_field %} -{% if field.value.authors|length() > 0 %} - {% for author in field.value.authors %} - {{ author.name }} - {% endfor %} -{% endif %} -{% endblock %} diff --git a/code_samples/front/render_content/templates/themes/my_theme/full/article.html.twig b/code_samples/front/render_content/templates/themes/my_theme/full/article.html.twig deleted file mode 100644 index 43e3c4369d5..00000000000 --- a/code_samples/front/render_content/templates/themes/my_theme/full/article.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{% extends '@ibexadesign/pagelayout.html.twig' %} - -{% block content %} -

    {{ ibexa_content_name(content) }}

    - -{{ content.contentInfo.publishedDate|ibexa_full_datetime }} - -{{ ibexa_render_field(content, 'intro') }} - -{{ ibexa_render_field(content, 'body', { - 'attr': { - class: 'article-body' - } -}) }} - -{{ ibexa_render_field(content, 'author', { - 'template': '@ibexadesign/fields/author.html.twig' -}) }} - -{% endblock %} diff --git a/code_samples/front/render_content/templates/themes/my_theme/pagelayout.html.twig b/code_samples/front/render_content/templates/themes/my_theme/pagelayout.html.twig deleted file mode 100644 index f1a0a3edad0..00000000000 --- a/code_samples/front/render_content/templates/themes/my_theme/pagelayout.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{{ encore_entry_link_tags('style') }} - -{% block content %} -{% endblock %} -
    diff --git a/code_samples/front/render_content_in_php/src/Command/ViewCommand.php b/code_samples/front/render_content_in_php/src/Command/ViewCommand.php deleted file mode 100644 index 10d0544cf8e..00000000000 --- a/code_samples/front/render_content_in_php/src/Command/ViewCommand.php +++ /dev/null @@ -1,64 +0,0 @@ -addOption('content-id', 'c', InputOption::VALUE_OPTIONAL, 'Content ID') - ->addOption('location-id', 'l', InputOption::VALUE_OPTIONAL, 'Location ID') - ->addOption('view-type', 't', InputOption::VALUE_OPTIONAL, 'View Type', 'line'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $contentId = $input->getOption('content-id'); - $locationId = $input->getOption('location-id'); - if (empty($contentId) && empty($locationId)) { - throw new \InvalidArgumentException('No Content ID nor Location ID given'); - } - - $viewParameters = [ - 'viewType' => $input->getOption('view-type'), - '_controller' => 'ibexa_content::viewAction', - ]; - - if (!empty($locationId)) { - $viewParameters['locationId'] = $locationId; - } - if (!empty($contentId)) { - $viewParameters['contentId'] = $contentId; - } - - // build view - $contentView = $this->contentViewBuilder->buildView($viewParameters); - - // render view - $renderedView = $this->templateRenderer->render($contentView); - - $output->writeln($renderedView); - - return 0; - } -} diff --git a/code_samples/front/render_page/templates/themes/my_theme/blocks/contentlist.html.twig b/code_samples/front/render_page/templates/themes/my_theme/blocks/contentlist.html.twig deleted file mode 100644 index 0e185de3420..00000000000 --- a/code_samples/front/render_page/templates/themes/my_theme/blocks/contentlist.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -
    -

    {{ parentName }}

    - {% if contentArray|length > 0 %} -
    - {% for content in contentArray %} - - {% endfor %} -
    - {% endif %} -
    diff --git a/code_samples/front/render_page/templates/themes/my_theme/layouts/sidebar.html.twig b/code_samples/front/render_page/templates/themes/my_theme/layouts/sidebar.html.twig deleted file mode 100644 index b0b00d5925b..00000000000 --- a/code_samples/front/render_page/templates/themes/my_theme/layouts/sidebar.html.twig +++ /dev/null @@ -1,32 +0,0 @@ -
    -
    - {% if zones[0].blocks %} - {% for block in zones[0].blocks %} -
    - {{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', { - 'contentId': contentInfo.id, - 'blockId': block.id, - 'versionNo': versionInfo.versionNo, - 'languageCode': field.languageCode - })) - }} -
    - {% endfor %} - {% endif %} -
    -
    - {% if zones[1].blocks %} - {% for block in zones[1].blocks %} -
    - {{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', { - 'contentId': contentInfo.id, - 'blockId': block.id, - 'versionNo': versionInfo.versionNo, - 'languageCode': field.languageCode - })) - }} -
    - {% endfor %} - {% endif %} -
    -
    diff --git a/code_samples/front/search/search_bar/templates/themes/my_theme/full/search.html.twig b/code_samples/front/search/search_bar/templates/themes/my_theme/full/search.html.twig deleted file mode 100644 index 70461f0cf8d..00000000000 --- a/code_samples/front/search/search_bar/templates/themes/my_theme/full/search.html.twig +++ /dev/null @@ -1,45 +0,0 @@ -{% block content %} -
    -
    -
    - {% include '@ibexadesign/parts/search_form.html.twig' with { form: form } %} - - {% if results is defined %} -
    -
    {{ 'search.header'|trans({'%total%': pager.nbResults})|desc('%total% search result(s):') }}
    -
    - - {% if results is empty %} -
    - - - - -
    - {{ 'search.no_result'|trans({'%query%': form.vars.value.query})|desc('No results found for "%query%".') }} -
    -
    - {% else %} -

    {{ 'search.name'|trans|desc('Name') }}

    - - - {% if pager.haveToPaginate %} -
    - {{ pagerfanta(pager, '', {'pageParameter': '[search][page]'}) }} -
    - {% endif %} - {% endif %} - {% endif %} -
    -
    -
    -{% endblock %} diff --git a/code_samples/front/search/search_bar/templates/themes/my_theme/pagelayout.html.twig b/code_samples/front/search/search_bar/templates/themes/my_theme/pagelayout.html.twig deleted file mode 100644 index 85ea39ef752..00000000000 --- a/code_samples/front/search/search_bar/templates/themes/my_theme/pagelayout.html.twig +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - {% if content is defined and title is not defined %} - {% set title = ibexa_content_name( content ) %} - {% endif %} - {{ title|default( 'Home' ) }} - - {% if content is defined and content.contentInfo.mainLocationId %} - - {% endif %} - - {% block stylesheets %} - {{ encore_entry_link_tags('app') }} - {% endblock %} - - -{% include '@ibexadesign/parts/search_bar.html.twig' %} -{% block content %} -{% endblock %} - -{% block javascripts %} - {{ encore_entry_script_tags('app') }} -{% endblock %} - - diff --git a/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_bar.html.twig b/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_bar.html.twig deleted file mode 100644 index b405caf8f0a..00000000000 --- a/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_bar.html.twig +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_form.html.twig b/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_form.html.twig deleted file mode 100644 index a9be97077a8..00000000000 --- a/code_samples/front/search/search_bar/templates/themes/my_theme/parts/search_form.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -{{ form_start(form) }} - -
    - {{ form_row(form.query) }} - -
    - -{{ form_end(form, {'render_rest': false}) }} diff --git a/code_samples/front/view_matcher/src/View/Matcher/Owner.php b/code_samples/front/view_matcher/src/View/Matcher/Owner.php deleted file mode 100644 index 9c21e121410..00000000000 --- a/code_samples/front/view_matcher/src/View/Matcher/Owner.php +++ /dev/null @@ -1,76 +0,0 @@ -hasOwner($location->getContentInfo()); - } - - /** - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException - */ - public function matchContentInfo(ContentInfo $contentInfo): bool - { - return $this->hasOwner($contentInfo); - } - - /** - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException - */ - public function match(View $view): ?bool - { - if ($view instanceof LocationValueView) { - return $this->matchLocation($view->getLocation()); - } - - if ($view instanceof ContentValueView) { - return $this->matchContentInfo($view->getContent()->contentInfo); - } - - return false; - } - - /** - * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException - */ - private function hasOwner(ContentInfo $contentInfo): bool - { - $owner = $this->userService->loadUser($contentInfo->ownerId); - - return in_array($owner->login, $this->matchingUserLogins, true); - } - - /** - * @param array $matchingConfig - */ - public function setMatchingConfig($matchingConfig): void - { - if (!is_array($matchingConfig)) { - throw new InvalidArgumentException('App\Owner view matcher configuration has to be an array'); - } - - $this->matchingUserLogins = $matchingConfig; - } -} diff --git a/code_samples/front/view_matcher/templates/themes/my_theme/featured_article.html.twig b/code_samples/front/view_matcher/templates/themes/my_theme/featured_article.html.twig deleted file mode 100644 index a285fbc8320..00000000000 --- a/code_samples/front/view_matcher/templates/themes/my_theme/featured_article.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% extends '@ibexadesign/pagelayout.html.twig' %} - -{% block content %} -

    Featured article: {{ ibexa_content_name(content) }}

    -{% endblock %} diff --git a/code_samples/mcp/src/Command/McpServerListCommand.php b/code_samples/mcp/src/Command/McpServerListCommand.php deleted file mode 100644 index f4deeb6de00..00000000000 --- a/code_samples/mcp/src/Command/McpServerListCommand.php +++ /dev/null @@ -1,26 +0,0 @@ -configRegistry->getServerConfigurations() as $serverConfiguration) { - $io->title($serverConfiguration->identifier); - dump($serverConfiguration); - } - - return Command::SUCCESS; - } -} diff --git a/code_samples/mcp/src/Mcp/ExampleCapabilities.php b/code_samples/mcp/src/Mcp/ExampleCapabilities.php deleted file mode 100644 index 682f65807cd..00000000000 --- a/code_samples/mcp/src/Mcp/ExampleCapabilities.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ - #[McpTool( - servers: ['example'], - name: 'greet', - title: 'User greeting', - description: 'Greet a user by name', - annotations: new ToolAnnotations( - readOnlyHint: true, - destructiveHint: false, - idempotentHint: true, - openWorldHint: false, - ), - icons: [new Icon( - src: 'https://openmoji.org/data/color/svg/1F44B.svg', - )], - outputSchema: [ - 'type' => 'object', - 'properties' => [ - 'general' => [ - 'type' => 'string', - 'description' => 'the safe way to greet someone', - ], - 'close' => [ - 'type' => 'string', - 'description' => 'when you\'re close to the person, like friends or relatives', - ], - 'morning' => [ - 'type' => 'string', - 'description' => 'when it\'s in the morning', - ], - 'afternoon' => [ - 'type' => 'string', - 'description' => 'when it\'s the afternoon', - ], - 'evening' => [ - 'type' => 'string', - 'description' => 'when it\'s late in the day', - ], - ], - ], - )] - public function greetByName(string $name): array - { - return [ - 'general' => sprintf('Hello, %s!', $name), - 'close' => sprintf('Hey, %s!', $name), - 'morning' => sprintf('Good morning, %s!', $name), - 'afternoon' => sprintf('Good afternoon, %s!', $name), - 'evening' => sprintf('Good evening, %s!', $name), - ]; - } - - /** - * @param string $name The name you want to be greeted by - * - * @return array - */ - #[McpPrompt( - servers: ['example'], - name: 'greet', - title: 'Be greeted', - description: 'Prompt to invoke the `greet` tool', - icons: [new Icon( - src: 'https://openmoji.org/data/color/svg/1F91D.svg', - )], - )] - public function getGreetPrompt(string $name): array - { - return [ - 'role' => 'user', - 'content' => [ - 'type' => 'text', - 'text' => "Hi. My name is $name. Please, greet me.", - ], - ]; - } -} diff --git a/code_samples/multisite/siteaccess/AcmeExampleExtension.php b/code_samples/multisite/siteaccess/AcmeExampleExtension.php deleted file mode 100644 index 47de70ea6c8..00000000000 --- a/code_samples/multisite/siteaccess/AcmeExampleExtension.php +++ /dev/null @@ -1,62 +0,0 @@ -getConfiguration($configs, $container); - $config = $this->processConfiguration($configuration, $configs); - - $loader = new Loader\YamlFileLoader($container, new FileLocator(self::ACME_CONFIG_DIR)); - $loader->load('default_settings.yaml'); - - $processor = new ConfigurationProcessor($container, 'acme_example'); - $processor->mapConfig( - $config, - // Any kind of callable can be used here. - // It is called for each declared scope/SiteAccess. - static function ($scopeSettings, $currentScope, ContextualizerInterface $contextualizer): void { - // Maps the "name" setting to "acme_example.<$currentScope>.name" container parameter - // It is then possible to retrieve this parameter through ConfigResolver in the application code: - // $helloSetting = $configResolver->getParameter( 'name', 'acme_example' ); - $contextualizer->setContextualParameter('name', $currentScope, $scopeSettings['name']); - } - ); - - // Now map "custom_setting" and ensure the key defined for "my_siteaccess" overrides the one for "my_siteaccess_group" - // It is done outside the closure as it's needed only once. - $processor->mapConfigArray('custom_setting', $config); - - // Map setting example - $processor = new ConfigurationProcessor($container, 'acme_example'); - $processor->mapSetting('name', $config); - - // Map config array example - $processor->mapConfigArray('custom_setting', $config); - - // Merge from second level example - $contextualizer = $processor->getContextualizer(); - $contextualizer->mapConfigArray('custom_setting', $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL); - } - - /** @param array $config */ - #[\Override] - public function getConfiguration(array $config, ContainerBuilder $container): Configuration - { - return new Configuration(); - } -} diff --git a/code_samples/multisite/siteaccess/Configuration.php b/code_samples/multisite/siteaccess/Configuration.php deleted file mode 100644 index 36e58f29e23..00000000000 --- a/code_samples/multisite/siteaccess/Configuration.php +++ /dev/null @@ -1,32 +0,0 @@ - The tree builder - */ - public function getConfigTreeBuilder(): TreeBuilder - { - $treeBuilder = new TreeBuilder('acme_example'); - $rootNode = $treeBuilder->getRootNode(); - - // $systemNode is the root of SiteAccess-aware settings. - $systemNode = $this->generateScopeBaseNode($rootNode); - $systemNode - ->scalarNode('name')->isRequired()->end() - ->arrayNode('custom_setting') - ->children() - ->scalarNode('string')->end() - ->integerNode('number')->end() - ->booleanNode('enabled')->end() - ->end() - ->end(); - - return $treeBuilder; - } -} diff --git a/code_samples/notifications/Src/Query/search.php b/code_samples/notifications/Src/Query/search.php deleted file mode 100644 index d771b8b343b..00000000000 --- a/code_samples/notifications/Src/Query/search.php +++ /dev/null @@ -1,19 +0,0 @@ -getRepository(); -$notificationService = $repository->getNotificationService(); -$query = new NotificationQuery([], 0, 25); - -$query->addCriterion(new Type('Workflow:Review')); -$query->addCriterion(new Status(['unread'])); - -$from = new \DateTimeImmutable('-7 days'); -$to = new \DateTimeImmutable(); - -$query->addCriterion(new DateCreated($from, $to)); - -$notificationList = $notificationService->findNotifications($query); diff --git a/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeMapper.php b/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeMapper.php deleted file mode 100644 index f5158b7d1c3..00000000000 --- a/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeMapper.php +++ /dev/null @@ -1,36 +0,0 @@ -create( - 'value', - MyStringAttributeType::class, - [ - 'constraints' => $constraints, - ] - ); - } -} diff --git a/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeType.php b/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeType.php deleted file mode 100644 index 34604db5619..00000000000 --- a/code_samples/page/custom_attribute/src/Block/Attribute/MyStringAttributeType.php +++ /dev/null @@ -1,21 +0,0 @@ -My String - {{ form_widget(form) }} -{% endblock %} diff --git a/code_samples/page/custom_attribute/templates/themes/standard/blocks/my_block.html.twig b/code_samples/page/custom_attribute/templates/themes/standard/blocks/my_block.html.twig deleted file mode 100644 index 29bd7f74ace..00000000000 --- a/code_samples/page/custom_attribute/templates/themes/standard/blocks/my_block.html.twig +++ /dev/null @@ -1 +0,0 @@ -

    {{ my_string_attribute }}

    diff --git a/code_samples/page/custom_block_validator/src/Form/Extension/AttributeTypeExtension.php b/code_samples/page/custom_block_validator/src/Form/Extension/AttributeTypeExtension.php deleted file mode 100644 index 0c3b08b6e65..00000000000 --- a/code_samples/page/custom_block_validator/src/Form/Extension/AttributeTypeExtension.php +++ /dev/null @@ -1,25 +0,0 @@ -getConstraints()['custom_not_blank'])) { - $builder->setRequired(true); - } - } - - public static function getExtendedTypes(): iterable - { - return [ - AttributeType::class, - ]; - } -} diff --git a/code_samples/page/custom_block_validator/src/Validator/AlphaOnly.php b/code_samples/page/custom_block_validator/src/Validator/AlphaOnly.php deleted file mode 100644 index 31aeb9dbcf6..00000000000 --- a/code_samples/page/custom_block_validator/src/Validator/AlphaOnly.php +++ /dev/null @@ -1,10 +0,0 @@ -context->buildViolation($constraint->message) - ->setParameter('{{ string }}', $value) - ->addViolation(); - } - } -} diff --git a/code_samples/page/custom_block_validator/templates/themes/standard/blocks/my_block.html.twig b/code_samples/page/custom_block_validator/templates/themes/standard/blocks/my_block.html.twig deleted file mode 100644 index 67246d61751..00000000000 --- a/code_samples/page/custom_block_validator/templates/themes/standard/blocks/my_block.html.twig +++ /dev/null @@ -1 +0,0 @@ -

    {{ my_text_attribute }}

    diff --git a/code_samples/page/custom_page_block/src/Event/Subscriber/BlockEmbedEventEventSubscriber.php b/code_samples/page/custom_page_block/src/Event/Subscriber/BlockEmbedEventEventSubscriber.php deleted file mode 100644 index 408be0db42a..00000000000 --- a/code_samples/page/custom_page_block/src/Event/Subscriber/BlockEmbedEventEventSubscriber.php +++ /dev/null @@ -1,31 +0,0 @@ - 'onBlockPreRender', - ]; - } - - public function onBlockPreRender(PreRenderEvent $event): void - { - /** @var \Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest $renderRequest */ - $renderRequest = $event->getRenderRequest(); - $parameters = $event->getRenderRequest()->getParameters(); - $parameters['event_content'] = $this->contentService->loadContent($parameters['event']); - $renderRequest->setParameters($parameters); - } -} diff --git a/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/config.html.twig b/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/config.html.twig deleted file mode 100644 index 90218036ae9..00000000000 --- a/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/config.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{% extends '@IbexaPageBuilder/page_builder/block/config.html.twig' %} - -{% block basic_tab_content %} -
    - {{ form_row(form.name) }} - {% if attributes_per_category['default'] is defined %} -
      - {% for identifier in attributes_per_category['default'] %} - {% block config_entry %} -
    1. - {{ form_row(form.attributes[identifier]) }} -
    2. - {% endblock %} - {% endfor %} -
    - {% endif %} -
    -{% endblock %} diff --git a/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/featured_template.html.twig b/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/featured_template.html.twig deleted file mode 100644 index 9b426a39ef2..00000000000 --- a/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/featured_template.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -

    {{ name }}

    -

    {{ category }}

    -{{ render(controller('ibexa_content::viewAction', { - 'contentId': event, - 'viewType': 'embed' -})) }} diff --git a/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/template.html.twig b/code_samples/page/custom_page_block/templates/themes/standard/blocks/event/template.html.twig deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/code_samples/page/ibexa_connect_scenario_block/config/packages/ibexa_connect.yaml b/code_samples/page/ibexa_connect_scenario_block/config/packages/ibexa_connect.yaml deleted file mode 100644 index 5bea90a2dd9..00000000000 --- a/code_samples/page/ibexa_connect_scenario_block/config/packages/ibexa_connect.yaml +++ /dev/null @@ -1,13 +0,0 @@ -ibexa_connect: - scenario_block: - block_templates: - company_customers: - template: 'blocks/default.html.twig' - external_clients: - label: External clients - template: 'blocks/default.html.twig' - parameters: - external_client_id: string - external_client_name: - type: string - required: true \ No newline at end of file diff --git a/code_samples/page/ibexa_connect_scenario_block/config/packages/views.yaml b/code_samples/page/ibexa_connect_scenario_block/config/packages/views.yaml deleted file mode 100644 index 00804bea64e..00000000000 --- a/code_samples/page/ibexa_connect_scenario_block/config/packages/views.yaml +++ /dev/null @@ -1,6 +0,0 @@ -ibexa: - system: - site: - page_layout: pagelayout.html.twig - user: - layout: pagelayout.html.twig \ No newline at end of file diff --git a/code_samples/page/ibexa_connect_scenario_block/templates/blocks/default.html.twig b/code_samples/page/ibexa_connect_scenario_block/templates/blocks/default.html.twig deleted file mode 100644 index d336ad13938..00000000000 --- a/code_samples/page/ibexa_connect_scenario_block/templates/blocks/default.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ dump(ibexa_connect_data) }} \ No newline at end of file diff --git a/code_samples/page/ibexa_connect_scenario_block/templates/pagelayout.html.twig b/code_samples/page/ibexa_connect_scenario_block/templates/pagelayout.html.twig deleted file mode 100644 index a19ba7096a2..00000000000 --- a/code_samples/page/ibexa_connect_scenario_block/templates/pagelayout.html.twig +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - {% if content is defined %} - {% set title = ez_content_name(content) %} - {% endif %} - {{ title|default('Home'|trans) }} - {{ "It's a Dog's World!"|trans }} - - -
    -
    - {% block content %}{% endblock %} -
    -
    - - \ No newline at end of file diff --git a/code_samples/page/page_listener/src/Block/Listener/MyBlockListener.php b/code_samples/page/page_listener/src/Block/Listener/MyBlockListener.php deleted file mode 100644 index 00f0884efb4..00000000000 --- a/code_samples/page/page_listener/src/Block/Listener/MyBlockListener.php +++ /dev/null @@ -1,29 +0,0 @@ - 'onBlockPreRender', - ]; - } - - public function onBlockPreRender(PreRenderEvent $event): void - { - /** @var \Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest $renderRequest */ - $renderRequest = $event->getRenderRequest(); - - $parameters = $event->getRenderRequest()->getParameters(); - - $parameters['my_parameter'] = 'parameter_value'; - - $renderRequest->setParameters($parameters); - } -} diff --git a/code_samples/page/page_listener/templates/themes/standard/block/my_block.html.twig b/code_samples/page/page_listener/templates/themes/standard/block/my_block.html.twig deleted file mode 100644 index 903e7c46222..00000000000 --- a/code_samples/page/page_listener/templates/themes/standard/block/my_block.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -
    - {{ my_parameter }} -
    diff --git a/code_samples/page/pagefield_layout.html.twig b/code_samples/page/pagefield_layout.html.twig deleted file mode 100644 index 0eacab3fc59..00000000000 --- a/code_samples/page/pagefield_layout.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -
    - {# The required attribute for the displayed zone #} -
    - {# If a zone with [0] index contains any blocks #} - {% if zones[0].blocks %} - {# for each block #} - {% for block in blocks %} - {# create a new layer with appropriate ID #} -
    - {# render the block by using the "Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction" controller #} - {# location.id is the ID of the Location of the current content item, block.id is the ID of the current block #} - {{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', { - 'locationId': locationId, - 'blockId': block.id, - 'versionNo': versionInfo.versionNo, - 'languageCode': field.languageCode - }, ibexa_append_cacheable_query_params(block))) }} -
    - {% endfor %} - {% endif %} -
    -
    diff --git a/code_samples/page/react_app_block/assets/page-builder/components/Calculator.jsx b/code_samples/page/react_app_block/assets/page-builder/components/Calculator.jsx deleted file mode 100644 index 34aa0eecc2a..00000000000 --- a/code_samples/page/react_app_block/assets/page-builder/components/Calculator.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -export default function (props) { - // a + b = ... - console.log("Hello React!"); - return
    {props.a} + {props.b} = {parseInt(props.a) + parseInt(props.b)}!
    ; -} diff --git a/code_samples/page/react_app_block/assets/page-builder/react/blocks/Calculator.js b/code_samples/page/react_app_block/assets/page-builder/react/blocks/Calculator.js deleted file mode 100644 index 1c3f055d0c7..00000000000 --- a/code_samples/page/react_app_block/assets/page-builder/react/blocks/Calculator.js +++ /dev/null @@ -1,5 +0,0 @@ -import Calculator from '/assets/page-builder/components/Calculator'; - -export default { - Calculator: Calculator, -}; diff --git a/code_samples/pim/availability/src/ProductAvailabilityPurchasableWithoutStockStrategy.php b/code_samples/pim/availability/src/ProductAvailabilityPurchasableWithoutStockStrategy.php deleted file mode 100644 index 0c28ad889d0..00000000000 --- a/code_samples/pim/availability/src/ProductAvailabilityPurchasableWithoutStockStrategy.php +++ /dev/null @@ -1,67 +0,0 @@ -handler->find($product->getCode()); - - $rawAvailableFlag = $productAvailability->isAvailable(); - $stock = $productAvailability->getStock(); - $isInfinite = $productAvailability->isInfinite(); - - $computedAvailable = $this->calculateAvailability( - $rawAvailableFlag, - $stock, - $isInfinite, - ); - - return new Availability( - $product, - $rawAvailableFlag, - $computedAvailable, - $isInfinite, - $stock, - ); - } - - private function calculateAvailability( - bool $rawAvailable, - ?int $stock, - bool $isInfinite - ): bool { - if ($rawAvailable === false) { - return false; - } - - if ($isInfinite) { - return true; - } - - if ($stock === null) { - return true; - } - - return $stock >= 0; - } -} diff --git a/code_samples/pim/availability/src/PurchasableWithoutStockAvailabilityContext.php b/code_samples/pim/availability/src/PurchasableWithoutStockAvailabilityContext.php deleted file mode 100644 index e8e8e547f6c..00000000000 --- a/code_samples/pim/availability/src/PurchasableWithoutStockAvailabilityContext.php +++ /dev/null @@ -1,9 +0,0 @@ -getDigits($value); - - $count = count($digits); - $total = 0; - for ($i = $count - 2; $i >= 0; $i -= 2) { - $digit = $digits[$i]; - if ($i % 2 === 0) { - $digit *= 2; - } - - $total += $digit > 9 ? $digit - 9 : $digit; - } - - $checksum = $digits[$count - 1]; - - return $total + $checksum === 0; - } - - /** - * Returns an array of digits from the given value (skipping any formatting characters). - * - * @return int[] - */ - private function getDigits(string $value): array - { - $chars = array_filter( - str_split($value), - static fn (string $char): bool => $char !== '-' - ); - - return array_map(intval(...), array_values($chars)); - } -} diff --git a/code_samples/product_catalog/src/EventSubscriber/MyAttributeRenderSubscriber.php b/code_samples/product_catalog/src/EventSubscriber/MyAttributeRenderSubscriber.php deleted file mode 100644 index 44d61854c2d..00000000000 --- a/code_samples/product_catalog/src/EventSubscriber/MyAttributeRenderSubscriber.php +++ /dev/null @@ -1,18 +0,0 @@ -addTemplateBefore( - 'templates/product/attributes/integer_attribute.html.twig', - '@ibexadesign/product_catalog/product/attributes/attribute_blocks.html.twig', - ); - } -} diff --git a/code_samples/raptor_cdp/date_of_birth_export/src/Export/User/DateOfBirthUserItemProcessor.php b/code_samples/raptor_cdp/date_of_birth_export/src/Export/User/DateOfBirthUserItemProcessor.php deleted file mode 100644 index 33a0993cae9..00000000000 --- a/code_samples/raptor_cdp/date_of_birth_export/src/Export/User/DateOfBirthUserItemProcessor.php +++ /dev/null @@ -1,44 +0,0 @@ -getUserField($userContent); - - if (null === $userField) { - throw new InvalidArgumentException('Content does not contain user field'); - } - - $dateOfBirth = ''; - $dateOfBirthField = $userContent->getField($this->dateOfBirthFieldIdentifier); - - if ($dateOfBirthField !== null - && $dateOfBirthField->value instanceof DateValue - && $dateOfBirthField->value->date !== null - ) { - $dateOfBirth = $dateOfBirthField->value->date->format('Y-m-d'); - } - - return array_merge( - $processedItemData, - [ - 'date_of_birth' => $dateOfBirth, - ] - ); - } -} diff --git a/code_samples/recent_activity/src/ActivityLog/ClassNameMapper/MyFeatureNameMapper.php b/code_samples/recent_activity/src/ActivityLog/ClassNameMapper/MyFeatureNameMapper.php deleted file mode 100644 index 92b08b11d81..00000000000 --- a/code_samples/recent_activity/src/ActivityLog/ClassNameMapper/MyFeatureNameMapper.php +++ /dev/null @@ -1,24 +0,0 @@ - 'my_feature'; - } - - public static function getTranslationMessages(): array - { - return [ - (new Message('ibexa.activity_log.search_form.object_class.my_feature', 'ibexa_activity_log')) - ->setDesc('My Feature'), - ]; - } -} diff --git a/code_samples/recent_activity/src/Command/ActivityLogContextTestCommand.php b/code_samples/recent_activity/src/Command/ActivityLogContextTestCommand.php deleted file mode 100644 index c53703e2fa9..00000000000 --- a/code_samples/recent_activity/src/Command/ActivityLogContextTestCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -addArgument('id', InputArgument::REQUIRED, 'A test number'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $id = $input->getArgument('id'); - $this->permissionResolver->setCurrentUserReference($this->userService->loadUserByLogin('admin')); - - $this->activityLogService->prepareContext('my_feature', 'Operation description'); - - $activityLogStruct = $this->activityLogService->build(MyFeature::class, $id, 'init'); - $activityLogStruct->setObjectName("My Feature #$id"); - $this->activityLogService->save($activityLogStruct); - - $contentCreateStruct = $this->contentService->newContentCreateStruct($this->contentTypeService->loadContentTypeByIdentifier('folder'), 'eng-GB'); - $contentCreateStruct->setField('name', "My Feature Folder #$id", 'eng-GB'); - $locationCreateStruct = new LocationCreateStruct(['parentLocationId' => 2]); - $draft = $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]); - $this->contentService->publishVersion($draft->versionInfo); - - $event = new MyFeatureEvent(new MyFeature(['id' => $id, 'name' => "My Feature #$id"]), 'simulate'); - $this->eventDispatcher->dispatch($event); - - $activityLogStruct = $this->activityLogService->build(MyFeature::class, $id, 'complete'); - $activityLogStruct->setObjectName("My Feature #$id"); - $this->activityLogService->save($activityLogStruct); - - $this->activityLogService->dismissContext(); - - return Command::SUCCESS; - } -} diff --git a/code_samples/recent_activity/src/Command/DispatchMyFeatureEventCommand.php b/code_samples/recent_activity/src/Command/DispatchMyFeatureEventCommand.php deleted file mode 100644 index ab8cec0ef06..00000000000 --- a/code_samples/recent_activity/src/Command/DispatchMyFeatureEventCommand.php +++ /dev/null @@ -1,34 +0,0 @@ - 123, 'name' => 'Logged Name']), 'simulate'); - $this->eventDispatcher->dispatch($event); - - $event = new MyFeatureEvent((object) ['id' => 456, 'name' => 'Some Name'], 'simulate'); - $this->eventDispatcher->dispatch($event); - - return Command::SUCCESS; - } -} diff --git a/code_samples/recent_activity/src/Command/MonitorRecentContentCreationCommand.php b/code_samples/recent_activity/src/Command/MonitorRecentContentCreationCommand.php deleted file mode 100644 index 8b82da5673a..00000000000 --- a/code_samples/recent_activity/src/Command/MonitorRecentContentCreationCommand.php +++ /dev/null @@ -1,79 +0,0 @@ -permissionResolver->setCurrentUserReference($this->userService->loadUserByLogin('admin')); - - foreach ($this->activityLogService->findGroups($query) as $activityLogGroup) { - if ($activityLogGroup->getSource()) { - $io->section($activityLogGroup->getSource()->getName()); - } - if ($activityLogGroup->getDescription()) { - $io->text($activityLogGroup->getDescription()); - } - $table = []; - foreach ($activityLogGroup->getActivityLogs() as $activityLog) { - $name = "“{$activityLog->getObjectName()}”"; - $content = $activityLog->getRelatedObject(); - if ($content && method_exists($content, 'getName') && $content->getName() !== $activityLog->getObjectName()) { - $name = "“{$content->getName()}” (formerly “{$activityLog->getObjectName()}”)"; - } - $table[] = [ - $activityLogGroup->getLoggedAt()->format(\DateTime::ATOM), - $activityLog->getObjectId(), - $name, - $activityLog->getAction(), - $activityLogGroup->getUser() ? $activityLogGroup->getUser()->login : '', - $activityLogGroup->getIp() ? $activityLogGroup->getIp()->getIp() : '', - ]; - } - $io->table([ - 'Logged at', - 'Obj. ID', - 'Object Name', - 'Action', - 'User', - 'IP', - ], $table); - } - - return Command::SUCCESS; - } -} diff --git a/code_samples/recent_activity/src/Event/MyFeatureEvent.php b/code_samples/recent_activity/src/Event/MyFeatureEvent.php deleted file mode 100644 index 84b46ba6c19..00000000000 --- a/code_samples/recent_activity/src/Event/MyFeatureEvent.php +++ /dev/null @@ -1,24 +0,0 @@ -object; - } - - public function getAction(): string - { - return $this->action; - } -} diff --git a/code_samples/recent_activity/src/EventSubscriber/MyFeatureEventSubscriber.php b/code_samples/recent_activity/src/EventSubscriber/MyFeatureEventSubscriber.php deleted file mode 100644 index 812875614ca..00000000000 --- a/code_samples/recent_activity/src/EventSubscriber/MyFeatureEventSubscriber.php +++ /dev/null @@ -1,33 +0,0 @@ - 'onMyFeatureEvent', - ]; - } - - public function onMyFeatureEvent(MyFeatureEvent $event): void - { - /** @var \App\MyFeature\MyFeature $object */ - $object = $event->getObject(); - $className = $object::class; - $id = (string)$object->id; - $action = $event->getAction(); - $activityLog = $this->activityLogService->build($className, $id, $action); - $activityLog->setObjectName($object->name); - $this->activityLogService->save($activityLog); - } -} diff --git a/code_samples/recent_activity/src/EventSubscriber/MyFeaturePostActivityListLoadEventSubscriber.php b/code_samples/recent_activity/src/EventSubscriber/MyFeaturePostActivityListLoadEventSubscriber.php deleted file mode 100644 index 619ff17f6ef..00000000000 --- a/code_samples/recent_activity/src/EventSubscriber/MyFeaturePostActivityListLoadEventSubscriber.php +++ /dev/null @@ -1,52 +0,0 @@ - ['loadMyFeature'], - ]; - } - - public function loadMyFeature(PostActivityGroupListLoadEvent $event): void - { - $visitedIds = []; - $list = $event->getList(); - foreach ($list as $logGroup) { - foreach ($logGroup->getActivityLogs() as $log) { - if ($log->getObjectClass() !== MyFeature::class) { - continue; - } - - $id = (int)$log->getObjectId(); - try { - if (!array_key_exists($id, $visitedIds)) { - $visitedIds[$id] = $this->myFeatureService->load($id); - } - - if ($visitedIds[$id] === null) { - continue; - } - - $log->setRelatedObject($visitedIds[$id]); - } catch (NotFoundException|UnauthorizedException) { - $visitedIds[$id] = null; - } - } - } - } -} diff --git a/code_samples/recent_activity/src/MyFeature/MyFeature.php b/code_samples/recent_activity/src/MyFeature/MyFeature.php deleted file mode 100644 index 82ed9c82c08..00000000000 --- a/code_samples/recent_activity/src/MyFeature/MyFeature.php +++ /dev/null @@ -1,21 +0,0 @@ - $properties - */ - public function __construct(array $properties) - { - foreach ($properties as $propertyName => $propertyValue) { - $this->$propertyName = $propertyValue; - } - } - - public function getName(): ?string - { - return property_exists($this, 'name') ? $this->name : null; - } -} diff --git a/code_samples/recent_activity/src/MyFeature/MyFeatureService.php b/code_samples/recent_activity/src/MyFeature/MyFeatureService.php deleted file mode 100644 index 078e0d496b5..00000000000 --- a/code_samples/recent_activity/src/MyFeature/MyFeatureService.php +++ /dev/null @@ -1,11 +0,0 @@ - $myFeatureId, 'name' => 'Actual Name']); - } -} diff --git a/code_samples/recent_activity/src/recent_activity_disable.php b/code_samples/recent_activity/src/recent_activity_disable.php deleted file mode 100644 index ba153acadfe..00000000000 --- a/code_samples/recent_activity/src/recent_activity_disable.php +++ /dev/null @@ -1,9 +0,0 @@ -disable(); - -// Perform operations that should not be logged to the activity log -// ... - -$activityLogService->enable(); diff --git a/code_samples/recent_activity/templates/themes/admin/activity_log/ui/default.html.twig b/code_samples/recent_activity/templates/themes/admin/activity_log/ui/default.html.twig deleted file mode 100644 index bb933d1951a..00000000000 --- a/code_samples/recent_activity/templates/themes/admin/activity_log/ui/default.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% extends '@IbexaActivityLog/themes/admin/activity_log/ui/default.html.twig' %} - -{%- block activity_log_description_widget -%} - {{ dump(log) }} -{%- endblock activity_log_description_widget -%} diff --git a/code_samples/recent_activity/templates/themes/admin/activity_log/ui/my_feature/simulate.html.twig b/code_samples/recent_activity/templates/themes/admin/activity_log/ui/my_feature/simulate.html.twig deleted file mode 100644 index 1fe2690c43c..00000000000 --- a/code_samples/recent_activity/templates/themes/admin/activity_log/ui/my_feature/simulate.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% extends '@ibexadesign/activity_log/ui/default.html.twig' %} - -{%- block activity_log_description_widget -%} - {% if log.getRelatedObject() is not null %} - - {{- log.getRelatedObject().name -}} - - {% if log.getRelatedObject().name != log.getObjectName() %} - (was named “{{ log.getObjectName() }}”) - {% endif %} - {% else %} - {{ log.getObjectName() }} (which doesn't exist anymore) - {% endif %} -{%- endblock activity_log_description_widget -%} diff --git a/code_samples/recommendations/EventData.php b/code_samples/recommendations/EventData.php deleted file mode 100644 index 4825ed61146..00000000000 --- a/code_samples/recommendations/EventData.php +++ /dev/null @@ -1,28 +0,0 @@ -getCode(), - productName: $product->getName(), - categoryPath: '25#Electronics;26#Smartphones', // Build manually - currency: 'USD', - itemPrice: '999.99' - ); - - $this->trackingDispatcher->dispatch($eventData); - } -} diff --git a/code_samples/recommendations/EventMapper.php b/code_samples/recommendations/EventMapper.php deleted file mode 100644 index cf0bd3bd8ee..00000000000 --- a/code_samples/recommendations/EventMapper.php +++ /dev/null @@ -1,29 +0,0 @@ -eventMapper->map(EventType::VISIT, $product, [ - EventContext::CATEGORY_IDENTIFIER => 'electronics', - ]); - - // Send tracking event - $this->trackingDispatcher->dispatch($eventData); - } -} diff --git a/code_samples/recommendations/EventSubscriber.php b/code_samples/recommendations/EventSubscriber.php deleted file mode 100644 index 175784efc44..00000000000 --- a/code_samples/recommendations/EventSubscriber.php +++ /dev/null @@ -1,42 +0,0 @@ - ['onResponse', -10]]; - } - - public function onResponse(ResponseEvent $event): void - { - if (!$event->isMainRequest()) { - return; - } - - $request = $event->getRequest(); - - // Example: track only if request has specific attribute - $product = $request->attributes->get('product'); - if (null === $product) { - return; - } - - $eventData = $this->eventMapper->map(EventType::VISIT, $product); - $this->trackingDispatcher->dispatch($eventData); - } -} diff --git a/code_samples/recommendations/events/basket_event.html.twig b/code_samples/recommendations/events/basket_event.html.twig deleted file mode 100644 index 11df19b560c..00000000000 --- a/code_samples/recommendations/events/basket_event.html.twig +++ /dev/null @@ -1,25 +0,0 @@ -{# templates/cart/add_confirmation.html.twig #} -{% extends 'base.html.twig' %} - -{% block content %} -
    -

    Product "{{ product.name }}" has been added to your cart!

    -

    Quantity: {{ addedQuantity }}

    -
    - - {# Build basket content string: "product-code:quantity;product-code:quantity" #} - {% set basketContent = [] %} - {% for entry in cart.entries %} - {% set basketContent = basketContent|merge([entry.product.code ~ ':' ~ entry.quantity]) %} - {% endfor %} - {# Track basket addition #} - {% set basketContext = { - 'basketContent': basketContent|join(';'), - 'basketId': cart.id, - 'quantity': addedQuantity - } %} - - {{ ibexa_tracking_track_event('basket', product, basketContext) }} - - View Cart -{% endblock %} diff --git a/code_samples/recommendations/events/buy_event.html.twig b/code_samples/recommendations/events/buy_event.html.twig deleted file mode 100644 index 47c97212dda..00000000000 --- a/code_samples/recommendations/events/buy_event.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% set buyContext = { - 'subtotal': '10.00', - 'currency': 'EUR', - 'quantity': 1 -} %} -{{ ibexa_tracking_track_event('buy', product, buyContext) }} diff --git a/code_samples/recommendations/events/category_parameter.html.twig b/code_samples/recommendations/events/category_parameter.html.twig deleted file mode 100644 index 16d67a06f1d..00000000000 --- a/code_samples/recommendations/events/category_parameter.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% block content %} -
    -

    {{ product.name }}

    - {# ... product content ... #} -
    - - {# Track with category identifier - automatic loading and formatting #} - {{ ibexa_tracking_track_event('visit', product, { - 'categoryIdentifier': 'electronics' - }) }} -{% endblock %} diff --git a/code_samples/recommendations/events/content_visit_event.html.twig b/code_samples/recommendations/events/content_visit_event.html.twig deleted file mode 100644 index 8723147fe6b..00000000000 --- a/code_samples/recommendations/events/content_visit_event.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{# templates/bundles/IbexaCoreBundle/default/content/full.html.twig #} -{% extends '@!IbexaCore/default/content/full.html.twig' %} - -{% block content %} - {{ parent() }} - {{ ibexa_tracking_track_event('contentvisit', content) }} -{% endblock %} diff --git a/code_samples/recommendations/events/itemclicked_event.html.twig b/code_samples/recommendations/events/itemclicked_event.html.twig deleted file mode 100644 index fc3cf42dfb7..00000000000 --- a/code_samples/recommendations/events/itemclicked_event.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{{ ibexa_tracking_track_event('itemclick', product.code, { - 'moduleName': 'homepage-recommendations', - 'redirectUrl': path('ibexa.product.view', {'productCode': product.code}) -}) }} diff --git a/code_samples/recommendations/events/product_visit_event.html.twig b/code_samples/recommendations/events/product_visit_event.html.twig deleted file mode 100644 index 0f7b61c3a9f..00000000000 --- a/code_samples/recommendations/events/product_visit_event.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{# templates/product/view.html.twig #} -{% extends 'base.html.twig' %} - -{% block content %} -
    -

    {{ product.name }}

    -

    {{ product.description }}

    -
    {{ product.price }}
    -
    - - {# Track product visit #} - {{ ibexa_tracking_track_event('visit', product) }} -{% endblock %} diff --git a/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.html.twig b/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.html.twig deleted file mode 100644 index 40eedecb7df..00000000000 --- a/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% extends '@IbexaConnectorRaptor/themes/standard/ibexa/tracking/script.html.twig' %} -{% block ibexa_tracking_script %} - console.log('My custom tracking script, but relying on loadTracking function.'); -{% endblock %} diff --git a/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.js.twig b/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.js.twig deleted file mode 100644 index c9f3ecddae9..00000000000 --- a/code_samples/recommendations/templates/themes/standard/ibexa/tracking/script.js.twig +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/code_samples/recommendations/templates/themes/standard/pagelayout.html.twig b/code_samples/recommendations/templates/themes/standard/pagelayout.html.twig deleted file mode 100644 index 33fc86b1557..00000000000 --- a/code_samples/recommendations/templates/themes/standard/pagelayout.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{# templates/pagelayout.html.twig #} - - - - {# ... other head content ... #} - - {# Initialize Raptor tracking - must be called before any tracking events #} - {{ ibexa_tracking_script() }} - - - {# ... page content ... #} - - diff --git a/code_samples/recommendations/templates/tracking/custom_visit.html.twig b/code_samples/recommendations/templates/tracking/custom_visit.html.twig deleted file mode 100644 index 9214e47f3bf..00000000000 --- a/code_samples/recommendations/templates/tracking/custom_visit.html.twig +++ /dev/null @@ -1,33 +0,0 @@ -{# templates/tracking/custom_visit.html.twig #} - -{# -# Custom visit tracking template -# -# Available variables, passed to the template by `ibexa_tracking_track_event`: -# - parameters: array of Raptor tracking parameters (p1, p2, p3, etc.) -# - debug: boolean flag to enable debug console messages -#} - - diff --git a/code_samples/search/content/customfield_criterion.php b/code_samples/search/content/customfield_criterion.php deleted file mode 100644 index a9a52400dee..00000000000 --- a/code_samples/search/content/customfield_criterion.php +++ /dev/null @@ -1,12 +0,0 @@ -query = new Query\Criterion\CustomField('content_name_s', Operator::EQ, '/Ibexa.*/'); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$searchService->findContent($query); diff --git a/code_samples/search/content/taxonomy_no_entries_criterion.php b/code_samples/search/content/taxonomy_no_entries_criterion.php deleted file mode 100644 index 048006d41c5..00000000000 --- a/code_samples/search/content/taxonomy_no_entries_criterion.php +++ /dev/null @@ -1,19 +0,0 @@ -query = new LogicalAnd( - [ - new TaxonomyNoEntries('tags'), - new ContentTypeIdentifier('article'), - ] -); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findContent($query); diff --git a/code_samples/search/content/taxonomy_subtree_criterion.php b/code_samples/search/content/taxonomy_subtree_criterion.php deleted file mode 100644 index c13f94ed70a..00000000000 --- a/code_samples/search/content/taxonomy_subtree_criterion.php +++ /dev/null @@ -1,19 +0,0 @@ -query = new LogicalAnd( - [ - new TaxonomySubtree(42), - new ContentTypeIdentifier('article'), - ] -); - -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findContent($query); diff --git a/code_samples/search/custom/src/EventSubscriber/CustomIndexDataSubscriber.php b/code_samples/search/custom/src/EventSubscriber/CustomIndexDataSubscriber.php deleted file mode 100644 index 02d216cdf0e..00000000000 --- a/code_samples/search/custom/src/EventSubscriber/CustomIndexDataSubscriber.php +++ /dev/null @@ -1,42 +0,0 @@ -getDocument(); - $document->fields[] = new Field( - 'custom_field', - 'Custom field value', - new StringField() - ); - } - - public function onLocationDocumentCreate(LocationIndexCreateEvent $event): void - { - $document = $event->getDocument(); - $document->fields[] = new Field( - 'custom_field', - 'Custom field value', - new StringField() - ); - } - - public static function getSubscribedEvents(): array - { - return [ - ContentIndexCreateEvent::class => 'onContentDocumentCreate', - LocationIndexCreateEvent::class => 'onLocationDocumentCreate', - ]; - } -} diff --git a/code_samples/search/custom/src/EventSubscriber/CustomQueryFilterSubscriber.php b/code_samples/search/custom/src/EventSubscriber/CustomQueryFilterSubscriber.php deleted file mode 100644 index 3fe41cd3b13..00000000000 --- a/code_samples/search/custom/src/EventSubscriber/CustomQueryFilterSubscriber.php +++ /dev/null @@ -1,37 +0,0 @@ -getQuery(); - - $additionalCriteria = new ObjectStateIdentifier('locked'); - - if ($query->filter !== null) { - $query->filter = $additionalCriteria; - } else { - // Append Criterion to existing filter - $query->filter = new LogicalAnd([ - $query->filter, - $additionalCriteria, - ]); - } - } - - public static function getSubscribedEvents(): array - { - return [ - QueryFilterEvent::class => 'onQueryFilter', - ]; - } -} diff --git a/code_samples/search/custom/src/GroupResolver/ContentTypeGroupGroupResolver.php b/code_samples/search/custom/src/GroupResolver/ContentTypeGroupGroupResolver.php deleted file mode 100644 index a707b331c51..00000000000 --- a/code_samples/search/custom/src/GroupResolver/ContentTypeGroupGroupResolver.php +++ /dev/null @@ -1,23 +0,0 @@ -contentTypeHandler->load($document->contentTypeId)->groupIds[0]; - - return (string)$index; - } -} diff --git a/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationResultExtractor.php b/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationResultExtractor.php deleted file mode 100644 index ab64e1be3f3..00000000000 --- a/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationResultExtractor.php +++ /dev/null @@ -1,33 +0,0 @@ -getName(), $entries); - } -} diff --git a/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationVisitor.php b/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationVisitor.php deleted file mode 100644 index 7782ff33b69..00000000000 --- a/code_samples/search/custom/src/Query/Aggregation/Elasticsearch/PriorityRangeAggregationVisitor.php +++ /dev/null @@ -1,57 +0,0 @@ - $aggregation - * - * @return array> - */ - public function visit(AggregationVisitor $dispatcher, Aggregation $aggregation, LanguageFilter $languageFilter): array - { - $ranges = []; - - foreach ($aggregation->getRanges() as $range) { - if ($range->getFrom() !== null && $range->getTo() !== null) { - $ranges[] = [ - 'from' => $range->getFrom(), - 'to' => $range->getTo(), - ]; - } elseif ($range->getFrom() === null && $range->getTo() !== null) { - $ranges[] = [ - 'to' => $range->getTo(), - ]; - } elseif ($range->getFrom() !== null && $range->getTo() === null) { - $ranges[] = [ - 'from' => $range->getFrom(), - ]; - } else { - // invalid range - } - } - - return [ - 'range' => [ - 'field' => 'priority_i', - 'ranges' => $ranges, - ], - ]; - } -} diff --git a/code_samples/search/custom/src/Query/Aggregation/PriorityRangeAggregation.php b/code_samples/search/custom/src/Query/Aggregation/PriorityRangeAggregation.php deleted file mode 100644 index 2952020fcd0..00000000000 --- a/code_samples/search/custom/src/Query/Aggregation/PriorityRangeAggregation.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ -final class PriorityRangeAggregation extends AbstractRangeAggregation implements LocationAggregation -{ -} diff --git a/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php b/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php deleted file mode 100644 index a81fb9b7432..00000000000 --- a/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationResultExtractor.php +++ /dev/null @@ -1,42 +0,0 @@ - $bucket) { - if ($key === 'count' || !str_contains($key, '_')) { - continue; - } - [$from, $to] = explode('_', $key, 2); - $entries[] = new RangeAggregationResultEntry( - new Range( - $from !== '*' ? $from : null, - $to !== '*' ? $to : null - ), - $bucket->count - ); - } - - return new RangeAggregationResult($aggregation->getName(), $entries); - } -} diff --git a/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php b/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php deleted file mode 100644 index 4f669dc70f9..00000000000 --- a/code_samples/search/custom/src/Query/Aggregation/Solr/PriorityRangeAggregationVisitor.php +++ /dev/null @@ -1,54 +0,0 @@ - $aggregation - */ - public function visit( - AggregationVisitor $dispatcherVisitor, - Aggregation $aggregation, - array $languageFilter - ): array { - $rangeFacets = []; - foreach ($aggregation->getRanges() as $range) { - $from = $this->formatRangeValue($range->getFrom()); - $to = $this->formatRangeValue($range->getTo()); - $rangeFacets["{$from}_{$to}"] = [ - 'type' => 'query', - 'q' => sprintf('priority_i:[%s TO %s}', $from, $to), - ]; - } - - return [ - 'type' => 'query', - 'q' => '*:*', - 'facet' => $rangeFacets, - ]; - } - - private function formatRangeValue($value): string - { - if ($value === null) { - return '*'; - } - - return (string)$value; - } -} diff --git a/code_samples/search/custom/src/Query/Criterion/CameraManufacturerCriterion.php b/code_samples/search/custom/src/Query/Criterion/CameraManufacturerCriterion.php deleted file mode 100644 index 91f34563693..00000000000 --- a/code_samples/search/custom/src/Query/Criterion/CameraManufacturerCriterion.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'exif_camera_manufacturer_id' => (array)$criterion->value, - ], - ]; - } -} diff --git a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php b/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php deleted file mode 100644 index c4cf00e5982..00000000000 --- a/code_samples/search/custom/src/Query/Criterion/Solr/CameraManufacturerVisitor.php +++ /dev/null @@ -1,30 +0,0 @@ - 'exif_camera_manufacturer_id:"' . $this->escapeQuote((string) $value) . '"', - $criterion->value - ); - - return '(' . implode(' OR ', $expressions) . ')'; - } -} diff --git a/code_samples/search/custom/src/Query/SortClause/Elasticsearch/ScoreVisitor.php b/code_samples/search/custom/src/Query/SortClause/Elasticsearch/ScoreVisitor.php deleted file mode 100644 index 45a35b808cf..00000000000 --- a/code_samples/search/custom/src/Query/SortClause/Elasticsearch/ScoreVisitor.php +++ /dev/null @@ -1,30 +0,0 @@ -direction === Query::SORT_ASC ? 'asc' : 'desc'; - - return [ - '_score' => [ - 'order' => $order, - ], - ]; - } -} diff --git a/code_samples/search/custom/src/Query/SortClause/ScoreSortClause.php b/code_samples/search/custom/src/Query/SortClause/ScoreSortClause.php deleted file mode 100644 index 8c316c18ef7..00000000000 --- a/code_samples/search/custom/src/Query/SortClause/ScoreSortClause.php +++ /dev/null @@ -1,16 +0,0 @@ -getDirection($sortClause); - } -} diff --git a/code_samples/search/custom/src/Search/FieldMapper/WebinarEventParentNameFieldMapper.php b/code_samples/search/custom/src/Search/FieldMapper/WebinarEventParentNameFieldMapper.php deleted file mode 100644 index a02e3a04a0f..00000000000 --- a/code_samples/search/custom/src/Search/FieldMapper/WebinarEventParentNameFieldMapper.php +++ /dev/null @@ -1,43 +0,0 @@ -versionInfo->contentInfo->contentTypeId === 42; - } - - /** - * @return \Ibexa\Contracts\Core\Search\Field[] - */ - public function mapFields(Content $content): array - { - $mainLocationId = $content->versionInfo->contentInfo->mainLocationId; - $location = $this->locationHandler->load($mainLocationId); - $parentLocation = $this->locationHandler->load($location->parentId); - $parentContentInfo = $this->contentHandler->loadContentInfo($parentLocation->contentId); - - return [ - new Search\Field( - 'parent_name', - $parentContentInfo->name, - new Search\FieldType\StringField() - ), - ]; - } -} diff --git a/code_samples/search/location/isbookmarked_criterion.php b/code_samples/search/location/isbookmarked_criterion.php deleted file mode 100644 index c61bf951b19..00000000000 --- a/code_samples/search/location/isbookmarked_criterion.php +++ /dev/null @@ -1,9 +0,0 @@ -filter = new IsBookmarked(); -/** @var \Ibexa\Contracts\Core\Repository\SearchService $searchService */ -$results = $searchService->findLocations($query); diff --git a/code_samples/translations_management/src/TranslationsManagement/ImageAltTextTransformer.php b/code_samples/translations_management/src/TranslationsManagement/ImageAltTextTransformer.php deleted file mode 100644 index d11ec9b1305..00000000000 --- a/code_samples/translations_management/src/TranslationsManagement/ImageAltTextTransformer.php +++ /dev/null @@ -1,60 +0,0 @@ -getValue(); - if (!$value instanceof ImageValue) { - throw new InvalidArgumentException( - '$field', - sprintf('Expected %s, got %s.', ImageValue::class, get_debug_type($value)) - ); - } - - return new EncodedFieldValue($value->alternativeText ?? ''); - } - - /** - * @param array $metadata - */ - public function decode(string $value, mixed $previousFieldValue, array $metadata): Value - { - if (!$previousFieldValue instanceof ImageValue) { - throw new InvalidArgumentException( - '$previousFieldValue', - sprintf('Expected %s, got %s.', ImageValue::class, get_debug_type($previousFieldValue)) - ); - } - - return new ImageValue([ - 'id' => $previousFieldValue->id, - 'fileName' => $previousFieldValue->fileName, - 'fileSize' => $previousFieldValue->fileSize, - 'uri' => $previousFieldValue->uri, - 'imageId' => $previousFieldValue->imageId, - 'inputUri' => $previousFieldValue->inputUri, - 'width' => $previousFieldValue->width, - 'height' => $previousFieldValue->height, - 'alternativeText' => $value, - 'additionalData' => $previousFieldValue->additionalData, - 'mime' => $previousFieldValue->mime, - ]); - } -} diff --git a/code_samples/translations_management/src/TranslationsManagement/MyApiClient.php b/code_samples/translations_management/src/TranslationsManagement/MyApiClient.php deleted file mode 100644 index 4091bb52859..00000000000 --- a/code_samples/translations_management/src/TranslationsManagement/MyApiClient.php +++ /dev/null @@ -1,15 +0,0 @@ -apiClient->translate( - $translationData->getText(), - $translationData->getSourceLanguage(), - $translationData->getTargetLanguage() - ); - } - - /** @return array */ - public function getSupportedLanguageCodes(): array - { - return ['eng-GB', 'ger-DE', 'fre-FR']; - } - - /** @return array */ - public function getConfiguration(): array - { - return [ - 'actionConfigurationIdentifier' => $this->actionConfigurationIdentifier, - ]; - } - - public function isConfigured(): bool - { - return $this->actionConfigurationIdentifier !== ''; - } -} diff --git a/code_samples/translations_management/src/TranslationsManagement/MyCustomExclusionRule.php b/code_samples/translations_management/src/TranslationsManagement/MyCustomExclusionRule.php deleted file mode 100644 index 48a55e68e04..00000000000 --- a/code_samples/translations_management/src/TranslationsManagement/MyCustomExclusionRule.php +++ /dev/null @@ -1,16 +0,0 @@ -getContentType()->identifier === 'my_excluded_type'; - } -} diff --git a/code_samples/translations_management/src/TranslationsManagement/MyCustomLanguageCodeNormalizer.php b/code_samples/translations_management/src/TranslationsManagement/MyCustomLanguageCodeNormalizer.php deleted file mode 100644 index aeefa2dcaee..00000000000 --- a/code_samples/translations_management/src/TranslationsManagement/MyCustomLanguageCodeNormalizer.php +++ /dev/null @@ -1,38 +0,0 @@ - 'en-GB', - 'ger-DE' => 'de', - 'fre-FR' => 'fr', - ]; - - public function supports(TranslationProviderInterface $provider): bool - { - return $provider->getIdentifier() === 'my_custom_ai_provider'; - } - - public function normalize( - TranslationProviderInterface $provider, - string $languageCode - ): string { - if (isset(self::LANGUAGE_MAP[$languageCode])) { - return self::LANGUAGE_MAP[$languageCode]; - } - - throw new UnsupportedLanguageException( - $languageCode, - $provider->getIdentifier(), - array_values(self::LANGUAGE_MAP) - ); - } -} diff --git a/code_samples/translations_management/src/TranslationsManagement/MyCustomProvider.php b/code_samples/translations_management/src/TranslationsManagement/MyCustomProvider.php deleted file mode 100644 index e726d3435fd..00000000000 --- a/code_samples/translations_management/src/TranslationsManagement/MyCustomProvider.php +++ /dev/null @@ -1,50 +0,0 @@ -apiClient->translate( - $translationData->getText(), - $translationData->getSourceLanguage(), - $translationData->getTargetLanguage() - ); - } - - /** @return array */ - public function getSupportedLanguageCodes(): array - { - return ['eng-GB', 'ger-DE', 'fre-FR']; - } -} diff --git a/code_samples/tutorials/page_tutorial/src/Event/RandomBlockListener.php b/code_samples/tutorials/page_tutorial/src/Event/RandomBlockListener.php deleted file mode 100644 index 04d20d6b935..00000000000 --- a/code_samples/tutorials/page_tutorial/src/Event/RandomBlockListener.php +++ /dev/null @@ -1,77 +0,0 @@ - 'onBlockPreRender', - ]; - } - - public function onBlockPreRender(PreRenderEvent $event): void - { - $blockValue = $event->getBlockValue(); - /** @var \Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest $renderRequest */ - $renderRequest = $event->getRenderRequest(); - - $parameters = $renderRequest->getParameters(); - - $contentIdAttribute = $blockValue->getAttribute('parent'); - $location = $this->loadLocationByContentId((int) $contentIdAttribute->getValue()); - $contents = $this->findContentItems($location); - shuffle($contents); - - $parameters['randomContent'] = reset($contents); - - $renderRequest->setParameters($parameters); - } - - private function findContentItems(Location $location): array - { - $query = new Query(); - $query->query = new Criterion\LogicalAnd( - [ - new Criterion\ParentLocationId($location->id), - new Criterion\Visibility(Criterion\Visibility::VISIBLE), - ] - ); - - $searchHits = $this->searchService->findContent($query)->searchHits; - - $contentArray = []; - foreach ($searchHits as $searchHit) { - $contentArray[] = $searchHit->valueObject; - } - - return $contentArray; - } - - private function loadLocationByContentId(int $contentId): Location - { - $contentInfo = $this->contentService->loadContentInfo($contentId); - - return $this->locationService->loadLocation($contentInfo->mainLocationId); - } -} diff --git a/code_samples/tutorials/page_tutorial/src/QueryType/MenuQueryType.php b/code_samples/tutorials/page_tutorial/src/QueryType/MenuQueryType.php deleted file mode 100644 index 5a529878ffc..00000000000 --- a/code_samples/tutorials/page_tutorial/src/QueryType/MenuQueryType.php +++ /dev/null @@ -1,38 +0,0 @@ - $criteria, - 'sortClauses' => [ - new SortClause\Location\Priority(LocationQuery::SORT_ASC), - ], - ]; - - return new LocationQuery($options); - } - - public static function getName() - { - return 'Menu'; - } - - public function getSupportedParameters() - { - return []; - } -} diff --git a/code_samples/tutorials/page_tutorial/templates/base.html.twig b/code_samples/tutorials/page_tutorial/templates/base.html.twig deleted file mode 100644 index d4f83f7f8bf..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/base.html.twig +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {% block title %}Welcome!{% endblock %} - - {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #} - {% block stylesheets %} - {{ encore_entry_link_tags('app') }} - {% endblock %} - - {% block javascripts %} - {{ encore_entry_script_tags('app') }} - {% endblock %} - - - {% block body %}{% endblock %} - - diff --git a/code_samples/tutorials/page_tutorial/templates/blocks/contentlist/default.html.twig b/code_samples/tutorials/page_tutorial/templates/blocks/contentlist/default.html.twig deleted file mode 100644 index 58a48d2b47f..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/blocks/contentlist/default.html.twig +++ /dev/null @@ -1,24 +0,0 @@ -
    -

    {{ parentName }}

    - {% if contentArray|length > 0 %} -
    - {% for content in contentArray %} -
    -
    - {{ ibexa_render_field(content.content, 'photo', { - 'parameters': { - 'alias': 'content_list' - } - }) }} -
    -

    {{ ibexa_content_name(content.content) }}

    - {% if not ibexa_field_is_empty(content.content, 'short_description') %} -
    - {{ ibexa_render_field(content.content, 'short_description') }} -
    - {% endif %} -
    - {% endfor %} -
    - {% endif %} -
    \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig b/code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig deleted file mode 100644 index bc611f6f3f7..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/blocks/form/newsletter.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -
    -
    - {{ ibexa_http_cache_tag_relation_location_ids(locationId) }} - {{ render(controller('ibexa_content::viewAction', { - 'contentId': contentId, - 'locationId': locationId, - 'viewType': 'embed' - })) }} - -
    -
    diff --git a/code_samples/tutorials/page_tutorial/templates/blocks/random/default.html.twig b/code_samples/tutorials/page_tutorial/templates/blocks/random/default.html.twig deleted file mode 100644 index cc6c24d341f..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/blocks/random/default.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -
    -

    {{ 'Tip of the Day'|trans }}

    -
    {{ ibexa_content_name(randomContent) }}
    -
    - {{ ibexa_render_field(randomContent, 'body') }} -
    -
    \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/blocks/schedule/featured.html.twig b/code_samples/tutorials/page_tutorial/templates/blocks/schedule/featured.html.twig deleted file mode 100644 index 13a08dffe6b..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/blocks/schedule/featured.html.twig +++ /dev/null @@ -1,19 +0,0 @@ -{% apply spaceless %} -
    - -
    -{% endapply %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/featured/article.html.twig b/code_samples/tutorials/page_tutorial/templates/featured/article.html.twig deleted file mode 100644 index 88b476d8f4b..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/featured/article.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% set imageAlias = ibexa_image_alias(content.getField('image'), content.versionInfo, 'featured_article') %} -
    -

    {{ ibexa_content_name(content) }}

    -
    \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/fields/form_field.html.twig b/code_samples/tutorials/page_tutorial/templates/fields/form_field.html.twig deleted file mode 100644 index b8484beda40..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/fields/form_field.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% block ibexa_form_field %} - {% set formValue = field.value.getForm() %} - {% if formValue %} - {% set form = formValue.createView() %} - {% form_theme form 'bootstrap_4_layout.html.twig' %} - {% apply spaceless %} - {% if not ibexa_field_is_empty(content, field) %} - {{ form(form) }} - {% endif %} - {% endapply %} - {% endif %} -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/full/article.html.twig b/code_samples/tutorials/page_tutorial/templates/full/article.html.twig deleted file mode 100644 index 1d25b67f084..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/full/article.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -

    {{ ibexa_content_name(content) }}

    -
    -
    - {{ ibexa_render_field(content, 'image', { - 'parameters': { - 'alias': 'article_full', - 'class': 'img-responsive' - } - }) }} -
    -
    -
    -
    - {{ ibexa_render_field(content, 'intro') }} -
    -
    - {{ ibexa_render_field(content, 'body') }} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/full/dog_breed.html.twig b/code_samples/tutorials/page_tutorial/templates/full/dog_breed.html.twig deleted file mode 100644 index b473df8c469..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/full/dog_breed.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -

    {{ ibexa_content_name(content) }}

    -
    - {{ ibexa_render_field(content, 'photo', { - 'parameters': { - 'alias': 'dog_breed_full' - } - }) }} -
    -
    -

    {{ ibexa_render_field(content, 'description') }}

    -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/full/folder.html.twig b/code_samples/tutorials/page_tutorial/templates/full/folder.html.twig deleted file mode 100644 index ad0a1b59005..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/full/folder.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -

    {{ ibexa_content_name(content) }}

    -
    - {% for item in items.searchHits %} -
    - {{ ibexa_content_name(item.valueObject.contentInfo) }} -
    - {% endfor %} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/full/landing_page.html.twig b/code_samples/tutorials/page_tutorial/templates/full/landing_page.html.twig deleted file mode 100644 index a47ab9dd3b3..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/full/landing_page.html.twig +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    - {{ ibexa_render_field(content, 'page') }} -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/full/tip.html.twig b/code_samples/tutorials/page_tutorial/templates/full/tip.html.twig deleted file mode 100644 index 92c656bc06b..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/full/tip.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -
    -

    {{ ibexa_content_name(content) }}

    - {{ ibexa_render_field( content, 'body', { - 'attr': { - 'class': 'tip-text-full' - } - }) }} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial/templates/layouts/sidebar.html.twig b/code_samples/tutorials/page_tutorial/templates/layouts/sidebar.html.twig deleted file mode 100644 index 03050166d32..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/layouts/sidebar.html.twig +++ /dev/null @@ -1,36 +0,0 @@ -
    -
    - {% if zones[0].blocks %} - {% set locationId = parameters.location is not null ? parameters.location.id : contentInfo.mainLocationId %} - - {% for block in zones[0].blocks %} -
    - {{ render_esi(controller('Ibexa\\Bundle\\FieldTypePage\\Controller\\BlockController::renderAction', { - 'locationId': locationId, - 'contentId': contentInfo.id, - 'blockId': block.id, - 'versionNo': versionInfo.versionNo, - 'languageCode': field.languageCode - })) }} -
    - {% endfor %} - {% endif %} -
    - -
    diff --git a/code_samples/tutorials/page_tutorial/templates/pagelayout.html.twig b/code_samples/tutorials/page_tutorial/templates/pagelayout.html.twig deleted file mode 100644 index 76eebcb6c4c..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/pagelayout.html.twig +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - {{ encore_entry_link_tags('tutorial') }} - - {% if content is defined %} - {% set title = ez_content_name(content) %} - {% endif %} - {{ title|default('Home'|trans) }} - {{ "It's a Dog's World!"|trans }} - - -
    -
    -
    - -
    -
    -
    -
    - -
    - {% block content %}{% endblock %} -
    -
    - -
    -
    - {{ 'This is a work of fiction. Any resemblance to actual dogs or ibexes, or actual events is purely coincidental'|trans }} -
    -
    - - diff --git a/code_samples/tutorials/page_tutorial/templates/pagelayout_menu.html.twig b/code_samples/tutorials/page_tutorial/templates/pagelayout_menu.html.twig deleted file mode 100644 index 8b49cf21fd2..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/pagelayout_menu.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if menuItems is defined and menuItems is not empty %} - {% for item in menuItems %} -
  • {{ ibexa_content_name(item.valueObject.contentInfo) }}
  • - {% endfor %} -{% endif %} diff --git a/code_samples/tutorials/page_tutorial/templates/themes/standard/full/welcome_page.html.twig b/code_samples/tutorials/page_tutorial/templates/themes/standard/full/welcome_page.html.twig deleted file mode 100644 index 57d32c1915b..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/themes/standard/full/welcome_page.html.twig +++ /dev/null @@ -1,159 +0,0 @@ -{% extends '@ibexadesign/pagelayout.html.twig' %} - -{% trans_default_domain 'ibexa_welcome_page' %} - -{% block stylesheets %} - - - - - {{ encore_entry_link_tags('welcome_page') }} -{% endblock %} - -{% block content %} -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -

    - {{ 'ibexa_platform_welcome_page.welcome_to'|trans|desc('Welcome to') }}
    - {{ ibexa_render_field(content, 'name') }} - {{ constant('Ibexa\\Contracts\\Core\\Ibexa::VERSION') }} -

    -
    - {{ ibexa_render_field(content, 'description') }} -

    {{ 'ibexa_platform_welcome_page.navigate_to'|trans({'%target%': project_dir})|desc('Navigate to: %target%') }}

    - - {% set admin_url = url('ibexa.dashboard', { 'siteaccess': 'admin' }) %} -

    - {{ 'ibexa_platform_welcome_page.create_new_content_at'|trans({'%target%': '' ~ admin_url ~ '' }) - |desc('Create new content at %target%')|raw }} -

    -
    -
    -
    -
    - -
    -
    - - {{ 'ibexa_platform_welcome_page.copyright'|trans({ - '%ibexa_link_open%': '', - '%ibexa_link_close%': '', - '%current_year%': "now"|date("Y") - }) |desc('Ibexa Digital Experience Platform © %current_year% %ibexa_link_open%Ibexa%ibexa_link_close% and others')|raw }} - -
    -
    -{% endblock %} diff --git a/code_samples/tutorials/page_tutorial/templates/themes/standard/pagelayout.html.twig b/code_samples/tutorials/page_tutorial/templates/themes/standard/pagelayout.html.twig deleted file mode 100644 index 32bea8c626d..00000000000 --- a/code_samples/tutorials/page_tutorial/templates/themes/standard/pagelayout.html.twig +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - {% if content is defined and title is not defined %} - {% set title = ibexa_content_name( content ) %} - {% endif %} - {{ title|default( 'Home' ) }} - - {% if content is defined and content.contentInfo.mainLocationId %} - - {% endif %} - - {% block stylesheets %} - {{ encore_entry_link_tags('app') }} - {% endblock %} - - -{% block content %} -{% endblock %} - -{% block javascripts %} - {{ encore_entry_script_tags('app') }} -{% endblock %} - - diff --git a/code_samples/tutorials/page_tutorial_starting_point/src/QueryType/MenuQueryType.php b/code_samples/tutorials/page_tutorial_starting_point/src/QueryType/MenuQueryType.php deleted file mode 100644 index 5a529878ffc..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/src/QueryType/MenuQueryType.php +++ /dev/null @@ -1,38 +0,0 @@ - $criteria, - 'sortClauses' => [ - new SortClause\Location\Priority(LocationQuery::SORT_ASC), - ], - ]; - - return new LocationQuery($options); - } - - public static function getName() - { - return 'Menu'; - } - - public function getSupportedParameters() - { - return []; - } -} diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/full/article.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/full/article.html.twig deleted file mode 100644 index 1d25b67f084..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/full/article.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -

    {{ ibexa_content_name(content) }}

    -
    -
    - {{ ibexa_render_field(content, 'image', { - 'parameters': { - 'alias': 'article_full', - 'class': 'img-responsive' - } - }) }} -
    -
    -
    -
    - {{ ibexa_render_field(content, 'intro') }} -
    -
    - {{ ibexa_render_field(content, 'body') }} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/full/dog_breed.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/full/dog_breed.html.twig deleted file mode 100644 index b517bac42e9..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/full/dog_breed.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -

    {{ ibexa_content_name(content) }}

    -
    - {{ ibexa_render_field(content, 'photo', { - 'parameters': { - 'alias': 'dog_breed_full' - } - }) }} -
    -
    -

    {{ ibexa_render_field(content, 'full_description') }}

    -
    -
    -{% endblock %} diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/full/folder.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/full/folder.html.twig deleted file mode 100644 index ad0a1b59005..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/full/folder.html.twig +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -

    {{ ibexa_content_name(content) }}

    -
    - {% for item in items.searchHits %} -
    - {{ ibexa_content_name(item.valueObject.contentInfo) }} -
    - {% endfor %} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/full/tip.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/full/tip.html.twig deleted file mode 100644 index 92c656bc06b..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/full/tip.html.twig +++ /dev/null @@ -1,14 +0,0 @@ -{% extends 'pagelayout.html.twig' %} - -{% block content %} -
    -
    -

    {{ ibexa_content_name(content) }}

    - {{ ibexa_render_field( content, 'body', { - 'attr': { - 'class': 'tip-text-full' - } - }) }} -
    -
    -{% endblock %} \ No newline at end of file diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout.html.twig deleted file mode 100644 index 25fec1b429c..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout.html.twig +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - {{ encore_entry_link_tags('tutorial') }} - - {% if content is defined %} - {% set title = ibexa_content_name(content) %} - {% endif %} - {{ title|default('Home'|trans) }} - {{ "It's a Dog's World!"|trans }} - - -
    -
    -
    - -
    -
    -
    -
    - -
    - {% block content %}{% endblock %} -
    -
    - -
    -
    - {{ 'This is a work of fiction. Any resemblance to actual dogs or ibexes, or actual events is purely coincidental'|trans }} -
    -
    - - diff --git a/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout_menu.html.twig b/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout_menu.html.twig deleted file mode 100644 index 8b49cf21fd2..00000000000 --- a/code_samples/tutorials/page_tutorial_starting_point/templates/pagelayout_menu.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% if menuItems is defined and menuItems is not empty %} - {% for item in menuItems %} -
  • {{ ibexa_content_name(item.valueObject.contentInfo) }}
  • - {% endfor %} -{% endif %} diff --git a/code_samples/user_management/in_memory/src/EventSubscriber/AuthenticationTokenCreatedSubscriber.php b/code_samples/user_management/in_memory/src/EventSubscriber/AuthenticationTokenCreatedSubscriber.php deleted file mode 100644 index 4f351028c54..00000000000 --- a/code_samples/user_management/in_memory/src/EventSubscriber/AuthenticationTokenCreatedSubscriber.php +++ /dev/null @@ -1,47 +0,0 @@ - $userMap */ - public function __construct( - private readonly ConfigResolverInterface $configResolver, - private readonly UserService $userService, - private readonly array $userMap = [], - ) { - } - - public static function getSubscribedEvents(): array - { - return [ - AuthenticationTokenCreatedEvent::class => ['onAuthenticationTokenCreated', 11], - ]; - } - - public function onAuthenticationTokenCreated(AuthenticationTokenCreatedEvent $event): void - { - $token = $event->getAuthenticatedToken(); - $tokenUser = $token->getUser(); - if (!$tokenUser instanceof InMemoryUser) { - return; - } - $userIdentifier = $token->getUserIdentifier(); - $ibexaUser = null; - if (array_key_exists($userIdentifier, $this->userMap)) { - $ibexaUser = $this->userService->loadUserByLogin($this->userMap[$userIdentifier]); - } - if (null === $ibexaUser) { - $anonymousUserId = (int)$this->configResolver->getParameter('anonymous_user_id'); - $ibexaUser = $this->userService->loadUser($anonymousUserId); - } - $token->setUser(new UserWrapped($tokenUser, $ibexaUser)); - } -} diff --git a/code_samples/user_management/oauth_google/src/OAuth/GoogleResourceOwnerMapper.php b/code_samples/user_management/oauth_google/src/OAuth/GoogleResourceOwnerMapper.php deleted file mode 100644 index cbd1d14a74d..00000000000 --- a/code_samples/user_management/oauth_google/src/OAuth/GoogleResourceOwnerMapper.php +++ /dev/null @@ -1,93 +0,0 @@ -loadUserByIdentifier($this->getUsername($resourceOwner)); - } - - /** - * @param \League\OAuth2\Client\Provider\GoogleUser $resourceOwner - */ - protected function createUser( - ResourceOwnerInterface $resourceOwner, - UserProviderInterface $userProvider - ): UserInterface { - $userCreateStruct = $this->oauthUserService->newOAuth2UserCreateStruct( - $this->getUsername($resourceOwner), - $resourceOwner->getEmail(), - $this->getMainLanguageCode(), - $this->getOAuth2UserContentType($this->repository) - ); - - $userCreateStruct->setField('first_name', $resourceOwner->getFirstName()); - $userCreateStruct->setField('last_name', $resourceOwner->getLastName()); - - $parentGroups = []; - if ($this->parentGroupRemoteId !== null) { - $parentGroups[] = $this->userService->loadUserGroupByRemoteId($this->parentGroupRemoteId); - } - - $this->userService->createUser($userCreateStruct, $parentGroups); - - return $userProvider->loadUserByIdentifier($this->getUsername($resourceOwner)); - } - - private function getOAuth2UserContentType(Repository $repository): ?ContentType - { - if ($this->contentTypeIdentifier !== null) { - $contentTypeService = $repository->getContentTypeService(); - - return $contentTypeService->loadContentTypeByIdentifier( - $this->contentTypeIdentifier - ); - } - - return null; - } - - private function getMainLanguageCode(): string - { - // Get first prioritized language for current scope - return $this->languageResolver->getPrioritizedLanguages()[0]; - } - - private function getUsername(GoogleUser $resourceOwner): string - { - return self::PROVIDER_PREFIX . $resourceOwner->getId(); - } -} diff --git a/code_samples/user_management/oauth_google/templates/themes/admin/account/login/oauth2_login.html.twig b/code_samples/user_management/oauth_google/templates/themes/admin/account/login/oauth2_login.html.twig deleted file mode 100644 index 9ce4972e5c4..00000000000 --- a/code_samples/user_management/oauth_google/templates/themes/admin/account/login/oauth2_login.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -
    - -
    diff --git a/code_samples/workflow/custom_workflow/src/EventListener/ApprovedTransitionListener.php b/code_samples/workflow/custom_workflow/src/EventListener/ApprovedTransitionListener.php deleted file mode 100644 index 1e6d72e7010..00000000000 --- a/code_samples/workflow/custom_workflow/src/EventListener/ApprovedTransitionListener.php +++ /dev/null @@ -1,33 +0,0 @@ -getContext(); - $message = $context['message']; - - $this->notificationHandler->info( - $message, - [], - 'domain' - ); - } -} diff --git a/code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php b/code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php deleted file mode 100644 index 067f46ee142..00000000000 --- a/code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php +++ /dev/null @@ -1,35 +0,0 @@ -getActionMetadata($event->getWorkflow(), $event->getTransition()); - $message = $metadata['data']['message'] ?? ''; - - $this->notificationHandler->info( - $message, - [], - 'domain' - ); - - $this->setResult($event, true); - } -} diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml deleted file mode 100644 index 14b12d28528..00000000000 --- a/deptrac.baseline.yaml +++ /dev/null @@ -1,203 +0,0 @@ -deptrac: - skip_violations: - AcmeFeatureBundle: - - Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension - App\Block\Listener\MyBlockListener: - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\BlockRenderEvents - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest - App\CatalogFilter\ProductNameFilterFormMapper: - - Ibexa\Bundle\ProductCatalog\Form\Type\TagifyType - App\Command\AddMissingAltTextCommand: - - Ibexa\Core\FieldType\Image\Value - - Ibexa\Core\IO\IOBinarydataHandler - App\Command\CalendarCommand: - - Ibexa\Scheduler\Calendar\EventAction\RescheduleEventActionContext - App\Command\CatalogCommand: - - Ibexa\ProductCatalog\Local\Repository\Values\Catalog\Status - App\Command\CreateImageCommand: - - Ibexa\Core\FieldType\Image\Value - App\Command\MigrationCommand: - - Ibexa\Migration\Repository\Migration - App\Command\SegmentCommand: - - Ibexa\Segmentation\Value\SegmentCreateStruct - - Ibexa\Segmentation\Value\SegmentGroupCreateStruct - App\Command\ViewCommand: - - Ibexa\Core\MVC\Symfony\View\Builder\ContentViewBuilder - - Ibexa\Core\MVC\Symfony\View\Renderer\TemplateRenderer - App\Controller\AllContentListController: - - Ibexa\AdminUi\Form\Factory\FormFactory - - Ibexa\Core\Pagination\Pagerfanta\LocationSearchAdapter - App\Controller\BreadcrumbController: - - Ibexa\Bundle\Core\Controller - App\Controller\CustomController: - - Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute - App\Controller\CustomFilterController: - - Ibexa\Bundle\Core\Controller - - Ibexa\Core\MVC\Symfony\View\ContentView - App\Controller\PaginationController: - - Ibexa\Bundle\Core\Controller - - Ibexa\Core\Pagination\Pagerfanta\ContentSearchAdapter - App\Controller\RelationController: - - Ibexa\Core\MVC\Symfony\View\View - App\Controller\RideController: - - Ibexa\Bundle\Core\Controller - - Ibexa\Core\MVC\Symfony\View\ContentView - App\Controller\SvgController: - - Ibexa\Core\Helper\TranslationHelper - - Ibexa\Core\IO\IOServiceInterface - - Ibexa\Core\MVC\Symfony\Controller\Controller - App\Corporate\EventSubscriber\ApplicationDetailsViewSubscriber: - - Ibexa\Bundle\CorporateAccount\EventSubscriber\AbstractViewSubscriber - - Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface - - Ibexa\Core\MVC\Symfony\View\View - - Ibexa\CorporateAccount\View\ApplicationDetailsView - App\Corporate\EventSubscriber\VerifyStateEventSubscriber: - - Ibexa\CorporateAccount\Event\ApplicationWorkflowEvents - - Ibexa\CorporateAccount\Persistence\Legacy\ApplicationState\HandlerInterface - - Ibexa\CorporateAccount\Persistence\Values\ApplicationStateUpdateStruct - App\DependencyInjection\AddFloatStorageDefinitionTag: - - Ibexa\ProductCatalog\Local\Persistence\Legacy\Attribute\Float\StorageDefinition - App\EventListener\TextAnchorMenuTabListener: - - Ibexa\AdminUi\Menu\ContentEditAnchorMenuBuilder - - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent - App\EventSubscriber\AuthenticationTokenCreatedSubscriber: - - Ibexa\Core\MVC\Symfony\Security\UserWrapped - App\EventSubscriber\FormFieldDefinitionSubscriber: - - Ibexa\FormBuilder\Definition\FieldAttributeDefinitionBuilder - - Ibexa\FormBuilder\Event\FieldDefinitionEvent - - Ibexa\FormBuilder\Event\FormEvents - App\EventSubscriber\HelpMenuSubscriber: - - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent - App\EventSubscriber\LoginFormViewSubscriber: - - Ibexa\Core\MVC\Symfony\Event\PreContentViewEvent - - Ibexa\Core\MVC\Symfony\MVCEvents - - Ibexa\Core\MVC\Symfony\View\LoginFormView - App\EventSubscriber\MyMenuSubscriber: - - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent - - Ibexa\AdminUi\Menu\MainMenuBuilder - App\EventSubscriber\NotificationScenarioSubscriber: - - Ibexa\IntegratedHelp\ProductTour\Block\LinkBlock - - Ibexa\IntegratedHelp\ProductTour\Block\TextBlock - - Ibexa\IntegratedHelp\ProductTour\ProductTourStep - App\Event\RandomBlockListener: - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\BlockRenderEvents - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest - App\Event\Subscriber\BlockEmbedEventEventSubscriber: - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\BlockRenderEvents - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest - App\Event\Subscriber\RichTextBlockSubscriber: - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\BlockRenderEvents - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Event\PreRenderEvent - - Ibexa\FieldTypePage\FieldType\Page\Block\Renderer\Twig\TwigRenderRequest - - Ibexa\FieldTypeRichText\RichText\DOMDocumentFactory - App\Export\User\DateOfBirthUserItemProcessor: - - Ibexa\Core\FieldType\Date\Value - App\FieldType\HelloWorld\Comparison\Comparable: - - Ibexa\VersionComparison\ComparisonValue\StringComparisonValue - App\FieldType\HelloWorld\Comparison\HelloWorldComparisonEngine: - - Ibexa\VersionComparison\Engine\Value\StringComparisonEngine - App\FieldType\HelloWorld\Comparison\HelloWorldComparisonResult: - - Ibexa\VersionComparison\Result\Value\StringComparisonResult - App\FieldType\HelloWorld\Comparison\Value: - - Ibexa\VersionComparison\ComparisonValue\StringComparisonValue - App\FormBuilder\FieldType\Field\Mapper\CheckboxWithRichtextDescriptionFieldMapper: - - Ibexa\FormBuilder\FieldType\Field\Mapper\GenericFieldMapper - App\FormBuilder\Field\Mapper\CountryFieldMapper: - - Ibexa\FormBuilder\FieldType\Field\Mapper\GenericFieldMapper - App\FormBuilder\FormSubmission\Converter\RichtextDescriptionFieldSubmissionConverter: - - Ibexa\FormBuilder\FormSubmission\Converter\BooleanFieldSubmissionConverter - App\FormBuilder\Form\Type\FieldAttribute\AttributeRichtextDescriptionType: - - Ibexa\FieldTypeRichText\Form\Type\RichTextType - App\GraphQL\Schema\MyFieldDefinitionMapper: - - Ibexa\GraphQL\Schema\Domain\Content\Mapper\FieldDefinition\DecoratingFieldDefinitionMapper - App\Migrations\Action\AssignSection: - - Ibexa\Migration\ValueObject\Step\Action - App\Migrations\Action\AssignSectionExecutor: - - Ibexa\Migration\StepExecutor\ActionExecutor\ExecutorInterface - - Ibexa\Migration\ValueObject\Step\Action - App\Migrations\Matcher\SectionIdentifierGenerator: - - Ibexa\Migration\Generator\CriterionGenerator\GeneratorInterface - App\Migrations\Matcher\SectionIdentifierNormalizer: - - Ibexa\Bundle\Migration\Serializer\Normalizer\Criterion\AbstractCriterionNormalizer - App\Migrations\Step\ReplaceNameStep: - - Ibexa\Migration\ValueObject\Step\StepInterface - App\Migrations\Step\ReplaceNameStepExecutor: - - Ibexa\Core\FieldType\TextLine\Value - - Ibexa\Migration\ValueObject\Step\StepInterface - App\Migrations\Step\ReplaceNameStepNormalizer: - - Ibexa\Migration\ValueObject\Step\StepInterface - App\MyService: - - Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface - App\Notification\ListRenderer: - - Ibexa\Core\Notification\Renderer\NotificationRenderer - - Ibexa\Core\Notification\Renderer\TypedNotificationRendererInterface - App\Notification\MyRenderer: - - Ibexa\Core\Notification\Renderer\NotificationRenderer - - Ibexa\Core\Notification\Renderer\TypedNotificationRendererInterface - App\OAuth\GoogleResourceOwnerMapper: - - Ibexa\OAuth2Client\ResourceOwner\ResourceOwnerToExistingOrNewUserMapper - App\ProductCatalog\Availability\ProductAvailabilityPurchasableWithoutStockStrategy: - - Ibexa\ProductCatalog\Local\Persistence\Legacy\ProductAvailability\HandlerInterface - - Ibexa\ProductCatalog\Local\Repository\Values\Availability - App\QueryType\LatestContentQueryType: - - Ibexa\Core\QueryType\QueryType - App\QueryType\MenuQueryType: - - Ibexa\Core\QueryType\QueryType - App\QueryType\OptionsBasedLatestContentQueryType: - - Ibexa\Core\QueryType\OptionsResolverBasedQueryType - - Ibexa\Core\QueryType\QueryType - App\QueryType\RideQueryType: - - Ibexa\Core\QueryType\QueryType - App\Search\Model\Suggestion\ProductSuggestion: - - Ibexa\ProductCatalog\Local\Repository\Values\Product - App\Security\FormPolicyProvider: - - Ibexa\Bundle\Core\DependencyInjection\Configuration\ConfigBuilderInterface - - Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\PolicyProviderInterface - App\Security\FormSubmissionServiceDecorator: - - Ibexa\Core\Base\Exceptions\NotFoundException - - Ibexa\Core\Base\Exceptions\UnauthorizedException - - Ibexa\FormBuilder\FormSubmission\Gateway\FormSubmissionGateway - App\Security\FormSubmissionsTabDecorator: - - Ibexa\FormBuilder\FieldType\FormFactory - - Ibexa\FormBuilder\FieldType\Type - - Ibexa\FormBuilder\Tab\LocationView\SubmissionsTab - App\Security\Limitation\CustomLimitationType: - - Ibexa\Core\Base\Exceptions\InvalidArgumentException - - Ibexa\Core\Base\Exceptions\InvalidArgumentType - - Ibexa\Core\FieldType\ValidationError - App\Security\Limitation\Mapper\CustomLimitationFormMapper: - - Ibexa\AdminUi\Limitation\LimitationFormMapperInterface - - Ibexa\Core\Limitation\LimitationIdentifierToLabelConverter - App\Security\Limitation\Mapper\CustomLimitationValueMapper: - - Ibexa\AdminUi\Limitation\LimitationValueMapperInterface - App\Security\MyPolicyProvider: - - Ibexa\Bundle\Core\DependencyInjection\Security\PolicyProvider\YamlPolicyProvider - App\Service\MyService: - - Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface - App\Setting\Group\MyGroup: - - Ibexa\User\UserSetting\Group\AbstractGroup - App\Setting\Unit: - - Ibexa\Core\Base\Exceptions\InvalidArgumentException - App\Tab\Dashboard\Everyone\EveryoneArticleTab: - - Ibexa\AdminUi\Tab\Dashboard\PagerLocationToDataMapper - - Ibexa\Core\Pagination\Pagerfanta\LocationSearchAdapter - App\TranslationsManagement\ImageAltTextTransformer: - - Ibexa\Core\Base\Exceptions\InvalidArgumentException - - Ibexa\Core\FieldType\Image\Value - - Ibexa\Core\FieldType\Value - App\View\Matcher\Owner: - - Ibexa\Core\MVC\Symfony\Matcher\ContentBased\MatcherInterface - - Ibexa\Core\MVC\Symfony\View\ContentValueView - - Ibexa\Core\MVC\Symfony\View\LocationValueView - - Ibexa\Core\MVC\Symfony\View\View - AttributeTypeExtension: - - Ibexa\PageBuilder\Form\Type\Attribute\AttributeType - CustomRepositoryConfigParser: - - Ibexa\Bundle\Core\DependencyInjection\Configuration\RepositoryConfigParserInterface - JohnDoeCanSelectMore: - - Ibexa\AdminUi\UniversalDiscovery\Event\ConfigResolveEvent - MyMapper: - - Ibexa\ContentForms\Form\Type\FieldType\CheckboxFieldType diff --git a/deptrac.yaml b/deptrac.yaml deleted file mode 100644 index c46f25cfc74..00000000000 --- a/deptrac.yaml +++ /dev/null @@ -1,54 +0,0 @@ -imports: - - deptrac.baseline.yaml - -deptrac: - paths: - - ./code_samples - layers: - - name: CodeSamples - collectors: - - type: directory - value: code_samples - - name: IbexaContracts - collectors: - - type: classLike - value: .*Ibexa\\Contracts\\.* - - name: IbexaSiteAccessConfiguration - collectors: - - type: classLike - value: .*Ibexa\\Bundle\\Core\\DependencyInjection\\Configuration\\SiteAccessAware\\.* - - name: IbexaInternal - collectors: - - type: tagValueRegex - tag: '@internal' - - name: IbexaRest - collectors: - - type: classLike - value: .*Ibexa\\.*\\Rest\\.* - - type: classLike - value: .*Ibexa\\Rest\\.* - - name: IbexaConstraints - collectors: - - type: classLike - value: .*Ibexa\\.*\\Constraints\\.* - - name: IbexaNotAllowed - collectors: - - type: bool - must: - - type: classLike - value: .*Ibexa\\.* - must_not: - - type: layer - value: IbexaContracts - - type: layer - value: IbexaSiteAccessConfiguration - - type: layer - value: IbexaRest - - type: layer - value: IbexaConstraints - ruleset: - CodeSamples: - - IbexaContracts - - IbexaSiteAccessConfiguration - - IbexaRest - - IbexaConstraints diff --git a/docs/administration/back_office/add_user_setting.md b/docs/administration/back_office/add_user_setting.md deleted file mode 100644 index 9860c231cfc..00000000000 --- a/docs/administration/back_office/add_user_setting.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -description: Add the option to select a custom preference in user menu. ---- - -# Add user setting - -## Create new user setting - -You can add new preferences to the **User Settings** menu in the back office. - -To do so, create a setting class implementing two interfaces: `ValueDefinitionInterface` and `FormMapperInterface`. - -In this example the class is located in `src/Setting/Unit.php` and enables the user to select their preference for metric or imperial unit systems. - -``` php -[[= include_code('code_samples/back_office/settings/src/Setting/Unit.php') =]] -``` - -Register the setting as a service: - -``` yaml -[[= include_file('code_samples/back_office/settings/config/custom_services.yaml', 0, 5) =]] -``` - -You can order the settings in the **User** menu by setting their `priority`. - -`group` indicates the group that the setting is placed in. -It can be one of the built-in groups, or a custom one. - -To create a custom setting group, create an `App/Setting/Group/MyGroup.php` file: - -``` php -[[= include_code('code_samples/back_office/settings/src/Setting/Group/MyGroup.php') =]] -``` - -Register the setting group as a service: - -``` yaml -[[= include_file('code_samples/back_office/settings/config/custom_services.yaml', 6, 9) =]] -``` - -The value of the setting is accessible with `ibexa_user_settings['unit']`. - -## Create template for editing settings - -You can override a template used when editing the new setting under the `ibexa.system..user_settings_update_view` [configuration key](configuration.md#configuration-files): - -``` yaml -[[= include_file('code_samples/back_office/settings/config/packages/user_settings.yaml') =]] -``` - -The `templates/themes/admin/user/setting/update_unit.html.twig` template must extend the `@ibexadesign/account/settings/update.html.twig` template: - -``` html+twig -[[= include_file('code_samples/back_office/settings/templates/themes/admin/user/setting/update_unit.html.twig') =]] -``` diff --git a/docs/administration/back_office/back_office_elements/add_drag_and_drop.md b/docs/administration/back_office/back_office_elements/add_drag_and_drop.md deleted file mode 100644 index 8d695dfe827..00000000000 --- a/docs/administration/back_office/back_office_elements/add_drag_and_drop.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -description: Add custom drag-and-drop interactions to back office interface. ---- - -# Add drag and drop - -You can create a generic interface for drag and drop interactions that you can reuse in many places across the back office. - -First, prepare the HTML code structure and place it in a Twig template. See the example: - -```html -
    -
    item name
    -
    item name
    -
    item name
    -
    -``` - -To initialize a drag and drop interface, add a JavaScript Code that comes with the template following the convention: - -```javascript -(function (global, doc, ibexa) { - const draggable = new ibexa.core.Draggable({ - itemsContainer: doc.querySelector('.items-container-drag'), - selectorItem: '.item-drag', - selectorPlaceholder: '.item-placeholder-drag', - }); - draggable.init(); -})(window, window.document, window.ibexa); -``` - -For more information on creating Twig templates, see [Templating basics](templates.md). - -## Configuration options - -Full list of options: - -|Option|Description|Required| -|------|-----------|--------| -|`itemsContainer`|Reference to DOM node that contains a draggable item.|required| -|`selectorItem`|CSS selector of a draggable item.|required| -|`selectorPlaceholder`|CSS selector of a placeholder.|required| -|`afterInit`|Callback function invoked after interface initialization.|optional| -|`afterDragStart`|Callback function invoked after starting to drag.|optional| -|`afterDragOver`|Callback function invoked after moving onto a droppable element.|optional| -|`afterDrop`|Callback function invoked after dropping an element.|optional| -|`attachCustomEventHandlersToItem`|Function to be invoked while attaching event handlers to every item in the item's container. Item of `HTMLElement` type is passed to the function as the first param.|optional| -|`timeoutRemovePlaceholders`|The amount of time after which the not dropped item disappears.The default value is set to 500ms.|optional| diff --git a/docs/administration/back_office/back_office_elements/add_dropdowns.md b/docs/administration/back_office/back_office_elements/add_dropdowns.md deleted file mode 100644 index 162dfdfc284..00000000000 --- a/docs/administration/back_office/back_office_elements/add_dropdowns.md +++ /dev/null @@ -1,157 +0,0 @@ ---- -description: Add custom drop down menus to back office interface. ---- - -# Add drop-downs - -In [[= product_name =]], you can create a reusable custom drop-down and implement it anywhere in the back office. -Follow the steps below to learn how to integrate this component to fit it to your project needs. - -## Create `` input, for example: - -```twig -{% set source %} - -{% endset %} -``` - - `` input header.| -|`choices`| |Elements listed in the drop-down.| -|`preferred_choices`| | Elements listed at the top of the list with a separator.| -|`value`|-|The currently selected element. It is an object with a key `value`. | -|`multiple`| true
    false|Boolean. To allow users to select multiple items.| -|`translation_domain`|true
    false|Used for translating choices and placeholder.| -|`custom_form`|true
    false|For custom form must be set to true.| -|`class`| |Additional classes for the element with `ibexa-dropdown` class.| -|`placeholder`| | Placeholder displayed when no option is selected.| -|`custom_init`|true
    false|By default set to `false`. If set to `true`, requires manually initializing drop-down in JavaScript.| -|`is_disabled`|true
    false|Disables drop-down.| -|`is_hidden`|true
    false|Hides the whole widget.| -|`is_small`|true
    false|Adjusts height of the widget (from 48px to 32px).| -|`is_ghost`|true
    false|Changes layout of the widget, removes all borders and backgrounds (similar to buttons modifier).| -|`min_search_items`|number, default 5|Minimum number of options that have to be passed to show the search inside the drop-down.| -|`selected_item_label`|text|Allows setting constant label for widget. By default the visible label shows the currently selected options.| -|`has_select_all_toggler`|true
    false|Allows showing a "Select all" option if the minimum number of items is reached.| -|`min_select_all_toggler_items`|number, default 5|Minimum number of items the dropdown must have for the "Select all" option to appear.| - -![Drop-down expanded state](dropdown_expanded_state.png) - -## Extend drop-down templates - -### Initialize - -All drop-downs are searched and initialized automatically in `admin.dropdown.js`. -To extend or modify the search, you need to add a `custom_init` attribute to the drop-down Twig parameters. Otherwise it's initialized two times. -Next, run the following JavaScript code: - -```javascript -(function (global, document) { -const container = document.querySelector('.ibexa-dropdown'); -const dropdown = new global.ibexa.core.Dropdown({ - container, - selectorSource, -}); - -dropdown.init(); -})(window, window.document); -``` - -## Configuration options - -Full list of options: - -|Name|Description|Required| -|----|-----------|--------| -|`container`|Contains a reference to a DOM node where the custom drop-down is initialized.|required| -|`selectorSource`|Use to change class of the source element.|required| diff --git a/docs/administration/back_office/back_office_elements/custom_components.md b/docs/administration/back_office/back_office_elements/custom_components.md deleted file mode 100644 index b19cf8fa2d4..00000000000 --- a/docs/administration/back_office/back_office_elements/custom_components.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -description: Back office components allow you to inject any custom widgets into selected places of the user interface. ---- - -# Customizing the back office with Twig Components - -You can customize many of the back office views by using [Twig components](components.md). -This allows you to inject your own custom logic and extend the templates. - -The available groups for the back office are: - -## Admin UI - -| Group name | Template file | -|---|---| -|`admin-ui-login-form-after` | `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/login/index.html.twig` | -|`admin-ui-login-form-before` | `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/login/index.html.twig` | -|`admin-ui-content-column-end`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` | -|`admin-ui-content-create-form-before`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/create/create.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/user/create.html.twig`
    | -|`admin-ui-content-create-form-after`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/create/create.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/user/create.html.twig`
    | -|`admin-ui-content-edit-form-after`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/user/edit.html.twig`
    | -|`admin-ui-content-edit-form-before`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/user/edit.html.twig`
    | -|`admin-ui-content-edit-sections`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/create_on_the_fly.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/on_the_fly/edit_on_the_fly.html.twig`
    | -|`admin-ui-content-form-create-header-actions`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/create/create.html.twig` | -|`admin-ui-content-form-edit-header-actions`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig` | -|`admin-ui-content-translations-row-actions`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/translations/tab.html.twig` | -|`admin-ui-content-tree-after`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig` | -|`admin-ui-content-tree-before`| `vendor/ibexaadmin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig` | -|`admin-ui-content-type-edit-sections`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content_type/edit.html.twig` | -|`admin-ui-content-type-tab-groups`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content_type/index.html.twig` | -|`admin-ui-dashboard-all-tab-groups`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/dashboard/block/all.html.twig` | -|`admin-ui-dashboard-blocks`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/dashboard/dashboard.html.twig` | -|`admin-ui-dashboard-my-tab-groups`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/dashboard/block/me.html.twig` | -|`admin-ui-distraction-free-mode-extras`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/form_fields.html.twig` | -|`admin-ui-form-content-add-translation-body`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/content/modal/add_translation.html.twig` | -|`admin-ui-global-search-autocomplete-templates`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/global_search.html.twig` | -|`admin-ui-global-search`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` | -|`admin-ui-header-user-menu-middle`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig` | -|`admin-ui-image-edit-actions-after`|
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ibexa_image.html.twig`
    • `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/field_type/edit/ibexa_image_asset.html.twig`
    | -|`admin-ui-layout-content-after`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` | -|`admin-ui-link-manager-block`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/url_management/url_management.html.twig` | -|`admin-ui-location-view-content-alerts`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig` | -|`admin-ui-location-view-tab-groups`| `vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig` | -|`admin-ui-location-view-tabs-after`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/tab/location_view.html.twig` | -|`admin-ui-script-body`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` | -|`admin-ui-script-head`| `vendor/ibexa/admin-ui-ui/src/bundle/Resources/views/themes/admin/ui/layout.html.twig` | -|`admin-ui-stylesheet-body`|