Esempio n. 1
0
if (!$user->authorize('com_users', 'manage')) {
    $app =& JFactory::getApplication();
    $app->redirect('index2.php', JText::_('ALERTNOTAUTH'));
}
// load language file
$lang =& JFactory::getLanguage();
if (file_exists(JPATH_COMPONENT . DS . 'language' . DS . $lang->getBackwardLang() . '.php')) {
    require_once JPATH_COMPONENT . DS . 'language' . DS . $lang->getBackwardLang() . '.php';
} else {
    //echo 'Language file [ '. $lang->getBackwardLang().' ] not found, using default language: english<br />';
    require_once JPATH_COMPONENT . DS . 'language' . DS . '/english.php';
}
// load settings from database
require_once JPATH_COMPONENT . DS . 'classes' . DS . 'JoomapConfig.php';
$config = new JoomapConfig();
if (!$config->load()) {
    $text = _JOOMAP_ERR_NO_SETTINGS . "<br />\n";
    $link = 'index2.php?option=com_joomap&task=create';
    echo sprintf($text, $link);
}
$cid = JRequest::getVar('cid', array(), '', 'array');
JArrayHelper::toInteger($cid, array());
$task = JRequest::getVar('task', '', '', 'string');
$admin = new JoomapAdmin();
$admin->show($config, $task, $cid);
class JoomapAdmin
{
    var $config = null;
    /** Parses input parameters and calls appropriate function */
    function show(&$config, &$task, &$cid)
    {
Esempio n. 2
0
 * The Joomap component frontend
 * @author Daniel Grothe
 * @see joomla.html.php
 * @see joomla.google.php
 * @package Joomap
 */
// load Joomap language file
$LangPath = $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_joomap/language/';
if (file_exists($LangPath . $GLOBALS['mosConfig_lang'] . '.php')) {
    require_once $LangPath . $GLOBALS['mosConfig_lang'] . '.php';
} else {
    require_once $LangPath . 'english.php';
}
require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_joomap/classes/JoomapConfig.php';
$config = new JoomapConfig();
$config->load();
require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_joomap/classes/JoomapPlugins.php';
JoomapPlugins::loadPlugins();
$joomap = new Joomap($config);
$tree = $joomap->generateTree();
//$joomap->printDebugTree( $tree );		// DEBUG output
$view = mosGetParam($_REQUEST, 'view', 'html');
switch ($view) {
    case 'google':
        // Google Sitemaps output
        require_once $GLOBALS['mosConfig_absolute_path'] . '/components/com_joomap/joomap.google.php';
        JoomapGoogle::printTree($joomap, $tree);
        break;
    default:
        // Html output
        global $mainframe;