Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
akrys committed May 1, 2019
2 parents 22e931f + 46856b3 commit c94372d
Show file tree
Hide file tree
Showing 42 changed files with 187 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ node_modules
/gulpfile.js
/composer.lock
/composer.json
/akrys/redaxo/addon/UsageCheck/Tests
/FriendsOfRedaxo/addon/UsageCheck/Tests

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Config-Datei
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck;
namespace FriendsOfRedaxo\addon\UsageCheck;

/**
* Config-Klasse mit Konstanten für die Runtime
Expand All @@ -29,7 +29,7 @@ class Config
*
* @var string
*/
const VERSION = '2.1';
const VERSION = '2.2';

/**
* release state
Expand All @@ -55,7 +55,7 @@ class Config
*/
public static function getBaseDir()
{
return realpath(__DIR__.'/../../../../');
return realpath(__DIR__.'/../../../');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2015-10-27
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck;
namespace FriendsOfRedaxo\addon\UsageCheck;

/**
* Container für Fehlermeldungen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @version 1.0 / 2015-10-27
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Exception;
namespace FriendsOfRedaxo\addon\UsageCheck\Exception;

/**
* Description of CloneException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @version 1.0 / 2016-02-14
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Exception;
namespace FriendsOfRedaxo\addon\UsageCheck\Exception;

/**
* Description of FunctionNotCallableException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2016-07-15
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Exception;
namespace FriendsOfRedaxo\addon\UsageCheck\Exception;

/**
* Wird geworfen, wenn es keine passende Funktionalität für die zugrunde liegende
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2018-05-13
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Lib;
namespace FriendsOfRedaxo\addon\UsageCheck\Lib;

/**
* Description of ModulesBase
Expand All @@ -28,6 +28,12 @@ abstract class BaseModule
*/
protected $detailId = null;

/**
* Tabellenfelder
* @var array
*/
protected $tableFields = array();

/**
* Anzeigemodus umstellen
* @param boolean $bln
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2018-05-12
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Lib;
namespace FriendsOfRedaxo\addon\UsageCheck\Lib;

/**
* Description of FileSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2018-05-13
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Lib;
namespace FriendsOfRedaxo\addon\UsageCheck\Lib;

/**
* Description of PictureYFrom
Expand Down Expand Up @@ -42,7 +42,7 @@ public function getYFormTableSQLParts(/* int */ $detail_id = null)
'table_out' => $table['table_out'],
'type' => $table['type_name'],
//in YForm 2, muss man prüfen, ob be_media einen multiple modifier hat.
//siehe Kommentare in \akrys\redaxo\addon\UsageCheck\RexV5\Modules\Pictures::getYFormSQL
//siehe Kommentare in \FriendsOfRedaxo\addon\UsageCheck\RexV5\Modules\Pictures::getYFormSQL
'multiple' => (isset($table['multiple']) && $table['multiple'] == '1'),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2018-05-13
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Lib;
namespace FriendsOfRedaxo\addon\UsageCheck\Lib;

/**
* Description of RexBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @version 1.0 / 2018-05-13
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck;
namespace FriendsOfRedaxo\addon\UsageCheck;

/**
* Description of Medium
Expand All @@ -21,7 +21,7 @@ class Medium
*
* @param array $item Idezes: category_id, filename
* @return \rex_media
* @throws \akrys\redaxo\addon\UsageCheck\Exception\FunctionNotCallableException
* @throws \FriendsOfRedaxo\addon\UsageCheck\Exception\FunctionNotCallableException
* @SuppressWarnings(PHPMD.StaticAccess)
*/
public static function get($item)
Expand All @@ -32,7 +32,7 @@ public static function get($item)
!(is_object($complexPerm) &&
$complexPerm->hasCategoryPerm($item['category_id']))) {
//keine Rechte am Medium
throw new \akrys\redaxo\addon\UsageCheck\Exception\FunctionNotCallableException();
throw new \FriendsOfRedaxo\addon\UsageCheck\Exception\FunctionNotCallableException();
}

//Das Medium wird später gebraucht.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* @version 1.0 / 2015-08-09
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Modules;
namespace FriendsOfRedaxo\addon\UsageCheck\Modules;

use \akrys\redaxo\addon\UsageCheck\Permission;
use \FriendsOfRedaxo\addon\UsageCheck\Permission;

