Пример #1
0
 /**
  * @param string $name
  * @param integer $page_level
  * @return string
  */
 private static function getWhatsNewArticleImageUrl($name, $page_level)
 {
     return $src = self::$current_locale === self::$default_locale ? self::pageLevelToPrefix($page_level, self::$current_locale) . "assets/images/whats-new/" . self::$current_element->getVersionNumber() . '/' . $name : self::pageLevelToPrefix($page_level, self::$current_locale) . "assets/images/" . self::$current_locale . "/whats-new/" . self::$current_element->getVersionNumber() . '/' . $name;
 }
Пример #2
0
 /**
  * @param Project         $project
  * @param WhatsNewArticle $article
  * @param string          $target_path
  * @param string          $locale
  * @param OutputInterface $output
  */
 private function copyVersionImages(Project $project, WhatsNewArticle $article, $target_path, $locale, OutputInterface $output)
 {
     $version_num = $article->getVersionNumber();
     $version_dir_path = $locale === $project->getDefaultLocale() ? "{$target_path}/assets/images/whats-new/{$version_num}" : "{$target_path}/assets/images/{$locale}/whats-new/{$version_num}";
     if (is_dir($version_dir_path)) {
         return;
     }
     $version_path = dirname($article->getIndexFilePath());
     if (is_dir("{$version_path}/images")) {
         Shade::copyDir("{$version_path}/images", $version_dir_path, null, function ($path) use(&$output) {
             $output->writeln("{$path} copied");
         });
     }
 }