Skip to content

Commit

Permalink
Merging develop into release/9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aembler committed Feb 17, 2020
2 parents 3b1802e + f7df978 commit 7f5ee69
Show file tree
Hide file tree
Showing 45 changed files with 1,179 additions and 71 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*.txt normalizetext
*.xml normalizetext
*.svg text eol=lf
/concrete/bin/concrete5 text eol=lf
/concrete/bin/concrete5.bat text eol=crlf

#
# Binary files
Expand Down
4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed (Reduce this once we're happy with the things that will close)
daysUntilClose: 100001
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- "Status:In Progress"
Expand Down
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ matrix:
script:
- composer test

- name: Test in Docker
php: '7.2'
services:
- docker
before_script:
- ./.travis/composer-deps.sh
script:
- composer test -- --group docker

- name: Test with PHP nightly
php: nightly
before_script:
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions concrete/attributes/express/form.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<?php
defined('C5_EXECUTE') or die("Access Denied.");
print $entrySelector->selectEntry($entity, $this->field('value'), $entry);
defined('C5_EXECUTE') or die('Access Denied.');

use Concrete\Core\Entity\Express\Entity;
use Concrete\Core\Entity\Express\Entry;

if (isset($entity, $entry) && $entity instanceof Entity && $entry instanceof Entry) {
echo $entrySelector->selectEntry($entity, $this->field('value'), $entry);
}
2 changes: 1 addition & 1 deletion concrete/attributes/select/type_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function getAttributeOptionHTML($v)
}
?>
<input id="akSelectValueField_<?php echo $akSelectValueID?>" onkeypress="ccmAttributesHelper.keydownHandler(event);" class="akSelectValueField form-control" data-select-value-id="<?php echo $akSelectValueID;
?>" name="akSelectValue_<?php echo $akSelectValueID?>" type="text" value="<?php echo $akSelectValue?>" size="40" />
?>" name="akSelectValue_<?php echo $akSelectValueID?>" type="text" value="<?php echo h($akSelectValue)?>" size="40" />
</span>
<div class="rightCol">
<input class="btn btn-default" type="button" onClick="ccmAttributesHelper.editValue('<?=addslashes($akSelectValueID)?>')" value="<?=t('Cancel')?>" />
Expand Down
1 change: 1 addition & 0 deletions concrete/blocks/calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
listMonth: { buttonText: '<?= t('list month'); ?>' },
listYear: { buttonText: '<?= t('list year'); ?>' }
},
contentHeight: 'auto',

