Exemplo n.º 1
0
 public function delete()
 {
     $result = parent::delete();
     if ($result) {
         //Sometimes installer messes up and leaves stuff behind. Remove them too when uninstalling
         if (version_compare(JVERSION, '1.6', '>=')) {
             $query = sprintf("DELETE FROM #__menu WHERE link = 'index.php?option=com_%s' AND component_id = 0 LIMIT 1", $this->component);
             $db = JFactory::getDbo();
             $db->setQuery($query);
             $db->query();
         }
         $db = JFactory::getDBO();
         $db->setQuery('SHOW TABLES LIKE ' . $db->quote($db->replacePrefix('#__files_containers')));
         if ($db->loadResult()) {
             $db->setQuery("DELETE FROM `#__files_containers` WHERE `slug` = 'fileman-files'");
             $db->query();
         }
     }
     return $result;
 }
Exemplo n.º 2
0
 public function save()
 {
     $result = parent::save();
     if ($result) {
         $db = JFactory::getDBO();
         if (version_compare(JVERSION, '1.6', '<')) {
             // Do not show the component in menu manager
             $db->setQuery("UPDATE #__components SET link = '' WHERE link = 'option=com_logman'");
             $db->query();
             $db->setQuery("SELECT id FROM #__modules WHERE module = 'mod_logman' AND title='MOD_LOGMAN' AND published = 0");
             $id = $db->loadResult();
             if ($id) {
                 $db->setQuery(sprintf("UPDATE `#__modules` SET title = 'LOGman - Activity Stream', position = 'cpanel', ordering = -1, published = 1\n\t\t\t\t    \tWHERE id = %d LIMIT 1", $id));
                 $db->query();
             }
         } else {
             $db->setQuery("SELECT id FROM #__modules WHERE module = 'mod_logman' AND published <> -2 AND position = ''");
             $id = $db->loadResult();
             if ($id) {
                 $db->setQuery(sprintf("UPDATE `#__modules` SET position = 'cpanel', ordering = -1, published = 1, params = '{\"limit\":\"10\",\"direction\":\"desc\"}'\n\t\t\t\t    \tWHERE id = %d LIMIT 1", $id));
                 $db->query();
                 $db->setQuery("REPLACE INTO #__modules_menu VALUES ({$id}, 0)");
                 $db->query();
             }
             // Remove com_activities from the menu table
             $db->setQuery("SELECT id FROM #__menu WHERE link = 'index.php?option=com_activities'");
             $id = $db->loadResult();
             if ($id) {
                 $table = JTable::getInstance('menu');
                 $table->bind(array('id' => $id));
                 $table->delete();
             }
         }
     }
     return $result;
 }
Exemplo n.º 3
0
 public function delete()
 {
     $result = parent::delete();
     if ($result) {
         $db = JFactory::getDbo();
         /*
          * Sometimes installer messes up and leaves stuff behind. Remove them too when uninstalling
          */
         $query = "DELETE FROM #__menu WHERE link = 'index.php?option=com_docman' AND component_id = 0 LIMIT 1";
         $db->setQuery($query);
         $db->query();
         $db = JFactory::getDBO();
         $db->setQuery('SHOW TABLES LIKE ' . $db->quote($db->replacePrefix('#__files_containers')));
         if ($db->loadResult()) {
             $db->setQuery("DELETE FROM `#__files_containers` WHERE `slug` = 'docman-files'");
             $db->query();
             $db->setQuery("DELETE FROM `#__files_containers` WHERE `slug` = 'docman-icons'");
             $db->query();
             $db->setQuery("DELETE FROM `#__files_containers` WHERE `slug` = 'docman-images'");
             $db->query();
         }
         JFactory::getCache()->clean('com_docman');
     }
     return $result;
 }