Skip to content
Permalink
Browse files

Merge pull request #4216 from kazumiiiiiiiiiii/move-pdf-logo

PDFのロゴ画像をファイル管理から変更できる機能を追加
  • Loading branch information...
chihiro-adachi committed Jul 9, 2019
2 parents 0323829 + b28f6a4 commit e8f2952925dda75db5b02ab52bf357f59343ecef
@@ -125,6 +125,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
}
$logoPath = '/assets/pdf/logo.png';
if (!file_exists($this->container->getParameter('eccube_html_dir').'/user_data'.$logoPath)) {
$file = new Filesystem();
$file->copy(
$this->container->getParameter('eccube_html_admin_dir').$logoPath,
$this->container->getParameter('eccube_html_dir').'/user_data'.$logoPath
);
}
$output->writeln(sprintf(' <comment>></comment> <info>%s</info>', 'Finished Successful!'));
}
}
@@ -230,6 +230,15 @@ public function step2()
);
}
$logoPath = '/assets/pdf/logo.png';
if (!file_exists($this->getParameter('eccube_html_dir').'/user_data'.$logoPath)) {
$file = new Filesystem();
$file->copy(
$this->getParameter('eccube_html_admin_dir').$logoPath,
$this->getParameter('eccube_html_dir').'/user_data'.$logoPath
);
}
return [
'noWritePermissions' => $noWritePermissions,
];
@@ -306,8 +306,13 @@ protected function renderShopData()
$this->lfText(125, 75, $text, 8); // Email
}
// ロゴ画像(app配下のロゴ画像を優先して読み込む)
$logoFile = $this->eccubeConfig->get('eccube_html_admin_dir').'/assets/pdf/logo.png';
// user_dataにlogo.pngが配置されている場合は優先的に読み込む
$logoFile = $this->eccubeConfig->get('eccube_html_dir').'/user_data/assets/pdf/logo.png';
if (!file_exists($logoFile)) {
$logoFile = $this->eccubeConfig->get('eccube_html_admin_dir').'/assets/pdf/logo.png';
}
$this->Image($logoFile, 124, 46, 40);
}
@@ -112,6 +112,7 @@ public function testStep2()
$this->assertArrayHasKey('noWritePermissions', $this->actual);
$this->assertFileExists($this->container->getParameter('eccube_html_dir').'/user_data/assets/img/common/favicon.ico');
$this->assertFileExists($this->container->getParameter('eccube_html_dir').'/user_data/assets/pdf/logo.png');
}
public function testStep3()

0 comments on commit e8f2952

Please sign in to comment.
You can’t perform that action at this time.