Exemple #1
0
         die('Cannot load sitemap');
     }
     $menutype = JRequest::getVar('menutype', '', "REQUEST");
     $menus = $sitemap->getMenus();
     if (!empty($menus[$menutype])) {
         $menu =& $menus[$menutype];
         $menu->show = JRequest::getVar('show', '', "POST");
         $menu->showXML = JRequest::getVar('showXML', '', "POST");
         $menu->priority = JRequest::getVar('priority', '', "POST");
         $menu->changefreq = JRequest::getVar('changefreq', '', "POST");
         $menu->module = JRequest::getVar('module', '', "POST");
         # 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;
Exemple #2
0
 function chageItemPropery($uid, $itemid, $view, $property, $value)
 {
     $this->loadItems($view, $itemid);
     $db =& JFactory::getDBO();
     $isNew = false;
     if (empty($this->_items[$view][$itemid][$uid])) {
         $this->_items[$view][$itemid][$uid] = array();
         $isNew = true;
     }
     $this->_items[$view][$itemid][$uid][$property] = $value;
     $sep = $properties = '';
     foreach ($this->_items[$view][$itemid][$uid] as $k => $v) {
         $properties .= $sep . $k . '=' . $v;
         $sep = ';';
     }
     if (!$isNew) {
         $query = 'UPDATE #__xmap_items SET properties=\'' . $db->getEscaped($properties) . "' where uid='" . $db->getEscaped($uid) . "' and itemid={$itemid} and view='{$view}' and sitemap_id=" . $this->id;
     } else {
         $query = 'INSERT #__xmap_items (uid,itemid,view,sitemap_id,properties) values ( \'' . $db->getEscaped($uid) . "',{$itemid},'{$view}',{$this->id},'" . $db->getEscaped($properties) . "')";
     }
     $db->setQuery($query);
     if ($db->query()) {
         XmapCache::cleanCache($this);
         return true;
     } else {
         return false;
     }
 }