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
89b717fa
Commit
89b717fa
authored
Dec 01, 2014
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes and improvements to the new metadata system
parent
13012857
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
Metadata.php
qa-include/Q2A/Util/Metadata.php
+1
-1
admin.php
qa-include/app/admin.php
+2
-3
admin-default.php
qa-include/pages/admin/admin-default.php
+2
-2
admin-plugins.php
qa-include/pages/admin/admin-plugins.php
+2
-3
qa-base.php
qa-include/qa-base.php
+6
-4
metadata.json
qa-plugin/basic-adsense/metadata.json
+1
-1
metadata.json
qa-theme/SnowFlat/metadata.json
+1
-1
No files found.
qa-include/Q2A/Util/Metadata.php
View file @
89b717fa
...
...
@@ -44,7 +44,7 @@ class Q2A_Util_Metadata
*/
public
function
fetchFromAddonPath
(
$path
)
{
$metadataFile
=
$path
.
self
::
METADATA_FILE_JSON
;
$metadataFile
=
$path
.
'/'
.
self
::
METADATA_FILE_JSON
;
if
(
is_file
(
$metadataFile
))
{
$content
=
file_get_contents
(
$metadataFile
);
return
$this
->
getArrayFromJson
(
$content
);
...
...
qa-include/app/admin.php
View file @
89b717fa
...
...
@@ -121,7 +121,7 @@
// find all language folders
$metadataUtil
=
new
Q2A_Util_Metadata
();
foreach
(
glob
(
QA_LANG_DIR
.
'*'
,
GLOB_NOSORT
|
GLOB_MARK
)
as
$directory
)
{
foreach
(
glob
(
QA_LANG_DIR
.
'*'
,
GLOB_NOSORT
|
GLOB_ONLYDIR
)
as
$directory
)
{
$code
=
basename
(
$directory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$directory
);
if
(
isset
(
$metadata
[
'display_name'
]))
...
...
@@ -132,7 +132,6 @@
}
asort
(
$options
,
SORT_STRING
);
return
$options
;
}
...
...
@@ -144,7 +143,7 @@
if
(
qa_to_override
(
__FUNCTION__
))
{
$args
=
func_get_args
();
return
qa_call_override
(
__FUNCTION__
,
$args
);
}
$metadataUtil
=
new
Q2A_Util_Metadata
();
foreach
(
glob
(
QA_THEME_DIR
.
'*'
,
GLOB_NOSORT
|
GLOB_
MARK
)
as
$directory
)
{
foreach
(
glob
(
QA_THEME_DIR
.
'*'
,
GLOB_NOSORT
|
GLOB_
ONLYDIR
)
as
$directory
)
{
$theme
=
basename
(
$directory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$directory
);
if
(
empty
(
$metadata
))
{
...
...
qa-include/pages/admin/admin-default.php
View file @
89b717fa
...
...
@@ -1007,11 +1007,11 @@
qa_optionfield_make_select
(
$optionfield
,
$themeoptions
,
$value
,
'Classic'
);
$metadataUtil
=
new
Q2A_Util_Metadata
();
$themedirectory
=
QA_THEME_DIR
.
$value
.
'/'
;
$themedirectory
=
QA_THEME_DIR
.
$value
;
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$themedirectory
);
if
(
empty
(
$metadata
))
{
// limit theme parsing to first 8kB
$contents
=
file_get_contents
(
$themedirectory
.
'qa-styles.css'
,
false
,
NULL
,
-
1
,
8192
);
$contents
=
file_get_contents
(
$themedirectory
.
'
/
qa-styles.css'
,
false
,
NULL
,
-
1
,
8192
);
$metadata
=
qa_addon_metadata
(
$contents
,
'Theme'
);
}
...
...
qa-include/pages/admin/admin-plugins.php
View file @
89b717fa
...
...
@@ -103,8 +103,7 @@
$metadataUtil
=
new
Q2A_Util_Metadata
();
$sortedPluginFiles
=
array
();
foreach
(
$pluginfiles
as
$pluginFile
)
{
$pluginDirectory
=
dirname
(
$pluginFile
)
.
'/'
;
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$pluginDirectory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
dirname
(
$pluginFile
));
if
(
empty
(
$metadata
))
{
// limit plugin parsing to first 8kB
$contents
=
file_get_contents
(
$pluginFile
,
false
,
NULL
,
-
1
,
8192
);
...
...
@@ -120,7 +119,7 @@
$pluginIndex
=
-
1
;
foreach
(
$sortedPluginFiles
as
$pluginFile
=>
$metadata
)
{
$pluginIndex
++
;
$plugindirectory
=
dirname
(
$pluginFile
.
'/'
)
;
$plugindirectory
=
dirname
(
$pluginFile
)
.
'/'
;
$hash
=
qa_admin_plugin_directory_hash
(
$plugindirectory
);
$showthisform
=
$showpluginforms
&&
(
qa_get
(
'show'
)
==
$hash
);
...
...
qa-include/qa-base.php
View file @
89b717fa
...
...
@@ -338,11 +338,9 @@
$metadataUtil
=
new
Q2A_Util_Metadata
();
foreach
(
$pluginfiles
as
$pluginfile
)
{
// these variables are utilized in the qa_register_plugin_* functions
$qa_plugin_directory
=
dirname
(
$pluginfile
)
.
'/'
;
$qa_plugin_urltoroot
=
substr
(
$qa_plugin_directory
,
strlen
(
QA_BASE_DIR
));
$pluginDirectory
=
dirname
(
$pluginfile
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$
qa_plugin_d
irectory
);
$metadata
=
$metadataUtil
->
fetchFromAddonPath
(
$
pluginD
irectory
);
if
(
empty
(
$metadata
))
{
// limit plugin parsing to first 8kB
$contents
=
file_get_contents
(
$pluginfile
,
false
,
NULL
,
-
1
,
8192
);
...
...
@@ -356,6 +354,10 @@
if
(
isset
(
$metadata
[
'min_php'
])
&&
qa_php_version_below
(
$metadata
[
'min_php'
]))
continue
;
// these variables are utilized in the qa_register_plugin_* functions
$qa_plugin_directory
=
$pluginDirectory
.
'/'
;
$qa_plugin_urltoroot
=
substr
(
$qa_plugin_directory
,
strlen
(
QA_BASE_DIR
));
require_once
$pluginfile
;
}
...
...
qa-plugin/basic-adsense/metadata.json
View file @
89b717fa
...
...
@@ -7,7 +7,7 @@
"author"
:
"Question2Answer"
,
"author_uri"
:
"http://www.question2answer.org"
,
"license"
:
"GPLv2"
,
"update"
:
"
http://localhost/webs/q2a-dev/qa-plugin/basic-adsense/metadata_1.json
"
,
"update"
:
""
,
"min_q2a"
:
"1.4"
,
"min_php"
:
""
}
qa-theme/SnowFlat/metadata.json
View file @
89b717fa
{
"name"
:
"Snow
Flat"
,
"name"
:
"SnowFlat"
,
"uri"
:
""
,
"description"
:
"ShowFlat responsive theme with RTL support"
,
"version"
:
"1.4"
,
...
...
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