Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Bitter authored and Fabian Bitter committed Aug 27, 2023
1 parent 8c37024 commit 425b341
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 59 deletions.
7 changes: 7 additions & 0 deletions .idea/app_icon.iml

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

7 changes: 7 additions & 0 deletions .idea/modules.xml

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

8 changes: 7 additions & 1 deletion .idea/vcs.xml

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

5 changes: 3 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Version 2.6.0
Version 2.7.0
==================================================
- Add support for multi sites
- Add help dialog
- Add multi site support

Version 2.5.0
==================================================
Expand Down
2 changes: 1 addition & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class Controller extends Package
{
protected $pkgHandle = 'app_icon';
protected $pkgVersion = '2.6.0';
protected $pkgVersion = '2.7.0';
protected $appVersionRequired = '9.0.0';
protected $pkgAutoloaderRegistries = [
'src/Bitter/AppIcon' => 'Bitter\AppIcon',
Expand Down
28 changes: 28 additions & 0 deletions elements/dashboard/help.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* @author Fabian Bitter
* @copyright (C) 2016 Fabian Bitter (www.bitter.de)
* @version 1.2.1
*/

defined('C5_EXECUTE') or die('Access Denied.');
?>

<a class="btn btn-secondary" href="javascript:void(0);" id="ccm-report-bug">
<?php echo t('Get Help') ?>
</a>

<script>
(function ($) {
$("#ccm-report-bug").click(function () {
jQuery.fn.dialog.open({
href: "<?php echo (string)\Concrete\Core\Support\Facade\Url::to("/ccm/system/dialogs/app_icon/create_ticket"); ?>",
modal: true,
width: 500,
title: "<?php echo h(t("Support"));?>",
height: '80%'
});
});
})(jQuery);
</script>
19 changes: 1 addition & 18 deletions single_pages/dashboard/system/app_icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,9 @@
?>

<div class="ccm-dashboard-header-buttons">
<a class="btn btn-secondary" href="javascript:void(0);" id="ccm-report-bug">
<?php echo t('Get Help') ?>
</a>
<?php \Concrete\Core\View\View::element("dashboard/help", [], "app_icon"); ?>
</div>


<script>
(function ($) {
$("#ccm-report-bug").click(function () {
jQuery.fn.dialog.open({
href: "<?php echo (string)\Concrete\Core\Support\Facade\Url::to("/ccm/system/dialogs/app_icon/create_ticket"); ?>",
modal: true,
width: 500,
title: "<?php echo h(t("Support"));?>",
height: '80%'
});
});
})(jQuery);
</script>

<div class="row">
<div class="col-xs-12">
<form action="#" method="post">
Expand Down
37 changes: 0 additions & 37 deletions src/Bitter/AppIcon/RouteList.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
<?php

/**
* @project: App Icon
*
* @author Fabian Bitter
* @copyright (C) 2016 Fabian Bitter (www.bitter.de)
* @version 1.1.1
*/

namespace Bitter\AppIcon;

use Concrete\Core\Http\Response;
use Concrete\Core\Http\ResponseFactory;
use Concrete\Core\Package\Package;
use Concrete\Core\Package\PackageService;
use Concrete\Core\Routing\RouteListInterface;
use Concrete\Core\Routing\Router;
use Concrete\Core\Support\Facade\Application;

class RouteList implements RouteListInterface
{
Expand All @@ -27,35 +20,5 @@ public function loadRoutes(Router $router)
->setNamespace('Concrete\Package\AppIcon\Controller\Dialog\Support')
->setPrefix('/ccm/system/dialogs/app_icon')
->routes('dialogs/support.php', 'app_icon');

$app = Application::getFacadeApplication();
/** @var $responseFactory ResponseFactory */
$responseFactory = $app->make(ResponseFactory::class);
/** @var PackageService $packageService */
$packageService = $app->make(PackageService::class);
$packageEntity = $packageService->getByHandle("app_icon");
/** @var Package $pkg */
$pkg = $packageEntity->getController();

/** @noinspection PhpDeprecationInspection */
$router->register("/bitter/app_icon/reminder/hide", function () use ($app, $responseFactory, $pkg) {
$pkg->getConfig()->save('reminder.hide', true);
$responseFactory->create("", Response::HTTP_OK)->send();
$app->shutdown();
});

/** @noinspection PhpDeprecationInspection */
$router->register("/bitter/app_icon/did_you_know/hide", function () use ($app, $responseFactory, $pkg) {
$pkg->getConfig()->save('did_you_know.hide', true);
$responseFactory->create("", Response::HTTP_OK)->send();
$app->shutdown();
});

/** @noinspection PhpDeprecationInspection */
$router->register("/bitter/app_icon/license_check/hide", function () use ($app, $responseFactory, $pkg) {
$pkg->getConfig()->save('license_check.hide', true);
$responseFactory->create("", Response::HTTP_OK)->send();
$app->shutdown();
});
}
}

0 comments on commit 425b341

Please sign in to comment.