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
13012857
Commit
13012857
authored
Nov 30, 2014
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugins are now sorted by plugin name rather than plugin directory name
parent
ead47f13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
admin-plugins.php
qa-include/pages/admin/admin-plugins.php
+21
-13
No files found.
qa-include/pages/admin/admin-plugins.php
View file @
13012857
...
...
@@ -99,24 +99,32 @@
else
$showpluginforms
=
true
;
if
(
count
(
$pluginfiles
))
{
if
(
!
empty
(
$pluginfiles
))
{
$metadataUtil
=
new
Q2A_Util_Metadata
();
foreach
(
$pluginfiles
as
$pluginindex
=>
$pluginfile
)
{
$plugindirectory
=
dirname
(
$pluginfile
)
.
'/'
;
$hash
=
qa_admin_plugin_directory_hash
(
$plugindirectory
);
$showthisform
=
$showpluginforms
&&
(
qa_get
(
'show'
)
==
$hash
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$plugindirectory
);
$sortedPluginFiles
=
array
();
foreach
(
$pluginfiles
as
$pluginFile
)
{
$pluginDirectory
=
dirname
(
$pluginFile
)
.
'/'
;
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$pluginDirectory
);
if
(
empty
(
$metadata
))
{
// limit plugin parsing to first 8kB
$contents
=
file_get_contents
(
$plugin
f
ile
,
false
,
NULL
,
-
1
,
8192
);
$contents
=
file_get_contents
(
$plugin
F
ile
,
false
,
NULL
,
-
1
,
8192
);
$metadata
=
qa_addon_metadata
(
$contents
,
'Plugin'
);
}
$metadata
[
'name'
]
=
isset
(
$metadata
[
'name'
])
&&
!
empty
(
$metadata
[
'name'
])
?
qa_html
(
$metadata
[
'name'
])
:
qa_lang_html
(
'admin/unnamed_plugin'
)
;
$sortedPluginFiles
[
$pluginFile
]
=
$metadata
;
}
qa_sort_by
(
$sortedPluginFiles
,
'name'
);
$pluginIndex
=
-
1
;
foreach
(
$sortedPluginFiles
as
$pluginFile
=>
$metadata
)
{
$pluginIndex
++
;
$plugindirectory
=
dirname
(
$pluginFile
.
'/'
);
$hash
=
qa_admin_plugin_directory_hash
(
$plugindirectory
);
$showthisform
=
$showpluginforms
&&
(
qa_get
(
'show'
)
==
$hash
);
if
(
isset
(
$metadata
[
'name'
])
&&
strlen
(
$metadata
[
'name'
]))
$namehtml
=
qa_html
(
$metadata
[
'name'
]);
else
$namehtml
=
qa_lang_html
(
'admin/unnamed_plugin'
);
$namehtml
=
$metadata
[
'name'
];
if
(
isset
(
$metadata
[
'uri'
])
&&
strlen
(
$metadata
[
'uri'
]))
$namehtml
=
'<a href="'
.
qa_html
(
$metadata
[
'uri'
])
.
'">'
.
$namehtml
.
'</a>'
;
...
...
@@ -172,7 +180,7 @@
$pluginhtml
=
'<strike style="color:#999">'
.
$pluginhtml
.
'</strike><br><span style="color:#f00">'
.
qa_lang_html_sub
(
'admin/requires_php_version'
,
qa_html
(
$metadata
[
'min_php'
]))
.
'</span>'
;
$qa_content
[
'form_plugin_'
.
$plugin
i
ndex
]
=
array
(
$qa_content
[
'form_plugin_'
.
$plugin
I
ndex
]
=
array
(
'tags'
=>
'id="'
.
qa_html
(
$hash
)
.
'"'
,
'style'
=>
'tall'
,
'fields'
=>
array
(
...
...
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