Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Photon-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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
Photon-Plugin
Commits
20b836bf
Commit
20b836bf
authored
14 years ago
by
Chris Scott
Browse files
Options
Downloads
Patches
Plain Diff
add admin notice if plugin isn't configured with required info.
parent
f9344bf1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cloudfiles-cdn.php
+11
-7
11 additions, 7 deletions
cloudfiles-cdn.php
with
11 additions
and
7 deletions
cloudfiles-cdn.php
+
11
−
7
View file @
20b836bf
...
@@ -24,8 +24,8 @@ class CloudfilesCdn {
...
@@ -24,8 +24,8 @@ class CloudfilesCdn {
add_action
(
'admin_menu'
,
array
(
$this
,
'add_options_page'
));
add_action
(
'admin_menu'
,
array
(
$this
,
'add_options_page'
));
if
(
!
self
::
get_setting
(
'username'
)
||
!
self
::
get_setting
(
'api_key'
)
||
!
self
::
get_setting
(
'container'
)
||
!
self
::
get_setting
(
'root_url'
))
{
if
(
!
self
::
get_setting
(
'username'
)
||
!
self
::
get_setting
(
'api_key'
)
||
!
self
::
get_setting
(
'container'
)
||
!
self
::
get_setting
(
'root_url'
)
||
!
self
::
get_setting
(
'file_extensions'
)
)
{
// these are the minimum required settings. should add an admin notice later...
add_action
(
'admin_notices'
,
array
(
'CloudfilesCdn'
,
'settings_warning'
));
return
;
return
;
}
}
...
@@ -37,6 +37,10 @@ class CloudfilesCdn {
...
@@ -37,6 +37,10 @@ class CloudfilesCdn {
}
}
public
static
function
settings_warning
()
{
echo
"<div class='update-nag'>The Cloudfiles CDN plugin is missing some required settings.</div>"
;
}
/**
/**
* get general setting
* get general setting
*
*
...
@@ -58,11 +62,11 @@ class CloudfilesCdn {
...
@@ -58,11 +62,11 @@ class CloudfilesCdn {
$settings
=
new
Voce_Settings
(
self
::
$option_general
,
self
::
$option_general
);
$settings
=
new
Voce_Settings
(
self
::
$option_general
,
self
::
$option_general
);
$section
=
$settings
->
add_section
(
'api'
,
'Cloudfiles API Settings'
,
$this
->
submenu_general
);
$section
=
$settings
->
add_section
(
'api'
,
'Cloudfiles API Settings'
,
$this
->
submenu_general
);
$section
->
add_field
(
'username'
,
'Username'
,
'field_input'
);
$section
->
add_field
(
'username'
,
'Username
(required)
'
,
'field_input'
);
$section
->
add_field
(
'api_key'
,
'API Key'
,
'field_input'
);
$section
->
add_field
(
'api_key'
,
'API Key
(required)
'
,
'field_input'
);
$section
->
add_field
(
'container'
,
'Container Name'
,
'field_input'
,
array
(
'description'
=>
'The container to store files in.'
));
$section
->
add_field
(
'container'
,
'Container Name
(required)
'
,
'field_input'
,
array
(
'description'
=>
'The container to store files in.'
));
$section
->
add_field
(
'root_url'
,
'Root URL'
,
'field_input'
,
array
(
'description'
=>
'The root URL to the container without a trailing slash.'
));
$section
->
add_field
(
'root_url'
,
'Root URL
(required)
'
,
'field_input'
,
array
(
'description'
=>
'The root URL to the container without a trailing slash.'
));
$section
->
add_field
(
'file_extensions'
,
'File Extensions'
,
'field_input'
);
$section
->
add_field
(
'file_extensions'
,
'File Extensions
(required)
'
,
'field_input'
);
$section
->
add_field
(
'enable_debug'
,
'Enable Debugging?'
,
'field_checkbox'
,
array
(
'description'
=>
'Enable error_log() to log upload/delete actions.'
));
$section
->
add_field
(
'enable_debug'
,
'Enable Debugging?'
,
'field_checkbox'
,
array
(
'description'
=>
'Enable error_log() to log upload/delete actions.'
));
}
}
...
...
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