Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into feature/psr_message
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Sep 18, 2020
2 parents ec804c8 + 3688539 commit ecba1ae
Show file tree
Hide file tree
Showing 829 changed files with 4,731 additions and 3,082 deletions.
14 changes: 9 additions & 5 deletions .htaccess.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
SetEnv APPLICATION_ENV "production"

RewriteEngine On

# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !\.(php[0-9]?|phtml|phps)$ - [NC,C]
RewriteRule !(?:^|/)\.(?!well-known(?:/.*)?$) - [C]
RewriteRule .* - [L]

# Strip any trailing slashes from incoming requests
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/+$
RewriteRule .* %1 [R=307,L]

Expand All @@ -20,7 +22,9 @@ RewriteRule .* %1 [R=307,L]
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]

RewriteCond %{ENV:REDIRECT_OMEKA_REQ} !"1"
RewriteRule ^(.*)$ %{ENV:BASE}/index.php [E=OMEKA_REQ:"1",L]

# Block access to all .ini files.
<FilesMatch "\.ini$">
Expand Down
8 changes: 6 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ return PhpCsFixer\Config::create()
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'cast_spaces' => true,
'concat_space' => ['spacing' => 'one'],
'include' => true,
'method_argument_space' => ['ensure_fully_multiline' => false],
'method_argument_space' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_break_comment' => false,
'no_extra_consecutive_blank_lines' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_trailing_comma_in_singleline_array' => true,
Expand All @@ -36,6 +39,7 @@ return PhpCsFixer\Config::create()
->exclude('files')
->exclude('modules')
->exclude('node_modules')
->exclude('themes')
->in(__DIR__)
)
;
39 changes: 39 additions & 0 deletions .php_cs_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
'cast_spaces' => true,
'concat_space' => ['spacing' => 'one'],
'include' => true,
'method_argument_space' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_break_comment' => false,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'phpdoc_indent' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_scalar' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'trailing_comma_in_multiline_array' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('asset')
->exclude('data/doctrine-proxies')
->exclude('node_modules')
->exclude('vendor')
)
;
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ cache:
- build/cache

before_install:
- nvm install 7
- nvm use 7
- nvm install 8
- nvm use 8

install:
- npm install
- ./node_modules/gulp/bin/gulp.js init
- npx gulp init