<?php if ($defaultView) { ?>
defaultView: '<?= $defaultView; ?>',
Expand Down
2 changes: 1 addition & 1 deletion concrete/blocks/event_list/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function view()
if ($calendar) {
$date = Core::make('date')->date('Y-m-d');
$time = Core::make('date')->toDateTime($date . ' 00:00:00')->getTimestamp();
$list->filterByStartTimeAfter($time);
$list->filterByEndTimeAfter($time);
$list->filterByCalendar($calendar);
if ($this->filterByFeatured) {
$list->filterByAttribute('is_featured', true);
Expand Down
4 changes: 2 additions & 2 deletions concrete/blocks/page_list/controller.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace Concrete\Block\PageList;

use BlockType;
Expand Down Expand Up @@ -461,7 +460,8 @@ public function save($args)
if (!$args['filterByRelated']) {
$args['relatedTopicAttributeKeyHandle'] = '';
}
if (!$args['filterByCustomTopic']) {

if (!$args['filterByCustomTopic'] || !$this->app->make('helper/number')->isInteger($args['customTopicTreeNodeID'])) {
$args['customTopicAttributeKeyHandle'] = '';
$args['customTopicTreeNodeID'] = 0;
}
Expand Down
4 changes: 4 additions & 0 deletions concrete/blocks/youtube/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public function save($data)
'startTime' => '',

'noCookie' => false,

'lazyLoad' => false
];

$args = [
Expand All @@ -147,6 +149,8 @@ public function save($data)
'startTime' => trim($data['startTime']),

'noCookie' => $data['noCookie'] ? 1 : 0,

'lazyLoad' => $data['lazyLoad'] ? 1 : 0
];
if ($args['sizing'] === 'fixed') {
$args += [
Expand Down
4 changes: 4 additions & 0 deletions concrete/blocks/youtube/db.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<default value="0"/>
<notnull/>
</field>
<field name="lazyLoad" type="boolean">
<default value="0"/>
<notnull/>
</field>
<field name="rel" type="boolean">
<default value="0"/>
<notnull/>
Expand Down
33 changes: 21 additions & 12 deletions concrete/blocks/youtube/form_setup_html.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?php defined('C5_EXECUTE') or die('Access Denied.'); ?>
<?php
<?php defined('C5_EXECUTE') or die('Access Denied.');

if (empty($vWidth)) {
$vWidth = 640;
}

if (empty($vHeight)) {
$vHeight = 360;
}

if (empty($sizing)) {
$sizing = '16:9';
}
?>

<?php
echo Core::make('helper/concrete/ui')->tabs([
['video', t('Video'), true],
['settings', t('Settings')],
Expand Down Expand Up @@ -138,49 +137,59 @@
<div class="form-group">
<?php echo $form->text('startTime', isset($startTime) ? $startTime : null); ?>
</div>

</div>
</fieldset>
<fieldset>
<legend><?php echo t('Privacy Options'); ?></legend>
<div class="form-group">
<div class="checkbox">
<label>
<?php echo $form->checkbox('noCookie', 1, $noCookie); ?>
<?php echo t('No Cookie'); ?>
<?php echo $form->checkbox('noCookie', 1, (isset($noCookie) ? $noCookie : false)); ?>
<?php echo t('No cookie') ?>
</label>
</div>
</div>
</fieldset>
<fieldset>
<legend><?php echo t('Loading Options'); ?></legend>
<div class="form-group">
<div class="checkbox">
<label>
<?php echo $form->checkbox('lazyLoad', 1, (isset($lazyLoad) ? $lazyLoad : false)); ?>
<?php echo t('Lazy load video')?>
</label>
</div>
</div>
</fieldset>
</div>

<script>
$(document).ready(function() {
$('#sizing1, #sizing2, #sizing3').change(function(){
$(document).ready(function () {
$('#sizing1, #sizing2, #sizing3').change(function () {
if ($('#sizing3').is(':checked')) {
$('#fixedsizes').removeClass('hidden');
} else {
$('#fixedsizes').addClass('hidden');
}
});

$('#controls').change(function(){
$('#controls').change(function () {
if ($('#controls').is(':checked')) {
$('.controls-only').removeClass('hidden');
} else {
$('.controls-only').addClass('hidden');
}
});

$('#color').change(function(){
$('#color').change(function () {
if ($(this).val() == 'white') {
$('#modestbranding').prop('disabled','disabled').prop('checked',false);
} else {
$('#modestbranding').removeProp('disabled');
}
});

$('#ccm-form-submit-button').click(function(){
$('#ccm-form-submit-button').click(function () {
if (!$('#videoURL').val()) {
$('[data-tab="video"').click();
}
Expand Down
14 changes: 10 additions & 4 deletions concrete/blocks/youtube/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

$responsiveClass = 'youtubeBlockResponsive16by9';
$sizeDisabled = '';
$lazyLoadAttribute = '';

if ($vWidth && $vHeight) {
$sizeargs = 'width="' . $vWidth . '" height="' . $vHeight . '"';
Expand All @@ -11,6 +12,10 @@
$responsiveClass = 'youtubeBlockResponsive4by3';
}

if (isset($lazyLoad) && $lazyLoad) {
$lazyLoadAttribute = 'loading="lazy"';
}

$params = [];

if (isset($playlist)) {
Expand Down Expand Up @@ -77,10 +82,11 @@
</div>
<?php
$loc->popActiveContext();
} else {
?>
} else { ?>
<div id="youtube<?= $bID; ?>" class="youtubeBlock <?php echo $responsiveClass; ?>">
<iframe class="youtube-player" <?php echo $sizeargs; ?> src="//<?= $youtubeDomain; ?>/embed/<?= $videoID; ?><?= $paramstring; ?>" allow="autoplay" allowfullscreen></iframe>
<iframe class="youtube-player" <?php echo $sizeargs; ?>
src="//<?= $youtubeDomain; ?>/embed/<?= $videoID; ?><?= $paramstring; ?>"
allow="autoplay" allowfullscreen <?= $lazyLoadAttribute; ?>></iframe>
</div>
<?php
} ?>
}
1 change: 1 addition & 0 deletions concrete/bootstrap/configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
define('DIR_FILES_UPLOADED_STANDARD', DIR_APPLICATION . '/files');
define('DIR_AL_ICONS', DIR_BASE_CORE . '/images/icons/filetypes');
define('DIR_LANGUAGES_SITE_INTERFACE', DIR_LANGUAGES . '/' . DIRNAME_LANGUAGES_SITE_INTERFACE);
define('DIR_CORE_CONFIG', DIR_BASE_CORE . '/config');

/*
* ----------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion concrete/config/concrete.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
'version' => '9.0.0a1',
'version_installed' => '9.0.0a1',
'version_db' => '20200116115000', // the key of the latest database migration
'version_db' => '20200203000000', // the key of the latest database migration

/*
* Installation status
Expand Down Expand Up @@ -115,6 +115,7 @@
// Include the BOM (byte-order mark) in generated CSV files?
// @var bool
'include_bom' => false,
'datetime_format' => 'ATOM',
],
],

Expand Down Expand Up @@ -1228,6 +1229,7 @@
'client_credentials' => true,
'authorization_code' => true,
'password_credentials' => false,
'refresh_token' => true,
],
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ protected function getAvailableGrantTypes()
'client_credentials' => t('Client Credentials'),
'authorization_code' => t('Authorization Code'),
'password_credentials' => t('Password Credentials'),
'refresh_token' => t('Refresh Token'),
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<?php
namespace Concrete\Controller\SinglePage\Dashboard\System\Registration;

use Concrete\Core\Page\Controller\DashboardPageController;
use Concrete\Core\Page\Controller\DashboardSitePageController;
use Concrete\Core\Page\Single;
use Config;
use Loader;

class Profiles extends DashboardSitePageController
{
public $helpers = array('form');
public $helpers = ['form'];

public function update_profiles()
{

/** @var Token $token */
$token = \Core::make('token');

Expand All @@ -24,29 +20,33 @@ public function update_profiles()
}

if ($this->isPost()) {

$config = $this->getSite()->getConfigRepository();

$isProfileOptionChanged = (bool) $config->get('user.profiles_enabled') !== (bool) $this->post('public_profiles');

$config->save('user.profiles_enabled', ($this->post('public_profiles') ? true : false));
$config->save('user.gravatar.enabled', ($this->post('gravatar_fallback') ? true : false));
$config->save('user.gravatar.max_level', Loader::helper('security')->sanitizeString($this->post('gravatar_max_level')));
$config->save('user.gravatar.image_set', Loader::helper('security')->sanitizeString($this->post('gravatar_image_set')));
$config->save('user.gravatar.max_level', $this->app->make('helper/security')->sanitizeString($this->post('gravatar_max_level')));
$config->save('user.gravatar.image_set', $this->app->make('helper/security')->sanitizeString($this->post('gravatar_image_set')));
$config->save('user.display_account_menu', (bool) $this->post('display_account_menu', false));


if (!$isProfileOptionChanged) {
$this->flash('success', t('Public profiles settings have been updated.'));
$this->redirect('/dashboard/system/registration/profiles');
}

// $message = ($this->post('public_profiles')?t('Public profiles have been enabled'):t('Public profiles have been disabled.'));
if ($this->post('public_profiles')) {

Single::add('/members');
$c = Single::add('/members/profile');
Single::add('/members/directory');
$c->update(['cName' => 'View Profile']);

$this->redirect('/dashboard/system/registration/profiles/profiles_enabled');
} else {

foreach($this->app->make('site')->getList() as $site) {
foreach(['/members/directory', '/members/profile', '/members'] as $path) {
foreach ($this->app->make('site')->getList() as $site) {
foreach (['/members/directory', '/members/profile', '/members'] as $path) {
$c = \Page::getByPath($path, 'RECENT', $site);
$c->delete();
}
Expand All @@ -73,16 +73,15 @@ public function view($message = null)
if ($message) {
$this->set('message', $message);
}
$this->token = Loader::helper('validation/token');

$config = $this->getSite()->getConfigRepository();

$this->set('public_profiles', $config->get('user.profiles_enabled'));
$this->set('gravatar_fallback', $config->get('user.gravatar.enabled'));
$this->set('gravatar_max_level', $config->get('user.gravatar.max_level'));
$this->set('gravatar_level_options', array('g' => 'G', 'pg' => 'PG', 'r' => 'R', 'x' => 'X'));
$this->set('gravatar_level_options', ['g' => 'G', 'pg' => 'PG', 'r' => 'R', 'x' => 'X']);
$this->set('gravatar_image_set', $config->get('user.gravatar.image_set'));
$this->set('gravatar_set_options', array('404' => '404', 'mm' => 'mm', 'identicon' => 'identicon', 'monsterid' => 'monsterid', 'wavatar' => "wavatar"));
$this->set('gravatar_set_options', ['404' => '404', 'mm' => 'mm', 'identicon' => 'identicon', 'monsterid' => 'monsterid', 'wavatar' => "wavatar"]);
$this->set('display_account_menu', $config->get('user.display_account_menu'));
}
}
Loading

0 comments on commit 7f5ee69

Please sign in to comment.