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
968ea5cc
Commit
968ea5cc
authored
Feb 17, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename qa_list_all_registered_modules_info() to qa_list_modules_info()
parent
39b13f70
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
27 deletions
+14
-27
qa-app-options.php
qa-include/qa-app-options.php
+1
-2
qa-base.php
qa-include/qa-base.php
+13
-25
No files found.
qa-include/qa-app-options.php
View file @
968ea5cc
...
...
@@ -491,10 +491,9 @@
foreach
(
$modules
as
$module
)
{
$value
=
$module
->
option_default
(
$name
);
if
(
strlen
(
$value
))
{
if
(
strlen
(
$value
))
return
$value
;
}
}
$value
=
''
;
break
;
...
...
qa-include/qa-base.php
View file @
968ea5cc
...
...
@@ -612,13 +612,12 @@
// Functions for listing, loading and getting info on modules
function
qa_list_
all_registered_
modules_info
()
function
qa_list_modules_info
()
/*
Return an array with all registered modules' information
*/
{
global
$qa_modules
;
return
$qa_modules
;
}
...
...
@@ -627,38 +626,27 @@
Return an array of all the module types for which at least one module has been registered
*/
{
return
array_keys
(
qa_list_all_registered_modules_info
());
}
function
qa_list_module_types
()
/*
Return an array of all the module types for which at least one module has been registered
*/
{
return
array_keys
(
qa_list_all_registered_modules_info
());
return
array_keys
(
qa_list_modules_info
());
}
function
qa_list_modules
(
$type
)
/*
Return a list of names of registered modules of $type
*/
{
$modules
=
qa_list_
all_registered_
modules_info
();
$modules
=
qa_list_modules_info
();
return
is_array
(
@
$modules
[
$type
])
?
array_keys
(
$modules
[
$type
])
:
array
();
}
function
qa_get_module_info
(
$type
,
$name
)
/*
Return an array containing information about the module of $type named $name
*/
{
$modules
=
qa_list_
all_registered_
modules_info
();
$modules
=
qa_list_modules_info
();
return
@
$modules
[
$type
][
$name
];
}
function
qa_load_module
(
$type
,
$name
)
/*
Return an instantiated class for module of $type named $name, whose functions can be called, or null if it doesn't exist
...
...
@@ -666,7 +654,7 @@
{
global
$qa_modules
;
$module
=
@
$qa_modules
[
$type
][
$name
];
$module
=
@
$qa_modules
[
$type
][
$name
];
if
(
is_array
(
$module
))
{
if
(
isset
(
$module
[
'object'
]))
...
...
@@ -676,12 +664,12 @@
require_once
$module
[
'directory'
]
.
$module
[
'include'
];
if
(
strlen
(
@
$module
[
'class'
]))
{
$object
=
new
$module
[
'class'
];
$object
=
new
$module
[
'class'
];
if
(
method_exists
(
$object
,
'load_module'
))
$object
->
load_module
(
$module
[
'directory'
],
qa_path_to_root
()
.
$module
[
'urltoroot'
],
$type
,
$name
);
$qa_modules
[
$type
][
$name
][
'object'
]
=
$object
;
$qa_modules
[
$type
][
$name
][
'object'
]
=
$object
;
return
$object
;
}
}
...
...
@@ -697,9 +685,9 @@
{
$modules
=
array
();
$reg
isteredmodules
=
qa_list_all_registered
_modules_info
();
$reg
modules
=
qa_list
_modules_info
();
foreach
(
$reg
istered
modules
as
$moduletype
=>
$modulesinfo
)
{
foreach
(
$regmodules
as
$moduletype
=>
$modulesinfo
)
{
foreach
(
$modulesinfo
as
$modulename
=>
$moduleinfo
)
{
$module
=
qa_load_module
(
$moduletype
,
$modulename
);
...
...
@@ -717,15 +705,15 @@
(other modules of that type are also loaded but not included in the returned array)
*/
{
$modules
=
array
();
$modules
=
array
();
$trynames
=
qa_list_modules
(
$type
);
$trynames
=
qa_list_modules
(
$type
);
foreach
(
$trynames
as
$tryname
)
{
$module
=
qa_load_module
(
$type
,
$tryname
);
$module
=
qa_load_module
(
$type
,
$tryname
);
if
(
method_exists
(
$module
,
$method
))
$modules
[
$tryname
]
=
$module
;
$modules
[
$tryname
]
=
$module
;
}
return
$modules
;
...
...
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