Skip to content

Commit

Permalink
EZP-29115: Add characters counter to RichText
Browse files Browse the repository at this point in the history
  • Loading branch information
konradoboza authored and konradoboza committed Jan 24, 2019
2 parents fbe42d0 + 6222468 commit beb0da3
Show file tree
Hide file tree
Showing 294 changed files with 5,554 additions and 1,835 deletions.
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"symfony/symfony": "^3.4",
"jms/translation-bundle": "^1.3.2",
"ezsystems/ezpublish-kernel": "^7.4@dev",
"ezsystems/repository-forms": "^2.3@dev",
"ezsystems/ezplatform-admin-ui-modules": "^1.3@dev",
"ezsystems/repository-forms": "^2.4@dev",
"ezsystems/ezplatform-admin-ui-modules": "^1.4@dev",
"ezsystems/ez-support-tools": "^0.2@dev",
"ezsystems/ezplatform-design-engine": "^2.0@dev",
"white-october/pagerfanta-bundle": "^1.1",
Expand All @@ -27,6 +27,7 @@
"willdurand/js-translation-bundle": "^2.6.6"
},
"require-dev": {
"behat/behat": "^3.5.0",
"friendsofphp/php-cs-fixer": "~2.7.1",
"phpunit/phpunit": "^6.4",
"matthiasnoback/symfony-dependency-injection-test": "^2.3"
Expand All @@ -37,8 +38,8 @@
"extra": {
"_ezplatform_branch_for_behat_tests": "master",
"branch-alias": {
"dev-tmp_ci_branch": "2.4.x-dev",
"dev-master": "1.4.x-dev"
"dev-tmp_ci_branch": "2.5.x-dev",
"dev-master": "1.5.x-dev"
}
}
}
21 changes: 20 additions & 1 deletion src/bundle/Controller/ContentOnTheFlyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use eZ\Publish\API\Repository\Exceptions as ApiException;
use eZ\Publish\API\Repository\LanguageService;
use eZ\Publish\API\Repository\LocationService;
use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct;
use eZ\Publish\API\Repository\Values\Content\Location;
use eZ\Publish\API\Repository\Values\ContentType\ContentType;
use eZ\Publish\Core\Base\Exceptions\UnauthorizedException;
Expand Down Expand Up @@ -118,7 +119,7 @@ public function hasCreateAccessAction(
$response = new JsonResponse();

try {
$contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, $languageCode);
$contentCreateStruct = $this->createContentCreateStruct($parentLocation, $contentType, $languageCode);
$locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocation->id);

$permissionResolver = $this->container->get('ezpublish.api.repository')->getPermissionResolver();
Expand Down Expand Up @@ -159,4 +160,22 @@ public function hasCreateAccessAction(

return $response;
}

/**
* @param \eZ\Publish\API\Repository\Values\Content\Location $location
* @param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType
* @param string $language
*
* @return \eZ\Publish\API\Repository\Values\Content\ContentCreateStruct
*/
private function createContentCreateStruct(
Location $location,
ContentType $contentType,
string $language
): ContentCreateStruct {
$contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, $language);
$contentCreateStruct->sectionId = $location->contentInfo->sectionId;

return $contentCreateStruct;
}
}
Loading

0 comments on commit beb0da3

Please sign in to comment.