Skip to content

Commit

Permalink
Remove support for tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Oct 26, 2020
1 parent e3054f2 commit fedf7b2
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 125 deletions.
2 changes: 0 additions & 2 deletions concrete/attributes/topics/type_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
$('input[name="akTopicTreeID"]').val($(this).find(':selected').val());
$('.tree-view-template').remove();
$('.tree-view-container').append(treeViewTemplate);
var toolsURL = '<?php echo Loader::helper('concrete/urls')->getToolsURL('tree/load');
?>';
var chosenTree = $(this).val();
$('.tree-view-template').concreteTree({
'treeID': chosenTree,
Expand Down
3 changes: 0 additions & 3 deletions concrete/bootstrap/configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
const DIRNAME_THEMES = 'themes';
const DIRNAME_THEMES_CORE = 'core';
const DIRNAME_CONFIG = 'config';
const DIRNAME_TOOLS = 'tools';
const DIRNAME_BLOCK_TEMPLATES = 'templates';
const DIRNAME_BLOCK_TEMPLATES_COMPOSER = 'composer';
const DIRNAME_CSS = 'css';
Expand Down Expand Up @@ -239,8 +238,6 @@
define('DIR_PACKAGES', DIR_BASE . '/packages');
define('DIR_FILES_BLOCK_TYPES', DIR_APPLICATION . '/' . DIRNAME_BLOCKS);
define('DIR_FILES_BLOCK_TYPES_CORE', DIR_BASE_CORE . '/' . DIRNAME_BLOCKS);
define('DIR_FILES_TOOLS', DIR_APPLICATION . '/tools');
define('DIR_FILES_TOOLS_REQUIRED', DIR_BASE_CORE . '/tools');
define('DIR_PACKAGES_CORE', DIR_BASE_CORE . '/packages');
defined('DIR_STARTING_POINT_PACKAGES') or define('DIR_STARTING_POINT_PACKAGES', DIR_CONFIG_SITE . '/install/packages');
define('DIR_STARTING_POINT_PACKAGES_CORE', DIR_BASE_CORE . '/config/install/packages');
Expand Down
9 changes: 0 additions & 9 deletions concrete/bootstrap/paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,3 @@
define('PACKAGE_GENERIC_ICON', ASSETS_URL_IMAGES . '/icons/icon_package_generic.png');
define('ASSETS_URL_THEMES_NO_THUMBNAIL', ASSETS_URL_IMAGES . '/spacer.gif');
define('AL_ICON_DEFAULT', ASSETS_URL_IMAGES . '/icons/filetypes/default.svg');

/*
* ----------------------------------------------------------------------------
* Relative paths to tools. Passes through concrete5.
* ----------------------------------------------------------------------------
*/
define('REL_DIR_FILES_TOOLS', $app['app_relative_path'] . '/' . DISPATCHER_FILENAME . '/tools');
define('REL_DIR_FILES_TOOLS_REQUIRED', $app['app_relative_path'] . '/' . DISPATCHER_FILENAME . '/tools/required'); // front-end
define('REL_DIR_FILES_TOOLS_PACKAGES', REL_DIR_FILES_TOOLS . '/packages');
1 change: 0 additions & 1 deletion concrete/elements/header_required.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@
var CCM_EDIT_MODE = <?php echo $isEditMode ? 'true' : 'false'; ?>;
var CCM_ARRANGE_MODE = <?php echo $isArrangeMode ? 'true' : 'false'; ?>;
var CCM_IMAGE_PATH = "<?php echo ASSETS_URL_IMAGES; ?>";
var CCM_TOOLS_PATH = "<?php echo REL_DIR_FILES_TOOLS_REQUIRED; ?>";
var CCM_APPLICATION_URL = "<?php echo rtrim((string) $app->make('url/canonical'), '/'); ?>";
var CCM_REL = "<?php echo $app->make('app_relative_path'); ?>";
var CCM_ACTIVE_LOCALE = <?= json_encode(Localization::activeLocale()) ?>;
Expand Down
1 change: 0 additions & 1 deletion concrete/elements/preview_header_required.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
var CCM_EDIT_MODE = false;
var CCM_ARRANGE_MODE = false;
var CCM_IMAGE_PATH = "<?= ASSETS_URL_IMAGES; ?>";
var CCM_TOOLS_PATH = "<?= REL_DIR_FILES_TOOLS_REQUIRED; ?>";
var CCM_APPLICATION_URL = "<?= rtrim((string) app('url/canonical'), '/'); ?>";
var CCM_REL = "<?= app('app_relative_path'); ?>";
var CCM_ACTIVE_LOCALE = <?= json_encode(Localization::activeLocale()) ?>;
Expand Down
2 changes: 0 additions & 2 deletions concrete/single_pages/dashboard/pages/feeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ class="btn btn-primary float-left"><?= t('Cancel') ?></a>
var treeViewTemplate = $('.tree-view-template');

$('select[name=customTopicAttributeKeyHandle]').on('change', function () {
var toolsURL = '<?= app('helper/concrete/urls')->getToolsURL('tree/load');
?>';
var chosenTree = $(this).find('option:selected').attr('data-topic-tree-id');
$('.tree-view-template').remove();
if (!chosenTree) {
Expand Down
24 changes: 0 additions & 24 deletions concrete/src/Application/Service/Urls.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,6 @@ public function getPackageURL($pkg)
return $pkg->getRelativePath();
}

/**
* @deprecated
* Gets a URL to reference a script in the tools directory
*
* @param string $tool
* @param string $pkgHandle
*
* @return string Relative url to tool
*/
public function getToolsURL($tool, $pkgHandle = null)
{
if ($pkgHandle != null) {
$url = REL_DIR_FILES_TOOLS_PACKAGES . '/' . $pkgHandle . '/' . $tool;

return $url;
} else {
if (file_exists(DIR_APPLICATION . '/' . DIRNAME_TOOLS . '/' . $tool . '.php')) {
return REL_DIR_FILES_TOOLS . '/' . $tool;
} else {
return REL_DIR_FILES_TOOLS_REQUIRED . '/' . $tool;
}
}
}

/**
* Gets a full URL to an icon for a particular block type.
*
Expand Down
22 changes: 0 additions & 22 deletions concrete/src/Foundation/Runtime/Run/DefaultRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ public function run()
// Define legacy urls, this may be the first thing that loads the entity manager
'initializeLegacyUrlDefinitions',

// Register legacy tools routes
'registerLegacyRoutes',

// Register legacy config values
'registerLegacyConfigValues',

Expand Down Expand Up @@ -212,25 +209,6 @@ protected function registerLegacyConfigValues()
$config->set('concrete.site', $name);
}

/**
* Register routes that power legacy functionality
* This includes `/tools/tool_handle` and `/tools/blocks/block_handle/tool_handle`.
*
* @deprecated In a future major version this will be part of HTTP middleware
*
* @return Response|void Returns a response if an error occurs
*/
protected function registerLegacyRoutes()
{
$router = $this->getRouter();
$router->register(
'/tools/{tool}',
'\Concrete\Core\Legacy\Controller\ToolController::display',
'tool',
['tool' => '[A-Za-z0-9_/.]+']
);
}

/**
* Create the request object to use.
*/
Expand Down
41 changes: 0 additions & 41 deletions concrete/src/Legacy/Controller/ToolController.php

This file was deleted.

1 change: 0 additions & 1 deletion concrete/src/System/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ public function getOverrideList()
DIR_FILES_EMAIL_TEMPLATES,
DIR_FILES_CONTENT,
DIR_FILES_THEMES,
DIR_FILES_TOOLS,
DIR_APPLICATION.'/'.DIRNAME_PAGE_TEMPLATES,
DIR_APPLICATION.'/'.DIRNAME_VIEWS,
DIR_APPLICATION.'/'.DIRNAME_CLASSES,
Expand Down
18 changes: 0 additions & 18 deletions concrete/src/Workflow/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,24 +327,6 @@ public static function getByName($wfName)
return $wfID ? static::getByID($wfID) : null;
}

/**
* Get the URL of a task for this workflow.
*
* @param string $task
*
* @return string
*/
public function getWorkflowToolsURL($task)
{
$type = $this->getWorkflowTypeObject();
$app = Application::getFacadeApplication();
$uh = $app->make('helper/concrete/urls');
$url = $uh->getToolsURL('workflow/types/' . $type->getWorkflowTypeHandle(), $type->getPackageHandle());
$url .= '?wfID=' . $this->getWorkflowID() . '&task=' . $task . '&' . $app->make('token')->getParameter($task);

return $url;
}

/**
* Change the (English) name of this workflow.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/View/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testOAuthAuthorizeBasic()
public function testLegacyToolsUrlDoesNotMatchDashboardTheme()
{
$view = new DialogView('/dashboard/get_image_data');
$view->setViewRootDirectoryName(DIRNAME_TOOLS);
$view->setViewRootDirectoryName('tools');
$view->setupRender();
$template = $view->getViewTemplate();
$file = $view->getInnerContentFile();
Expand Down

0 comments on commit fedf7b2

Please sign in to comment.