Skip to content

Commit

Permalink
Plugin Manager entfernt
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Sep 7, 2024
1 parent e1f93b1 commit e9e724e
Show file tree
Hide file tree
Showing 72 changed files with 1,879 additions and 1,872 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
99 changes: 99 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,102 @@
rex_view::addJsFile($this->getAssetsUrl('inputmask/dist/jquery.inputmask.min.js'));
rex_view::addJsFile($this->getAssetsUrl('tools.js'));
}

// Manager

rex_complex_perm::register('yform_manager_table_edit', 'rex_yform_manager_table_perm_edit');
rex_complex_perm::register('yform_manager_table_view', 'rex_yform_manager_table_perm_view');

if (rex::isBackend() && rex::getUser()) {
rex_extension::register('PACKAGES_INCLUDED', function () {
if ($this->getProperty('compile')) {
$compiler = new rex_scss_compiler();
$compiler->setRootDir($this->getPath('scss/'));
$compiler->setScssFile($this->getPath('scss/manager.scss'));
$compiler->setCssFile($this->getPath('assets/manager.css'));
$compiler->compile();
rex_dir::copy($this->getPath('assets'), $this->getAssetsPath()); // copy whole assets directory
}
});

rex_view::addJsFile($this->getAssetsUrl('manager.js'));
rex_view::addJsFile($this->getAssetsUrl('relations.js'));
rex_view::addCssFile($this->getAssetsUrl('manager.css'));
rex_view::addJsFile($this->getAssetsUrl('widget.js'));

if (!rex::getUser()->isAdmin()) {
$page = $this->getProperty('page');
$page['hidden'] = true;
$this->setProperty('page', $page);
}

try {
$tables = rex_yform_manager_table::getAll();
} catch (Exception $e) {
$tables = [];
}
$pages = [];

$prio = 1;
foreach ($tables as $table) {
if ($table->isActive() && $table->isGranted('VIEW', rex::getUser())) {
$be_page = new rex_be_page_main('yform_tables', $table->getTableName(), rex_escape($table->getNameLocalized()));
$be_page->setHref('index.php?page=yform/manager/data_edit&table_name=' . $table->getTableName());
$icon = rex_escape($table->getCustomIcon() ?: 'rex-icon-module');
$be_page->setIcon('rex-icon ' . $icon);
$be_page->setPrio($prio);

if ($table->isHidden()) {
$be_page->setHidden();
}

if ('yform/manager/data_edit' == rex_request('page', 'string') && rex_request('table_name', 'string') == $table->getTableName()) {
$be_page->setIsActive();

$main_page = $this->getAddon()->getProperty('page');
$main_page['isActive'] = false;

$rex_yform_manager_opener = rex_request('rex_yform_manager_opener', 'array');
$rex_yform_manager_popup = rex_request('rex_yform_manager_popup', 'int');
$rex_yform_filter = rex_request('rex_yform_filter', 'array');

if ((isset($rex_yform_manager_opener['id']) && '' != $rex_yform_manager_opener['id']) || 1 == $rex_yform_manager_popup) {
$main_page['popup'] = true;
}

$this->getAddon()->setProperty('page', $main_page);
}

$pages[] = $be_page;

++$prio;
}
}

$this->setProperty('pages', $pages);
}

rex_extension::register('MEDIA_IS_IN_USE', 'rex_yform_value_be_media::isMediaInUse');
rex_extension::register('PACKAGES_INCLUDED', 'rex_yform_value_be_link::isArticleInUse');

rex_extension::register('YFORM_SAVED', static function (rex_extension_point $ep) {
if ($ep->getSubject() instanceof Exception) {
return;
}

$table = rex_yform_manager_table::get($ep->getParam('table'));
if (!$table) {
return;
}

$dataset = $ep->getParam('form')->getParam('manager_dataset');
if (!$dataset) {
$dataset = rex_yform_manager_dataset::getRaw($ep->getParam('id'), $table->getTableName());
}
$dataset->invalidateData();

if ($table->hasHistory() && $dataset->isHistoryEnabled()) {
$action = 'insert' === $ep->getParam('action') ? rex_yform_manager_dataset::ACTION_CREATE : rex_yform_manager_dataset::ACTION_UPDATE;
$dataset->makeSnapshot($action);
}
});
7 changes: 2 additions & 5 deletions docs/02_email.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# E-Mail-Templates (PlugIn)

> **Hinweis:**
> Plugins erweitern YForm und können optional aktiviert werden.
# E-Mail-Templates

## Zweck der E-Mail-Templates

Expand Down Expand Up @@ -138,7 +135,7 @@ REX_YFORM_DATA[field="custom"]

## Variante 2: E-Mail-Versand zur Verwendung in Cronjobs, Addons, etc.

Dieser Code basiert auf [plugins/email/lib/yform_action_tpl2email.php](https://github.com/yakamara/redaxo_yform/blob/master/plugins/email/lib/yform_action_tpl2email.php).
Dieser Code basiert auf [lib/yform/action/tpl2email.php](https://github.com/yakamara/redaxo_yform/blob/master/plugins/email/lib/yform_action_tpl2email.php).

```php
<?php
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e9e724e

Please sign in to comment.