Ejemplo n.º 1
0
 public function doExecute()
 {
     JLoader::register('ModTeamspeak3Helper', JPATH_BASE . '/modules/mod_teamspeak3/helper.php');
     $db = JFactory::getDbo();
     $query = $db->getQuery(true)->select('m.params')->select('m.title')->from('#__modules AS m')->where('m.module = ' . $db->quote('mod_teamspeak3'))->where('m.published = ' . $db->quote(1));
     $db->setQuery($query);
     $results = $db->loadObjectList();
     if (empty($results)) {
         $this->out('no active teamspeak3 modules found');
         return;
     }
     foreach ($results as $row) {
         $module = new stdClass();
         $row->params = new JRegistry($row->params);
         $data = ModTeamspeak3Helper::getData($row->params, $module);
         if (is_string($data)) {
             $this->out($data);
         } else {
             $this->out($row->title . ' (' . $row->params->get('server_host') . ') successful');
         }
     }
 }
<?php

/**
 * @author     Branko Wilhelm <*****@*****.**>
 * @link       http://www.z-index.net
 * @copyright  (c) 2014 Branko Wilhelm
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die;
JLoader::register('ModTeamspeak3Helper', dirname(__FILE__) . '/helper.php');
$params->set('layout', $params->get('layout', 'viewer'));
$data = ModTeamspeak3Helper::getData($params, $module);
if (is_string($data)) {
    echo $data;
    return;
}
require JModuleHelper::getLayoutPath($module->module, $params->get('layout', 'viewer'));