Skip to content

Commit

Permalink
Replace old or syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Jan 5, 2024
1 parent 9065adc commit ec7a7af
Show file tree
Hide file tree
Showing 82 changed files with 98 additions and 98 deletions.
2 changes: 1 addition & 1 deletion backup/moodle2/backup_datalynx_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

/**
* Define all the backup steps that will be used by the backup_datalynx_activity_task
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_datalynx_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/backup/moodle2/restore_datalynx_stepslib.php");

Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_datalynx_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

/**
* Define all the restore steps that will be used by the restore_datalynx_activity_task
Expand Down
2 changes: 1 addition & 1 deletion css.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function definition() {
$df->print_footer();
} else {

defined('NO_MOODLE_COOKIES') or define('NO_MOODLE_COOKIES', true); // Session not used here.
defined('NO_MOODLE_COOKIES') || define('NO_MOODLE_COOKIES', true); // Session not used here.

$lifetime = 0; // Seconds to cache this stylesheet.

Expand Down
2 changes: 1 addition & 1 deletion db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$capabilities = array(

Expand Down
2 changes: 1 addition & 1 deletion db/caches.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
* @copyright 2014 Ivan Šakić
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$definitions = array('patterns' => array('mode' => cache_store::MODE_APPLICATION));
2 changes: 1 addition & 1 deletion db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2015 Ivan Šakić <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$observers = array(
array('eventname' => 'mod_datalynx\event\comment_created',
Expand Down
2 changes: 1 addition & 1 deletion db/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Definition of log events
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$logs = array(
array('module' => 'datalynx', 'action' => 'view', 'mtable' => 'datalynx', 'field' => 'name'),
Expand Down
2 changes: 1 addition & 1 deletion db/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2015 Ivan Šakić <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$messageproviders = array(

Expand Down
2 changes: 1 addition & 1 deletion db/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2020 Michael Pollak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$addons = [
'mod_datalynx' => [ // Plugin identifier
Expand Down
2 changes: 1 addition & 1 deletion db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$functions = array();
2 changes: 1 addition & 1 deletion db/subplugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$subplugins = array('datalynxfield' => 'mod/datalynx/field', 'datalynxview' => 'mod/datalynx/view',
'datalynxrule' => 'mod/datalynx/rule', 'datalynxtool' => 'mod/datalynx/tool'
Expand Down
4 changes: 2 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* Please do not forget to use upgrade_set_timeout()
* before any action that may take longer time to finish.
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

function xmldb_datalynx_upgrade($oldversion) {
global $CFG, $DB;
Expand Down Expand Up @@ -183,7 +183,7 @@ function xmldb_datalynx_upgrade($oldversion) {
// Move content of matrixext param1 -> param4 and param3 -> param5.
if ($views = $DB->get_records('datalynx_views', array('type' => 'matrixext'))) {
foreach ($views as $view) {
if (!empty($view->param1) or !empty($view->param3)) {
if (!empty($view->param1) || !empty($view->param3)) {
$view->param4 = $view->param1;
$view->param5 = $view->param3;
$view->param1 = null;
Expand Down
6 changes: 3 additions & 3 deletions entries_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

use core_user\fields;

defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

/**
*/
Expand Down Expand Up @@ -281,7 +281,7 @@ public function get_entries($options = null) {

if ($entries->entries = $DB->get_records_sql($sqlselect, $allparams + $eidparams)) {
// If one entry was requested get its position.
if (!is_array($filter->eids) or count($filter->eids) == 1) {
if (!is_array($filter->eids) || count($filter->eids) == 1) {
$sqlselect = "$sqlcount AND e.id $ineids";
$eidposition = $DB->get_records_sql($sqlselect, $allparams + $eidparams);

Expand Down Expand Up @@ -590,7 +590,7 @@ public function process_entries(string $action, $eids, $data = null, bool $confi
if ($entries) {
foreach ($entries as $eid => $entry) {
// Filter approvable entries.
if (($action == 'approve' or $action == 'disapprove') and
if (($action == 'approve' || $action == 'disapprove') and
!has_capability('mod/datalynx:approve', $dl->context)
) {
unset($entries[$eid]);
Expand Down
2 changes: 1 addition & 1 deletion field/_entry/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_class.php");

Expand Down
2 changes: 1 addition & 1 deletion field/_entry/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield__entry';
$plugin->version = 2015092200;
Expand Down
4 changes: 2 additions & 2 deletions field/_time/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_class.php");

Expand Down Expand Up @@ -105,7 +105,7 @@ public function get_search_sql(array $search): array {
$params = array();

if ($operator != 'BETWEEN') {
if (!$operator or $operator == 'LIKE') {
if (!$operator || $operator == 'LIKE') {
$operator = '=';
}
$params[$namefrom] = $from;
Expand Down
2 changes: 1 addition & 1 deletion field/_time/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/renderer.php");

Expand Down
2 changes: 1 addition & 1 deletion field/_time/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield__time';
$plugin->version = 2015092200;
Expand Down
2 changes: 1 addition & 1 deletion field/editor/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2014 Ivan Šakić
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_form.php");

Expand Down
2 changes: 1 addition & 1 deletion field/editor/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield_editor';
$plugin->version = 2015092200;
Expand Down
2 changes: 1 addition & 1 deletion field/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . '/../classes/datalynx.php');
require_once(dirname(__FILE__) . '/../behavior/behavior.php');
Expand Down
2 changes: 1 addition & 1 deletion field/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2013 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->libdir/formslib.php");

Expand Down
2 changes: 1 addition & 1 deletion field/file/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2012 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_class.php");
require_once("$CFG->dirroot/lib/resourcelib.php");
Expand Down
2 changes: 1 addition & 1 deletion field/file/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_form.php");

Expand Down
4 changes: 2 additions & 2 deletions field/file/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/renderer.php");

Expand Down Expand Up @@ -92,7 +92,7 @@ public function render_display_mode(stdClass $entry, array $params): ?string {
// Contentid is stored in itemid for lookup. This is usable with fieldgroups.
$files = $fs->get_area_files($field->df()->context->id, 'mod_datalynx', 'content',
$contentid);
if (!$files or !(count($files) > 1)) {
if (!$files || !(count($files) > 1)) {
return '';
}

Expand Down
2 changes: 1 addition & 1 deletion field/file/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield_file';
$plugin->version = 2015092200;
Expand Down
2 changes: 1 addition & 1 deletion field/number/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield_number';
$plugin->version = 2015092200;
Expand Down
4 changes: 2 additions & 2 deletions field/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . '/../behavior/behavior.php');
require_once(dirname(__FILE__) . '/../renderer/renderer.php');
Expand Down Expand Up @@ -356,7 +356,7 @@ final public function get_menu($showall = false) {
// The default menu category for fields.
$patternsmenu = array();
foreach ($this->patterns() as $tag => $pattern) {
if ($showall or $pattern[self::PATTERN_SHOW_IN_MENU]) {
if ($showall || $pattern[self::PATTERN_SHOW_IN_MENU]) {
// Which category.
if (!empty($pattern[self::PATTERN_CATEGORY])) {
$cat = $pattern[self::PATTERN_CATEGORY];
Expand Down
4 changes: 2 additions & 2 deletions field/tag/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2016 David Bogner
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_class.php");

Expand Down Expand Up @@ -149,7 +149,7 @@ public function get_search_sql(array $search): array {
$operator = '';
}

if ($operator === 'ANY_OF' OR $operator === 'ALL_OF') {
if ($operator === 'ANY_OF' || $operator === 'ALL_OF') {
foreach ($value as $key => $searchstring) {
$xname = $name . $key;

Expand Down
2 changes: 1 addition & 1 deletion field/tag/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2016 David Bogner
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_form.php");

Expand Down
2 changes: 1 addition & 1 deletion field/tag/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2016 David Bogner
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . "/../renderer.php");

Expand Down
2 changes: 1 addition & 1 deletion field/tag/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @copyright 2015 David Bogner {@link http:// Www.edulabs.org}.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'datalynxfield_tag';
$plugin->version = 2015092203;
Expand Down
2 changes: 1 addition & 1 deletion field/text/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . '/../field_class.php');

Expand Down
2 changes: 1 addition & 1 deletion field/text/field_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright based on the work by 2011 Itamar Tzadok
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once("$CFG->dirroot/mod/datalynx/field/field_form.php");

Expand Down
6 changes: 3 additions & 3 deletions field/text/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @copyright 2014 Ivan Šakić
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') or die();
defined('MOODLE_INTERNAL') || die();

require_once(dirname(__FILE__) . "/../renderer.php");

Expand Down Expand Up @@ -94,8 +94,8 @@ public function render_edit_mode(MoodleQuickForm &$mform, stdClass $entry, array
}
// Length rule.
if ($length = $field->get('param5')) {
($min = $field->get('param6')) or ($min = 0);
($max = $field->get('param7')) or ($max = 64);
($min = $field->get('param6')) || ($min = 0);
($max = $field->get('param7')) || ($max = 64);

$val = false;
switch ($length) {
Expand Down
Loading

0 comments on commit ec7a7af

Please sign in to comment.