Beispiel #1
0
 /** Show settings dialog
  * @param integer  configuration save success
  */
 function showSettingsDialog($success = 0)
 {
     global $mainframe;
     $database =& JFactory::getDBO();
     $menus = $this->getMenus();
     # $this->sortMenus( $menus );
     $config =& $this->config;
     // success messages
     switch ($success) {
         case 1:
             $lists['msg_success'] = _XMAP_MSG_SET_BACKEDUP;
             break;
         case 2:
             $lists['msg_success'] = _XMAP_ERR_CONF_SAVE;
             break;
         default:
             $lists['msg_success'] = '';
             break;
     }
     $pluginList = '';
     $xmlfile = '';
     loadInstalledPlugins($pluginList, $xmlfile);
     require_once $mainframe->getPath('admin_html');
     XmapAdminHtml::show($config, $menus, $lists, $pluginList, $xmlfile);
 }
    function showInstallForm($title, $p_startdir)
    {
        ?>
		<table class="content">
<?php 
        XmapAdminHtml::writableCell('/administrator/components/com_xmap/extensions');
        ?>
		</table>
		<div style="margin: 10px 0px; padding: 5px 15px 5px 35px; min-height: 25px; border: 1px solid #cc0000; background: #ffffcc; text-align: left; color: red; font-weight: bold; background-image: url(../includes/js/ThemeOffice/warning.png); background-repeat: no-repeat; background-position: 10px 50%;">
			<?php 
        echo _XMAP_INSTALL_3PD_WARN;
        ?>
		</div>
		<script language="javascript" type="text/javascript">
		function submitbutton3(pressbutton) {
			var form = document.adminForm_dir;

			// do field validation
			if (form.install_directory.value == ""){
				alert( "<?php 
        echo str_replace('"', '\\"', _XMAP_MSG_SELECT_FOLDER);
        ?>
" );
			} else {
				form.submit();
			}
		}
		</script>
		<form enctype="multipart/form-data" action="index2.php" method="post" name="filename">
		<table class="adminheading">
		<tr>
			<th class="install">
			<?php 
        echo $title;
        ?>
			</th>
		</tr>
		</table>

		<table class="adminform">
		<tr>
			<th>
			<?php 
        echo _XMAP_UPLOAD_PKG_FILE;
        ?>
			</th>
		</tr>
		<tr>
			<td align="left">
			Package File:
			<input class="text_area" name="install_package" type="file" size="40"/>
			<input class="button" type="submit" value="<?php 
        echo _XMAP_UPLOAD_AND_INSTALL;
        ?>
" />
			</td>
		</tr>
		</table>

		<input type="hidden" name="task" value="uploadfile" />
		<input type="hidden" name="installtype" value="upload" />
		<input type="hidden" name="option" value="com_xmap" />
		</form>
		<br />

		<form enctype="multipart/form-data" action="index2.php" method="post" name="adminForm_dir">
		<table class="adminform">
		<tr>
			<th>
			<?php 
        echo _XMAP_INSTALL_F_DIRECTORY;
        ?>
			</th>
		</tr>
		<tr>
			<td align="left">
			<?php 
        echo _XMAP_INSTALL_DIRECTORY;
        ?>
:&nbsp;
			<input type="text" name="install_directory" class="text_area" size="60" value="<?php 
        echo $p_startdir;
        ?>
"/>&nbsp;
			<input type="button" class="button" value="<?php 
        echo _XMAP_INSTALL;
        ?>
" onclick="submitbutton3()" />
			</td>
		</tr>
		</table>

		<input type="hidden" name="task" value="installfromdir" />
		<input type="hidden" name="installtype" value="folder" />
		<input type="hidden" name="option" value="com_xmap"/>
		</form>
		<?php 
    }
Beispiel #3
0
            # Clean the cache of the sitemap
            $sitemap->setMenus($menus);
            if ($sitemap->save()) {
                if ($sitemap->usecache) {
                    XmapCache::cleanCache($sitemap);
                }
                echo 1;
            } else {
                echo $database->getErrorMsg();
            }
        }
        break;
    case 'uninstallplugin':
        $id = intval(JRequest::getVar('plugin', '', "REQUEST"));
        if ($id != JRequest::getVar('plugin', '', "REQUEST")) {
            //Security Check!
            die('Cannot load plugin');
        }
        if (xmapUninstallPlugin($id)) {
            echo 1;
        }
        break;
    case 'edit_plugin_settings':
        $id = intval(JRequest::getVar('plugin', '', "REQUEST"));
        $plugin = new XmapPlugin($database);
        if ($id != JRequest::getVar('plugin', '', "REQUEST") || !$plugin->load($id)) {
            die('Cannot load plugin');
        }
        XmapAdminHtml::showPluginSettings($plugin);
        break;
}