Peciura wrote:
Sonya: I would appreciate your help.
I
guess i will need a half of ModuleManager
in one UDT. It should take one letter (e.g. "e") and return an array:
No, just a little UDT
Attenition! It works only if you set the column
admin_only in the table
cms_modules for the module nuSOAP to 0.
Then create a new UDT
soap_grab with this content:
Code: Select all
global $gCms, $CMS_VERSION;
$nusoap =& CMSModule::GetModuleInstance('nuSOAP');
$nusoap->Load();
$url = 'http://modules.cmsmadesimple.org/soap.php?module=ModuleRepository';
$nu_soapclient =& new nu_soapclient($url,false,false,false,false,false,90,90);
if (!isset($params['letter'])) {
$qparms['prefix'] = 'A';
} else {
$qparms['prefix'] = $params['letter'];
}
$qparms['newest'] = 1;
$qparms['clientcmsversion'] = $CMS_VERSION;
$allmoduledetails = $nu_soapclient->call('ModuleRepository.soap_moduledetailsgetall',$qparms);
print '<pre>';
print_r($allmoduledetails);
print '</pre>';
Use the UDT in the content page and it prints out all modules starting with letter "A" from the repository this way:
Code: Select all
[0] => Array
(
[name] => ABFlashGallery
[filename] => ABFlashGallery-0.2.xml
[md5sum] => f2871d3cc07f15f133d85456fabf3dad
[version] => 0.2
[mincmsversion] => 1.0
[description] => Creer des galleries flash sympa a inserer dans votre site.
[date] => 2009-06-22 13:43:59
[size] => 121575
)
[1] => Array
(
[name] => AjaxMadeSimple
[filename] => AjaxMadeSimple-0.1.6.xml
[md5sum] => 9a37bc2f70db9e20d7a48f8014e225e4
[version] => 0.1.6
[mincmsversion] => 1.1
[description] => Et udvikler-orienteret modul der tillade nem adgang til Ajax-funktionality i andre moduler
[date] => 2009-06-22 13:43:59
[size] => 230294
)
The UDT accepts the parameter
letter for the first letter of the module, e. g. {soap_grab letter='S'} would print all the modules starting with the letter S.
Additionaly, there is following information that can be grabbed as well:
Module Help
Module Dependencies
Module About section
Add to the UDT the output as shown below:
Code: Select all
foreach ($allmoduledetails as $key => $module) {
echo '<h1>'.$module['name'].' - '.$module['version'].'</h1>';
$depends = $nu_soapclient->call('ModuleRepository.soap_moduledepends',array('name' => $module['filename'] ));
$help = $nu_soapclient->call('ModuleRepository.soap_modulehelp',array('name' => $module['filename'] ));
$about = $nu_soapclient->call('ModuleRepository.soap_moduleabout',array('name' => $module['filename'] ));
if (is_array($depends[1])) {
foreach ($depends[1] as $key => $mod) {
echo $mod['name'].' ('.$mod['version'].') ,';
}
} else {
echo ' No dependencies';
}
echo '<hr />';
echo $help[1];
echo '<hr />';
echo $about[1];
}