Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
47943f19
Commit
47943f19
authored
Oct 24, 2005
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#35069
by leafish_paul: updated archive module to new forms API.
parent
c47d2fcb
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/archive.module
+13
-5
13 additions, 5 deletions
modules/archive.module
modules/archive/archive.module
+13
-5
13 additions, 5 deletions
modules/archive/archive.module
with
26 additions
and
10 deletions
modules/archive.module
+
13
−
5
View file @
47943f19
...
...
@@ -216,7 +216,6 @@ function archive_menu($may_cache) {
function
archive_page
(
$year
=
0
,
$month
=
0
,
$day
=
0
)
{
global
$user
;
$output
=
''
;
$op
=
$_POST
[
'op'
];
$edit
=
$_POST
[
'edit'
];
...
...
@@ -234,10 +233,12 @@ function archive_page($year = 0, $month = 0, $day = 0) {
$months
=
array
(
1
=>
t
(
'January'
),
2
=>
t
(
'February'
),
3
=>
t
(
'March'
),
4
=>
t
(
'April'
),
5
=>
t
(
'May'
),
6
=>
t
(
'June'
),
7
=>
t
(
'July'
),
8
=>
t
(
'August'
),
9
=>
t
(
'September'
),
10
=>
t
(
'October'
),
11
=>
t
(
'November'
),
12
=>
t
(
'December'
));
$days
=
drupal_map_assoc
(
range
(
0
,
31
));
$start
=
'<div class="container-inline">'
;
$start
.
=
form_select
(
''
,
'year'
,
(
$year
?
$year
:
date
(
'Y'
)),
$years
)
.
form_select
(
''
,
'month'
,
(
$month
?
$month
:
date
(
'm'
)),
$months
)
.
form_select
(
''
,
'day'
,
(
$day
?
$day
:
date
(
'd'
)),
$days
)
.
form_submit
(
t
(
'Show'
));
$start
.
=
'</div>'
;
$output
.
=
form
(
$start
);
$form
[
'year'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$year
?
$year
:
date
(
'Y'
)),
'#options'
=>
$years
);
$form
[
'month'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$month
?
$month
:
date
(
'm'
)),
'#options'
=>
$months
);
$form
[
'day'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$day
?
$day
:
date
(
'd'
)),
'#options'
=>
$days
);
$form
[
'show'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Show'
));
$output
=
drupal_get_form
(
'archive_dates'
,
$form
);
if
(
$year
&&
$month
&&
$day
)
{
// Fetch nodes for the selected date, if one was specified.
...
...
@@ -252,4 +253,11 @@ function archive_page($year = 0, $month = 0, $day = 0) {
return
$output
;
}
/**
* Form theme function; displays the archive date navigation form inline.
*/
function
theme_archive_dates
(
$form
)
{
$output
=
'<div class="container-inline">'
.
form_render
(
$form
)
.
'</div>'
;
return
$output
;
}
This diff is collapsed.
Click to expand it.
modules/archive/archive.module
+
13
−
5
View file @
47943f19
...
...
@@ -216,7 +216,6 @@ function archive_menu($may_cache) {
function
archive_page
(
$year
=
0
,
$month
=
0
,
$day
=
0
)
{
global
$user
;
$output
=
''
;
$op
=
$_POST
[
'op'
];
$edit
=
$_POST
[
'edit'
];
...
...
@@ -234,10 +233,12 @@ function archive_page($year = 0, $month = 0, $day = 0) {
$months
=
array
(
1
=>
t
(
'January'
),
2
=>
t
(
'February'
),
3
=>
t
(
'March'
),
4
=>
t
(
'April'
),
5
=>
t
(
'May'
),
6
=>
t
(
'June'
),
7
=>
t
(
'July'
),
8
=>
t
(
'August'
),
9
=>
t
(
'September'
),
10
=>
t
(
'October'
),
11
=>
t
(
'November'
),
12
=>
t
(
'December'
));
$days
=
drupal_map_assoc
(
range
(
0
,
31
));
$start
=
'<div class="container-inline">'
;
$start
.
=
form_select
(
''
,
'year'
,
(
$year
?
$year
:
date
(
'Y'
)),
$years
)
.
form_select
(
''
,
'month'
,
(
$month
?
$month
:
date
(
'm'
)),
$months
)
.
form_select
(
''
,
'day'
,
(
$day
?
$day
:
date
(
'd'
)),
$days
)
.
form_submit
(
t
(
'Show'
));
$start
.
=
'</div>'
;
$output
.
=
form
(
$start
);
$form
[
'year'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$year
?
$year
:
date
(
'Y'
)),
'#options'
=>
$years
);
$form
[
'month'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$month
?
$month
:
date
(
'm'
)),
'#options'
=>
$months
);
$form
[
'day'
]
=
array
(
'#type'
=>
'select'
,
'#default_value'
=>
(
$day
?
$day
:
date
(
'd'
)),
'#options'
=>
$days
);
$form
[
'show'
]
=
array
(
'#type'
=>
'submit'
,
'#value'
=>
t
(
'Show'
));
$output
=
drupal_get_form
(
'archive_dates'
,
$form
);
if
(
$year
&&
$month
&&
$day
)
{
// Fetch nodes for the selected date, if one was specified.
...
...
@@ -252,4 +253,11 @@ function archive_page($year = 0, $month = 0, $day = 0) {
return
$output
;
}
/**
* Form theme function; displays the archive date navigation form inline.
*/
function
theme_archive_dates
(
$form
)
{
$output
=
'<div class="container-inline">'
.
form_render
(
$form
)
.
'</div>'
;
return
$output
;
}
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