Skip to content

Commit

Permalink
merge fixed conflict add case fail
Browse files Browse the repository at this point in the history
  • Loading branch information
thangnn committed Feb 21, 2024
2 parents 105eb5e + 959cb3a commit 862f66e
Show file tree
Hide file tree
Showing 37 changed files with 640 additions and 361 deletions.
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions composer_installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function whichPhp()

function command($phpPath)
{
$phpPath = escapeshellarg($phpPath);
if (!$phpPath) $phpPath = 'php';
if (!is_writable(ROOT_DIR . 'composer')) {
throw new Exception('/composer に書き込み権限がありません。書き込み権限を与えてください。');
Expand Down
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Model/Table/ContentsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ public function updateChildrenUrl($id)
if ($children) {
foreach($children as $child) {
// サイト全体を更新する為、サイト規模によってはかなり時間がかかる為、SQLを利用
$connection->update('contents', ['url' => $this->createUrl($child->id)], ['id' => $child->id]);
$connection->update($this->getTable(), ['url' => $this->createUrl($child->id)], ['id' => $child->id]);
}
}
return true;
Expand Down
12 changes: 8 additions & 4 deletions plugins/baser-core/src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@ public function addTheme(PluginApplicationInterface $application)
foreach($sites as $site) {
if ($site->theme) {
BcUtil::includePluginClass($site->theme);
$application->addPlugin($site->theme);
$pluginPath = CorePlugin::path($site->theme) . 'plugins' . DS;
if(!is_dir($pluginPath)) continue;
$path[] = $pluginPath;
try {
$application->addPlugin($site->theme);
$pluginPath = CorePlugin::path($site->theme) . 'plugins' . DS;
if (!is_dir($pluginPath)) continue;
$path[] = $pluginPath;
} catch (MissingPluginException $e) {
$this->log($e->getMessage());
}
}
}
// テーマプラグインを追加
Expand Down
43 changes: 23 additions & 20 deletions plugins/baser-core/src/Utility/BcFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function create(int $mask = 0777)
$parent = dirname($path);
if (!is_dir($parent)) {
$this->path = $parent;
if($this->create($mask)) {
if ($this->create($mask)) {
$this->path = $path;
} else {
$this->path = $path;
Expand Down Expand Up @@ -113,7 +113,7 @@ public function getFiles(array $options = [])
], $options);
$files = [];
$dir = new \DirectoryIterator($this->path);
foreach ($dir as $fileInfo) {
foreach($dir as $fileInfo) {
$filename = $fileInfo->getFilename();
if ($fileInfo->isFile() && !in_array($filename, $options['exclude'])) {
$files[] = $options['full']? $fileInfo->getPathname() : $fileInfo->getFilename();;
Expand All @@ -140,7 +140,7 @@ public function getFolders(array $options = [])
$folders = [];
$dir = new \DirectoryIterator($this->path);
/** @var $fileInfo \SplFileInfo */
foreach ($dir as $fileInfo) {
foreach($dir as $fileInfo) {
$filename = $fileInfo->getFilename();
if ($fileInfo->isDir() && !$fileInfo->isDot() && !in_array($filename, $options['exclude'])) {
$folders[] = $options['full']? $fileInfo->getPathname() : $fileInfo->getFilename();
Expand All @@ -160,12 +160,12 @@ public function delete()
{
if (!is_dir($this->path)) return false;
$files = $this->getFiles(['full' => true]);
foreach ($files as $file) {
foreach($files as $file) {
unlink($file);
}
$folders = $this->getFolders(['full' => true]);
$path = $this->path;
foreach ($folders as $folder) {
foreach($folders as $folder) {
$this->path = $folder;
$this->delete();
}
Expand All @@ -180,28 +180,31 @@ public function delete()
* @noTodo
* @unitTest
*/
public function copy($dest): bool
public function copy($dest, $mode = 0777): bool
{
$source=$this->path;
$source = $this->path;
if (!is_dir($source)) return false;
if(is_dir($source)) {
$dir_handle=opendir($source);
if(!file_exists($dest)){
mkdir($dest);
if (is_dir($source)) {
$dir_handle = opendir($source);
if (!file_exists($dest)) {
(new BcFolder($dest))->create();
chmod($dest, $mode);
}
while($file=readdir($dir_handle)){
if($file!="." && $file!=".."){
if(is_dir($source."/".$file)){
$this->path = $source .DS. $file;
self::copy( $dest .DS. $file);
while($file = readdir($dir_handle)) {
if ($file != "." && $file != "..") {
if (is_dir($source . "/" . $file)) {
$this->path = $source . DS . $file;
self::copy($dest . DS . $file);
} else {
copy($source."/".$file, $dest."/".$file);
copy($source . "/" . $file, $dest . "/" . $file);
chmod($dest . "/" . $file, $mode);
}
}
}
closedir($dir_handle);
} else {
copy($source, $dest);
chmod($dest, $mode);
}
return true;
}
Expand Down Expand Up @@ -249,8 +252,8 @@ public function chmod(?int $mode = null, bool $recursive = true, array $exceptio
if (is_dir($path)) {
$paths = $this->tree($path);

foreach ($paths as $type) {
foreach ($type as $fullpath) {
foreach($paths as $type) {
foreach($type as $fullpath) {
$check = explode(DIRECTORY_SEPARATOR, $fullpath);
$count = count($check);

Expand Down Expand Up @@ -321,7 +324,7 @@ public function tree(?string $path = null, $exceptions = false, ?string $type =
* @var string $itemPath
* @var RecursiveDirectoryIterator $fsIterator
*/
foreach ($iterator as $itemPath => $fsIterator) {
foreach($iterator as $itemPath => $fsIterator) {
if ($skipHidden) {
$subPathName = $fsIterator->getSubPathname();
if ($subPathName[0] === '.' || str_contains($subPathName, DIRECTORY_SEPARATOR . '.')) {
Expand Down
8 changes: 5 additions & 3 deletions plugins/baser-core/src/View/Helper/BcFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,18 +865,20 @@ public function file($fieldName, $options = []): string

// PHP5.3対応のため、is_string($value) 判別を実行
$delCheckTag = '';
if ($fileLinkTag && $linkOptions['delCheck'] && (is_string($value) || empty($value['session_key']))) {
if ($fileLinkTag && $linkOptions['delCheck'] && (is_string($value) ||
(is_array($value) && empty($value['session_key'])) ||
(is_object($value) && $value->getError() == UPLOAD_ERR_NO_FILE))) {
$delCheckTag = $this->Html->tag('span', $this->checkbox($fieldName . '_delete', $deleteCheckboxOptions) . $this->label($fieldName . '_delete', __d('baser_core', '削除する'), $deleteLabelOptions), $deleteSpanOptions);
}
$hiddenValue = $this->getSourceValue($fieldName . '_');
$fileValue = $this->getSourceValue($fieldName);

$hiddenTag = '';
if ($fileLinkTag) {
if (is_array($fileValue) && empty($fileValue['tmp_name']) && $hiddenValue) {
if (is_object($fileValue) && empty($fileValue->getClientFileName()) && $hiddenValue) {
$hiddenTag = $this->hidden($fieldName . '_', ['value' => $hiddenValue]);
} else {
if (is_array($fileValue)) {
if (is_array($fileValue) || is_object($fileValue)) {
$fileValue = null;
}
$hiddenTag = $this->hidden($fieldName . '_', ['value' => $fileValue]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ $(function () {
} else {
previewurl += '?url=' + fullUrl + '&preview=' + previewMode;
}
if (typeof $.bcCkeditor.editor['editor_detail_tmp'] !== undefined) {
$.bcCkeditor.editor['editor_detail_tmp'].execCommand('synchronize');
if (typeof $.bcCkeditor.editor.editor_contents_tmp !== "undefined") {
$.bcCkeditor.editor.editor_contents_tmp.execCommand('synchronize');
}
form.attr('target', 'preview');
form.attr('action', previewurl);
Expand All @@ -70,8 +70,8 @@ $(function () {
*/
$("#BtnSave").click(function () {
$.bcUtil.showLoader();
if (typeof $.bcCkeditor.editor['editor_detail_tmp'] !== undefined) {
$.bcCkeditor.editor['editor_detail_tmp'].execCommand('synchronize');
if (typeof $.bcCkeditor.editor.editor_contents_tmp !== "undefined") {
$.bcCkeditor.editor.editor_contents_tmp.execCommand('synchronize');
}
$("#BlogPostMode").val('save');
$.bcToken.check(function () {
Expand Down
3 changes: 2 additions & 1 deletion plugins/bc-admin-third/src/css/components/_section.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bca-section {
margin-bottom: 20px;
&__post-detail {
margin-bottom: 1.5em;
}
Expand Down Expand Up @@ -56,4 +57,4 @@
&[data-bca-section-type=form-group] {
margin-bottom: 60px;
}
}
}
Loading

0 comments on commit 862f66e

Please sign in to comment.