Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add js files as resources #59

Open
wants to merge 5 commits into
base: component_paper_impl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions cli/build_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@

INFO;

if (isset($argv[1])) {
$resolution_file = $argv[1];
} else {
$resolution_file = realpath(__DIR__ . "/../dependency_resolution.php");
if (count($argv) !== 3) {
die("php cli/build_bootstrap.php \$dependency_resolution \$name");
}

$resolution_file = $argv[1];
$name = $argv[2];


if (!file_exists($resolution_file)) {
die("Cannot find resolution file at {$resolution_file}.\n");
}
Expand Down Expand Up @@ -87,4 +89,4 @@
if (!is_dir(__DIR__ . "/../artifacts")) {
mkdir(__DIR__ . "/../artifacts", 0755, true);
}
file_put_contents(__DIR__ . "/../artifacts/bootstrap.php", $bootstrap);
file_put_contents(__DIR__ . "/../artifacts/bootstrap_$name.php", $bootstrap);
2 changes: 1 addition & 1 deletion cli/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*********************************************************************/

require_once(__DIR__ . "/../artifacts/bootstrap.php");
require_once(__DIR__ . "/../artifacts/bootstrap_setup.php");
require_once(__DIR__ . "/../ilias_version.php");

exit(entry_point("The ILIAS Setup"));
11 changes: 10 additions & 1 deletion components/ILIAS/AccessControl/AccessControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilAccessControlSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilAccessRBACSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "ilPermSelect.js");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(ilPermissionGUI $a_parent_obj, string $a_parent_cmd,
$this->tree_path_ids = $this->tree->getPathId($this->ref_id);

$tpl = $DIC->ui()->mainTemplate();
$tpl->addJavaScript('./components/ILIAS/AccessControl/js/ilPermSelect.js');
$tpl->addJavaScript('assets/js/ilPermSelect.js');

$this->setTitle($this->lng->txt('permission_settings'));
$this->setEnableHeader(true);
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion components/ILIAS/Accordion/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "accordion.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\NodeModule("owl.carousel/dist/owl.carousel.js");
}
}
4 changes: 2 additions & 2 deletions components/ILIAS/Accordion/classes/class.ilAccordionGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ public static function addCss(): void
public static function getLocalJavascriptFiles(): array
{
return array(
"./components/ILIAS/Accordion/js/accordion.js",
self::$owl_path . self::$owl_js_path
"assets/js/accordion.js",
"assets/js" . self::$owl_js_path
);
}

Expand Down
5 changes: 4 additions & 1 deletion components/ILIAS/Administration/Administration.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ILIAS\Administration\Setup\ilAdministrationSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getUpdateObjective(Config $config = null): Setup\Objective
}


public function getBuildArtifactObjective(): Setup\Objective
public function getBuildObjective(): Setup\Objective
{
return new Setup\Objective\NullObjective();
}
Expand Down
6 changes: 5 additions & 1 deletion components/ILIAS/AuthShibboleth/AuthShibboleth.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\Endpoint($this, "shib_login.php");

$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\Endpoint($this, "shib_logout.php");
}
}
2 changes: 1 addition & 1 deletion public/shib_login.php → ...S/AuthShibboleth/resources/shib_login.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
// @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
// $DIC->ctrl()->setCmd('doShibbolethAuthentication');
$DIC->ctrl()->callBaseClass(ilStartUpGUI::class);
}
}
2 changes: 1 addition & 1 deletion public/shib_logout.php → .../AuthShibboleth/resources/shib_logout.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ function unserializesession($serialized_string)
}

return ($variables);
}
}
8 changes: 7 additions & 1 deletion components/ILIAS/Authentication/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilAuthenticationSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);

$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\Endpoint($this, "sessioncheck.php");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
);
}