before_script:
- mysql -e "create database IF NOT EXISTS omeka_test;" -uroot
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ options in the [documentation](https://omeka.org/s/docs/user-manual/configuratio
* `$ cd omeka-s`
1. Perform first-time setup:
* `$ npm install`
* `$ npm install --global gulp-cli` (if you do not already have `gulp` installed)
* `$ gulp init`
* `$ npx gulp init`
1. Open `config/database.ini` and add your MySQL username, password, database
name, and host name. The user and database must be created before this step.
1. Make sure the `files/` directory is writable by Apache.
Expand Down Expand Up @@ -87,3 +86,5 @@ Omeka uses the following libraries, among others:

Omeka development adheres to the [Zend Framework 2 Coding Standards](https://zf2-docs.readthedocs.org/en/latest/ref/coding.standard.html)
and uses the [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model.

© 2013-2016 [Roy Rosenzweig Center for History and New Media](http://chnm.gmu.edu/), 2016-present [Corporation for Digital Scholarship](http://digitalscholar.org/)
8 changes: 3 additions & 5 deletions application/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Module extends AbstractModule
/**
* This Omeka version.
*/
const VERSION = '2.9.3-alpha';
const VERSION = '3.0.0-alpha2';

/**
* The vocabulary IRI used to define Omeka application data.
Expand Down Expand Up @@ -547,7 +547,6 @@ public function searchFulltext(ZendEvent $event)
$qb = $event->getParam('queryBuilder');

$searchAlias = $adapter->createAlias();
$matchAlias = $adapter->createAlias();

$match = sprintf(
'MATCH(%s.title, %s.text) AGAINST (%s)',
Expand All @@ -562,14 +561,13 @@ public function searchFulltext(ZendEvent $event)
$adapter->createNamedParameter($qb, $adapter->getResourceName())
);

$qb->addSelect(sprintf('%s AS %s', $match, $matchAlias))
->innerJoin('Omeka\Entity\FulltextSearch', $searchAlias, 'WITH', $joinConditions)
$qb->innerJoin('Omeka\Entity\FulltextSearch', $searchAlias, 'WITH', $joinConditions)
// Filter out resources with no similarity.
->andWhere(sprintf('%s > 0', $match))
// Order by the relevance. Note the use of orderBy() and not
// addOrderBy(). This should ensure that ordering by relevance
// is the first thing being ordered.
->orderBy($matchAlias, 'DESC');
->orderBy($match, 'DESC');

// Set visibility constraints.
$acl = $this->getServiceLocator()->get('Omeka\Acl');
Expand Down
2 changes: 1 addition & 1 deletion application/asset/css/style.css

Large diffs are not rendered by default.

23 changes: 6 additions & 17 deletions application/asset/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,12 @@ var Omeka = {
$(function() {
Omeka.reserveSidebarSpace();

if (window.location.hash && $('.section').filter(window.location.hash).length) {
// Open the section that corresponds to the URL fragment identifier.
Omeka.switchActiveSection($(window.location.hash));
// Open the section that corresponds to the URL fragment identifier.
if (window.location.hash && !$('body').hasClass('no-section-hashes')) {
var possibleSection = document.getElementById(window.location.hash.slice(1));
if (possibleSection && possibleSection.classList.contains('section')) {
Omeka.switchActiveSection($(possibleSection));
}
}

$('#content').on('click', '.button.cancel', function(e) {
Expand Down Expand Up @@ -393,20 +396,6 @@ var Omeka = {
}
});

// Set classes for expandable/collapsible content.
$(document).on('click', 'a.expand, a.collapse', function(e) {
e.preventDefault();
var toggle = $(this);
toggle.toggleClass('collapse').toggleClass('expand');
if (toggle.hasClass('expand')) {
toggle.attr('aria-label', Omeka.jsTranslate('Expand')).attr('title', Omeka.jsTranslate('Expand'));
toggle.trigger('o:collapsed');
} else {
toggle.attr('aria-label', Omeka.jsTranslate('Collapse')).attr('title', Omeka.jsTranslate('Collapse'));
toggle.trigger('o:expanded');
}
});

// Switch between section tabs.
$('.section-nav a[href^="#"]').click(function (e) {
e.preventDefault();
Expand Down
20 changes: 18 additions & 2 deletions application/asset/js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,32 @@ $(document).ready(function() {
// Add a value.
$('form').on('click', '.multi-value .add-value', function(e) {
e.preventDefault();
var template = $(this).parents('.field').data('field-template');
var fieldContainer = $(this).parents('.field');
var template = fieldContainer.data('field-template');
var newValue = $(template);
newValue.children('input[type="text"]').val(null);
newValue.children('select').prop('selectedIndex', 0);
newValue.insertBefore($(this)).trigger('o:value-created');
newValue.appendTo(fieldContainer.find('.inputs'));
newValue.trigger('o:value-created');
});

// Remove a value.
$('form').on('click', '.multi-value .remove-value', function(e) {
e.preventDefault();
$(this).closest('.value').remove();
});

// Set classes for expandable/collapsible content.
$(document).on('click', 'a.expand, a.collapse', function(e) {
e.preventDefault();
var toggle = $(this);
toggle.toggleClass('collapse').toggleClass('expand');
if (toggle.hasClass('expand')) {
toggle.attr('aria-label', Omeka.jsTranslate('Expand')).attr('title', Omeka.jsTranslate('Expand'));
toggle.trigger('o:collapsed');
} else {
toggle.attr('aria-label', Omeka.jsTranslate('Collapse')).attr('title', Omeka.jsTranslate('Collapse'));
toggle.trigger('o:expanded');
}
});
});
9 changes: 8 additions & 1 deletion application/asset/js/resource-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
});

$('input.value-language').on('keyup', function(e) {
$('input.value-language').on('keyup, change', function(e) {
if ('' === this.value || Omeka.langIsValid(this.value)) {
this.setCustomValidity('');
} else {
Expand Down Expand Up @@ -345,6 +345,13 @@
field.attr('data-property-id', propertyId);
field.attr('aria-labelledby', 'property-' + propertyId + '-label');
$('div#properties').append(field);

new Sortable(field.find('.values')[0], {
draggable: '.value',
handle: '.sortable-handle'
});

field.trigger('o:property-added');
return field;
};

Expand Down
13 changes: 13 additions & 0 deletions application/asset/js/site-resources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(function($) {
$(document).ready(function() {
var advancedSearch = $('#advanced-search');
$(document).on('change', '[name="item_assignment_action"]', function() {
var selectedValue = $(this).val();
if ((selectedValue == 'no_action') || (selectedValue == 'remove_all')) {
advancedSearch.addClass('inactive');
} else {
advancedSearch.removeClass('inactive');
}
});
});
})(jQuery)
Loading

0 comments on commit ecba1ae

Please sign in to comment.