=== removed file 'modules/update/update-rtl.css'
--- modules/update/update-rtl.css 2007-07-11 15:15:39 +0000
+++ modules/update/update-rtl.css 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-/* $Id: update-rtl.css,v 1.1 2007/07/11 15:15:40 dries Exp $ */
-
-.update .project {
- padding-right: .25em;
-}
-
-.update .version-status {
- float: left;
- padding-left: 10px;
-}
-
-.update .version-status .icon {
- padding-right: .5em;
-}
-
-.update table.version .version-title {
- padding-left: 1em;
-}
-
-.update table.version .version-details {
- padding-left: .5em;
-}
-
-.update table.version .version-links {
- text-align: left;
- padding-left: 1em;
-}
=== removed file 'modules/update/update.compare.inc'
--- modules/update/update.compare.inc 2007-07-11 15:15:39 +0000
+++ modules/update/update.compare.inc 1970-01-01 00:00:00 +0000
@@ -1,398 +0,0 @@
-status)) {
- // Skip disabled modules or themes.
- continue;
- }
-
- // Skip if the .info file is broken.
- if (empty($file->info)) {
- continue;
- }
-
- // If the .info doesn't define the 'project', try to figure it out.
- if (!isset($file->info['project'])) {
- $file->info['project'] = update_get_project_name($file);
- }
-
- if (!isset($projects[$file->info['project']])) {
- // Only process this if we haven't done this project, since a single
- // project can have multiple modules or themes.
- $projects[$file->info['project']] = array(
- 'name' => $file->info['project'],
- 'info' => $file->info,
- 'datestamp' => isset($file->info['datestamp']) ? $file->info['datestamp'] : 0,
- 'includes' => array($file->name => $file->info['name']),
- 'project_type' => $file->info['project'] == 'drupal' ? 'core' : $project_type,
- );
- }
- else {
- $projects[$file->info['project']]['includes'][$file->name] = $file->info['name'];
- }
- }
-}
-
-/**
- * Given a $file object (as returned by system_get_files_database()), figure
- * out what project it belongs to.
- *
- * @see system_get_files_database()
- */
-function update_get_project_name($file) {
- $project_name = '';
- if (isset($file->info['project'])) {
- $project_name = $file->info['project'];
- }
- elseif (isset($file->info['package']) && (strpos($file->info['package'], 'Core -') !== FALSE)) {
- $project_name = 'drupal';
- }
- elseif (in_array($file->name, array('bluemarine', 'chameleon', 'garland', 'marvin', 'minnelli', 'pushbutton'))) {
- // Unfortunately, there's no way to tell if a theme is part of core,
- // so we must hard-code a list here.
- $project_name = 'drupal';
- }
- else {
- // This isn't part of core, so guess the project from the directory.
- $last = '';
- foreach (array_reverse(explode('/', $file->filename)) as $dir) {
- if ($dir == 'modules' || $dir == 'themes') {
- break;
- }
- $last = $dir;
- }
- if ($last) {
- $project_name = $last;
- }
- }
- return $project_name;
-}
-
-/**
- * Process the list of projects on the system to figure out the currently
- * installed versions, and other information that is required before we can
- * compare against the available releases to produce the status report.
- *
- * @param $projects
- * Array of project information from update_get_projects().
- */
-function update_process_project_info(&$projects) {
- foreach ($projects as $key => $project) {
- // Assume an official release until we see otherwise.
- $install_type = 'official';
-
- $info = $project['info'];
-
- if (isset($info['version'])) {
- // Check for development snapshots
- if (preg_match('@(dev|HEAD)@', $info['version'])) {
- $install_type = 'dev';
- }
-
- // Figure out what the currently installed major version is. We need
- // to handle both contribution (e.g. "5.x-1.3", major = 1) and core
- // (e.g. "5.1", major = 5) version strings.
- $matches = array();
- if (preg_match('/^(\d+\.x-)?(\d+)\..*$/', $info['version'], $matches)) {
- $info['major'] = $matches[2];
- }
- elseif (!isset($info['major'])) {
- // This would only happen for version strings that don't follow the
- // drupal.org convention. We let contribs define "major" in their
- // .info in this case, and only if that's missing would we hit this.
- $info['major'] = -1;
- }
- }
- else {
- // No version info available at all.
- $install_type = 'unknown';
- $info['version'] = t('Unknown');
- $info['major'] = -1;
- }
-
- // Finally, save the results we care about into the $projects array.
- $projects[$key]['existing_version'] = $info['version'];
- $projects[$key]['existing_major'] = $info['major'];
- $projects[$key]['install_type'] = $install_type;
- unset($projects[$key]['info']);
- }
-}
-
-/**
- * Given the installed projects and the available release data retrieved from
- * remote servers, calculate the current status.
- *
- * This function is the heart of the update status feature. It iterates over
- * every currently installed project, and for each one, decides what major
- * release series to consider (the larger of the major version currently
- * installed and the default major version specified by the maintainer of that
- * project).
- *
- * Given a target major version, it scans the available releases looking for
- * the specific release to recommend (avoiding beta releases and development
- * snapshots if possible). This is complicated to describe, but an example
- * will help clarify. For the target major version, find the highest patch
- * level. If there is a release at that patch level with no extra ("beta",
- * etc), then we recommend the release at that patch level with the most
- * recent release date. If every release at that patch level has extra (only
- * betas), then recommend the latest release from the previous patch
- * level. For example:
- *
- * 1.6-bugfix <-- recommended version because 1.6 already exists.
- * 1.6
- *
- * or
- *
- * 1.6-beta
- * 1.5 <-- recommended version because no 1.6 exists.
- * 1.4
- *
- * It also looks for the latest release from the same major version, even a
- * beta release, to display to the user as the "Latest version" option.
- * Additionally, it finds the latest official release from any higher major
- * versions that have been released to provide a set of "Also available"
- * options.
- *
- * Finally, and most importantly, it keeps scanning the release history until
- * it gets to the currently installed release, searching for anything marked
- * as a security update. If any security updates have been found between the
- * recommended release and the installed version, all of the releases that
- * included a security fix are recorded so that the site administrator can be
- * warned their site is insecure, and links pointing to the release notes for
- * each security update can be included (which, in turn, will link to the
- * official security announcements for each vulnerability).
- *
- * This function relies on the fact that the .xml release history data comes
- * sorted based on major version and patch level, then finally by release date
- * if there are multiple releases such as betas from the same major.patch
- * version (e.g. 5.x-1.5-beta1, 5.x-1.5-beta2, and 5.x-1.5). Development
- * snapshots for a given major version are always listed last.
- *
- * @param $available
- * Array of data about available project releases.
- *
- * @see update_get_available()
- * @see update_get_projects()
- * @see update_process_project_info()
- */
-function update_calculate_project_data($available) {
- $projects = update_get_projects();
- update_process_project_info($projects);
- foreach ($projects as $project => $project_info) {
- if (isset($available[$project])) {
- // Figure out the target major version.
- $existing_major = $project_info['existing_major'];
- if (isset($available[$project]['default_major'])) {
- $default_major = $available[$project]['default_major'];
- $target_major = max($existing_major, $default_major);
- }
- else {
- $target_major = $existing_major;
- }
-
- $version_patch_changed = '';
- $patch = '';
-
- foreach ($available[$project]['releases'] as $version => $release) {
- // Ignore unpublished releases.
- if ($release['status'] != 'published') {
- continue;
- }
-
- // See if this is a higher major version than our target, and if so,
- // record it as an "Also available" release.
- if ($release['version_major'] > $target_major) {
- if (!isset($available[$project]['also'])) {
- $available[$project]['also'] = array();
- }
- if (!isset($available[$project]['also'][$release['version_major']])) {
- $available[$project]['also'][$release['version_major']] = $version;
- }
- // Otherwise, this release can't matter to us, since it's neither
- // from the release series we're currently using nor the recommended
- // release. We don't even care about security updates for this
- // branch, since if a project maintainer puts out a security release
- // at a higher major version and not at the lower major version,
- // they must change the default major release at the same time, in
- // which case we won't hit this code.
- continue;
- }
-
- // Look for the 'latest version' if we haven't found it yet. Latest is
- // defined as the most recent version for the target major version.
- if (!isset($available[$project]['latest_version'])
- && $release['version_major'] == $target_major) {
- $available[$project]['latest_version'] = $version;
- }
-
- // Look for the development snapshot release for this branch.
- if (!isset($available[$project]['dev_version'])
- && $release['version_major'] == $target_major
- && isset($release['version_extra'])
- && $release['version_extra'] == 'dev') {
- $available[$project]['dev_version'] = $version;
- }
-
- // Look for the 'recommended' version if we haven't found it yet (see
- // phpdoc at the top of this function for the definition).
- if (!isset($available[$project]['recommended'])
- && $release['version_major'] == $target_major
- && isset($release['version_patch'])) {
- if ($patch != $release['version_patch']) {
- $patch = $release['version_patch'];
- $version_patch_changed = $release['version'];
- }
- if (empty($release['version_extra']) && $patch == $release['version_patch']) {
- $available[$project]['recommended'] = $version_patch_changed;
- }
- }
-
- // Stop searching once we hit the currently installed version.
- if ($projects[$project]['existing_version'] == $version) {
- break;
- }
-
- // If we're running a dev snapshot and have a timestamp, stop
- // searching for security updates once we hit an official release
- // older than what we've got. Allow 100 seconds of leeway to handle
- // differences between the datestamp in the .info file and the
- // timestamp of the tarball itself (which are usually off by 1 or 2
- // seconds) so that we don't flag that as a new release.
- if ($projects[$project]['install_type'] == 'dev') {
- if (empty($projects[$project]['datestamp'])) {
- // We don't have current timestamp info, so we can't know.
- continue;
- }
- elseif (isset($release['date']) && ($projects[$project]['datestamp'] + 100 > $release['date'])) {
- // We're newer than this, so we can skip it.
- continue;
- }
- }
-
- // See if this release is a security update.
- if (isset($release['terms'])
- && isset($release['terms']['Release type'])
- && in_array('Security update', $release['terms']['Release type'])) {
- $projects[$project]['security updates'][] = $release;
- }
- }
-
- // If we were unable to find a recommended version, then make the latest
- // version the recommended version if possible.
- if (!isset($available[$project]['recommended']) && isset($available[$project]['latest_version'])) {
- $available[$project]['recommended'] = $available[$project]['latest_version'];
- }
-
- // If we're running a dev snapshot, compare the date of the dev snapshot
- // with the latest official version, and record the absolute latest in
- // 'latest_dev' so we can correctly decide if there's a newer release
- // than our current snapshot.
- if ($projects[$project]['install_type'] == 'dev') {
- if (isset($available[$project]['dev_version']) && $available[$project]['releases'][$available[$project]['dev_version']]['date'] > $available[$project]['releases'][$available[$project]['latest_version']]['date']) {
- $projects[$project]['latest_dev'] = $available[$project]['dev_version'];
- }
- else {
- $projects[$project]['latest_dev'] = $available[$project]['latest_version'];
- }
- }
-
- // Stash the info about available releases into our $projects array.
- $projects[$project] += $available[$project];
-
- //
- // Check to see if we need an update or not.
- //
-
- // If we don't know what to recommend, there's nothing much we can
- // report, so bail out early.
- if (!isset($projects[$project]['recommended'])) {
- $projects[$project]['status'] = UPDATE_UNKNOWN;
- $projects[$project]['reason'] = t('No available releases found');
- continue;
- }
-
- // Check based upon install type and the site-wide threshold setting.
- $error_level = variable_get('update_notification_threshold', 'all');
-
- switch ($projects[$project]['install_type']) {
- case 'official':
- if ($projects[$project]['existing_version'] == $projects[$project]['recommended'] || $projects[$project]['existing_version'] == $projects[$project]['latest_version']) {
- $projects[$project]['status'] = UPDATE_CURRENT;
- }
- else {
- if (!empty($projects[$project]['security updates'])) {
- $projects[$project]['status'] = UPDATE_NOT_SECURE;
- }
- else {
- $projects[$project]['status'] = UPDATE_NOT_CURRENT;
- }
- }
- break;
- case 'dev':
- if (!empty($projects[$project]['security updates'])) {
- $projects[$project]['status'] = UPDATE_NOT_SECURE;
- break;
- }
-
- $latest = $available[$project]['releases'][$projects[$project]['latest_dev']];
- if (empty($projects[$project]['datestamp'])) {
- $projects[$project]['status'] = UPDATE_NOT_CHECKED;
- $projects[$project]['reason'] = t('Unknown release date');
- }
- elseif (($projects[$project]['datestamp'] + 100 > $latest['date'])) {
- $projects[$project]['status'] = UPDATE_CURRENT;
- }
- else {
- $projects[$project]['status'] = UPDATE_NOT_CURRENT;
- }
- break;
-
- default:
- $projects[$project]['status'] = UPDATE_UNKNOWN;
- $projects[$project]['reason'] = t('Invalid info');
- }
- }
- else {
- $projects[$project]['status'] = UPDATE_UNKNOWN;
- $projects[$project]['reason'] = t('No available releases found');
- }
- }
- // Give other modules a chance to alter the status (for example, to allow a
- // contrib module to provide fine-grained settings to ignore specific
- // projects or releases).
- drupal_alter('update_status', $projects);
- return $projects;
-}
=== removed file 'modules/update/update.css'
--- modules/update/update.css 2007-08-07 08:39:35 +0000
+++ modules/update/update.css 1970-01-01 00:00:00 +0000
@@ -1,98 +0,0 @@
-/* $Id: update.css,v 1.2 2007/08/07 08:39:36 goba Exp $ */
-
-.update .project {
- font-weight: bold;
- font-size: 110%;
- padding-left: .25em; /* LTR */
- height: 22px;
-}
-
-.update .version-status {
- float: right; /* LTR */
- padding-right: 10px; /* LTR */
- font-size: 110%;
- height: 20px;
-}
-
-.update .version-status .icon {
- padding-left: .5em; /* LTR */
-}
-
-.update .info {
- margin: 0;
- padding: 1em 1em .25em 1em;
-}
-
-.update tr td {
- border-top: 1px solid #ccc;
- border-bottom: 1px solid #ccc;
-}
-
-.update tr.error {
- background: #fcc;
-}
-
-.update tr.error .version-recommended {
- background: #fdd;
-}
-
-.update tr.ok {
- background: #dfd;
-}
-
-.update tr.warning {
- background: #ffd;
-}
-
-.update tr.warning .version-recommended {
- background: #ffe;
-}
-
-.current-version, .new-version {
- direction: ltr; /* Note: version numbers should always be LTR. */
-}
-
-table.update,
-.update table.version {
- width: 100%;
- margin-top: .5em;
-}
-
-.update table.version tbody {
- border: none;
-}
-
-.update table.version tr,
-.update table.version td {
- line-height: .9em;
- padding: 0;
- margin: 0;
- border: none;
-}
-
-.update table.version .version-title {
- padding-left: 1em; /* LTR */
- width: 14em;
-}
-
-.update table.version .version-details {
- padding-right: .5em; /* LTR */
-}
-
-.update table.version .version-links {
- text-align: right; /* LTR */
- padding-right: 1em; /* LTR */
-}
-
-.update table.version-security .version-title {
- color: #970F00;
-}
-
-.update table.version-recommended-strong .version-title {
- font-weight: bold;
-}
-
-.update .security-error {
- font-weight: bold;
- color: #970F00;
-}
=== removed file 'modules/update/update.fetch.inc'
--- modules/update/update.fetch.inc 2007-08-11 07:05:11 +0000
+++ modules/update/update.fetch.inc 1970-01-01 00:00:00 +0000
@@ -1,223 +0,0 @@
- $project) {
- $url = _update_build_fetch_url($project, $site_key);
- $xml = drupal_http_request($url);
- if (isset($xml->data)) {
- $data[] = $xml->data;
- }
- }
-
- if ($data) {
- $parser = new update_xml_parser;
- $available = $parser->parse($data);
- $frequency = variable_get('update_check_frequency', 1);
- cache_set('update_info', $available, 'cache_update', time() + (60 * 60 * 24 * $frequency));
- variable_set('update_last_check', time());
- watchdog('update', 'Fetched information about all available new releases and updates.', array(), WATCHDOG_NOTICE, l('view', 'admin/logs/updates'));
- }
- else {
- watchdog('update', 'Unable to fetch any information about available new releases and updates.', array(), WATCHDOG_ERROR, l('view', 'admin/logs/updates'));
- }
- return $available;
-}
-
-/**
- * Generates the URL to fetch information about project updates.
- *
- * This figures out the right URL to use, based on the project's .info file
- * and the global defaults. Appends optional query arguments when the site is
- * configured to report usage stats.
- *
- * @param $project
- * The array of project information from update_get_projects().
- * @param $site_key
- * The anonymous site key hash (optional).
- *
- * @see update_refresh()
- * @see update_get_projects()
- */
-function _update_build_fetch_url($project, $site_key = '') {
- $default_url = variable_get('update_fetch_url', UPDATE_DEFAULT_URL);
- if (!isset($project['info']['project status url'])) {
- $project['info']['project status url'] = $default_url;
- }
- $name = $project['name'];
- $url = $project['info']['project status url'];
- $url .= '/'. $name .'/'. DRUPAL_CORE_COMPATIBILITY;
- if (!empty($site_key)) {
- $url .= (strpos($url, '?') === TRUE) ? '&' : '?';
- $url .= 'site_key=';
- $url .= drupal_urlencode($site_key);
- if (!empty($project['info']['version'])) {
- $url .= '&version=';
- $url .= drupal_urlencode($project['info']['version']);
- }
- }
- return $url;
-}
-
-/**
- * Perform any notifications that should be done once cron fetches new data.
- *
- * This method checks the status of the site using the new data and depending
- * on the configuration of the site, notifys administrators via email if there
- * are new releases or missing security updates.
- *
- * @see update_requirements()
- */
-function _update_cron_notify() {
- include_once './includes/install.inc';
- $status = update_requirements('runtime');
- $params = array();
- foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
- if (isset($status[$type]['severity'])
- && $status[$type]['severity'] == REQUIREMENT_ERROR) {
- $params[$report_type] = $status[$type]['reason'];
- }
- }
- if (!empty($params)) {
- $notify_list = variable_get('update_notify_emails', '');
- if (!empty($notify_list)) {
- $default_language = language_default();
- foreach ($notify_list as $target) {
- if ($target_user = user_load(array('mail' => $target))) {
- $target_language = user_preferred_language($target_user);
- }
- else {
- $target_language = $default_language;
- }
- drupal_mail('update', 'status_notify', $target, $target_language, $params);
- }
- }
- }
-}
-
-/**
- * XML Parser object to read Drupal's release history info files.
- * This uses PHP4's lame XML parsing, but it works.
- */
-class update_xml_parser {
- var $projects = array();
- var $current_project;
- var $current_release;
- var $current_term;
- var $current_tag;
- var $current_object;
-
- /**
- * Parse an array of XML data files.
- */
- function parse($data) {
- foreach ($data as $datum) {
- $parser = xml_parser_create();
- xml_set_object($parser, $this);
- xml_set_element_handler($parser, 'start', 'end');
- xml_set_character_data_handler($parser, "data");
- xml_parse($parser, $datum);
- xml_parser_free($parser);
- }
- return $this->projects;
- }
-
- function start($parser, $name, $attr) {
- $this->current_tag = $name;
- switch ($name) {
- case 'PROJECT':
- unset($this->current_object);
- $this->current_project = array();
- $this->current_object = &$this->current_project;
- break;
- case 'RELEASE':
- unset($this->current_object);
- $this->current_release = array();
- $this->current_object = &$this->current_release;
- break;
- case 'TERM':
- unset($this->current_object);
- $this->current_term = array();
- $this->current_object = &$this->current_term;
- break;
- }
- }
-
- function end($parser, $name) {
- switch ($name) {
- case 'PROJECT':
- unset($this->current_object);
- $this->projects[$this->current_project['short_name']] = $this->current_project;
- $this->current_project = array();
- break;
- case 'RELEASE':
- unset($this->current_object);
- $this->current_project['releases'][$this->current_release['version']] = $this->current_release;
- break;
- case 'RELEASES':
- $this->current_object = &$this->current_project;
- break;
- case 'TERM':
- unset($this->current_object);
- $term_name = $this->current_term['name'];
- if (!isset($this->current_release['terms'])) {
- $this->current_release['terms'] = array();
- }
- if (!isset($this->current_release['terms'][$term_name])) {
- $this->current_release['terms'][$term_name] = array();
- }
- $this->current_release['terms'][$term_name][] = $this->current_term['value'];
- break;
- case 'TERMS':
- $this->current_object = &$this->current_release;
- break;
- default:
- $this->current_object[strtolower($this->current_tag)] = trim($this->current_object[strtolower($this->current_tag)]);
- $this->current_tag = '';
- }
- }
-
- function data($parser, $data) {
- if ($this->current_tag && !in_array($this->current_tag, array('PROJECT', 'RELEASE', 'RELEASES', 'TERM', 'TERMS'))) {
- $tag = strtolower($this->current_tag);
- if (isset($this->current_object[$tag])) {
- $this->current_object[$tag] .= $data;
- }
- else {
- $this->current_object[$tag] = $data;
- }
- }
- }
-}
=== removed file 'modules/update/update.info'
--- modules/update/update.info 2007-07-11 15:15:39 +0000
+++ modules/update/update.info 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-; $Id: update.info,v 1.1 2007/07/11 15:15:40 dries Exp $
-name = Update status
-description = Checks the status of available updates for Drupal and your installed modules and themes.
-version = VERSION
-package = Core - optional
-core = 6.x
=== removed file 'modules/update/update.install'
--- modules/update/update.install 2007-07-11 15:15:39 +0000
+++ modules/update/update.install 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-'. t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') .'
';
-
- case 'admin/build/themes':
- case 'admin/build/modules':
- include_once './includes/install.inc';
- $status = update_requirements('runtime');
- foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
- if (isset($status[$type]['severity'])) {
- if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
- drupal_set_message($status[$type]['description'], 'error');
- }
- elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) {
- drupal_set_message($status[$type]['description']);
- }
- }
- }
- return ''. t('See the available updates page for information on installed modules and themes with new versions released.', array('@available_updates' => url('admin/logs/updates'))) .'
';
-
- case 'admin/logs/updates/settings':
- case 'admin/logs/status':
- // These two pages don't need additional nagging.
- break;
-
- default:
- // Otherwise, if we're on *any* admin page and there's a security
- // update missing, print an error message about it.
- if (arg(0) == 'admin' && strpos($path, '#') === FALSE
- && user_access('administer site configuration')) {
- include_once './includes/install.inc';
- $status = update_requirements('runtime');
- foreach (array('core', 'contrib') as $report_type) {
- $type = 'update_'. $report_type;
- if (isset($status[$type])
- && isset($status[$type]['reason'])
- && $status[$type]['reason'] === UPDATE_NOT_SECURE) {
- drupal_set_message($status[$type]['description'], 'error');
- }
- }
- }
-
- }
-}
-
-/**
- * Implementation of hook_menu().
- */
-function update_menu() {
- $items = array();
-
- $items['admin/logs/updates'] = array(
- 'title' => 'Available updates',
- 'description' => 'Get a status report about available updates for your installed modules and themes.',
- 'page callback' => 'update_status',
- 'access arguments' => array('administer site configuration'),
- 'file' => 'update.report.inc',
- 'weight' => 10,
- );
- $items['admin/logs/updates/list'] = array(
- 'title' => 'List',
- 'page callback' => 'update_status',
- 'access arguments' => array('administer site configuration'),
- 'file' => 'update.report.inc',
- 'type' => MENU_DEFAULT_LOCAL_TASK,
- );
- $items['admin/logs/updates/settings'] = array(
- 'title' => 'Settings',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('update_settings'),
- 'access arguments' => array('administer site configuration'),
- 'file' => 'update.settings.inc',
- 'type' => MENU_LOCAL_TASK,
- );
- $items['admin/logs/updates/check'] = array(
- 'title' => 'Manual update check',
- 'page callback' => 'update_manual_status',
- 'access arguments' => array('administer site configuration'),
- 'file' => 'update.fetch.inc',
- 'type' => MENU_CALLBACK,
- );
-
- return $items;
-}
-
-/**
- * Implementation of the hook_theme() registry.
- */
-function update_theme() {
- return array(
- 'update_settings' => array(
- 'arguments' => array('form' => NULL),
- ),
- 'update_report' => array(
- 'arguments' => array('data' => NULL),
- ),
- 'update_version' => array(
- 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => NULL),
- ),
- );
-}
-
-/**
- * Implementation of hook_requirements.
- *
- * @return
- * An array describing the status of the site regarding available updates.
- * If there is no update data, only one record will be returned, indicating
- * that the status of core can't be determined. If data is available, there
- * will be two records: one for core, and another for all of contrib
- * (assuming there are any contributed modules or themes enabled on the
- * site). In addition to the fields expected by hook_requirements ('value',
- * 'severity', and optionally 'description'), this array will contain a
- * 'reason' attribute, which is an integer constant to indicate why the
- * given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or
- * UPDATE_UNKNOWN). This is used for generating the appropriate e-mail
- * notification messages during update_cron(), and might be useful for other
- * modules that invoke update_requirements() to find out if the site is up
- * to date or not.
- *
- * @see _update_message_text()
- * @see _update_cron_notify()
- */
-function update_requirements($phase) {
- if ($phase == 'runtime') {
- $requirements['update_core']['title'] = t('Drupal core update status');
- $notification_level = variable_get('update_notification_threshold', 'all');
- if ($available = update_get_available(FALSE)) {
- include_once './modules/update/update.compare.inc';
- $data = update_calculate_project_data($available);
- switch ($data['drupal']['status']) {
- case UPDATE_NOT_CURRENT:
- $requirements['update_core']['value'] = t('Out of date (version @version available)', array('@version' => $data['drupal']['recommended']));
- $requirements['update_core']['severity'] = $notification_level == 'all' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
- $requirements['update_core']['reason'] = UPDATE_NOT_CURRENT;
- $requirements['update_core']['description'] = _update_message_text('core', UPDATE_NOT_CURRENT, TRUE);
- break;
-
- case UPDATE_NOT_SECURE:
- $requirements['update_core']['value'] = t('Not secure! (version @version available)', array('@version' => $data['drupal']['recommended']));
- $requirements['update_core']['severity'] = REQUIREMENT_ERROR;
- $requirements['update_core']['reason'] = UPDATE_NOT_SECURE;
- $requirements['update_core']['description'] = _update_message_text('core', UDPDATE_NOT_SECURE, TRUE);
- break;
-
- default:
- $requirements['update_core']['value'] = t('Up to date');
- break;
- }
- // We don't want to check drupal a second time.
- unset($data['drupal']);
- $not_current = FALSE;
- if (!empty($data)) {
- $requirements['update_contrib']['title'] = t('Module and theme update status');
- // Default to being current until we see otherwise.
- $requirements['update_contrib']['value'] = t('Up to date');
- foreach (array_keys($data) as $project) {
- if (isset($available[$project])) {
- if ($data[$project]['status'] == UPDATE_NOT_SECURE) {
- $requirements['update_contrib']['value'] = t('Not secure!');
- $requirements['update_contrib']['severity'] = REQUIREMENT_ERROR;
- $requirements['update_contrib']['reason'] = UPDATE_NOT_SECURE;
- $requirements['update_contrib']['description'] = _update_message_text('contrib', UPDATE_NOT_SECURE, TRUE);
- break;
- }
- elseif ($data[$project]['status'] == UPDATE_NOT_CURRENT) {
- $not_current = TRUE;
- }
- }
- }
- if (!isset($requirements['update_contrib']['severity']) && $not_current) {
- $requirements['update_contrib']['severity'] = $notification_level == 'all' ? REQUIREMENT_ERROR : REQUIREMENT_WARNING;
- $requirements['update_contrib']['value'] = t('Out of date');
- $requirements['update_contrib']['reason'] = UPDATE_NOT_CURRENT;
- $requirements['update_contrib']['description'] = _update_message_text('contrib', UPDATE_NOT_CURRENT, TRUE);
- }
- }
- }
- else {
- $requirements['update_core']['value'] = t('No update data available');
- $requirements['update_core']['severity'] = REQUIREMENT_WARNING;
- $requirements['update_core']['reason'] = UPDATE_UNKNOWN;
- $requirements['update_core']['description'] = _update_no_data();
- }
- return $requirements;
- }
-}
-
-/**
- * Implementation of hook_cron().
- */
-function update_cron() {
- $frequency = variable_get('update_check_frequency', 1);
- $interval = 60 * 60 * 24 * $frequency;
- if (time() - variable_get('update_last_check', 0) > $interval) {
- update_refresh();
- _update_cron_notify();
- }
-}
-
-/**
- * Implementation of hook_form_alter().
- *
- * Adds a submit handler to the system modules and themes forms, so that if a
- * site admin saves either form, we invalidate the cache of available updates.
- *
- * @see update_invalidate_cache()
- */
-function update_form_alter(&$form, $form_state, $form_id) {
- if ($form_id == 'system_modules' || $form_id == 'system_themes' ) {
- $form['#submit'][] = 'update_invalidate_cache';
- }
-}
-
-/**
- * Prints a warning message when there is no data about available updates.
- */
-function _update_no_data() {
- $destination = drupal_get_destination();
- return t('No information is available about potential new releases for currently installed modules and themes. To check for updates, you may need to run cron or you can check manually. Please note that checking for available updates can take a long time, so please be patient.', array(
- '@run_cron' => url('admin/logs/status/run-cron', array('query' => $destination)),
- '@check_manually' => url('admin/logs/updates/check', array('query' => $destination)),
- ));
-}
-
-/**
- * Internal helper to try to get the update information from the cache
- * if possible, and to refresh the cache when necessary.
- *
- * @param $refresh
- * Boolean to indicate if this method should refresh the cache automatically
- * if there's no data.
- */
-function update_get_available($refresh = FALSE) {
- $available = array();
- if (($cache = cache_get('update_info', 'cache_update'))
- && $cache->expire > time()) {
- $available = $cache->data;
- }
- elseif ($refresh) {
- $available = update_refresh();
- }
- return $available;
-}
-
-/**
- * Invalidates any cached data relating to update status.
- */
-function update_invalidate_cache() {
- cache_clear_all('update_info', 'cache_update');
-}
-
-/**
- * Wrapper to load the include file and then refresh the release data.
- */
-function update_refresh() {
- include_once './modules/update/update.fetch.inc';
- return _update_refresh();
-}
-
-/**
- * Implementation of hook_mail().
- *
- * Constructs the email notification message when the site is out of date.
- *
- * @param $key
- * Unique key to indicate what message to build, always 'status_notify'.
- * @param $message
- * Reference to the message array being built.
- * @param $params
- * Array of parameters to indicate what kind of text to include in the
- * message body. This is a keyed array of message type ('core' or 'contrib')
- * as the keys, and the status reason constant (UPDATE_NOT_SECURE, etc) for
- * the values.
- *
- * @see drupal_mail();
- * @see _update_cron_notify();
- * @see _update_message_text();
- */
-function update_mail($key, &$message, $params) {
- $language = $message['language'];
- $langcode = $language->language;
- $message['subject'] .= t('New release(s) available for !site_name', array('!site_name' => variable_get('site_name', 'Drupal')), $langcode);
- foreach ($params as $msg_type => $msg_reason) {
- $message['body'][] = _update_message_text($msg_type, $msg_reason, FALSE, $language);
- }
- $message['body'][] = t('See the available updates page for more information:', array(), $langcode) ."\n". url('admin/logs/updates', array('absolute' => TRUE, 'language' => $language));
-}
-
-/**
- * Helper function to return the appropriate message text when the site is out
- * of date or missing a security update.
- *
- * These error messages are shared by both update_requirements() for the
- * site-wide status report at admin/logs/status and in the body of the
- * notification emails generated by update_cron().
- *
- * @param $msg_type
- * String to indicate what kind of message to generate. Can be either
- * 'core' or 'contrib'.
- * @param $msg_reason
- * Integer constant specifying why message is generated. Can be either
- * UPDATE_NOT_CURRENT or UPDATE_NOT_SECURE.
- * @param $report_link
- * Boolean that controls if a link to the updates report should be added.
- * @param $language
- * An optional language object to use.
- * @return
- * The properly translated error message for the given key.
- */
-function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $language = NULL) {
- $langcode = isset($language) ? $language->language : NULL;
- $text = '';
- switch ($msg_reason) {
- case UPDATE_NOT_CURRENT:
- if ($msg_type == 'core') {
- $text = t('There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.', array(), $langcode);
- }
- else {
- $text = t('There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.', array(), $langcode);
- }
- break;
-
- case UPDATE_NOT_SECURE:
- if ($msg_type == 'core') {
- $text = t('There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately!', array(), $langcode);
- }
- else {
- $text = t('There are security updates available for one or more of your modules or themes. To ensure the security of your server, you should update immediately!', array(), $langcode);
- }
- break;
- }
-
- if ($report_link) {
- $text .= ' '. t('See the available updates page for more information.', array('@available_updates' => url('admin/logs/updates', array('language' => $language))), $langcode);
- }
-
- return $text;
-}
=== removed file 'modules/update/update.report.inc'
--- modules/update/update.report.inc 2007-07-11 15:15:39 +0000
+++ modules/update/update.report.inc 1970-01-01 00:00:00 +0000
@@ -1,224 +0,0 @@
-'. t('Last checked: ') . ($last ? format_interval(time() - $last) .' '. t('ago') : t('Never'));
- $output .= ' '. l(t('Check manually'), 'admin/logs/updates/check') .'';
- $output .= "\n";
-
- if (!is_array($data)) {
- $output .= ''. $data .'
';
- return $output;
- }
-
- $header = array();
- $rows = array();
-
- $notification_level = variable_get('update_notification_threshold', 'all');
-
- foreach ($data as $project) {
- switch ($project['status']) {
- case UPDATE_CURRENT:
- $class = 'ok';
- $icon = theme('image', 'misc/watchdog-ok.png');
- break;
- case UPDATE_NOT_SECURE:
- case UPDATE_NOT_CURRENT:
- if ($notification_level == 'all'
- || $project['status'] == UPDATE_NOT_SECURE) {
- $class = 'error';
- $icon = theme('image', 'misc/watchdog-error.png');
- break;
- }
- // Otherwise, deliberate no break and use the warning class/icon.
- default:
- $class = 'warning';
- $icon = theme('image', 'misc/watchdog-warning.png');
- break;
- }
-
- $row = '';
- switch ($project['status']) {
- case UPDATE_CURRENT:
- $row .= t('Up to date');
- break;
- case UPDATE_NOT_SECURE:
- $row .= '';
- $row .= t('Security update required!');
- $row .= '';
- break;
- case UPDATE_NOT_CURRENT:
- $row .= t('Update available');
- break;
- default:
- $row .= check_plain($project['reason']);
- break;
- }
- $row .= ''. $icon .'';
- $row .= "
\n";
-
- $row .= '';
- if (isset($project['title'])) {
- if (isset($project['link'])) {
- $row .= l($project['title'], $project['link']);
- }
- else {
- $row .= check_plain($project['title']);
- }
- }
- else {
- $row .= check_plain($project['name']);
- }
- $row .= ' '. check_plain($project['existing_version']);
- if ($project['install_type'] == 'dev' && !empty($project['datestamp'])) {
- $row .= ' ('. format_date($project['datestamp'], 'custom', 'Y-M-d') .') ';
- }
- $row .= "
\n";
-
- $row .= "\n";
-
- if (isset($project['recommended'])) {
- if ($project['status'] != UPDATE_CURRENT || $project['existing_version'] != $project['recommended']) {
-
- // First, figure out what to recommend.
- // If there's only 1 security update and it has the same version we're
- // recommending, give it the same CSS class as if it was recommended,
- // but don't print out a separate "Recommended" line for this project.
- if (!empty($project['security updates']) && count($project['security updates']) == 1 && $project['security updates'][0]['version'] == $project['recommended']) {
- $security_class = ' version-recommended version-recommended-strong';
- }
- else {
- $security_class = '';
- $version_class = 'version-recommended';
- // Apply an extra class if we're displaying both a recommended
- // version and anything else for an extra visual hint.
- if ($project['recommended'] != $project['latest_version']
- || !empty($project['also'])
- || ($project['install_type'] == 'dev'
- && $project['latest_version'] != $project['dev_version']
- && $project['recommended'] != $project['dev_version'])
- || (isset($project['security updates'][0])
- && $project['recommended'] != $project['security updates'][0])
- ) {
- $version_class .= ' version-recommended-strong';
- }
- $row .= theme('update_version', $project['releases'][$project['recommended']], t('Recommended version:'), $version_class);
- }
-
- // Now, print any security updates.
- if (!empty($project['security updates'])) {
- foreach ($project['security updates'] as $security_update) {
- $row .= theme('update_version', $security_update, t('Security update:'), 'version-security'. $security_class);
- }
- }
- }
-
- if ($project['recommended'] != $project['latest_version']) {
- $row .= theme('update_version', $project['releases'][$project['latest_version']], t('Latest version:'), 'version-latest');
- }
- if ($project['install_type'] == 'dev'
- && $project['status'] != UPDATE_CURRENT
- && $project['recommended'] != $project['dev_version']) {
- $row .= theme('update_version', $project['releases'][$project['dev_version']], t('Development version:'), 'version-latest');
- }
- }
-
- if (isset($project['also'])) {
- foreach ($project['also'] as $also) {
- $row .= theme('update_version', $project['releases'][$also], t('Also available:'), 'version-also-available');
- }
- }
-
- $row .= "
\n"; // versions div.
-
- $row .= "\n";
- if (!empty($project['extra'])) {
- $row .= '\n"; // extra div.
- }
-
- $row .= '
';
- sort($project['includes']);
- $row .= t('Includes: %includes', array('%includes' => implode(', ', $project['includes'])));
- $row .= "
\n";
-
- $row .= "
\n"; // info div.
-
- if (!isset($rows[$project['project_type']])) {
- $rows[$project['project_type']] = array();
- }
- $rows[$project['project_type']][] = array(
- 'class' => $class,
- 'data' => array($row),
- );
- }
-
- $project_types = array(
- 'core' => t('Drupal core'),
- 'module' => t('Modules'),
- 'theme' => t('Themes'),
- );
- foreach ($project_types as $type_name => $type_label) {
- if (!empty($rows[$type_name])) {
- $output .= "\n". $type_label ."
\n";
- $output .= theme('table', $header, $rows[$type_name], array('class' => 'update'));
- }
- }
- drupal_add_css(drupal_get_path('module', 'update') .'/update.css');
- return $output;
-}
-
-function theme_update_version($version, $tag, $class) {
- $output = '';
- $output .= '';
- $output .= '';
- $output .= '| '. $tag ." | \n";
- $output .= '';
- $output .= l($version['version'], $version['release_link']);
- $output .= ' ('. format_date($version['date'], 'custom', 'Y-M-d') .') ';
- $output .= " | \n";
- $output .= '';
- $links = array();
- $links['update-download'] = array(
- 'title' => t('Download'),
- 'href' => $version['download_link'],
- );
- $links['update-release-notes'] = array(
- 'title' => t('Release notes'),
- 'href' => $version['release_link'],
- );
- $output .= theme('links', $links);
- $output .= ' | ';
- $output .= '
';
- $output .= "
\n";
- return $output;
-}
=== removed file 'modules/update/update.schema'
--- modules/update/update.schema 2007-07-11 15:15:39 +0000
+++ modules/update/update.schema 1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
- 'textarea',
- '#title' => t('E-mail addresses to notify when updates are available'),
- '#rows' => 4,
- '#default_value' => implode("\n", $notify_emails),
- '#description' => t('Whenever your site checks for available updates and finds new releases, it can notify a list of users via e-email. Put each address on a separate line. If blank, no e-mails will be sent.'),
- );
-
- $form['update_check_frequency'] = array(
- '#type' => 'radios',
- '#title' => t('Check for updates'),
- '#default_value' => variable_get('update_check_frequency', 1),
- '#options' => array(
- '1' => t('Daily'),
- '7' => t('Weekly'),
- ),
- '#description' => t('Select how frequently you want to automatically check for new releases of your currently installed modules and themes.'),
- );
-
- $form['update_notification_threshold'] = array(
- '#type' => 'radios',
- '#title' => t('Notification threshold'),
- '#default_value' => variable_get('update_notification_threshold', 'all'),
- '#options' => array(
- 'all' => t('All newer versions'),
- 'security' => t('Only security updates'),
- ),
- '#description' => t('If there are updates available of Drupal core or any of your installed modules and themes, your site will print an error message on the status report, the modules page, and the themes page. You can choose to only see these error messages if a security update is available, or to be notified about any newer versions.', array('@status_report' => url('admin/logs/status'), '@modules_page' => url('admin/build/modules'), '@themes_page' => url('admin/build/themes')))
- );
-
- $form = system_settings_form($form);
- // Custom valiation callback for the email notification setting.
- $form['#validate'][] = 'update_settings_validate';
- // We need to call our own submit callback first, not the one from
- // system_settings_form(), so that we can process and save the emails.
- unset($form['#submit']);
-
- return $form;
-}
-
-/**
- * Validation callback for the settings form.
- *
- * Validates the email addresses and ensures the field is formatted correctly.
- */
-function update_settings_validate($form, &$form_state) {
- if (!empty($form_state['values']['update_notify_emails'])) {
- $valid = array();
- $invalid = array();
- foreach (explode("\n", trim($form_state['values']['update_notify_emails'])) as $email) {
- $email = trim($email);
- if (!empty($email)) {
- if (valid_email_address($email)) {
- $valid[] = $email;
- }
- else {
- $invalid[] = $email;
- }
- }
- }
- if (empty($invalid)) {
- $form_state['notify_emails'] = $valid;
- }
- elseif (count($invalid) == 1) {
- form_set_error('update_notify_emails', t('%email is not a valid e-mail address.', array('%email' => reset($invalid))));
- }
- else {
- form_set_error('update_notify_emails', t('%emails are not valid e-mail addresses.', array('%emails' => implode(', ', $invalid))));
- }
- }
-}
-
-/**
- * Submit handler for the settings tab.
- */
-function update_settings_submit($form, $form_state) {
- $op = $form_state['values']['op'];
-
- if ($op == t('Reset to defaults')) {
- unset($form_state['notify_emails']);
- }
- else {
- if (empty($form_state['notify_emails'])) {
- variable_del('update_notify_emails');
- }
- else {
- variable_set('update_notify_emails', $form_state['notify_emails']);
- }
- unset($form_state['notify_emails']);
- unset($form_state['values']['update_notify_emails']);
- }
- system_settings_form_submit($form, $form_state);
-}
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2007-08-08 19:38:53 +0000
@@ -0,0 +1,2 @@
+.project
+.projectOptions
=== added file 'modules/update/update.css'
--- modules/update/update.css 1970-01-01 00:00:00 +0000
+++ modules/update/update.css 2007-08-09 05:37:42 +0000
@@ -0,0 +1,98 @@
+/* $Id: update.css,v 1.2 2007/08/07 08:39:36 goba Exp $ */
+
+.update .project {
+ font-weight: bold;
+ font-size: 110%;
+ padding-left: .25em; /* LTR */
+ height: 22px;
+}
+
+.update .version-status {
+ float: right; /* LTR */
+ padding-right: 10px; /* LTR */
+ font-size: 110%;
+ height: 20px;
+}
+
+.update .version-status .icon {
+ padding-left: .5em; /* LTR */
+}
+
+.update .info {
+ margin: 0;
+ padding: 1em 1em .25em 1em;
+}
+
+.update tr td {
+ border-top: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+}
+
+.update tr.error {
+ background: #fcc;
+}
+
+.update tr.error .version-recommended {
+ background: #fdd;
+}
+
+.update tr.ok {
+ background: #dfd;
+}
+
+.update tr.warning {
+ background: #ffd;
+}
+
+.update tr.warning .version-recommended {
+ background: #ffe;
+}
+
+.current-version, .new-version {
+ direction: ltr; /* Note: version numbers should always be LTR. */
+}
+
+table.update,
+.update table.version {
+ width: 100%;
+ margin-top: .5em;
+}
+
+.update table.version tbody {
+ border: none;
+}
+
+.update table.version tr,
+.update table.version td {
+ line-height: .9em;
+ padding: 0;
+ margin: 0;
+ border: none;
+}
+
+.update table.version .version-title {
+ padding-left: 1em; /* LTR */
+ width: 14em;
+}
+
+.update table.version .version-details {
+ padding-right: .5em; /* LTR */
+}
+
+.update table.version .version-links {
+ text-align: right; /* LTR */
+ padding-right: 1em; /* LTR */
+}
+
+.update table.version-security .version-title {
+ color: #970F00;
+}
+
+.update table.version-recommended-strong .version-title {
+ font-weight: bold;
+}
+
+.update .security-error {
+ font-weight: bold;
+ color: #970F00;
+}
=== added file 'private.php'
--- private.php 1970-01-01 00:00:00 +0000
+++ private.php 2007-08-08 19:38:53 +0000
@@ -0,0 +1,12 @@
+
S: maintained
-UPDATE MODULE
-M: Derek Wright
- Earl Miles
-S: maintained
-
XML-RPC SERVER/CLIENT
M: John VanDyk
S: maintained
=== modified file 'includes/bootstrap.inc'
--- includes/bootstrap.inc 2007-08-07 08:41:24 +0000
+++ includes/bootstrap.inc 2007-08-09 05:10:06 +0000
@@ -1088,6 +1088,7 @@ function language_default($property = NU
return $property ? $language->$property : $language;
}
+
/**
* If Drupal is behind a reverse proxy, we use the X-Forwarded-For header
* instead of $_SERVER['REMOTE_ADDR'], which would be the IP address
=== modified file 'includes/common.inc'
--- includes/common.inc 2007-08-12 15:55:35 +0000
+++ includes/common.inc 2007-08-12 20:54:52 +0000
@@ -1592,7 +1592,7 @@ function drupal_build_css_cache($types,
$data = '';
// Create the css/ within the files folder.
- $csspath = file_create_path('css');
+ $csspath = _file_create_path('css',FILE_DOWNLOADS_PUBLIC);
file_check_directory($csspath, FILE_CREATE_DIRECTORY);
if (!file_exists($csspath .'/'. $filename)) {
@@ -1636,7 +1636,7 @@ function drupal_build_css_cache($types,
* Delete all cached CSS files.
*/
function drupal_clear_css_cache() {
- file_scan_directory(file_create_path('css'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
+ file_scan_directory(_file_create_path('css',FILE_DOWNLOADS_PUBLIC), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
}
/**
@@ -1830,7 +1830,7 @@ function drupal_build_js_cache($files, $
$contents = '';
// Create the js/ within the files folder.
- $jspath = file_create_path('js');
+ $jspath = _file_create_path('js',FILE_DOWNLOADS_PUBLIC);
file_check_directory($jspath, FILE_CREATE_DIRECTORY);
if (!file_exists($jspath .'/'. $filename)) {
@@ -2077,7 +2077,7 @@ function _packer_backreferences($match,
* Delete all cached JS files.
*/
function drupal_clear_js_cache() {
- file_scan_directory(file_create_path('js'), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
+ file_scan_directory(_file_create_path('js',FILE_DOWNLOADS_PUBLIC), '.*', array('.', '..', 'CVS'), 'file_delete', TRUE);
variable_set('javascript_parsed', array());
}
=== modified file 'includes/file.inc'
--- includes/file.inc 2007-07-25 17:41:27 +0000
+++ includes/file.inc 2007-08-10 22:08:35 +0000
@@ -12,8 +12,8 @@
* Common file handling functions.
*/
-define('FILE_DOWNLOADS_PUBLIC', 1);
-define('FILE_DOWNLOADS_PRIVATE', 2);
+define('FILE_DOWNLOADS_PUBLIC', 0);
+define('FILE_DOWNLOADS_PRIVATE', 1);
define('FILE_CREATE_DIRECTORY', 1);
define('FILE_MODIFY_PERMISSIONS', 2);
define('FILE_EXISTS_RENAME', 0);
@@ -32,23 +32,74 @@ define('FILE_EXISTS_ERROR', 2);
define('FILE_STATUS_TEMPORARY', 0);
define('FILE_STATUS_PERMANENT', 1);
+
+/**
+ * Create download path to a file
+ *
+ * @return A string containing the path to the desired file
+ * @param &$file A file object.
+ *
+ */
+
+function file_create_url(&$file) {
+ // Avoid duplication with _file_create_url
+ if (!isset($file->private)) {
+ $file->private = FILE_DOWNLOADS_PUBLIC;
+ }
+ return _file_create_url($file->filename, $file->private);
+}
+
+
/**
* Create the download path to a file.
*
* @param $path A string containing the path of the file to generate URL for.
+ * @param $private An integer indicated whether the file is public (0) or private (1).
* @return A string containing a URL that can be used to download the file.
*/
-function file_create_url($path) {
+function _file_create_url($path, $private = 0) {
// Strip file_directory_path from $path. We only include relative paths in urls.
+ // TODO, add private directory path
if (strpos($path, file_directory_path() .'/') === 0) {
$path = trim(substr($path, strlen(file_directory_path())), '\\/');
}
- switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
- case FILE_DOWNLOADS_PUBLIC:
- return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path);
- case FILE_DOWNLOADS_PRIVATE:
- return url('system/files/'. $path, array('absolute' => TRUE));
+
+ // Check if the file is private
+ if ( $private ) {
+ // If it is private return a private file path
+ return url('system/files/'. $path, array('absolute' => TRUE)); // TODO: this will need to be changed when private.php is implemented
}
+ else {
+ // Otherwise return a public file path
+ return $GLOBALS['base_url'] .'/'. file_directory_path() .'/'. str_replace('\\', '/', $path);
+ }
+}
+
+
+/**
+ * Make sure the destination is a complete path and resides in the file system
+ * directory, if it is not prepend the file system directory.
+ *
+ * @param $file A file object containing the path to verify and the public/private status of the file.
+ * @return A string containing the path to file, with file system directory
+ * appended if necessary, or FALSE if the path is invalid (i.e. outside the
+ * configured 'files' or temp directories).
+ */
+function file_create_path(&$file) {
+
+
+ /*
+ * Note by Kyle C
+ *
+ * This should probably be updated to have better logic. Something along the lines
+ * of if private isn't set then we should query the database.
+ */
+ if ( !isset($file->private) ) {
+ $file->private = FILE_DOWNLOADS_PUBLIC;
+ }
+
+ // Avoiding Duplication with _file_create_path
+ return _file_create_path($file->filename, $file->private);
}
/**
@@ -57,15 +108,44 @@ function file_create_url($path) {
*
* @param $dest A string containing the path to verify. If this value is
* omitted, Drupal's 'files' directory will be used.
+ * @param $private An integer containg 0 if the public file path
+ * should be checked or a 1 if the private file path should be checked.
+ * This should be omitted if it isn't known whether a file will reside
+ * in the public or private file path.
* @return A string containing the path to file, with file system directory
* appended if necessary, or FALSE if the path is invalid (i.e. outside the
* configured 'files' or temp directories).
*/
-function file_create_path($dest = 0) {
- $file_path = file_directory_path();
+function _file_create_path($dest = 0, $private = NULL) {
+
+ /*
+ A small performance hit will be necessary in some cases because it won't
+ be clear from the calling function whether a file will be residing in
+ the public or private file path. So in that case we query the database
+ to determine if the file is public or private.
+ */
+ if ($private == NULL) {
+
+ $result = db_query("SELECT private,status FROM {files} WHERE filepath='%s'",$dest);
+ while($file = db_fetch_object($result) ) {
+ $private = $file->private;
+ }
+
+ }
+
+ // If private look in private files directory otherwise look in public files directory
+ if ($private == FILE_DOWNLOADS_PRIVATE) {
+ $file_path = file_directory_private_path();
+ }
+ else {
+ $file_path = file_directory_path();
+ }
+
+ // Return file_directory_path if $dest is not supplied
if (!$dest) {
return $file_path;
}
+
// file_check_location() checks whether the destination is inside the Drupal files directory.
if (file_check_location($dest, $file_path)) {
return $dest;
@@ -211,11 +291,11 @@ function file_check_location($source, $d
* - FILE_EXISTS_REPLACE - Replace the existing file
* - FILE_EXISTS_RENAME - Append _{incrementing number} until the filename is unique
* - FILE_EXISTS_ERROR - Do nothing and return FALSE.
- * @return True for success, FALSE for failure.
+ * @return TRUE for success, FALSE for failure.
*/
-function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
- $dest = file_create_path($dest);
-
+function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME, $private = FILE_DOWNLOADS_PUBLIC) {
+
+ $dest = _file_create_path($dest,$private);
$directory = $dest;
$basename = file_check_path($directory);
@@ -289,7 +369,7 @@ function file_copy(&$source, $dest = 0,
* - FILE_EXISTS_RENAME - Append _{incrementing number} until the filename is
* unique
* - FILE_EXISTS_ERROR - Do nothing and return FALSE.
- * @return The destination file path or FALSE if the file already exists and
+ * @return The destination file path or FALSE if the file already exists or
* FILE_EXISTS_ERROR was specified.
*/
function file_destination($destination, $replace) {
@@ -327,10 +407,10 @@ function file_destination($destination,
* - FILE_EXISTS_ERROR - Do nothing and return FALSE.
* @return True for success, FALSE for failure.
*/
-function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
+function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME, $private = FILE_DOWNLOADS_PUBLIC) {
$path_original = is_object($source) ? $source->filepath : $source;
- if (file_copy($source, $dest, $replace)) {
+ if (file_copy($source, $dest, $replace, $private)) {
$path_current = is_object($source) ? $source->filepath : $source;
if ($path_original == $path_current || file_delete($path_original)) {
@@ -413,6 +493,7 @@ function file_create_filename($basename,
}
else {
$name = $basename;
+ $ext = "";
}
$counter = 0;
@@ -538,7 +619,7 @@ function file_save_upload($source, $vali
// Create temporary name/path for newly uploaded files.
if (!$dest) {
- $dest = file_destination(file_create_path($file->filename), FILE_EXISTS_RENAME);
+ $dest = file_destination(file_create_path($file), FILE_EXISTS_RENAME);
}
$file->source = $source;
$file->destination = $dest;
@@ -787,7 +868,8 @@ function file_set_status(&$file, $status
* @param $headers An array of http headers to send along with file.
*/
function file_transfer($source, $headers) {
- ob_end_clean();
+
+ @ob_end_clean(); // Supress error messages because there may be no buffer!
foreach ($headers as $header) {
// To prevent HTTP header injection, we delete new lines that are
@@ -797,7 +879,7 @@ function file_transfer($source, $headers
drupal_set_header($header);
}
- $source = file_create_path($source);
+ $source = _file_create_path($source, FILE_DOWNLOADS_PRIVATE);
// Transfer file in 1024 byte chunks to save memory usage.
if ($fd = fopen($source, 'rb')) {
@@ -829,7 +911,7 @@ function file_download() {
$filepath = $_GET['file'];
}
- if (file_exists(file_create_path($filepath))) {
+ if (file_exists(_file_create_path($filepath,0))) {
$headers = module_invoke_all('file_download', $filepath);
if (in_array(-1, $headers)) {
return drupal_access_denied();
@@ -956,6 +1038,24 @@ function file_directory_path() {
}
/**
+ * Determine the default 'private-files' directory
+ *
+ * @return A string containing the path to Drupal's private-files directory.
+ */
+function file_directory_private_path() {
+ return variable_get('file_private_path','private-files');
+}
+
+/**
+* Determine whether downloads should be public or private by default.
+*
+* @ An integer containing 0 if file access is public and 0 if file access is private.
+*/
+function file_private_downloads() {
+ return variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC);
+}
+
+/**
* Determine the maximum file upload size by querying the PHP settings.
*
* @return
@@ -972,3 +1072,73 @@ function file_upload_max_size() {
}
return $max_size;
}
+
+
+/**
+ * Set file accessibility in Drupal's database and update file path accordingly.
+ *
+ * @param A file object that has had its "private" variable updated to indicate whether the file should be public or private.
+ * To have the file be privately accessibly a non-zero value should be used whereas public should have a value of zero.
+ *
+ * @return A boolean with TRUE if the operation was successful and FALSE if the operation failed.
+ */
+function file_set_private(&$file) {
+
+ // Make sure private member is set
+ if ( !isset($file->private) ) {
+ $file->private = FILE_DOWNLOADS_PUBLIC;
+ }
+
+ // If file is private we check the private directory to make sure it is writable, if not the directory is created
+ if( $file->private && file_check_directory( file_directory_private_path(), FILE_CREATE_DIRECTORY) ) {
+
+ // Move file to private path
+ if( file_move($file, file_directory_private_path(), FILE_EXISTS_RENAME, FILE_DOWNLOADS_PRIVATE) ) {
+ $result = db_query ('UPDATE {files} SET private=\'%d\', filepath=\'%s\' WHERE filename=\'%s\'',$file->private, $file->filepath, $file->filename);
+ return TRUE;
+ }
+ else {
+ drupal_set_message ('The chosen file could not be moved to the private path.','error');
+ return FALSE;
+ }
+ }
+ else if( $file->private ) {
+ drupal_set_message ('The chosen private path is not writable or cannot be created, please choose another.','error');
+ return FALSE;
+ }
+
+
+ // If this point has be reached the file is public
+ if( file_check_directory( file_directory_path(), FILE_CREATE_DIRECTORY) ) {
+
+ if( file_move( $file->filepath, file_directory_path(), FILE_EXISTS_RENAME, FILE_DOWNLOADS_PUBLIC ) ){
+ $result = db_query('UPDATE {files} SET private=\'%d\', filepath=\'%s\' WHERE filename=\'%s\'',$file->private, $file->filepath, $file->filename);
+ return TRUE;
+ }
+ else {
+ drupal_set_message('The chosen file could not be moved to the public path', 'error');
+ }
+ }
+
+ return FALSE;
+}
+
+
+/**
+*
+* This has been put in for debugging purposes.
+* It var_dumps arrays and objects and returns a string
+* to be used with drupal_set_message or it's ilk
+*
+*/
+function file_debug() {
+
+ for($i = 0; $i < func_num_args(); $i++) {
+
+ $string = ''.print_r( func_get_arg($i) , TRUE).'
';
+ $string = nl2br($string);
+ drupal_set_message($string, 'error');
+ $string = '';
+
+ }
+}
=== modified file 'includes/language.inc'
--- includes/language.inc 2007-07-11 20:07:00 +0000
+++ includes/language.inc 2007-08-08 19:38:53 +0000
@@ -1,5 +1,5 @@
javascript)) {
- drupal_add_js(file_create_path(variable_get('locale_js_directory', 'languages') .'/'. $language->language .'_'. $language->javascript .'.js'), 'core');
+ drupal_add_js(_file_create_path(variable_get('locale_js_directory', 'languages') .'/'. $language->language .'_'. $language->javascript .'.js', FILE_DOWNLOADS_PUBLIC), 'core');
}
}
@@ -2086,14 +2086,14 @@ function _locale_rebuild_js($langcode =
// Construct the directory where JS translation files are stored.
// There is (on purpose) no front end to edit that variable.
- $dir = file_create_path(variable_get('locale_js_directory', 'languages'));
+ $dir = _file_create_path(variable_get('locale_js_directory', 'languages'), FILE_DOWNLOADS_PUBLIC );
// Only create a new file if the content has changed.
$data_hash = md5($data);
if ($language->javascript != $data_hash) {
if (!empty($language->javascript)) {
// We are recreating the new file, so delete the old one.
- file_delete(file_create_path($dir .'/'. $language->language .'_'. $language->javascript .'.js'));
+ file_delete(_file_create_path($dir .'/'. $language->language .'_'. $language->javascript .'.js', FILE_DOWNLOADS_PUBLIC ));
$language->javascript = '';
}
else {
@@ -2141,7 +2141,7 @@ function _locale_rebuild_js($langcode =
// delete it and reset the database.
elseif (!empty($language->javascript)) {
// Delete the old JavaScript file
- file_delete(file_create_path(variable_get('locale_js_directory', 'languages') .'/'. $language->language .'_'. $language->javascript .'.js'));
+ file_delete(_file_create_path(variable_get('locale_js_directory', 'languages') .'/'. $language->language .'_'. $language->javascript .'.js', FILE_DOWNLOADS_PUBLIC));
db_query("UPDATE {languages} SET javascript = '' WHERE language = '%s'", $language->language);
watchdog('locale', 'Deleted JavaScript translation file for the locale %language.', array('%language' => t($language->name)));
}
=== modified file 'misc/collapse.js'
--- misc/collapse.js 2007-07-12 18:24:24 +0000
+++ misc/collapse.js 2007-08-08 19:38:54 +0000
@@ -1,17 +1,17 @@
-// $Id: collapse.js,v 1.15 2007/07/12 18:24:24 dries Exp $
+// $Id: collapse.js,v 1.14 2007/07/01 15:37:08 dries Exp $
/**
* Toggle the visibility of a fieldset using smooth animations
*/
Drupal.toggleFieldset = function(fieldset) {
if ($(fieldset).is('.collapsed')) {
- var content = $('> div', fieldset);
+ var content = $('> div', fieldset).hide();
$(fieldset).removeClass('collapsed');
- content.hide();
content.slideDown( {
- duration: 'fast',
- easing: 'linear',
+ duration: 300,
complete: function() {
+ // Make sure we open to height auto
+ $(this).css('height', 'auto');
Drupal.collapseScrollIntoView(this.parentNode);
this.parentNode.animating = false;
},
@@ -22,7 +22,7 @@ Drupal.toggleFieldset = function(fieldse
});
}
else {
- var content = $('> div', fieldset).slideUp('fast', function() {
+ var content = $('> div', fieldset).slideUp('medium', function() {
$(this.parentNode).addClass('collapsed');
this.parentNode.animating = false;
});
=== modified file 'misc/jquery.js'
--- misc/jquery.js 2007-07-12 18:24:24 +0000
+++ misc/jquery.js 2007-08-08 19:38:54 +0000
@@ -1,11 +1,11 @@
-// $Id: jquery.js,v 1.8 2007/07/12 18:24:24 dries Exp $
+// $Id: jquery.js,v 1.7 2007/06/04 10:36:42 goba Exp $
/*
- * jQuery 1.1.3.1 - New Wave Javascript
+ * jQuery 1.1.2 - New Wave Javascript
*
* Copyright (c) 2007 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*/
-eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","2y>"]||!s.J("<7g")&&[1,"<52>","52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","1r>"]||!s.J("<2V")&&[2,"<1r><1z>","1z>1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","2V>1z>1r>"]||!s.J("<73")&&[2,"<1r><4W>","4W>1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1o(/^\\s+|\\s+$/g,"")},2L:q(a){u r=[];7(1g a!="6I")E(u i=0,26=a.C;i<26;i++)r.R(a[i]);B r=a.51(0);v r},2w:q(b,a){E(u i=0,26=a.C;i<26;i++)7(a[i]==b)v i;v-1},1T:q(a,b){E(u i=0;b[i];i++)a.R(b[i]);v a},5g:q(a){u r=[],3P=6.1k++;E(u i=0,4G=a.C;i<4G;i++)7(3P!=a[i].1k){a[i].1k=3P;r.R(a[i])}v r},1k:0,2s:q(c,b,d){7(1g b=="1s")b=14 45("a","i","v "+b);u a=[];E(u i=0,30=c.C;i<30;i++)7(!d&&b(c[i],i)||d&&!b(c[i],i))a.R(c[i]);v a},3k:q(c,b){7(1g b=="1s")b=14 45("a","v "+b);u d=[];E(u i=0,30=c.C;i<30;i++){u a=b(c[i],i);7(a!==H&&a!=I){7(a.15!=2b)a=[a];d=d.6v(a)}}v d}});14 q(){u b=6u.6t.2H();6.M={4D:(b.3t(/.+(?:6s|6q|6o|6m)[\\/: ]([\\d.]+)/)||[])[1],20:/5l/.17(b),2a:/2a/.17(b),1h:/1h/.17(b)&&!/2a/.17(b),3j:/3j/.17(b)&&!/(6h|5l)/.17(b)};6.6g=!6.M.1h||P.6f=="6c";6.1U=6.M.1h?"1U":"5x",6.3H={"E":"68","67":"12","3x":6.1U,5x:6.1U,1U:6.1U,27:"27",12:"12",2v:"2v",2r:"2r",2B:"2B",65:"63",2T:"2T",62:"5Z"}};6.F({4v:"a.L",4p:"6.4p(a)",8o:"6.22(a,2,\'1X\')",8n:"6.22(a,2,\'4t\')",8k:"6.4q(a.L.1d,a)",8h:"6.4q(a.1d)"},q(i,n){6.11[i]=q(a){u b=6.3k(9,n);7(a&&1g a=="1s")b=6.2x(a,b);v 9.1Z(b)}});6.F({5o:"3e",8g:"5w",2K:"5t",8f:"5s"},q(i,n){6.11[i]=q(){u a=19;v 9.F(q(){E(u j=0,26=a.C;j<26;j++)6(a[j])[n](9)})}});6.F({5v:q(a){6.1b(9,a,"");9.8d(a)},8c:q(c){6.12.1A(9,c)},88:q(c){6.12.1E(9,c)},87:q(c){6.12[6.12.3w(9,c)?"1E":"1A"](9,c)},1E:q(a){7(!a||6.1i(a,[9]).r.C)9.L.3q(9)},2Y:q(){1v(9.1d)9.3q(9.1d)}},q(i,n){6.11[i]=q(){v 9.F(n,19)}});6.F(["5Q","5P","5O","5N"],q(i,n){6.11[n]=q(a,b){v 9.1i(":"+n+"("+a+")",b)}});6.F(["1u","29"],q(i,n){6.11[n]=q(h){v h==I?(9.C?6.1f(9[0],n):H):9.1f(n,h.15==33?h:h+"4o")}});6.1c({4n:{"":"m[2]==\'*\'||6.Q(a,m[2])","#":"a.35(\'2m\')==m[2]",":":{5P:"im[3]-0",22:"m[3]-0==i",5Q:"m[3]-0==i",2Q:"i==0",2P:"i==r.C-1",5L:"i%2==0",5K:"i%2","2Q-3u":"a.L.3R(\'*\')[0]==a","2P-3u":"6.22(a.L.5J,1,\'4t\')==a","86-3u":"!6.22(a.L.5J,2,\'4t\')",4v:"a.1d",2Y:"!a.1d",5N:"(a.5H||a.85||\'\').J(m[3])>=0",4f:\'"1y"!=a.G&&6.1f(a,"U")!="1P"&&6.1f(a,"48")!="1y"\',1y:\'"1y"==a.G||6.1f(a,"U")=="1P"||6.1f(a,"48")=="1y"\',84:"!a.2r",2r:"a.2r",2B:"a.2B",2T:"a.2T||6.1b(a,\'2T\')",2A:"\'2A\'==a.G",4b:"\'4b\'==a.G",5F:"\'5F\'==a.G",4l:"\'4l\'==a.G",5E:"\'5E\'==a.G",4k:"\'4k\'==a.G",5D:"\'5D\'==a.G",5C:"\'5C\'==a.G",1J:\'"1J"==a.G||6.Q(a,"1J")\',5B:"/5B|2y|82|1J/i.17(a.Q)"},"[":"6.1L(m[2],a).C"},5A:[/^\\[ *(@)([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,14 3o("^([:.#]*)("+(6.2J=6.M.20&&6.M.4D<"3.0.0"?"\\\\w":"(?:[\\\\w\\7Z-\\7X*1I-]|\\\\\\\\.)")+"+)")],2x:q(a,c,b){u d,1K=[];1v(a&&a!=d){d=a;u f=6.1i(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1K=b?c=f.r:6.1T(1K,f.r)}v 1K},1L:q(t,l){7(1g t!="1s")v[t];7(l&&!l.1q)l=H;l=l||P;7(!t.J("//")){l=l.4h;t=t.2G(2,t.C)}B 7(!t.J("/")&&!l.2O){l=l.4h;t=t.2G(1,t.C);7(t.J("/")>=1)t=t.2G(t.J("/"),t.C)}u b=[l],2j=[],2P;1v(t&&2P!=t){u r=[];2P=t;t=6.2C(t).1o(/^\\/\\//,"");u k=N;u g=14 3o("^[/>]\\\\s*("+6.2J+"+)");u m=g.1V(t);7(m){u o=m[1].1D();E(u i=0;b[i];i++)E(u c=b[i].1d;c;c=c.1X)7(c.1q==1&&(o=="*"||c.Q.1D()==o.1D()))r.R(c);b=r;t=t.1o(g,"");7(t.J(" ")==0)7R;k=K}B{g=/^((\\/?\\.\\.)|([>\\/+~]))\\s*([a-z]*)/i;7((m=g.1V(t))!=H){r=[];u o=m[4],1k=6.1k++;m=m[1];E(u j=0,2e=b.C;j<2e;j++)7(m.J("..")<0){u n=m=="~"||m=="+"?b[j].1X:b[j].1d;E(;n;n=n.1X)7(n.1q==1){7(m=="~"&&n.1k==1k)1F;7(!o||n.Q.1D()==o.1D()){7(m=="~")n.1k=1k;r.R(n)}7(m=="+")1F}}B r.R(b[j].L);b=r;t=6.2C(t.1o(g,""));k=K}}7(t&&!k){7(!t.J(",")){7(l==b[0])b.4e();2j=6.1T(2j,b);r=b=[l];t=" "+t.2G(1,t.C)}B{u h=14 3o("^("+6.2J+"+)(#)("+6.2J+"+)");u m=h.1V(t);7(m){m=[0,m[2],m[3],m[1]]}B{h=14 3o("^([#.]?)("+6.2J+"*)");m=h.1V(t)}m[2]=m[2].1o(/\\\\/g,"");u f=b[b.C-1];7(m[1]=="#"&&f&&f.4d){u p=f.4d(m[2]);7((6.M.1h||6.M.2a)&&p&&1g p.2m=="1s"&&p.2m!=m[2])p=6(\'[@2m="\'+m[2]+\'"]\',f)[0];b=r=p&&(!m[3]||6.Q(p,m[3]))?[p]:[]}B{E(u i=0;b[i];i++){u a=m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&b[i].Q.2H()=="7P")a="2E";r=6.1T(r,b[i].3R(a))}7(m[1]==".")r=6.4c(r,m[2]);7(m[1]=="#"){u e=[];E(u i=0;r[i];i++)7(r[i].35("2m")==m[2]){e=[r[i]];1F}r=e}b=r}t=t.1o(h,"")}}7(t){u d=6.1i(t,r);b=r=d.r;t=6.2C(d.t)}}7(t)b=[];7(b&&l==b[0])b.4e();2j=6.1T(2j,b);v 2j},4c:q(r,m,a){m=" "+m+" ";u b=[];E(u i=0;r[i];i++){u c=(" "+r[i].12+" ").J(m)>=0;7(!a&&c||a&&!c)b.R(r[i])}v b},1i:q(t,r,h){u d;1v(t&&t!=d){d=t;u p=6.5A,m;E(u i=0;p[i];i++){m=p[i].1V(t);7(m){t=t.7N(m[0].C);m[2]=m[2].1o(/\\\\/g,"");1F}}7(!m)1F;7(m[1]==":"&&m[2]=="4Y")r=6.1i(m[3],r,K).r;B 7(m[1]==".")r=6.4c(r,m[2],h);B 7(m[1]=="@"){u g=[],G=m[3];E(u i=0,2e=r.C;i<2e;i++){u a=r[i],z=a[6.3H[m[2]]||m[2]];7(z==H||/4M|2u/.17(m[2]))z=6.1b(a,m[2])||\'\';7((G==""&&!!z||G=="="&&z==m[5]||G=="!="&&z!=m[5]||G=="^="&&z&&!z.J(m[5])||G=="$="&&z.2G(z.C-m[5].C)==m[5]||(G=="*="||G=="~=")&&z.J(m[5])>=0)^h)g.R(a)}r=g}B 7(m[1]==":"&&m[2]=="22-3u"){u e=6.1k++,g=[],17=/(\\d*)n\\+?(\\d*)/.1V(m[3]=="5L"&&"2n"||m[3]=="5K"&&"2n+1"||!/\\D/.17(m[3])&&"n+"+m[3]||m[3]),2Q=(17[1]||1)-0,d=17[2]-0;E(u i=0,2e=r.C;i<2e;i++){u j=r[i],L=j.L;7(e!=L.1k){u c=1;E(u n=L.1d;n;n=n.1X)7(n.1q==1)n.4a=c++;L.1k=e}u b=N;7(2Q==1){7(d==0||j.4a==d)b=K}B 7((j.4a+d)%2Q==0)b=K;7(b^h)g.R(j)}r=g}B{u f=6.4n[m[1]];7(1g f!="1s")f=6.4n[m[1]][m[2]];49("f = q(a,i){v "+f+"}");r=6.2s(r,f,h)}}v{r:r,t:t}},4p:q(c){u b=[];u a=c.L;1v(a&&a!=P){b.R(a);a=a.L}v b},22:q(a,e,c,b){e=e||1;u d=0;E(;a;a=a[c])7(a.1q==1&&++d==e)1F;v a},4q:q(n,a){u r=[];E(;n;n=n.1X){7(n.1q==1&&(!a||n!=a))r.R(n)}v r}});6.S={1A:q(d,e,c,b){7(6.M.1h&&d.3m!=I)d=18;7(!c.1Q)c.1Q=9.1Q++;7(b!=I){u f=c;c=q(){v f.O(9,19)};c.W=b;c.1Q=f.1Q}7(!d.$1a)d.$1a={};7(!d.$1p)d.$1p=q(){u a;7(1g 6=="I"||6.S.47)v a;a=6.S.1p.O(d,19);v a};u g=d.$1a[e];7(!g){g=d.$1a[e]={};7(d.46)d.46(e,d.$1p,N);B d.7M("5r"+e,d.$1p)}g[c.1Q]=c;7(!9.Y[e])9.Y[e]=[];7(6.2w(d,9.Y[e])==-1)9.Y[e].R(d)},1Q:1,Y:{},1E:q(b,c,a){u d=b.$1a,1Y,2p;7(d){7(c&&c.G){a=c.44;c=c.G}7(!c){E(c V d)9.1E(b,c)}B 7(d[c]){7(a)3l d[c][a.1Q];B E(a V b.$1a[c])3l d[c][a];E(1Y V d[c])1F;7(!1Y){7(b.43)b.43(c,b.$1p,N);B b.7J("5r"+c,b.$1p);1Y=H;3l d[c];1v(9.Y[c]&&((2p=6.2w(b,9.Y[c]))>=0))3l 9.Y[c][2p]}}E(1Y V d)1F;7(!1Y)b.$1p=b.$1a=H}},1t:q(c,b,d){b=6.2L(b||[]);7(!d)6.F(9.Y[c]||[],q(){6.S.1t(c,b,9)});B{u a,1Y,11=6.16(d[c]||H);b.5p(9.42({G:c,1O:d}));7(6.16(d.$1p)&&(a=d.$1p.O(d,b))!==N)9.47=K;7(11&&a!==N&&!6.Q(d,\'a\'))d[c]();9.47=N}},1p:q(b){u a;b=6.S.42(b||18.S||{});u c=9.$1a&&9.$1a[b.G],1S=[].51.3D(19,1);1S.5p(b);E(u j V c){1S[0].44=c[j];1S[0].W=c[j].W;7(c[j].O(9,1S)===N){b.2d();b.2D();a=N}}7(6.M.1h)b.1O=b.2d=b.2D=b.44=b.W=H;v a},42:q(c){u a=c;c=6.1c({},a);c.2d=q(){7(a.2d)v a.2d();a.7H=N};c.2D=q(){7(a.2D)v a.2D();a.7F=K};7(!c.1O&&c.5n)c.1O=c.5n;7(6.M.20&&c.1O.1q==3)c.1O=a.1O.L;7(!c.41&&c.4j)c.41=c.4j==c.1O?c.7C:c.4j;7(c.5k==H&&c.5j!=H){u e=P.4h,b=P.4y;c.5k=c.5j+(e&&e.5i||b.5i);c.7z=c.7y+(e&&e.5f||b.5f)}7(!c.3h&&(c.5e||c.5d))c.3h=c.5e||c.5d;7(!c.5c&&c.5b)c.5c=c.5b;7(!c.3h&&c.1J)c.3h=(c.1J&1?1:(c.1J&2?3:(c.1J&4?2:0)));v c}};6.11.1c({3g:q(c,a,b){v c=="3z"?9.3Z(c,a,b):9.F(q(){6.S.1A(9,c,b||a,b&&a)})},3Z:q(d,b,c){v 9.F(q(){6.S.1A(9,d,q(a){6(9).3U(a);v(c||b).O(9,19)},c&&b)})},3U:q(a,b){v 9.F(q(){6.S.1E(9,a,b)})},1t:q(a,b){v 9.F(q(){6.S.1t(a,b,9)})},1R:q(){u a=19;v 9.5a(q(e){9.4u=0==9.4u?1:0;e.2d();v a[9.4u].O(9,[e])||N})},7w:q(f,g){q 3W(e){u p=e.41;1v(p&&p!=9)2g{p=p.L}25(e){p=9};7(p==9)v N;v(e.G=="3V"?f:g).O(9,[e])}v 9.3V(3W).59(3W)},1G:q(f){7(6.3d)f.O(P,[6]);B 6.2q.R(q(){v f.O(9,[6])});v 9}});6.1c({3d:N,2q:[],1G:q(){7(!6.3d){6.3d=K;7(6.2q){6.F(6.2q,q(){9.O(P)});6.2q=H}7(6.M.3j||6.M.2a)P.43("58",6.1G,N);7(!18.7v.C)6(18).1W(q(){6("#3T").1E()})}}});14 q(){6.F(("7u,7t,1W,7s,7r,3z,5a,7q,"+"7p,7o,7n,3V,59,7m,2y,"+"4k,7l,7k,7j,2c").2R(","),q(i,o){6.11[o]=q(f){v f?9.3g(o,f):9.1t(o)}});7(6.M.3j||6.M.2a)P.46("58",6.1G,N);B 7(6.M.1h){P.7i("<7h"+"7f 2m=3T 7e=K "+"2u=//:><\\/3b>");u a=P.4d("3T");7(a)a.7d=q(){7(9.3a!="1n")v;6.1G()};a=H}B 7(6.M.20)6.3N=3m(q(){7(P.3a=="79"||P.3a=="1n"){3M(6.3N);6.3N=H;6.1G()}},10);6.S.1A(18,"1W",6.1G)};7(6.M.1h)6(18).3Z("3z",q(){u a=6.S.Y;E(u b V a){u c=a[b],i=c.C;7(i&&b!=\'3z\')77 c[i-1]&&6.S.1E(c[i-1],b);1v(--i)}});6.11.1c({76:q(c,b,a){9.1W(c,b,a,1)},1W:q(g,d,c,e){7(6.16(g))v 9.3g("1W",g);c=c||q(){};u f="3K";7(d)7(6.16(d)){c=d;d=H}B{d=6.2E(d);f="50"}u h=9;6.2Z({1C:g,G:f,W:d,2t:e,1n:q(a,b){7(b=="28"||!e&&b=="4V")h.1b("27",a.3c).3J().F(c,[a.3c,b,a]);B c.O(h,[a.3c,b,a])}});v 9},72:q(){v 6.2E(9)},3J:q(){v 9.1L("3b").F(q(){7(9.2u)6.4U(9.2u);B 6.3I(9.2A||9.5H||9.27||"")}).2U()}});6.F("4T,4I,4S,4R,4Q,4P".2R(","),q(i,o){6.11[o]=q(f){v 9.3g(o,f)}});6.1c({1M:q(e,c,a,d,b){7(6.16(c)){a=c;c=H}v 6.2Z({G:"3K",1C:e,W:c,28:a,3G:d,2t:b})},6X:q(d,b,a,c){v 6.1M(d,b,a,c,1)},4U:q(b,a){v 6.1M(b,H,a,"3b")},6V:q(c,b,a){v 6.1M(c,b,a,"4N")},6T:q(d,b,a,c){7(6.16(b)){a=b;b={}}v 6.2Z({G:"50",1C:d,W:b,28:a,3G:c})},6S:q(a){6.36.21=a},6Q:q(a){6.1c(6.36,a)},36:{Y:K,G:"3K",21:0,4O:"6P/x-6O-34-6N",4K:K,38:K,W:H},32:{},2Z:q(s){s=6.1c({},6.36,s);7(s.W){7(s.4K&&1g s.W!="1s")s.W=6.2E(s.W);7(s.G.2H()=="1M"){s.1C+=((s.1C.J("?")>-1)?"&":"?")+s.W;s.W=H}}7(s.Y&&!6.3L++)6.S.1t("4T");u f=N;u h=18.4Z?14 4Z("6L.6J"):14 4J();h.7b(s.G,s.1C,s.38);7(s.W)h.3Q("6H-6G",s.4O);7(s.2t)h.3Q("6F-3O-6D",6.32[s.1C]||"6C, 6B 6A 6z 4r:4r:4r 6y");h.3Q("X-6x-6w","4J");7(s.56)s.56(h);7(s.Y)6.S.1t("4P",[h,s]);u g=q(d){7(h&&(h.3a==4||d=="21")){f=K;7(i){3M(i);i=H}u c;2g{c=6.54(h)&&d!="21"?s.2t&&6.4F(h,s.1C)?"4V":"28":"2c";7(c!="2c"){u b;2g{b=h.3E("53-3O")}25(e){}7(s.2t&&b)6.32[s.1C]=b;u a=6.55(h,s.3G);7(s.28)s.28(a,c);7(s.Y)6.S.1t("4Q",[h,s])}B 6.2X(s,h,c)}25(e){c="2c";6.2X(s,h,c,e)}7(s.Y)6.S.1t("4S",[h,s]);7(s.Y&&!--6.3L)6.S.1t("4I");7(s.1n)s.1n(h,c);7(s.38)h=H}};u i=3m(g,13);7(s.21>0)4C(q(){7(h){h.6r();7(!f)g("21")}},s.21);2g{h.6p(s.W)}25(e){6.2X(s,h,H,e)}7(!s.38)g();v h},2X:q(s,a,b,e){7(s.2c)s.2c(a,b,e);7(s.Y)6.S.1t("4R",[a,s,e])},3L:0,54:q(r){2g{v!r.23&&7A.7B=="4l:"||(r.23>=5u&&r.23<6l)||r.23==5m||6.M.20&&r.23==I}25(e){}v N},4F:q(a,c){2g{u b=a.3E("53-3O");v a.23==5m||b==6.32[c]||6.M.20&&a.23==I}25(e){}v N},55:q(r,b){u c=r.3E("6k-G");u a=!b&&c&&c.J("4B")>=0;a=b=="4B"||a?r.6j:r.3c;7(b=="3b")6.3I(a);7(b=="4N")a=49("("+a+")");7(b=="3F")6("<1x>").3F(a).3J();v a},2E:q(a){u s=[];7(a.15==2b||a.3C)6.F(a,q(){s.R(2l(9.6i)+"="+2l(9.2v))});B E(u j V a)7(a[j]&&a[j].15==2b)6.F(a[j],q(){s.R(2l(j)+"="+2l(9))});B s.R(2l(j)+"="+2l(a[j]));v s.5M("&")},3I:q(a){7(18.4A)18.4A(a);B 7(6.M.20)18.4C(a,0);B 49.3D(18,a)}});6.11.1c({1m:q(b,a){v b?9.1w({1u:"1m",29:"1m",1e:"1m"},b,a):9.1i(":1y").F(q(){9.T.U=9.2i?9.2i:"";7(6.1f(9,"U")=="1P")9.T.U="2h"}).2U()},1j:q(b,a){v b?9.1w({1u:"1j",29:"1j",1e:"1j"},b,a):9.1i(":4f").F(q(){9.2i=9.2i||6.1f(9,"U");7(9.2i=="1P")9.2i="2h";9.T.U="1P"}).2U()},5G:6.11.1R,1R:q(a,b){v 6.16(a)&&6.16(b)?9.5G(a,b):a?9.1w({1u:"1R",29:"1R",1e:"1R"},a,b):9.F(q(){6(9)[6(9).37(":1y")?"1m":"1j"]()})},6e:q(b,a){v 9.1w({1u:"1m"},b,a)},6d:q(b,a){v 9.1w({1u:"1j"},b,a)},6b:q(b,a){v 9.1w({1u:"1R"},b,a)},6a:q(b,a){v 9.1w({1e:"1m"},b,a)},69:q(b,a){v 9.1w({1e:"1j"},b,a)},7U:q(c,a,b){v 9.1w({1e:a},c,b)},1w:q(d,h,f,g){v 9.1l(q(){u c=6(9).37(":1y"),1H=6.5z(h,f,g),5y=9;E(u p V d){7(d[p]=="1j"&&c||d[p]=="1m"&&!c)v 6.16(1H.1n)&&1H.1n.O(9);7(p=="1u"||p=="29"){1H.U=6.1f(9,"U");1H.2f=9.T.2f}}7(1H.2f!=H)9.T.2f="1y";9.2k=6.1c({},d);6.F(d,q(a,b){u e=14 6.2M(5y,1H,a);7(b.15==3y)e.2W(e.1K(),b);B e[b=="1R"?c?"1m":"1j":b](d)})})},1l:q(a,b){7(!b){b=a;a="2M"}v 9.F(q(){7(!9.1l)9.1l={};7(!9.1l[a])9.1l[a]=[];9.1l[a].R(b);7(9.1l[a].C==1)b.O(9)})}});6.1c({5z:q(b,a,c){u d=b&&b.15==64?b:{1n:c||!c&&a||6.16(b)&&b,1B:b,2I:c&&a||a&&a.15!=45&&a||(6.2I.4i?"4i":"4w")};d.1B=(d.1B&&d.1B.15==3y?d.1B:{61:60,89:5u}[d.1B])||8a;d.2N=d.1n;d.1n=q(){6.5I(9,"2M");7(6.16(d.2N))d.2N.O(9)};v d},2I:{4w:q(p,n,b,a){v b+a*p},4i:q(p,n,b,a){v((-5W.5X(p*5W.8e)/2)+0.5)*a+b}},1l:{},5I:q(b,a){a=a||"2M";7(b.1l&&b.1l[a]){b.1l[a].4e();u f=b.1l[a][0];7(f)f.O(b)}},3B:[],2M:q(f,e,g){u z=9;u y=f.T;z.a=q(){7(e.3A)e.3A.O(f,[z.2o]);7(g=="1e")6.1b(y,"1e",z.2o);B{y[g]=8m(z.2o)+"4o";y.U="2h"}};z.5V=q(){v 39(6.1f(f,g))};z.1K=q(){u r=39(6.2z(f,g));v r&&r>-8l?r:z.5V()};z.2W=q(c,b){z.4s=(14 5T()).5S();z.2o=c;z.a();6.3B.R(q(){v z.3A(c,b)});7(6.3B.C==1){u d=3m(q(){u a=6.3B;E(u i=0;ie.1B+z.4s){z.2o=c;z.a();7(f.2k)f.2k[g]=K;u b=K;E(u i V f.2k)7(f.2k[i]!==K)b=N;7(b){7(e.U!=H){y.2f=e.2f;y.U=e.U;7(6.1f(f,"U")=="1P")y.U="2h"}7(e.1j)y.U="1P";7(e.1j||e.1m)E(u p V f.2k)6.1b(y,p,f.24[p])}7(b&&6.16(e.1n))e.1n.O(f);v N}B{u n=t-9.4s;u p=n/e.1B;z.2o=6.2I[e.2I](p,n,a,(c-a),e.1B);z.a()}v K}}})}',62,524,'||||||jQuery|if||this|||||||||||||||||function||||var|return||||||else|length||for|each|type|null|undefined|indexOf|true|parentNode|browser|false|apply|document|nodeName|push|event|style|display|in|data||global|||fn|className||new|constructor|isFunction|test|window|arguments|events|attr|extend|firstChild|opacity|css|typeof|msie|filter|hide|mergeNum|queue|show|complete|replace|handle|nodeType|table|string|trigger|height|while|animate|div|hidden|tbody|add|duration|url|toUpperCase|remove|break|ready|opt|_|button|cur|find|get|tb|target|none|guid|toggle|args|merge|styleFloat|exec|load|nextSibling|ret|pushStack|safari|timeout|nth|status|orig|catch|al|innerHTML|success|width|opera|Array|error|preventDefault|rl|overflow|try|block|oldblock|done|curAnim|encodeURIComponent|id||now|index|readyList|disabled|grep|ifModified|src|value|inArray|multiFilter|select|curCSS|text|checked|trim|stopPropagation|param|domManip|substr|toLowerCase|easing|chars|insertBefore|makeArray|fx|old|ownerDocument|last|first|split|childNodes|selected|end|tr|custom|handleError|empty|ajax|el|clean|lastModified|String|form|getAttribute|ajaxSettings|is|async|parseFloat|readyState|script|responseText|isReady|append|defaultView|bind|which|position|mozilla|map|delete|setInterval|static|RegExp|oWidth|removeChild|oHeight|cloneNode|match|child|toString|has|float|Number|unload|step|timers|jquery|call|getResponseHeader|html|dataType|props|globalEval|evalScripts|GET|active|clearInterval|safariTimer|Modified|num|setRequestHeader|getElementsByTagName|currentStyle|__ie_init|unbind|mouseover|handleHover|init|getComputedStyle|one|isXMLDoc|relatedTarget|fix|removeEventListener|handler|Function|addEventListener|triggered|visibility|eval|nodeIndex|radio|classFilter|getElementById|shift|visible|appendChild|documentElement|swing|fromElement|submit|file|swap|expr|px|parents|sibling|00|startTime|previousSibling|lastToggle|parent|linear|ol|body|tagName|execScript|xml|setTimeout|version|setArray|httpNotModified|fl|prop|ajaxStop|XMLHttpRequest|processData|alpha|href|json|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxComplete|ajaxStart|getScript|notmodified|colgroup|100|not|ActiveXObject|POST|slice|fieldset|Last|httpSuccess|httpData|beforeSend|getPropertyValue|DOMContentLoaded|mouseout|click|ctrlKey|metaKey|keyCode|charCode|scrollTop|unique|createElement|scrollLeft|clientX|pageX|webkit|304|srcElement|appendTo|unshift|prevObject|on|after|before|200|removeAttr|prepend|cssFloat|self|speed|parse|input|reset|image|password|checkbox|_toggle|textContent|dequeue|lastChild|odd|even|join|contains|gt|lt|eq|nodeValue|getTime|Date|zoom|max|Math|cos|font|maxLength|600|slow|maxlength|readOnly|Object|readonly|createTextNode|class|htmlFor|fadeOut|fadeIn|slideToggle|CSS1Compat|slideUp|slideDown|compatMode|boxModel|compatible|name|responseXML|content|300|ie|noConflict|ra|send|it|abort|rv|userAgent|navigator|concat|With|Requested|GMT|1970|Jan|01|Thu|Since|reverse|If|Type|Content|array|XMLHTTP|ig|Microsoft|NaN|urlencoded|www|application|ajaxSetup|val|ajaxTimeout|post|setAttribute|getJSON|getAttributeNode|getIfModified|method|FORM|action|options|serialize|col|th|td|loadIfModified|do|colg|loaded|tfoot|open|thead|onreadystatechange|defer|ipt|leg|scr|write|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|dblclick|scroll|resize|focus|blur|frames|hover|clone|clientY|pageY|location|protocol|toElement|clientWidth|clientHeight|cancelBubble|relative|returnValue|left|detachEvent|right|absolute|attachEvent|substring|offsetWidth|object|offsetHeight|continue|Width|border|fadeTo|padding|size|uFFFF|Left|u0128|Right|Bottom|textarea|Top|enabled|innerText|only|toggleClass|removeClass|fast|400|wrap|addClass|removeAttribute|PI|insertAfter|prependTo|children|line|splice|siblings|10000|parseInt|prev|next|weight|1px|prototype'.split('|'),0,{}))
+eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7(1C 1w.6=="T"){1w.T=1w.T;B 6=u(a,c){7(1w==q)v 1p 6(a,c);a=a||17;7(6.1t(a))v 1p 6(17)[6.E.27?"27":"2O"](a);7(1C a=="23"){B m=/^[^<]*(<(.|\\s)+>)[^>]*$/.2Q(a);7(m)a=6.3k([m[1]]);J v 1p 6(c).2o(a)}v q.6r(a.1l==2y&&a||(a.3Y||a.I&&a!=1w&&!a.24&&a[0]!=T&&a[0].24)&&6.3M(a)||[a])};7(1C $!="T")6.2S$=$;B $=6;6.E=6.8p={3Y:"1.1.2",8q:u(){v q.I},I:0,2b:u(1T){v 1T==T?6.3M(q):q[1T]},2r:u(a){B L=6(a);L.6p=q;v L},6r:u(a){q.I=0;[].1g.14(q,a);v q},K:u(E,1E){v 6.K(q,E,1E)},2h:u(1c){B 4c=-1;q.K(u(i){7(q==1c)4c=i});v 4c},1I:u(1Y,O,C){B 1c=1Y;7(1Y.1l==3t)7(O==T)v q.I&&6[C||"1I"](q[0],1Y)||T;J{1c={};1c[1Y]=O}v q.K(u(2h){P(B H 1x 1c)6.1I(C?q.1q:q,H,6.H(q,1c[H],C,2h,H))})},1m:u(1Y,O){v q.1I(1Y,O,"30")},2L:u(e){7(1C e=="23")v q.3u().3r(17.8t(e));B t="";6.K(e||q,u(){6.K(q.2I,u(){7(q.24!=8)t+=q.24!=1?q.60:6.E.2L([q])})});v t},2K:u(){B a=6.3k(1A);v q.K(u(){B b=a[0].3l(U);q.11.2X(b,q);22(b.1b)b=b.1b;b.4C(q)})},3r:u(){v q.3j(1A,U,1,u(a){q.4C(a)})},5i:u(){v q.3j(1A,U,-1,u(a){q.2X(a,q.1b)})},5j:u(){v q.3j(1A,12,1,u(a){q.11.2X(a,q)})},5t:u(){v q.3j(1A,12,-1,u(a){q.11.2X(a,q.2e)})},4g:u(){v q.6p||6([])},2o:u(t){v q.2r(6.31(q,u(a){v 6.2o(t,a)}),t)},4Y:u(4N){v q.2r(6.31(q,u(a){B a=a.3l(4N!=T?4N:U);a.$1H=16;v a}))},1D:u(t){v q.2r(6.1t(t)&&6.2q(q,u(2z,2h){v t.14(2z,[2h])})||6.3z(t,q))},2g:u(t){v q.2r(t.1l==3t&&6.3z(t,q,U)||6.2q(q,u(a){v(t.1l==2y||t.3Y)?6.3y(a,t)<0:a!=t}))},1M:u(t){v q.2r(6.2k(q.2b(),t.1l==3t?6(t).2b():t.I!=T&&(!t.1f||t.1f=="8v")?t:[t]))},4l:u(1s){v 1s?6.1D(1s,q).r.I>0:12},1a:u(1a){v 1a==T?(q.I?q[0].O:16):q.1I("O",1a)},4U:u(1a){v 1a==T?(q.I?q[0].2t:16):q.3u().3r(1a)},3j:u(1E,1P,3Z,E){B 4Y=q.I>1;B a=6.3k(1E);7(3Z<0)a.8w();v q.K(u(){B 1c=q;7(1P&&6.1f(q,"1P")&&6.1f(a[0],"3m"))1c=q.5J("20")[0]||q.4C(17.6n("20"));6.K(a,u(){E.14(1c,[4Y?q.3l(U):q])})})}};6.1z=6.E.1z=u(){B 1O=1A[0],a=1;7(1A.I==1){1O=q;a=0}B H;22(H=1A[a++])P(B i 1x H)1O[i]=H[i];v 1O};6.1z({8x:u(){7(6.2S$)$=6.2S$;v 6},1t:u(E){v!!E&&1C E!="23"&&!E.1f&&1C E[0]=="T"&&/u/i.1n(E+"")},4B:u(D){v D.66&&D.5I&&!D.5I.64},1f:u(D,Y){v D.1f&&D.1f.3K()==Y.3K()},K:u(1c,E,1E){7(1c.I==T)P(B i 1x 1c)E.14(1c[i],1E||[i,1c[i]]);J P(B i=0,6q=1c.I;i<6q;i++)7(E.14(1c[i],1E||[i,1c[i]])===12)3O;v 1c},H:u(D,O,C,2h,H){7(6.1t(O))O=O.3n(D,[2h]);B 6s=/z-?2h|7P-?8A|1d|58|8B-?28/i;v O&&O.1l==3Q&&C=="30"&&!6s.1n(H)?O+"4S":O},19:{1M:u(D,c){6.K(c.3o(/\\s+/),u(i,Q){7(!6.19.2V(D.19,Q))D.19+=(D.19?" ":"")+Q})},2f:u(D,c){D.19=c?6.2q(D.19.3o(/\\s+/),u(Q){v!6.19.2V(c,Q)}).6t(" "):""},2V:u(t,c){t=t.19||t;c=c.1R(/([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:])/g,"\\\\$1");v t&&1p 4v("(^|\\\\s)"+c+"(\\\\s|$)").1n(t)}},4d:u(e,o,f){P(B i 1x o){e.1q["1N"+i]=e.1q[i];e.1q[i]=o[i]}f.14(e,[]);P(B i 1x o)e.1q[i]=e.1q["1N"+i]},1m:u(e,p){7(p=="28"||p=="3V"){B 1N={},46,3P,d=["7d","8C","8D","8E"];6.K(d,u(){1N["8F"+q]=0;1N["8G"+q+"8H"]=0});6.4d(e,1N,u(){7(6.1m(e,"1h")!="1Z"){46=e.8I;3P=e.8J}J{e=6(e.3l(U)).2o(":4j").5l("2Z").4g().1m({4n:"1G",45:"8K",1h:"2D",7I:"0",8M:"0"}).5z(e.11)[0];B 3d=6.1m(e.11,"45");7(3d==""||3d=="4b")e.11.1q.45="6x";46=e.6y;3P=e.6z;7(3d==""||3d=="4b")e.11.1q.45="4b";e.11.33(e)}});v p=="28"?46:3P}v 6.30(e,p)},30:u(D,H,53){B L;7(H=="1d"&&6.W.1j)v 6.1I(D.1q,"1d");7(H=="4h"||H=="2v")H=6.W.1j?"3T":"2v";7(!53&&D.1q[H])L=D.1q[H];J 7(17.44&&17.44.4W){7(H=="2v"||H=="3T")H="4h";H=H.1R(/([A-Z])/g,"-$1").4m();B Q=17.44.4W(D,16);7(Q)L=Q.55(H);J 7(H=="1h")L="1Z";J 6.4d(D,{1h:"2D"},u(){B c=17.44.4W(q,"");L=c&&c.55(H)||""})}J 7(D.51){B 56=H.1R(/\\-(\\w)/g,u(m,c){v c.3K()});L=D.51[H]||D.51[56]}v L},3k:u(a){B r=[];6.K(a,u(i,1r){7(!1r)v;7(1r.1l==3Q)1r=1r.6C();7(1C 1r=="23"){B s=6.35(1r),1V=17.6n("1V"),2i=[];B 2K=!s.18("<1u")&&[1,"<42>","42>"]||(!s.18("<6D")||!s.18("<20")||!s.18("<6E"))&&[1,"<1P>","1P>"]||!s.18("<3m")&&[2,"<1P><20>","20>1P>"]||(!s.18("<6F")||!s.18("<6G"))&&[3,"<1P><20><3m>","3m>20>1P>"]||[0,"",""];1V.2t=2K[1]+s+2K[2];22(2K[0]--)1V=1V.1b;7(6.W.1j){7(!s.18("<1P")&&s.18("<20")<0)2i=1V.1b&&1V.1b.2I;J 7(2K[1]=="<1P>"&&s.18("<20")<0)2i=1V.2I;P(B n=2i.I-1;n>=0;--n)7(6.1f(2i[n],"20")&&!2i[n].2I.I)2i[n].11.33(2i[n])}1r=[];P(B i=0,l=1V.2I.I;im[3]-0",2a:"m[3]-0==i",5q:"m[3]-0==i",2u:"i==0",2T:"i==r.I-1",5R:"i%2==0",5S:"i%2","2a-3s":"6.2a(a.11.1b,m[3],\'2e\',a)==a","2u-3s":"6.2a(a.11.1b,1,\'2e\')==a","2T-3s":"6.2a(a.11.7n,1,\'5s\')==a","7p-3s":"6.2B(a.11.1b).I==1",5u:"a.1b",3u:"!a.1b",5v:"6.E.2L.14([a]).18(m[3])>=0",3i:\'a.C!="1G"&&6.1m(a,"1h")!="1Z"&&6.1m(a,"4n")!="1G"\',1G:\'a.C=="1G"||6.1m(a,"1h")=="1Z"||6.1m(a,"4n")=="1G"\',7v:"!a.2W",2W:"a.2W",2Z:"a.2Z",2Y:"a.2Y||6.1I(a,\'2Y\')",2L:"a.C==\'2L\'",4j:"a.C==\'4j\'",5x:"a.C==\'5x\'",4G:"a.C==\'4G\'",5y:"a.C==\'5y\'",4R:"a.C==\'4R\'",5A:"a.C==\'5A\'",5B:"a.C==\'5B\'",3x:\'a.C=="3x"||6.1f(a,"3x")\',5C:"/5C|42|7A|3x/i.1n(a.1f)"},".":"6.19.2V(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z&&!z.18(m[4])","$=":"z&&z.2U(z.I - m[4].I,m[4].I)==m[4]","*=":"z&&z.18(m[4])>=0","":"z",4u:u(m){v["",m[1],m[3],m[2],m[5]]},5P:"z=a[m[3]];7(!z||/5E|3e/.1n(m[3]))z=6.1I(a,m[3]);"},"[":"6.2o(m[2],a).I"},5M:[/^\\[ *(@)([a-2m-3C-]*) *([!*$^=]*) *(\'?"?)(.*?)\\4 *\\]/i,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([a-2m-3C-]*)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/i,/^([:.#]*)([a-2m-3C*-]*)/i],1Q:[/^(\\/?\\.\\.)/,"a.11",/^(>|\\/)/,"6.2B(a.1b)",/^(\\+)/,"6.2a(a,2,\'2e\')",/^(~)/,u(a){B s=6.2B(a.11.1b);v s.3N(6.3y(a,s)+1)}],3z:u(1s,1U,2g){B 1N,Q=[];22(1s&&1s!=1N){1N=1s;B f=6.1D(1s,1U,2g);1s=f.t.1R(/^\\s*,\\s*/,"");Q=2g?1U=f.r:6.2k(Q,f.r)}v Q},2o:u(t,1B){7(1C t!="23")v[t];7(1B&&!1B.24)1B=16;1B=1B||17;7(!t.18("//")){1B=1B.4H;t=t.2U(2,t.I)}J 7(!t.18("/")){1B=1B.4H;t=t.2U(1,t.I);7(t.18("/")>=1)t=t.2U(t.18("/"),t.I)}B L=[1B],2c=[],2T=16;22(t&&2T!=t){B r=[];2T=t;t=6.35(t).1R(/^\\/\\//i,"");B 3B=12;B 1J=/^[\\/>]\\s*([a-2m-9*-]+)/i;B m=1J.2Q(t);7(m){6.K(L,u(){P(B c=q.1b;c;c=c.2e)7(c.24==1&&(6.1f(c,m[1])||m[1]=="*"))r.1g(c)});L=r;t=t.1R(1J,"");7(t.18(" ")==0)5F;3B=U}J{P(B i=0;i<6.1Q.I;i+=2){B 1J=6.1Q[i];B m=1J.2Q(t);7(m){r=L=6.31(L,6.1t(6.1Q[i+1])?6.1Q[i+1]:u(a){v 40(6.1Q[i+1])});t=6.35(t.1R(1J,""));3B=U;3O}}}7(t&&!3B){7(!t.18(",")){7(L[0]==1B)L.4L();6.2k(2c,L);r=L=[1B];t=" "+t.2U(1,t.I)}J{B 34=/^([a-2m-3C-]+)(#)([a-2m-9\\\\*2S-]*)/i;B m=34.2Q(t);7(m){m=[0,m[2],m[3],m[1]]}J{34=/^([#.]?)([a-2m-9\\\\*2S-]*)/i;m=34.2Q(t)}7(m[1]=="#"&&L[L.I-1].4X){B 2l=L[L.I-1].4X(m[2]);7(6.W.1j&&2l&&2l.2J!=m[2])2l=6(\'[@2J="\'+m[2]+\'"]\',L[L.I-1])[0];L=r=2l&&(!m[3]||6.1f(2l,m[3]))?[2l]:[]}J{7(m[1]==".")B 4r=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");6.K(L,u(){B 3E=m[1]!=""||m[0]==""?"*":m[2];7(6.1f(q,"7J")&&3E=="*")3E="3g";6.2k(r,m[1]!=""&&L.I!=1?6.4x(q,[],m[1],m[2],4r):q.5J(3E))});7(m[1]=="."&&L.I==1)r=6.2q(r,u(e){v 4r.1n(e.19)});7(m[1]=="#"&&L.I==1){B 5K=r;r=[];6.K(5K,u(){7(q.36("2J")==m[2]){r=[q];v 12}})}L=r}t=t.1R(34,"")}}7(t){B 1a=6.1D(t,r);L=r=1a.r;t=6.35(1a.t)}}7(L&&L[0]==1B)L.4L();6.2k(2c,L);v 2c},1D:u(t,r,2g){22(t&&/^[a-z[({<*:.#]/i.1n(t)){B p=6.5M,m;6.K(p,u(i,1J){m=1J.2Q(t);7(m){t=t.7M(m[0].I);7(6.1s[m[1]].4u)m=6.1s[m[1]].4u(m);v 12}});7(m[1]==":"&&m[2]=="2g")r=6.1D(m[3],r,U).r;J 7(m[1]=="."){B 1J=1p 4v("(^|\\\\s)"+m[2]+"(\\\\s|$)");r=6.2q(r,u(e){v 1J.1n(e.19||"")},2g)}J{B f=6.1s[m[1]];7(1C f!="23")f=6.1s[m[1]][m[2]];40("f = u(a,i){"+(6.1s[m[1]].5P||"")+"v "+f+"}");r=6.2q(r,f,2g)}}v{r:r,t:t}},4x:u(o,r,1Q,Y,1J){P(B s=o.1b;s;s=s.2e)7(s.24==1){B 1M=U;7(1Q==".")1M=s.19&&1J.1n(s.19);J 7(1Q=="#")1M=s.36("2J")==Y;7(1M)r.1g(s);7(1Q=="#"&&r.I)3O;7(s.1b)6.4x(s,r,1Q,Y,1J)}v r},4z:u(D){B 4A=[];B Q=D.11;22(Q&&Q!=17){4A.1g(Q);Q=Q.11}v 4A},2a:u(Q,1i,3Z,D){1i=1i||1;B 1T=0;P(;Q;Q=Q[3Z]){7(Q.24==1)1T++;7(1T==1i||1i=="5R"&&1T%2==0&&1T>1&&Q==D||1i=="5S"&&1T%2==1&&Q==D)v Q}},2B:u(n,D){B r=[];P(;n;n=n.2e){7(n.24==1&&(!D||n!=D))r.1g(n)}v r}});6.G={1M:u(S,C,1o,F){7(6.W.1j&&S.3L!=T)S=1w;7(F)1o.F=F;7(!1o.2A)1o.2A=q.2A++;7(!S.$1H)S.$1H={};B 38=S.$1H[C];7(!38){38=S.$1H[C]={};7(S["39"+C])38[0]=S["39"+C]}38[1o.2A]=1o;S["39"+C]=q.5Y;7(!q.1k[C])q.1k[C]=[];q.1k[C].1g(S)},2A:1,1k:{},2f:u(S,C,1o){7(S.$1H){B i,j,k;7(C&&C.C){1o=C.1o;C=C.C}7(C&&S.$1H[C])7(1o)5U S.$1H[C][1o.2A];J P(i 1x S.$1H[C])5U S.$1H[C][i];J P(j 1x S.$1H)q.2f(S,j);P(k 1x S.$1H[C])7(k){k=U;3O}7(!k)S["39"+C]=16}},1S:u(C,F,S){F=6.3M(F||[]);7(!S)6.K(q.1k[C]||[],u(){6.G.1S(C,F,q)});J{B 1o=S["39"+C],1a,E=6.1t(S[C]);7(1o){F.61(q.2j({C:C,1O:S}));7((1a=1o.14(S,F))!==12)q.4F=U}7(E&&1a!==12)S[C]();q.4F=12}},5Y:u(G){7(1C 6=="T"||6.G.4F)v;G=6.G.2j(G||1w.G||{});B 3R;B c=q.$1H[G.C];B 1E=[].3N.3n(1A,1);1E.61(G);P(B j 1x c){1E[0].1o=c[j];1E[0].F=c[j].F;7(c[j].14(q,1E)===12){G.2n();G.2H();3R=12}}7(6.W.1j)G.1O=G.2n=G.2H=G.1o=G.F=16;v 3R},2j:u(G){7(!G.1O&&G.63)G.1O=G.63;7(G.65==T&&G.67!=T){B e=17.4H,b=17.64;G.65=G.67+(e.68||b.68);G.7Y=G.7Z+(e.6c||b.6c)}7(6.W.2N&&G.1O.24==3){B 3a=G;G=6.1z({},3a);G.1O=3a.1O.11;G.2n=u(){v 3a.2n()};G.2H=u(){v 3a.2H()}}7(!G.2n)G.2n=u(){q.3R=12};7(!G.2H)G.2H=u(){q.82=U};v G}};6.E.1z({3U:u(C,F,E){v q.K(u(){6.G.1M(q,C,E||F,F)})},6u:u(C,F,E){v q.K(u(){6.G.1M(q,C,u(G){6(q).6f(G);v(E||F).14(q,1A)},F)})},6f:u(C,E){v q.K(u(){6.G.2f(q,C,E)})},1S:u(C,F){v q.K(u(){6.G.1S(C,F,q)})},3X:u(){B a=1A;v q.6j(u(e){q.4M=q.4M==0?1:0;e.2n();v a[q.4M].14(q,[e])||12})},83:u(f,g){u 4O(e){B p=(e.C=="41"?e.84:e.85)||e.86;22(p&&p!=q)2G{p=p.11}2w(e){p=q};7(p==q)v 12;v(e.C=="41"?f:g).14(q,[e])}v q.41(4O).6k(4O)},27:u(f){7(6.3W)f.14(17,[6]);J{6.3c.1g(u(){v f.14(q,[6])})}v q}});6.1z({3W:12,3c:[],27:u(){7(!6.3W){6.3W=U;7(6.3c){6.K(6.3c,u(){q.14(17)});6.3c=16}7(6.W.3h||6.W.3f)17.87("6o",6.27,12)}}});1p u(){6.K(("88,8a,2O,8b,8d,52,6j,8e,"+"8f,8g,8h,41,6k,8j,42,"+"4R,8k,8l,8m,2C").3o(","),u(i,o){6.E[o]=u(f){v f?q.3U(o,f):q.1S(o)}});7(6.W.3h||6.W.3f)17.8n("6o",6.27,12);J 7(6.W.1j){17.8o("<8r"+"8s 2J=62 8u=U "+"3e=//:><\\/2d>");B 2d=17.4X("62");7(2d)2d.37=u(){7(q.3D!="1X")v;q.11.33(q);6.27()};2d=16}J 7(6.W.2N)6.50=3L(u(){7(17.3D=="8y"||17.3D=="1X"){4p(6.50);6.50=16;6.27()}},10);6.G.1M(1w,"2O",6.27)};7(6.W.1j)6(1w).6u("52",u(){B 1k=6.G.1k;P(B C 1x 1k){B 4Z=1k[C],i=4Z.I;7(i&&C!=\'52\')6w 6.G.2f(4Z[i-1],C);22(--i)}});6.E.1z({6A:u(V,21,M){q.2O(V,21,M,1)},2O:u(V,21,M,1W){7(6.1t(V))v q.3U("2O",V);M=M||u(){};B C="5d";7(21)7(6.1t(21)){M=21;21=16}J{21=6.3g(21);C="5V"}B 4e=q;6.3v({V:V,C:C,F:21,1W:1W,1X:u(2P,15){7(15=="2M"||!1W&&15=="5L")4e.1I("2t",2P.3G).4V().K(M,[2P.3G,15,2P]);J M.14(4e,[2P.3G,15,2P])}});v q},6B:u(){v 6.3g(q)},4V:u(){v q.2o("2d").K(u(){7(q.3e)6.59(q.3e);J 6.4a(q.2L||q.6H||q.2t||"")}).4g()}});7(!1w.3p)3p=u(){v 1p 6I("6K.6M")};6.K("5m,5Q,5O,5W,5N,5H".3o(","),u(i,o){6.E[o]=u(f){v q.3U(o,f)}});6.1z({2b:u(V,F,M,C,1W){7(6.1t(F)){M=F;F=16}v 6.3v({V:V,F:F,2M:M,4t:C,1W:1W})},6Q:u(V,F,M,C){v 6.2b(V,F,M,C,1)},59:u(V,M){v 6.2b(V,16,M,"2d")},6S:u(V,F,M){v 6.2b(V,F,M,"6m")},6U:u(V,F,M,C){7(6.1t(F)){M=F;F={}}v 6.3v({C:"5V",V:V,F:F,2M:M,4t:C})},6X:u(29){6.3q.29=29},6Y:u(5c){6.1z(6.3q,5c)},3q:{1k:U,C:"5d",29:0,5r:"70/x-73-3w-77",5h:U,48:U,F:16},3S:{},3v:u(s){s=6.1z({},6.3q,s);7(s.F){7(s.5h&&1C s.F!="23")s.F=6.3g(s.F);7(s.C.4m()=="2b"){s.V+=((s.V.18("?")>-1)?"&":"?")+s.F;s.F=16}}7(s.1k&&!6.4E++)6.G.1S("5m");B 4y=12;B N=1p 3p();N.7j(s.C,s.V,s.48);7(s.F)N.3A("7l-7m",s.5r);7(s.1W)N.3A("7o-4K-7q",6.3S[s.V]||"7s, 7t 7w 7x 4o:4o:4o 7z");N.3A("X-7B-7C","3p");7(N.7E)N.3A("7F","7G");7(s.5G)s.5G(N);7(s.1k)6.G.1S("5H",[N,s]);B 37=u(4s){7(N&&(N.3D==4||4s=="29")){4y=U;7(3I){4p(3I);3I=16}B 15;2G{15=6.5Z(N)&&4s!="29"?s.1W&&6.69(N,s.V)?"5L":"2M":"2C";7(15!="2C"){B 3F;2G{3F=N.4P("6b-4K")}2w(e){}7(s.1W&&3F)6.3S[s.V]=3F;B F=6.6i(N,s.4t);7(s.2M)s.2M(F,15);7(s.1k)6.G.1S("5N",[N,s])}J 6.3J(s,N,15)}2w(e){15="2C";6.3J(s,N,15,e)}7(s.1k)6.G.1S("5O",[N,s]);7(s.1k&&!--6.4E)6.G.1S("5Q");7(s.1X)s.1X(N,15);7(s.48)N=16}};B 3I=3L(37,13);7(s.29>0)57(u(){7(N){N.7N();7(!4y)37("29")}},s.29);2G{N.7Q(s.F)}2w(e){6.3J(s,N,16,e)}7(!s.48)37();v N},3J:u(s,N,15,e){7(s.2C)s.2C(N,15,e);7(s.1k)6.G.1S("5W",[N,s,e])},4E:0,5Z:u(r){2G{v!r.15&&7V.7W=="4G:"||(r.15>=5X&&r.15<7X)||r.15==6d||6.W.2N&&r.15==T}2w(e){}v 12},69:u(N,V){2G{B 6e=N.4P("6b-4K");v N.15==6d||6e==6.3S[V]||6.W.2N&&N.15==T}2w(e){}v 12},6i:u(r,C){B 4Q=r.4P("8c-C");B F=!C&&4Q&&4Q.18("N")>=0;F=C=="N"||F?r.8i:r.3G;7(C=="2d")6.4a(F);7(C=="6m")40("F = "+F);7(C=="4U")6("<1V>").4U(F).4V();v F},3g:u(a){B s=[];7(a.1l==2y||a.3Y)6.K(a,u(){s.1g(2x(q.Y)+"="+2x(q.O))});J P(B j 1x a)7(a[j]&&a[j].1l==2y)6.K(a[j],u(){s.1g(2x(j)+"="+2x(q))});J s.1g(2x(j)+"="+2x(a[j]));v s.6t("&")},4a:u(F){7(1w.54)1w.54(F);J 7(6.W.2N)1w.57(F,0);J 40.3n(1w,F)}});6.E.1z({1L:u(R,M){B 1G=q.1D(":1G");R?1G.26({28:"1L",3V:"1L",1d:"1L"},R,M):1G.K(u(){q.1q.1h=q.2E?q.2E:"";7(6.1m(q,"1h")=="1Z")q.1q.1h="2D"});v q},1K:u(R,M){B 3i=q.1D(":3i");R?3i.26({28:"1K",3V:"1K",1d:"1K"},R,M):3i.K(u(){q.2E=q.2E||6.1m(q,"1h");7(q.2E=="1Z")q.2E="2D";q.1q.1h="1Z"});v q},5g:6.E.3X,3X:u(E,4I){B 1E=1A;v 6.1t(E)&&6.1t(4I)?q.5g(E,4I):q.K(u(){6(q)[6(q).4l(":1G")?"1L":"1K"].14(6(q),1E)})},7a:u(R,M){v q.26({28:"1L"},R,M)},7c:u(R,M){v q.26({28:"1K"},R,M)},7f:u(R,M){v q.K(u(){B 5k=6(q).4l(":1G")?"1L":"1K";6(q).26({28:5k},R,M)})},7r:u(R,M){v q.26({1d:"1L"},R,M)},7u:u(R,M){v q.26({1d:"1K"},R,M)},7y:u(R,43,M){v q.26({1d:43},R,M)},26:u(H,R,1v,M){v q.1F(u(){q.2F=6.1z({},H);B 1u=6.R(R,1v,M);P(B p 1x H){B e=1p 6.3b(q,1u,p);7(H[p].1l==3Q)e.2s(e.Q(),H[p]);J e[H[p]](H)}})},1F:u(C,E){7(!E){E=C;C="3b"}v q.K(u(){7(!q.1F)q.1F={};7(!q.1F[C])q.1F[C]=[];q.1F[C].1g(E);7(q.1F[C].I==1)E.14(q)})}});6.1z({R:u(R,1v,E){B 1u=R&&R.1l==7K?R:{1X:E||!E&&1v||6.1t(R)&&R,25:R,1v:E&&1v||1v&&1v.1l!=4w&&1v};1u.25=(1u.25&&1u.25.1l==3Q?1u.25:{7R:7S,7T:5X}[1u.25])||7U;1u.1N=1u.1X;1u.1X=u(){6.6a(q,"3b");7(6.1t(1u.1N))1u.1N.14(q)};v 1u},1v:{},1F:{},6a:u(D,C){C=C||"3b";7(D.1F&&D.1F[C]){D.1F[C].4L();B f=D.1F[C][0];7(f)f.14(D)}},3b:u(D,1e,H){B z=q;B y=D.1q;B 4D=6.1m(D,"1h");y.5T="1G";z.a=u(){7(1e.49)1e.49.14(D,[z.2p]);7(H=="1d")6.1I(y,"1d",z.2p);J 7(6l(z.2p))y[H]=6l(z.2p)+"4S";y.1h="2D"};z.6v=u(){v 4T(6.1m(D,H))};z.Q=u(){B r=4T(6.30(D,H));v r&&r>-8z?r:z.6v()};z.2s=u(4f,43){z.4J=(1p 5o()).5w();z.2p=4f;z.a();z.4q=3L(u(){z.49(4f,43)},13)};z.1L=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1L=U;z.2s(0,D.1y[H]);7(H!="1d")y[H]="5a"};z.1K=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();1e.1K=U;z.2s(D.1y[H],0)};z.3X=u(){7(!D.1y)D.1y={};D.1y[H]=q.Q();7(4D=="1Z"){1e.1L=U;7(H!="1d")y[H]="5a";z.2s(0,D.1y[H])}J{1e.1K=U;z.2s(D.1y[H],0)}};z.49=u(32,47){B t=(1p 5o()).5w();7(t>1e.25+z.4J){4p(z.4q);z.4q=16;z.2p=47;z.a();7(D.2F)D.2F[H]=U;B 2c=U;P(B i 1x D.2F)7(D.2F[i]!==U)2c=12;7(2c){y.5T="";y.1h=4D;7(6.1m(D,"1h")=="1Z")y.1h="2D";7(1e.1K)y.1h="1Z";7(1e.1K||1e.1L)P(B p 1x D.2F)7(p=="1d")6.1I(y,p,D.1y[p]);J y[p]=""}7(2c&&6.1t(1e.1X))1e.1X.14(D)}J{B n=t-q.4J;B p=n/1e.25;z.2p=1e.1v&&6.1v[1e.1v]?6.1v[1e.1v](p,n,32,(47-32),1e.25):((-6h.7O(p*6h.8L)/2)+0.5)*(47-32)+32;z.a()}}}})}',62,545,'||||||jQuery|if|||||||||||||||||||this||||function|return||||||var|type|elem|fn|data|event|prop|length|else|each|ret|callback|xml|value|for|cur|speed|element|undefined|true|url|browser||name|||parentNode|false||apply|status|null|document|indexOf|className|val|firstChild|obj|opacity|options|nodeName|push|display|result|msie|global|constructor|css|test|handler|new|style|arg|expr|isFunction|opt|easing|window|in|orig|extend|arguments|context|typeof|filter|args|queue|hidden|events|attr|re|hide|show|add|old|target|table|token|replace|trigger|num|elems|div|ifModified|complete|key|none|tbody|params|while|string|nodeType|duration|animate|ready|height|timeout|nth|get|done|script|nextSibling|remove|not|index|tb|fix|merge|oid|z0|preventDefault|find|now|grep|pushStack|custom|innerHTML|first|cssFloat|catch|encodeURIComponent|Array|el|guid|sibling|error|block|oldblock|curAnim|try|stopPropagation|childNodes|id|wrap|text|success|safari|load|res|exec|al|_|last|substr|has|disabled|insertBefore|selected|checked|curCSS|map|firstNum|removeChild|re2|trim|getAttribute|onreadystatechange|handlers|on|originalEvent|fx|readyList|parPos|src|opera|param|mozilla|visible|domManip|clean|cloneNode|tr|call|split|XMLHttpRequest|ajaxSettings|append|child|String|empty|ajax|form|button|inArray|multiFilter|setRequestHeader|foundToken|9_|readyState|tag|modRes|responseText|second|ival|handleError|toUpperCase|setInterval|makeArray|slice|break|oWidth|Number|returnValue|lastModified|styleFloat|bind|width|isReady|toggle|jquery|dir|eval|mouseover|select|to|defaultView|position|oHeight|lastNum|async|step|globalEval|static|pos|swap|self|from|end|float|alpha|radio|inv|is|toLowerCase|visibility|00|clearInterval|timer|rec|isTimeout|dataType|_resort|RegExp|Function|getAll|requestDone|parents|matched|isXMLDoc|appendChild|oldDisplay|active|triggered|file|documentElement|fn2|startTime|Modified|shift|lastToggle|deep|handleHover|getResponseHeader|ct|submit|px|parseFloat|html|evalScripts|getComputedStyle|getElementById|clone|els|safariTimer|currentStyle|unload|force|execScript|getPropertyValue|newProp|setTimeout|zoom|getScript|1px|sl|settings|GET|rl|check|_toggle|processData|prepend|before|state|removeAttr|ajaxStart|lt|Date|gt|eq|contentType|previousSibling|after|parent|contains|getTime|checkbox|password|appendTo|image|reset|input|webkit|href|continue|beforeSend|ajaxSend|ownerDocument|getElementsByTagName|tmp|notmodified|parse|ajaxSuccess|ajaxComplete|_prefix|ajaxStop|even|odd|overflow|delete|POST|ajaxError|200|handle|httpSuccess|nodeValue|unshift|__ie_init|srcElement|body|pageX|tagName|clientX|scrollLeft|httpNotModified|dequeue|Last|scrollTop|304|xmlRes|unbind|100|Math|httpData|click|mouseout|parseInt|json|createElement|DOMContentLoaded|prevObject|ol|setArray|exclude|join|one|max|do|relative|clientHeight|clientWidth|loadIfModified|serialize|toString|thead|tfoot|td|th|textContent|ActiveXObject|htmlFor|Microsoft|class|XMLHTTP|readOnly|gi|match|getIfModified|9999|getJSON|getAttributeNode|post|setAttribute|ig|ajaxTimeout|ajaxSetup|concat|application|userAgent|compatible|www|compatMode|CSS1Compat|next|urlencoded|siblings|children|slideDown|prependTo|slideUp|Top|insertAfter|slideToggle|removeAttribute|addClass|removeClass|open|toggleClass|Content|Type|lastChild|If|only|Since|fadeIn|Thu|01|fadeOut|enabled|Jan|1970|fadeTo|GMT|textarea|Requested|With|prev|overrideMimeType|Connection|close|boxModel|right|object|Object|navigator|substring|abort|cos|font|send|slow|600|fast|400|location|protocol|300|pageY|clientY|method|action|cancelBubble|hover|fromElement|toElement|relatedTarget|removeEventListener|blur|readonly|focus|resize|content|scroll|dblclick|mousedown|mouseup|mousemove|responseXML|change|keydown|keypress|keyup|addEventListener|write|prototype|size|scr|ipt|createTextNode|defer|FORM|reverse|noConflict|loaded|10000|weight|line|Bottom|Right|Left|padding|border|Width|offsetHeight|offsetWidth|absolute|PI|left'.split('|'),0,{}))
=== modified file 'modules/blogapi/blogapi.module'
--- modules/blogapi/blogapi.module 2007-06-30 19:46:54 +0000
+++ modules/blogapi/blogapi.module 2007-08-08 19:38:54 +0000
@@ -367,7 +367,7 @@ function blogapi_metaweblog_new_media_ob
}
// Return the successful result.
- return array('url' => file_create_url($file), 'struct');
+ return array('url' => _file_create_url($file,0), 'struct');
}
/**
* Blogging API callback. Returns a list of the taxonomy terms that can be
=== modified file 'modules/locale/locale.install'
--- modules/locale/locale.install 2007-06-17 17:41:40 +0000
+++ modules/locale/locale.install 2007-08-08 19:38:54 +0000
@@ -121,7 +121,7 @@ function locale_uninstall() {
$files = db_query('SELECT javascript FROM {languages}');
while ($file = db_fetch_object($files)) {
if (!empty($file)) {
- file_delete(file_create_path($file->javascript));
+ file_delete(file_create_path($file));
}
}
=== modified file 'modules/search/search.module'
--- modules/search/search.module 2007-07-08 12:18:02 +0000
+++ modules/search/search.module 2007-08-08 19:38:54 +0000
@@ -1,5 +1,5 @@
'textfield',
- '#title' => t('File system path'),
+ '#title' => t('Public file path'),
'#default_value' => file_directory_path(),
'#maxlength' => 255,
- '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to the Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
+ '#description' => t('A file system path where public files will be stored. This directory has to exist and be writable by Drupal. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
'#after_build' => array('system_check_directory'),
);
+ $form['file_private_path'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Private file path'),
+ '#default_value' => file_directory_private_path(),
+ '#maxlength' => 255,
+ '#description' => t('A file system path where priavte files will be stored. This directory has to exist and be writable by Drupal. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.'),
+ '#after_build' => array('system_check_directory'),
+ );
+
$form['file_directory_temp'] = array(
'#type' => 'textfield',
'#title' => t('Temporary directory'),
@@ -769,12 +778,15 @@ function system_file_system_settings() {
'#after_build' => array('system_check_directory'),
);
+ // NOTE: Changes needed
$form['file_downloads'] = array(
'#type' => 'radios',
- '#title' => t('Download method'),
- '#default_value' => variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC),
+ '#title' => t('Download method default'),
+ '#default_value' => file_private_downloads(),
'#options' => array(FILE_DOWNLOADS_PUBLIC => t('Public - files are available using HTTP directly.'), FILE_DOWNLOADS_PRIVATE => t('Private - files are transferred by Drupal.')),
- '#description' => t('If you want any sort of access control on the downloading of files, this needs to be set to private. You can change this at any time, however all download URLs will change and there may be unexpected problems so it is not recommended.')
+ '#description' => t('This determines Drupal\'s default download method. Private files will
+ have node access restrictions placed on them. Public Files will be available for download
+ by anyone.')
);
return system_settings_form($form);
=== modified file 'modules/system/system.schema'
--- modules/system/system.schema 2007-08-11 14:06:14 +0000
+++ modules/system/system.schema 2007-08-12 20:54:57 +0000
@@ -39,6 +39,7 @@ function system_schema() {
'filemime' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
'filesize' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'private' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
'timestamp' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
),
'indexes' => array(
=== modified file 'modules/upload/upload.module'
--- modules/upload/upload.module 2007-08-09 11:00:58 +0000
+++ modules/upload/upload.module 2007-08-10 21:41:59 +0000
@@ -148,7 +148,7 @@ function upload_file_download($file) {
if (!user_access('view uploaded files')) {
return -1;
}
- $file = file_create_path($file);
+ $file = _file_create_path($file, FILE_DOWNLOADS_PRIVATE );
$result = db_query("SELECT f.* FROM {files} f INNER JOIN {upload} u ON f.fid = u.fid WHERE filepath = '%s'", $file);
if ($file = db_fetch_object($result)) {
return array(
@@ -192,6 +192,7 @@ function _upload_prepare(&$node) {
// Save new file uploads.
if (($user->uid != 1 || user_access('upload files')) && ($file = file_save_upload('upload', $validators))) {
+ $file->private = upload_get_private();
$file->list = variable_get('upload_list_default',1);
$file->description = $file->filename;
$_SESSION['upload_current_file'] = $file->fid;
@@ -204,10 +205,12 @@ function _upload_prepare(&$node) {
$node->files[$fid] = $file;
}
}
+
}
function upload_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
+ $form['#cache'] = FALSE;
$form['workflow']['upload'] = array(
'#type' => 'radios',
'#title' => t('Attachments'),
@@ -264,6 +267,7 @@ function upload_form_alter(&$form, $form
* Implementation of hook_nodeapi().
*/
function upload_nodeapi(&$node, $op, $teaser) {
+
switch ($op) {
case 'load':
@@ -326,7 +330,7 @@ function upload_nodeapi(&$node, $op, $te
array(
'key' => 'enclosure',
'attributes' => array(
- 'url' => file_create_url($file->filepath),
+ 'url' => file_create_url($file),
'length' => $file->filesize,
'type' => $file->filemime
)
@@ -347,7 +351,7 @@ function theme_upload_attachments($files
foreach ($files as $file) {
$file = (object)$file;
if ($file->list && empty($file->remove)) {
- $href = file_create_url($file->filepath);
+ $href = file_create_url($file);
$text = $file->description ? $file->description : $file->filename;
$rows[] = array(l($text, $href), format_size($file->filesize));
}
@@ -380,6 +384,7 @@ function upload_total_space_used() {
}
function upload_save(&$node) {
+
if (empty($node->files) || !is_array($node->files)) {
return;
}
@@ -403,11 +408,13 @@ function upload_save(&$node) {
if (!empty($node->old_vid) || array_key_exists($fid, $_SESSION['upload_files'])) {
db_query("INSERT INTO {upload} (fid, nid, vid, list, description) VALUES (%d, %d, %d, %d, '%s')", $file->fid, $node->nid, $node->vid, $file->list, $file->description);
file_set_status($file, FILE_STATUS_PERMANENT);
+ file_set_private($file);
}
// Update existing revision.
else {
db_query("UPDATE {upload} SET list = %d, description = '%s' WHERE fid = %d AND vid = %d", $file->list, $file->description, $file->fid, $node->vid);
file_set_status($file, FILE_STATUS_PERMANENT);
+ file_set_private($file);
}
}
// Empty the session storage after save. We use this variable to track files
@@ -459,10 +466,11 @@ function _upload_form($node) {
$form['files']['#theme'] = 'upload_form_current';
$form['files']['#tree'] = TRUE;
foreach ($node->files as $key => $file) {
- $description = file_create_url($file->filepath);
+ $description = file_create_url($file);
$description = "". check_plain($description) ."";
$form['files'][$key]['description'] = array('#type' => 'textfield', '#default_value' => !empty($file->description) ? $file->description : $file->filename, '#maxlength' => 256, '#description' => $description );
$form['files'][$key]['size'] = array('#value' => format_size($file->filesize));
+ $form['files'][$key]['private'] = array('#type' => 'radios', '#options' => array(FILE_DOWNLOADS_PRIVATE => 'Private', FILE_DOWNLOADS_PUBLIC => 'Public'), '#default_value' => $file->private );
$form['files'][$key]['remove'] = array('#type' => 'checkbox', '#default_value' => !empty($file->remove));
$form['files'][$key]['list'] = array('#type' => 'checkbox', '#default_value' => $file->list);
// If the file was uploaded this page request, set value. this fixes the
@@ -506,12 +514,13 @@ function _upload_form($node) {
* Theme the attachments list.
*/
function theme_upload_form_current(&$form) {
- $header = array(t('Delete'), t('List'), t('Description'), t('Size'));
+ $header = array(t('Delete'), t('List'),t('Access'), t('Description'), t('Size'));
foreach (element_children($form) as $key) {
$row = array();
$row[] = drupal_render($form[$key]['remove']);
$row[] = drupal_render($form[$key]['list']);
+ $row[] = drupal_render($form[$key]['private']);
$row[] = drupal_render($form[$key]['description']);
$row[] = drupal_render($form[$key]['size']);
$rows[] = $row;
@@ -582,3 +591,13 @@ function upload_js() {
print drupal_to_js(array('status' => TRUE, 'data' => $output));
exit;
}
+
+/**
+* Get the value for whether file uploads should be private or public by default.
+*
+* @return An integer containg 0 if uploads should be public and 1 if uploads should be private.
+*/
+function upload_get_private()
+{
+ return variable_get('upload_private_default',FILE_DOWNLOADS_PUBLIC);
+}
\ No newline at end of file
=== modified file 'modules/user/user.module'
--- modules/user/user.module 2007-08-12 19:25:57 +0000
+++ modules/user/user.module 2007-08-12 20:54:54 +0000
@@ -499,7 +499,7 @@ function user_perm() {
*/
function user_file_download($file) {
if (strpos($file, variable_get('user_picture_path', 'pictures') .'/picture-') === 0) {
- $info = image_get_info(file_create_path($file));
+ $info = image_get_info(_file_create_path($file,FILE_DOWNLOADS_PRIVATE));
return array('Content-type: '. $info['mime_type']);
}
}
@@ -745,7 +745,7 @@ function template_preprocess_user_pictur
if (variable_get('user_pictures', 0)) {
$account = $variables['account'];
if (!empty($account->picture) && file_exists($account->picture)) {
- $picture = file_create_url($account->picture);
+ $picture = _file_create_url($account->picture,0);
}
else if (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
@@ -2794,7 +2794,7 @@ function user_admin_settings() {
// If picture support is enabled, check whether the picture directory exists:
if (variable_get('user_pictures', 0)) {
- $picture_path = file_create_path(variable_get('user_picture_path', 'pictures'));
+ $picture_path = _file_create_path(variable_get('user_picture_path', 'pictures'), FILE_DOWNLOADS_PUBLIC);
file_check_directory($picture_path, 1, 'user_picture_path');
}
=== modified file 'profiles/default/default.profile'
--- profiles/default/default.profile 2007-07-11 15:15:39 +0000
+++ profiles/default/default.profile 2007-08-08 19:38:55 +0000
@@ -1,5 +1,5 @@