public function getBuildArtifactObjective(): Setup\Objective
public function getBuildObjective(): Setup\Objective
{
return new Setup\Objective\NullObjective();
}
Expand Down
20 changes: 10 additions & 10 deletions public/sessioncheck.php → ...Authentication/resources/sessioncheck.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
/** @var ILIAS\DI\Container $DIC */
$DIC->http()->saveResponse(
(
new ilSessionReminderCheck(
$DIC->http(),
$DIC->refinery(),
$DIC->language(),
$DIC->database(),
$DIC['ilClientIniFile'],
$DIC->logger()->auth(),
(new DataFactory())->clock()->utc()
)
new ilSessionReminderCheck(
$DIC->http(),
$DIC->refinery(),
$DIC->language(),
$DIC->database(),
$DIC['ilClientIniFile'],
$DIC->logger()->auth(),
(new DataFactory())->clock()->utc()
)
)->handle()
);
$DIC->http()->sendResponse();
$DIC->http()->close();
$DIC->http()->close();
3 changes: 2 additions & 1 deletion components/ILIAS/Awareness/Awareness.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "Awareness.js");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function initJS(): void
{
$ilUser = $this->user;
// init js
$this->main_tpl->addJavaScript("./components/ILIAS/Awareness/js/Awareness.js");
$this->main_tpl->addJavaScript("./assets/js/Awareness.js");
$this->ctrl->setParameter($this, "ref_id", $this->ref_id);
$this->main_tpl->addOnLoadCode("il.Awareness.setBaseUrl('" . $this->ctrl->getLinkTarget(
$this,
Expand Down
5 changes: 4 additions & 1 deletion components/ILIAS/BackgroundTasks/BackgroundTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilBackgroundTasksSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function hasConfig(): bool
*/
public function getArrayToConfigTransformation(): Refinery\Transformation
{
return $this->refinery->custom()->transformation(fn ($data): \ilBackgroundTasksSetupConfig => new \ilBackgroundTasksSetupConfig(
return $this->refinery->custom()->transformation(fn($data): \ilBackgroundTasksSetupConfig => new \ilBackgroundTasksSetupConfig(
$data["type"] ?? \ilBackgroundTasksSetupConfig::TYPE_SYNCHRONOUS,
$data["max_number_of_concurrent_tasks"] ?? 1
));
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
/**
* @inheritdoc
*/
public function getBuildArtifactObjective(): Setup\Objective
public function getBuildObjective(): Setup\Objective
{
return new Setup\Objective\NullObjective();
}
Expand Down
5 changes: 4 additions & 1 deletion components/ILIAS/Bibliographic/Bibliographic.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilBibliographicSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
/**
* @inheritdoc
*/
public function getBuildArtifactObjective(): Setup\Objective
public function getBuildObjective(): Setup\Objective
{
return new Setup\Objective\NullObjective();
}
Expand Down
3 changes: 2 additions & 1 deletion components/ILIAS/Block/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "ilblockcallback.js");
}
}
2 changes: 1 addition & 1 deletion components/ILIAS/Block/classes/class.ilBlockGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function __construct()
$this->ui = $DIC->ui();

ilYuiUtil::initConnection();
$this->main_tpl->addJavaScript("./components/ILIAS/Block/js/ilblockcallback.js");
$this->main_tpl->addJavaScript("./assets/js/ilblockcallback.js");

$this->setLimit((int) $this->user->getPref("hits_per_page"));

Expand Down
10 changes: 9 additions & 1 deletion components/ILIAS/COPage/COPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "ilCOPagePres.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "ilCOPagePCInteractiveImage.js");

$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\NodeModule("tinymce/tinymce.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\NodeModule("tinymce/tinymce.min.js");
}
}
6 changes: 3 additions & 3 deletions components/ILIAS/COPage/Editor/UI/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ public function initUI(
}

if (DEVMODE == 1) {
$main_tpl->addJavaScript("./node_modules/tinymce/tinymce.js");
$main_tpl->addJavaScript("assets/js/tinymce.js");
} else {
$main_tpl->addJavaScript("./node_modules/tinymce/tinymce.min.js");
$main_tpl->addJavaScript("assets/js/tinymce.min.js");
}

\ilYuiUtil::initConnection();
$main_tpl->addJavaScript("./components/ILIAS/UIComponent/Explorer/js/ilExplorer.js");
$main_tpl->addJavaScript("assets/js/ilExplorer.js");

// ensure that form.js is loaded which is needed for file input (js that shows file names)
$dummy = new \ilPropertyFormGUI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function __construct(
iljQueryUtil::initjQueryUI();
parent::__construct($a_content_obj, $a_page, $request);

$this->main_tpl->addJavaScript("./components/ILIAS/COPage/js/ilCOPagePres.js");
$this->main_tpl->addJavaScript("./components/ILIAS/COPage/js/ilCOPagePCInteractiveImage.js");
$this->main_tpl->addJavaScript("assets/js/ilCOPagePres.js");
$this->main_tpl->addJavaScript("assets/js/ilCOPagePCInteractiveImage.js");

ilAccordionGUI::addJavaScript();
ilAccordionGUI::addCss();
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/COPage/PC/Table/class.ilPCTableGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ public function editData(): void
$this->displayValidationError();

$this->initEditor();
$this->tpl->addJavaScript("./components/ILIAS/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
$this->tpl->addJavaScript("assets/js/AdvancedSelectionList.js");
$this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
$this->tpl->setContent($this->getEditDataTable(true));
}
Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/COPage/Resources/ResourcesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ protected function init(\ilPageObject $pg): void
if ($this->output_mode == \ilPageObjectGUI::OFFLINE) {
$this->js_files[] = \iljQueryUtil::getLocaljQueryPath();
$this->js_files[] = \iljQueryUtil::getLocaljQueryUIPath();
$this->js_files[] = './components/ILIAS/JavaScript/js/Basic.js';
$this->js_files[] = 'assets/js/Basic.js';
}

$this->js_files[] = "./components/ILIAS/COPage/js/ilCOPagePres.js";
$this->js_files[] = "assets/js/ilCOPagePres.js";

// for all page components...
$defs = $this->pc_definition->getPCDefinitions();
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/COPage/classes/class.ilPageObjectGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public function showPage(): string
// $this->initSelfAssessmentRendering();
ilObjMediaObjectGUI::includePresentationJS($main_tpl);

$main_tpl->addJavaScript("./components/ILIAS/COPage/js/ilCOPagePres.js");
$main_tpl->addJavaScript("assets/js/ilCOPagePres.js");

// needed for overlays in iim
ilOverlayGUI::initJavascript();
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion components/ILIAS/Calendar/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilCalendarSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);

$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\Endpoint($this, "calendar.php");
}
}
File renamed without changes.
5 changes: 4 additions & 1 deletion components/ILIAS/Certificate/Certificate.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[\ILIAS\Setup\Agent::class] = fn() =>
new \ilCertificatSetupAgent(
$pull[\ILIAS\Refinery\Factory::class]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
);
}

public function getBuildArtifactObjective(): Setup\Objective
public function getBuildObjective(): Setup\Objective
{
return new Setup\Objective\NullObjective();
}
Expand Down
15 changes: 14 additions & 1 deletion components/ILIAS/Chart/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ public function init(
array | \ArrayAccess &$pull,
array | \ArrayAccess &$internal,
): void {
// ...
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "excanvas.min.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.min.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.resize.min.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.stack.min.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.pie.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.highlighter.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentJS($this, "jquery.flot.spider.js");
}
}
Loading
Loading