Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
drupal.org
feeds
Commits
18392cb3
Commit
18392cb3
authored
15 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
Move plugins form into feeds class.
parent
63b6227c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
feeds_ui/feeds_ui.admin.inc
+1
-30
1 addition, 30 deletions
feeds_ui/feeds_ui.admin.inc
includes/feed.inc
+30
-0
30 additions, 0 deletions
includes/feed.inc
with
31 additions
and
30 deletions
feeds_ui/feeds_ui.admin.inc
+
1
−
30
View file @
18392cb3
...
...
@@ -170,40 +170,11 @@ function feeds_ui_build_mapping_form(&$form_state, $feed) {
*/
function
feeds_ui_build_plugin_form
(
&
$form_state
,
$feed
)
{
$form
=
array
();
$plugins
=
feeds_get_plugins
();
$form
[
'plugins'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Plugins'
),
);
$form
[
'plugins'
][
'fetcher'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Fetcher'
),
'#options'
=>
$plugins
[
'fetcher'
],
'#description'
=>
t
(
'Select a fetcher for this configuration.'
),
'#default_value'
=>
empty
(
$feed
)
?
key
(
$plugins
[
'fetcher'
])
:
get_class
(
$feed
->
fetcher
),
);
$form
[
'plugins'
][
'parser'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Parser'
),
'#options'
=>
$plugins
[
'parser'
],
'#description'
=>
t
(
'Select a parser for this configuration.'
),
'#default_value'
=>
empty
(
$feed
)
?
key
(
$plugins
[
'parser'
])
:
get_class
(
$feed
->
parser
),
);
if
(
empty
(
$feed
))
{
$default
=
array
(
key
(
$plugins
[
'processor'
]));
}
else
{
foreach
(
$feed
->
processors
as
$processor
)
{
$default
[
get_class
(
$processor
)]
=
get_class
(
$processor
);
}
}
$form
[
'plugins'
][
'processors'
]
=
array
(
'#type'
=>
'checkboxes'
,
'#title'
=>
t
(
'Processors'
),
'#options'
=>
$plugins
[
'processor'
],
'#description'
=>
t
(
'Select processors for this configuration.'
),
'#default_value'
=>
$default
,
);
$form
[
'plugins'
]
+=
$feed
->
pluginsForm
(
$form_state
);
$form
[
'submit'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Save'
),
...
...
This diff is collapsed.
Click to expand it.
includes/feed.inc
+
30
−
0
View file @
18392cb3
...
...
@@ -80,6 +80,36 @@ class Feed extends FeedsConfigurable {
return
$form
;
}
/**
* Feed class specific plugin form.
*/
public
function
pluginsForm
(
&
$form_state
)
{
$form
=
array
();
$plugins
=
feeds_get_plugins
();
$form
[
'fetcher'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Fetcher'
),
'#options'
=>
$plugins
[
'fetcher'
],
'#description'
=>
t
(
'Select a fetcher for this configuration.'
),
'#default_value'
=>
$this
->
config
[
'fetcher'
],
);
$form
[
'parser'
]
=
array
(
'#type'
=>
'radios'
,
'#title'
=>
t
(
'Parser'
),
'#options'
=>
$plugins
[
'parser'
],
'#description'
=>
t
(
'Select a parser for this configuration.'
),
'#default_value'
=>
$this
->
config
[
'parser'
],
);
$form
[
'processors'
]
=
array
(
'#type'
=>
'checkboxes'
,
'#title'
=>
t
(
'Processors'
),
'#options'
=>
$plugins
[
'processor'
],
'#description'
=>
t
(
'Select processors for this configuration.'
),
'#default_value'
=>
$this
->
config
[
'processors'
],
);
return
$form
;
}
/**
* Import feed by using configured fetchers, parsers, processors.
*/
...
...
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