Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
782302f8
Commit
782302f8
authored
Nov 29, 2014
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Themes are now sorted by theme name fetched from metadata rather than directory name
parent
612a817f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
admin.php
qa-include/app/admin.php
+14
-15
No files found.
qa-include/app/admin.php
View file @
782302f8
...
@@ -137,26 +137,25 @@
...
@@ -137,26 +137,25 @@
}
}
function
qa_admin_theme_options
()
/**
/*
* Return a sorted array of available themes, [theme name] => [theme name]
Return a sorted array of available themes, [theme name] => [theme name]
*/
*/
function
qa_admin_theme_options
()
{
{
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$options
=
array
();
$metadataUtil
=
new
Q2A_Util_Metadata
();
foreach
(
glob
(
QA_THEME_DIR
.
'*'
,
GLOB_NOSORT
|
GLOB_MARK
)
as
$directory
)
{
$directory
=@
opendir
(
QA_THEME_DIR
);
$theme
=
basename
(
$directory
);
if
(
is_resource
(
$directory
))
{
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$directory
);
while
((
$theme
=
readdir
(
$directory
))
!==
false
)
if
(
empty
(
$metadata
))
{
if
(
(
substr
(
$theme
,
0
,
1
)
!=
'.'
)
&&
file_exists
(
QA_THEME_DIR
.
$theme
.
'/qa-styles.css'
)
)
// limit theme parsing to first 8kB
$options
[
$theme
]
=
$theme
;
$contents
=
file_get_contents
(
$directory
.
'/qa-styles.css'
,
false
,
NULL
,
-
1
,
8192
);
$metadata
=
qa_addon_metadata
(
$contents
,
'Theme'
);
closedir
(
$directory
);
}
$options
[
$theme
]
=
isset
(
$metadata
[
'name'
])
?
$metadata
[
'name'
]
:
$theme
;
}
}
asort
(
$options
,
SORT_STRING
);
asort
(
$options
,
SORT_STRING
);
return
$options
;
return
$options
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment