Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
akrys committed Sep 26, 2015
2 parents 52cd149 + 7f16265 commit af98ce6
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace akrys\redaxo\addon\UserCheck;
namespace akrys\redaxo\addon\UsageCheck;

/**
* Datei für ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace akrys\redaxo\addon\UserCheck;
namespace akrys\redaxo\addon\UsageCheck;

class Config
{
Expand Down Expand Up @@ -33,7 +33,7 @@ class Config
*
* @var string
*/
const VERSION = '0.2 DEVELOP';
const VERSION = '0.25 DEVELOP';

/**
* Release-Datum zur Unterscheidung der Versionen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace akrys\redaxo\addon\UserCheck;
namespace akrys\redaxo\addon\UsageCheck;

/**
* Datei für ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace akrys\redaxo\addon\UserCheck;
namespace akrys\redaxo\addon\UsageCheck;

/**
* Datei für ...
Expand Down Expand Up @@ -222,4 +222,15 @@ public static function getSizeOut($item)

return $value.' '.$unit;
}

/**
* Überprüfen, ob eine Datei existiert.
*
* @global type $REX
* @param array $item
* @return boolean
*/
public static function exits($item){
return file_exists($GLOBALS['REX']['MEDIAFOLDER'].DIRECTORY_SEPARATOR.$item['filename']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace akrys\redaxo\addon\UserCheck;
namespace akrys\redaxo\addon\UsageCheck;

/**
* Datei für ...
Expand Down
4 changes: 2 additions & 2 deletions config.inc.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

require_once __DIR__.'/akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/akrys/redaxo/addon/UsageCheck/Config.php';

use akrys\redaxo\addon\UserCheck\Config;
use akrys\redaxo\addon\UsageCheck\Config;
/* Addon Parameter */
$REX['ADDON']['rxid'][Config::NAME] = Config::ID;
$REX['ADDON']['name'][Config::NAME] = 'Usage Check';
Expand Down
4 changes: 2 additions & 2 deletions install.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* and open the template in the editor.
*/

require_once __DIR__.'/akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/akrys/redaxo/addon/UsageCheck/Config.php';

use akrys\redaxo\addon\UserCheck\Config;
use akrys\redaxo\addon\UsageCheck\Config;
// @todo Datenbank anpassung

$error = '';
Expand Down
1 change: 1 addition & 0 deletions lang/de_de_utf8.lang
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ akrys_usagecheck_images_table_heading_functions = Funktionen
akrys_usagecheck_images_category_header = Kategorie
akrys_usagecheck_images_msg_used = OK, wird verwendet
akrys_usagecheck_images_msg_not_used = nicht verwendet
akrys_usagecheck_images_msg_not_found = Die Datei exisitert nicht im Medien-Ordner
akrys_usagecheck_images_linktext_edit = Im Mediapool bearbeiten
akrys_usagecheck_images_linktext_edit_in_slice = Im Slice bearbeiten (ID: $sliceID$, Artikel: "$articleName$")
akrys_usagecheck_images_linktext_edit_in_xformtable = In Tabelle "$tableName$" bearbeiten (ID: $entryID$)
Expand Down
1 change: 1 addition & 0 deletions lang/en_gb_utf8.lang
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ akrys_usagecheck_images_table_heading_functions = Functions
akrys_usagecheck_images_category_header = Category
akrys_usagecheck_images_msg_used = OK, this is used
akrys_usagecheck_images_msg_not_used = not used
akrys_usagecheck_images_msg_not_found = This file does not exist.
akrys_usagecheck_images_linktext_edit = edit in media pool
akrys_usagecheck_images_linktext_edit_in_slice = edit in original slice (ID: $sliceID$, article: "$articleName$")
akrys_usagecheck_images_linktext_edit_in_xformtable = edit in table "$tableName$" (ID: $entryID$)
Expand Down
8 changes: 4 additions & 4 deletions pages/_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* and open the template in the editor.
*/

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Actions.php';
use akrys\redaxo\addon\UsageCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Actions.php';

$showAll = rex_get('showall', 'string', "");

rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_action_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);

$items = \akrys\redaxo\addon\UserCheck\Actions::getActions($showAll);
$items = \akrys\redaxo\addon\UsageCheck\Actions::getActions($showAll);


$showAllParam = '&showall=true';
Expand Down
4 changes: 2 additions & 2 deletions pages/_changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* and open the template in the editor.
*/

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
use akrys\redaxo\addon\UsageCheck\Config;
rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_changelog_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);

if (!function_exists('\\glob')) {
Expand Down
8 changes: 4 additions & 4 deletions pages/_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* and open the template in the editor.
*/

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Modules.php';
use akrys\redaxo\addon\UsageCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Modules.php';

$showAll = rex_get('showall', 'string', "");

rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_module_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);

$items = \akrys\redaxo\addon\UserCheck\Modules::getModules($showAll);
$items = \akrys\redaxo\addon\UsageCheck\Modules::getModules($showAll);


