Example #1
0
 /**
  * @param string $path
  *
  * @return string
  */
 protected function preparePath($path)
 {
     $path = parent::preparePath($path);
     if ($this->isAdminUri($path) === false) {
         $path = $this->aliases->getUriAlias($path);
     }
     return $path;
 }
 /**
  * @param ModelSaveEvent $event
  */
 public function generatePictureAliases(ModelSaveEvent $event)
 {
     if ($this->aliases && $this->metaStatements && $this->uriAliasManager) {
         $galleryId = $event->getEntryId();
         $pictures = $this->pictureRepository->getPicturesByGalleryId($galleryId);
         $alias = $this->aliases->getUriAlias(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId), true);
         $seoKeywords = $this->metaStatements->getKeywords(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId));
         $seoDescription = $this->metaStatements->getDescription(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId));
         foreach ($pictures as $picture) {
             $this->uriAliasManager->insertUriAlias(sprintf(Gallery\Helpers::URL_KEY_PATTERN_PICTURE, $picture['id']), !empty($alias) ? $alias . '/img-' . $picture['id'] : '', $seoKeywords, $seoDescription);
         }
     }
 }
Example #3
0
 /**
  * Returns the SEO form fields
  *
  * @param string $path
  *
  * @return array
  */
 public function formFields($path = '')
 {
     if (!empty($path)) {
         $path .= !preg_match('/\\/$/', $path) ? '/' : '';
         $alias = $this->request->getPost()->get('alias', $this->aliases->getUriAlias($path, true));
         $keywords = $this->request->getPost()->get('seo_keywords', $this->metaStatements->getKeywords($path));
         $description = $this->request->getPost()->get('seo_description', $this->metaStatements->getDescription($path));
         $robots = $this->metaStatements->getSeoInformation($path, 'robots', 0);
     } else {
         $alias = $keywords = $description = '';
         $robots = 0;
     }
     return ['alias' => $alias, 'keywords' => $keywords, 'description' => $description, 'robots' => $this->formsHelper->choicesGenerator('seo_robots', $this->getRobotsChoicesGeneratorValues(), $robots)];
 }
Example #4
0
File: Create.php Project: acp3/cms
 /**
  * Setzt einen einzelnen Alias für ein Bild einer Fotogalerie
  *
  * @param integer $pictureId
  *
  * @return boolean
  */
 protected function generatePictureAlias($pictureId)
 {
     if ($this->aliases && $this->metaStatements && $this->uriAliasManager) {
         $galleryId = $this->pictureRepository->getGalleryIdFromPictureId($pictureId);
         $alias = $this->aliases->getUriAlias(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId), true);
         if (!empty($alias)) {
             $alias .= '/img-' . $pictureId;
         }
         $seoKeywords = $this->metaStatements->getKeywords(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId));
         $seoDescription = $this->metaStatements->getDescription(sprintf(Gallery\Helpers::URL_KEY_PATTERN_GALLERY, $galleryId));
         return $this->uriAliasManager->insertUriAlias(sprintf(Gallery\Helpers::URL_KEY_PATTERN_PICTURE, $pictureId), $alias, $seoKeywords, $seoDescription);
     }
     return true;
 }
 /**
  * @return bool
  */
 private function uriAliasExists()
 {
     return $this->aliases->uriAliasExists($this->request->getQuery()) === true && $this->request->getPathInfo() !== $this->aliases->getUriAlias($this->request->getQuery()) . '/';
 }