Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alg
Knowledge Space WP Plugin
Commits
c66db032
Commit
c66db032
authored
3 years ago
by
Maximilian Giller
Browse files
Options
Downloads
Patches
Plain Diff
Hardcoded default empty space
parent
882a7022
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#50712
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
datasets/datasets.php
+4
-5
4 additions, 5 deletions
datasets/datasets.php
datasets/empty-space.json
+0
-1
0 additions, 1 deletion
datasets/empty-space.json
with
4 additions
and
6 deletions
datasets/datasets.php
+
4
−
5
View file @
c66db032
<?php
<?php
$EMPTY_SPACE
_FILE
=
__DIR__
.
"/empty-space.json"
;
$EMPTY_SPACE
=
'{"links":[],"nodes":[]}'
;
$SPACES_DIR
=
__DIR__
.
"/spaces/"
;
$SPACES_DIR
=
__DIR__
.
"/spaces/"
;
add_action
(
"wp_ajax_get_space"
,
"kg_get_space"
);
// Fires only for logged-in-users
add_action
(
"wp_ajax_get_space"
,
"kg_get_space"
);
// Fires only for logged-in-users
...
@@ -91,10 +91,9 @@ function kg_create_empty_space($file_path) {
...
@@ -91,10 +91,9 @@ function kg_create_empty_space($file_path) {
return
;
return
;
}
}
// Read and copy default empty graph from default file
// Write empty space to file
global
$EMPTY_SPACE_FILE
;
global
$EMPTY_SPACE
;
$empty_graph
=
file_get_contents
(
$EMPTY_SPACE_FILE
);
file_put_contents
(
$file_path
,
$EMPTY_SPACE
);
file_put_contents
(
$file_path
,
$empty_graph
);
}
}
function
endsWith
(
$haystack
,
$needle
)
{
function
endsWith
(
$haystack
,
$needle
)
{
...
...
This diff is collapsed.
Click to expand it.
datasets/empty-space.json
deleted
100644 → 0
+
0
−
1
View file @
882a7022
{
"links"
:[],
"nodes"
:[]}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment