Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Camo Image Proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
WP Plugins
Camo Image Proxy
Merge requests
!9
WIP: Capture PHPUnit reports
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
WIP: Capture PHPUnit reports
add/junit
into
master
Overview
1
Commits
9
Pipelines
4
Changes
13
Closed
Erick Hitter
requested to merge
add/junit
into
master
6 years ago
Overview
1
Commits
9
Pipelines
4
Changes
13
Expand
Depends on GitLab 11.2.
Fixes
#3
0
0
Merge request reports
Compare
master
version 2
bb4f46bc
6 years ago
version 1
3cc44bb1
6 years ago
master (base)
and
latest version
latest version
bb4f46bc
9 commits,
5 years ago
version 2
bb4f46bc
2 commits,
6 years ago
version 1
3cc44bb1
1 commit,
6 years ago
13 files
+
40
−
510
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
13
Search (e.g. *.vue) (Ctrl+P)
inc/class-options-page.php deleted
100644 → 0
+
0
−
86
Options
<?php
/**
* Plugin options page
*
* @package Camo_Image_Proxy
*/
namespace
Camo_Image_Proxy
;
/**
* Class Options_Page
*/
class
Options_Page
{
use
Singleton
;
/**
* Settings screen section
*
* @var string
*/
private
$section
=
'camp-image-proxy'
;
/**
* Field labels
*
* @var array
*/
private
$labels
=
[];
/**
* Option name
*
* @var string
*/
private
$name
;
/**
* Hooks
*/
public
function
setup
()
{
$this
->
name
=
Options
::
instance
()
->
name
;
$this
->
labels
[
'host'
]
=
__
(
'Host'
,
'camo-image-proxy'
);
$this
->
labels
[
'key'
]
=
__
(
'Shared Key'
,
'camo-image-proxy'
);
add_action
(
'admin_init'
,
[
$this
,
'action_admin_init'
]
);
}
/**
* Add fields to Media settings page
*/
public
function
action_admin_init
()
{
register_setting
(
'media'
,
$this
->
name
,
[
Options
::
instance
(),
'sanitize_all'
]
);
add_settings_section
(
$this
->
section
,
__
(
'Camo Image Proxy'
,
'camo-image-proxy'
),
'__return_false'
,
'media'
);
foreach
(
$this
->
labels
as
$key
=>
$label
)
{
$args
=
[
'option'
=>
$key
,
'label'
=>
$label
,
];
add_settings_field
(
$key
,
$label
,
[
$this
,
'screen'
],
'media'
,
$this
->
section
,
$args
);
}
}
/**
* Render options field
*
* @param array $args Field arguments.
*/
public
function
screen
(
$args
)
{
$value
=
Options
::
instance
()
->
get
(
$args
[
'option'
]
);
$input_type
=
'host'
===
$args
[
'option'
]
?
'url'
:
'text'
;
$name
=
sprintf
(
'%1$s[%2$s]'
,
$this
->
name
,
$args
[
'option'
]
);
$html_id
=
sprintf
(
'%1$s-%2$s'
,
str_replace
(
'_'
,
'-'
,
$this
->
name
),
$args
[
'option'
]
);
?>
<input
type=
"
<?php
echo
esc_attr
(
$input_type
);
?>
"
name=
"
<?php
echo
esc_attr
(
$name
);
?>
"
class=
"regular-text"
id=
"
<?php
echo
esc_attr
(
$html_id
);
?>
"
value=
"
<?php
echo
esc_attr
(
$value
);
?>
"
/>
<?php
}
}
Loading