$showAllParam = '&showall=true';
Expand Down
4 changes: 2 additions & 2 deletions pages/_overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* and open the template in the editor.
*/

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
use akrys\redaxo\addon\UsageCheck\Config;
rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_overview_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);
?>

Expand Down
35 changes: 26 additions & 9 deletions pages/_picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
/**
* Anzeige der nicht verwendeten Bilder.
*/
require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Pictures.php';
use akrys\redaxo\addon\UsageCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Pictures.php';

$showAll = rex_get('showall', 'string', "");

rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_images_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);

$items = \akrys\redaxo\addon\UserCheck\Pictures::getPictures($showAll);
$items = \akrys\redaxo\addon\UsageCheck\Pictures::getPictures($showAll);



Expand Down Expand Up @@ -57,7 +57,7 @@
<strong><?php echo $item['title']; ?></strong><br />

<?php
echo $item['filename'].' ('.akrys\redaxo\addon\UserCheck\Pictures::getSizeOut($item).')';
echo $item['filename'].' ('.akrys\redaxo\addon\UsageCheck\Pictures::getSizeOut($item).')';
?>

<br />
Expand All @@ -79,14 +79,31 @@
}
}

$errors = array();
if ($used === false) {
$errors[] = $I18N->msg('akrys_usagecheck_images_msg_not_used');
}

if (!\akrys\redaxo\addon\UsageCheck\Pictures::exits($item)) {
$errors[] = $I18N->msg('akrys_usagecheck_images_msg_not_found');
}

if (count($errors) > 0) {
?>

<div class="rex-message">
<div class="rex-warning">
<p>
<span><?php echo $I18N->msg('akrys_usagecheck_images_msg_not_used'); ?></span>
</p>
<?php
foreach ($errors as $error) {
?>

<p>
<span><?php echo $error; ?></span>
</p>

<?php
}
?>
</div>
</div>

Expand All @@ -106,7 +123,7 @@
<span>

<ol>
<li><a href="http://redaxo.arbeit.local/redaxo/index.php?page=mediapool&subpage=detail&file_name=<?php echo $item['filename']; ?>" target="_blank"><?php echo $I18N->msg('akrys_usagecheck_images_linktext_edit'); ?></a><br /></li>
<li><a href="index.php?page=mediapool&subpage=detail&file_name=<?php echo $item['filename']; ?>" target="_blank"><?php echo $I18N->msg('akrys_usagecheck_images_linktext_edit'); ?></a><br /></li>

<?php
if ($item['slice_data'] !== null) {
Expand Down
8 changes: 4 additions & 4 deletions pages/_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
* and open the template in the editor.
*/

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

/* @var $I18N \i18n */

use akrys\redaxo\addon\UserCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Templates.php';
use akrys\redaxo\addon\UsageCheck\Config;
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Templates.php';

$showAll = rex_get('showall', 'string', "");
$showInactive = rex_get('showinactive', 'string', "");

rex_title(Config::NAME_OUT.' / '.$I18N->msg('akrys_usagecheck_template_subpagetitle').' <span style="font-size:10px;color:#c2c2c2">'.Config::VERSION.'</span>', $REX['ADDON']['pages'][Config::NAME]);

$items = \akrys\redaxo\addon\UserCheck\Templates::getTemplates($showAll, $showInactive);
$items = \akrys\redaxo\addon\UsageCheck\Templates::getTemplates($showAll, $showInactive);


$showAllParam = '';
Expand Down
4 changes: 2 additions & 2 deletions pages/index.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
require $REX['INCLUDE_PATH'].'/layout/top.php';

require_once __DIR__.'/../akrys/redaxo/addon/UserCheck/Config.php';
require_once __DIR__.'/../akrys/redaxo/addon/UsageCheck/Config.php';

use akrys\redaxo\addon\UserCheck\Config;
use akrys\redaxo\addon\UsageCheck\Config;

$page = rex_request('page', 'string');
$subpage = rex_request('subpage', 'string');
Expand Down
5 changes: 5 additions & 0 deletions pages/release_notes/de/2015-09-25_0.25 DEVELOP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

<ul>
<li>Bei ungenutzten Mediapool-Dateien prüfen, ob sie exisiteren.</li>
<li>Namespace umbenannt. War völlig falsch. Statt "UsageCheck" habe ich "UserCheck" geschrieben. Und es ist mir nie aufgefallen.</li>
</ul>
5 changes: 5 additions & 0 deletions pages/release_notes/en/2015-09-25_0.25 DEVELOP.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

<ul>
<li>Check existance of unsed media pool files.</li>
<li>Namespace repair. Insted of "UsageCheck", I wrote "UserCheck". Clumsy me!</li>
</ul>
4 changes: 2 additions & 2 deletions uninstall.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
require_once __DIR__.'/akrys/redaxo/addon/UserCheck/Config.php';
use akrys\redaxo\addon\UserCheck\Config;
require_once __DIR__.'/akrys/redaxo/addon/UsageCheck/Config.php';
use akrys\redaxo\addon\UsageCheck\Config;

$REX['ADDON']['install'][Config::NAME] = 0;

Expand Down

0 comments on commit af98ce6

Please sign in to comment.