/**
* Description of Modules
*
* @author akrys
*/
class Actions
extends \akrys\redaxo\addon\UsageCheck\Lib\BaseModule
extends \FriendsOfRedaxo\addon\UsageCheck\Lib\BaseModule
{
const TYPE = 'actions';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* @version 1.0 / 2015-08-09
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Modules;
namespace FriendsOfRedaxo\addon\UsageCheck\Modules;

use \akrys\redaxo\addon\UsageCheck\Permission;
use \FriendsOfRedaxo\addon\UsageCheck\Permission;

/**
* Description of Modules
*
* @author akrys
*/
class Modules
extends \akrys\redaxo\addon\UsageCheck\Lib\BaseModule
extends \FriendsOfRedaxo\addon\UsageCheck\Lib\BaseModule
{
const TYPE = 'modules';

Expand Down Expand Up @@ -80,6 +80,7 @@ public function getDetails($item_id)
protected function getSQL(/* int */$detail_id = null)
{
$additionalFields = '';
$where = '';
$whereArray = [];
$groupBy = 'group by m.id';

Expand All @@ -105,7 +106,7 @@ protected function getSQL(/* int */$detail_id = null)
}

if (count($whereArray) > 0) {
$where = 'where '.implode(' and ', $whereArray);
$where .= 'where '.implode(' and ', $whereArray);
}

//Keine integer oder Datumswerte in einem concat!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,26 @@
* @version 1.0 / 2015-08-08
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Modules;
namespace FriendsOfRedaxo\addon\UsageCheck\Modules;

use \akrys\redaxo\addon\UsageCheck\Permission;
use \FriendsOfRedaxo\addon\UsageCheck\Permission;

/**
* Description of Pictures
*
* @author akrys
*/
class Pictures
extends \akrys\redaxo\addon\UsageCheck\Lib\BaseModule
extends \FriendsOfRedaxo\addon\UsageCheck\Lib\BaseModule
{
const TYPE = 'media';

/**
* Yform Integration
* @var \akrys\redaxo\addon\UsageCheck\Lib\PictureYFrom
* @var \FriendsOfRedaxo\addon\UsageCheck\Lib\PictureYFrom
*/
private $yform = null;

/**
* Tabellenfelder
* @var array
*/
private $tableFields;

/**
* Nicht genutze Bilder holen
Expand All @@ -49,7 +44,7 @@ public function get()
$rexSQL = $this->getRexSql();

if (!isset($this->yform)) {
$this->yform = new \akrys\redaxo\addon\UsageCheck\Lib\PictureYFrom($this);
$this->yform = new \FriendsOfRedaxo\addon\UsageCheck\Lib\PictureYFrom($this);
$this->yform->setRexSql($rexSQL);
}

Expand All @@ -70,7 +65,7 @@ public function getDetails($item_id)

$rexSQL = $this->getRexSql();
if (!isset($this->yform)) {
$this->yform = new \akrys\redaxo\addon\UsageCheck\Lib\PictureYFrom($this);
$this->yform = new \FriendsOfRedaxo\addon\UsageCheck\Lib\PictureYFrom($this);
$this->yform->setRexSql($rexSQL);
}

Expand Down Expand Up @@ -431,7 +426,7 @@ public static function showUsedInfo($item, $fields)
{
$return = '';
$used = false;
if ($item['count'] > 0) {
if (isset($item['count']) && $item['count'] > 0) {
$used = true;
}

Expand All @@ -444,19 +439,19 @@ public static function showUsedInfo($item, $fields)
}
}

if ($item['usagecheck_s_id'] > 0) {
if (isset($item['usagecheck_s_id']) && $item['usagecheck_s_id'] > 0) {
$used = true;
}

if ($item['usagecheck_metaArtIDs'] > 0) {
if (isset($item['usagecheck_metaArtIDs']) && $item['usagecheck_metaArtIDs'] > 0) {
$used = true;
}

if ($item['usagecheck_metaCatIDs'] > 0) {
if (isset($item['usagecheck_metaCatIDs']) && $item['usagecheck_metaCatIDs'] > 0) {
$used = true;
}

if ($item['usagecheck_metaMedIDs'] > 0) {
if (isset($item['usagecheck_metaMedIDs']) && $item['usagecheck_metaMedIDs'] > 0) {
$used = true;
}

Expand All @@ -465,7 +460,7 @@ public static function showUsedInfo($item, $fields)
$errors[] = \rex_i18n::rawMsg('akrys_usagecheck_images_msg_not_used');
}

if (!\akrys\redaxo\addon\UsageCheck\Medium::exists($item)) {
if (!\FriendsOfRedaxo\addon\UsageCheck\Medium::exists($item)) {
$errors[] = \rex_i18n::rawMsg('akrys_usagecheck_images_msg_not_found');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* @version 1.0 / 2015-08-09
* @author akrys
*/
namespace akrys\redaxo\addon\UsageCheck\Modules;
namespace FriendsOfRedaxo\addon\UsageCheck\Modules;

use \akrys\redaxo\addon\UsageCheck\Permission;
use \FriendsOfRedaxo\addon\UsageCheck\Permission;

/**
* Description of Templates
*
* @author akrys
*/
class Templates
extends \akrys\redaxo\addon\UsageCheck\Lib\BaseModule
extends \FriendsOfRedaxo\addon\UsageCheck\Lib\BaseModule
{
const TYPE = 'templates';

Expand Down Expand Up @@ -65,7 +65,7 @@ public function get()
// @codeCoverageIgnoreStart
//SQL-Fehler an der Stelle recht schwer zu testen, aber dennoch sinnvoll enthalten zu sein.
if (!$return) {
\akrys\redaxo\addon\UsageCheck\Error::getInstance()->add($rexSQL->getError());
\FriendsOfRedaxo\addon\UsageCheck\Error::getInstance()->add($rexSQL->getError());
}
// @codeCoverageIgnoreEnd

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* User-Rechte
*/
namespace akrys\redaxo\addon\UsageCheck;
namespace FriendsOfRedaxo\addon\UsageCheck;

/**
* User-Rechte für Zugriffe abfragen.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Dann muss man das Addon nur noch über das Redaxo-Backend installieren und aktiv

## Kompatibilität
- PHP Version: __5.6.11__ oder höher
- getestet mit Redaxo __5.0.1__, __5.1__, __5.2__, __5.3__, __5.4__, __5.5__
- getestet mit Redaxo __5.0.1__, __5.1__, __5.2__, __5.3__, __5.4__, __5.5__, __5.6__, __5.7__

## Hinweis Code-Analyse-Tools
Mit der Verison 1.0-Beta7 habe ich Code-Anlayse-Tools, wie z.B. `PHPUnit` eingebaut. Dafür schein es am Einfachsten zu
Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ After copying the files you'll need to install and activate this addon using the

## Compatibility
- PHP version: __5.6.11__ or later
- tested on Redaxo versions __5.0.1__, __5.1__, __5.2__, __5.3__, __5.4__, __5.5__
- tested on Redaxo versions __5.0.1__, __5.1__, __5.2__, __5.3__, __5.4__, __5.5__, __5.6__, __5.7__

## Notice on code-analyzing tools
As of version 1.0-Beta7, I'm using some code analyzing tools such as `PHPUnit`.
Expand Down
6 changes: 3 additions & 3 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Generelle Configuration
*/
require_once __DIR__.'/akrys/redaxo/addon/UsageCheck/Config.php';
require_once __DIR__.'/FriendsOfRedaxo/addon/UsageCheck/Config.php';

/*
* Sichergehen, dass der rex_autoloader nicht Stundenlang die PHPUnit-Klassen analysiert.
Expand All @@ -12,15 +12,15 @@
* Verzeichnis.
*/
try {
\akrys\redaxo\addon\UsageCheck\Config::checkVendorDir();
\FriendsOfRedaxo\addon\UsageCheck\Config::checkVendorDir();
} catch (\Exception $e) {
if (\rex::isBackend()) {
print $e->getMessage();
}
die();
}

spl_autoload_register(array('akrys\\redaxo\\addon\\UsageCheck\\Config', 'autoload'), true, true);
spl_autoload_register(array('FriendsOfRedaxo\\addon\\UsageCheck\\Config', 'autoload'), true, true);

if (class_exists(rex_fragment::class)) {
rex_fragment::addDirectory(realpath(__DIR__));
Expand Down
2 changes: 1 addition & 1 deletion fragments/image.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

<img alt="<?= $this->alt ?>" src="<?= $this->src ?>" <?= $this->style ? 'style="'.$this->style.'"' : ''; ?> />
<img alt="<?= $this->alt ?>" src="<?= $this->src ?>" <?= isset($this->style) ? 'style="'.$this->style.'"' : ''; ?> />
Loading

0 comments on commit c94372d

Please sign in to comment.