예제 #1
0
global $xmapComponentURL, $xmapSiteURL, $xmapComponentPath, $xmapAdministratorURL, $xmapLang, $xmapAdministratorPath;
$lang =& JFactory::getLanguage();
$xmapLang = strtolower($lang->getBackwardLang());
$xmapComponentPath = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_xmap';
$xmapComponentURL = $live_site . '/administrator/components/com_xmap';
$xmapAdministratorPath = JPATH_ADMINISTRATOR;
$xmapAdministratorURL = $live_site . '/administrator';
$xmapSiteURL = $live_site;
// load language file
if (file_exists($xmapComponentPath . DS . 'language' . DS . $xmapLang . '.php')) {
    require_once $xmapComponentPath . DS . 'language' . DS . $xmapLang . '.php';
} else {
    if ($task != 'ajax_request') {
        echo 'Language file [ ' . $xmapLang . ' ] not found, using default language: english<br />';
    }
    $xmapLang = 'english';
    require_once $xmapComponentPath . DS . 'language' . DS . 'english.php';
}
require_once $xmapComponentPath . DS . 'classes' . DS . 'XmapAdmin.php';
JToolBarHelper::title('Xmap', 'generic');
// load settings from database
require_once $xmapComponentPath . DS . 'classes' . DS . 'XmapConfig.php';
require_once $xmapComponentPath . DS . 'admin.xmap.html.php';
$config = new XmapConfig();
if (!$config->load()) {
    $text = _XMAP_ERR_NO_SETTINGS . "<br />\n";
    $link = 'index2.php?option=com_xmap&task=create';
    echo sprintf($text, $link);
}
$admin = new XmapAdmin();
$admin->show($config, $task, $cid);
예제 #2
0
$lang =& JFactory::getLanguage();
$language = $lang->getBackwardLang();
$LangPath = JPATH_COMPONENT_ADMINISTRATOR . DS . 'language' . DS;
if (file_exists($LangPath . $language . '.php')) {
    require_once $LangPath . $language . '.php';
} else {
    require_once $LangPath . 'english.php';
}
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapConfig.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapSitemap.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapPlugins.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapCache.php';
$user =& JFactory::getUser();
global $xSitemap, $xConfig;
$xConfig = new XmapConfig();
$xConfig->load();
// This is an AJAX request to modify a item of the sitemap
if ($task == 'editElement') {
    if ($user->get('gid') != "25") {
        die('Invalid request!');
    }
    $sitemapid = JRequest::getInt('sitemap', 0);
    if ($sitemapid) {
        $sitemap = new XmapSitemap($database);
        if ($sitemap->load($sitemapid)) {
            $action = JRequest::getCmd('action', '');
            $uid = JRequest::getCmd('uid', '');
            $itemid = JRequest::getInt('itemid', '');
            switch ($action) {
                case 'toggleElement':
                    if ($uid && $itemid) {
예제 #3
0
$action = JRequest::getVar('action', '', "REQUEST");
$database =& JFactory::getDBO();
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapCache.php';
require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'classes' . DS . 'XmapPlugin.php';
header('Content-Type: text/xhtml; charset=' . _XMAP_CHARSET);
header("Cache-Control: no-cache, must-revalidate ");
switch ($action) {
    case 'add_sitemap':
        $sitemap = new XmapSitemap($database);
        $sitemap->save();
        XmapAdminHtml::showSitemapInfo($sitemap);
        break;
    case 'delete_sitemap':
        $id = intval(JRequest::getVar('sitemap', '', "REQUEST"));
        $config = new XmapConfig();
        $config->load();
        if (!$id || $id != JRequest::getVar('sitemap', '', "REQUEST")) {
            die("Invalid Sitemap ID");
        }
        if ($config->sitemap_default == $id) {
            echo _XMAP_ERROR_DELETE_DEFAULT;
            exit;
        }
        $sitemap = new XmapSitemap($database);
        $sitemap->load($id);
        if ($sitemap->remove()) {
            echo 1;
        } else {
            $database->getErrorMsg();
        }
        break;