/** * Modifies a filter * * @param string $root Root folder where $dir is located * @param string $dir The directory's name (relative path to $root) * @param string $checked If it's "on", "yes" or "checked" the filter is activated, else deactivated */ function modifyFilter($root, $dir, $checked) { $value = JoomlapackAbstraction::TranslateWinPath($root . "/" . $dir); if ($checked == "on" || $checked == "yes" || $checked == "checked") { // Enable the filter JoomlapackHelperFiltertable::addExclusionFilter($this->_filterClass, $value); } else { // Disable the filter JoomlapackHelperFiltertable::deleteExclusionFilter($this->_filterClass, $value); } }
/** * Populates _databaseList with the list of databases in the settings * */ function _getDatabaseList() { /* * Logic: * Add an entry for the Joomla! database * If we are in DB Only mode, return * Otherwise, itterate the configured databases and add them if and only if all settings are populated */ // Cleanup the _databaseList array $this->_databaseList = array(); // Add a new record for the core Joomla! database $entry = array('isJoomla' => true, 'useFilters' => true, 'host' => '', 'port' => '', 'username' => '', 'password' => '', 'database' => '', 'dumpFile' => ''); $this->_databaseList[] = $entry; $cube =& JoomlapackCUBE::getInstance(); if ($cube->_OnlyDBMode) { JoomlapackLogger::WriteLog(_JP_LOG_DEBUG, "JoomlapackDomainDBBackup :: Skipping extra databases definitions"); return; } $extraDefs = JoomlapackHelperFiltertable::getInclusionList('multidb'); if (count($extraDefs) > 0) { foreach ($extraDefs as $def) { $entry = array('isJoomla' => false, 'useFilters' => false, 'host' => $def['host'], 'port' => $def['port'], 'username' => $def['username'], 'password' => $def['password'], 'database' => $def['database'], 'dumpFile' => $def['id'] . '-' . $def['database'] . '.sql'); $this->_databaseList[] = $entry; } } }
function updateInclusionFilter($filterClass, $id, $value) { if (isset($value['id'])) { $newval = array(); foreach ($value as $key => $data) { if ($key != 'id') { $newval[$key] = $data; } } $value = $newval; unset($newval); } if (JoomlapackHelperFiltertable::isInclusionFilterSet($filterClass, $value) || !is_null($id)) { $db = JoomlapackAbstraction::getDatabase(); $value = serialize($value); $sql = 'UPDATE #__jp_inclusion SET ' . $db->nameQuote('value') . ' = ' . $db->Quote($value) . ' WHERE ' . $db->nameQuote('class') . ' = ' . $db->Quote($filterClass) . ' AND ' . $db->nameQuote('id') . ' = ' . $db->Quote($id); $db->setQuery($sql); $db->query(); return true; } else { return JoomlapackHelperFiltertable::addInclusionFilter($filterClass, $value); } }
/** * Loads a record into an associative array * * @param integer $id The ID of the requested row * @return array */ function _getRow($id) { return JoomlapackHelperFiltertable::getInclusionEntry($this->_filterClass, $id); }
/** * Removes all filters */ function ResetDBFilters() { JoomlapackHelperFiltertable::resetExclusionList($this->_filterClass); }