<?php /** * History. * * @author jan@kristinus.de * * @package redaxo5 */ $mypage = 'history'; $history_date = rex_request('rex_history_date', 'string'); rex_perm::register('history[article_rollback]', null, rex_perm::OPTIONS); if ($history_date != '') { $user = rex_backend_login::createUser(); if (!$user) { throw new rex_exception('no permission'); } if (!$user->hasPerm('history[article_rollback]')) { throw new rex_exception('no permission for the slice version'); } rex_extension::register('ART_INIT', function (rex_extension_point $ep) { $article = $ep->getParam('article'); if ($article instanceof rex_article_content) { $article->getContentAsQuery(); } $article->setEval(true); }); rex_extension::register('ART_SLICES_QUERY', function (rex_extension_point $ep) { $history_date = rex_request('rex_history_date', 'string'); $history_revision = rex_request('history_revision', 'int', 0); $article = $ep->getParam('article');
foreach ($page->getRequiredPermissions() as $perm) { // ignore admin perm and complex perms (with "/") if ($perm && !in_array($perm, ['isAdmin', 'admin', 'admin[]']) && strpos($perm, '/') === false && !rex_perm::has($perm)) { rex_perm::register($perm); } } $registerImplicitePagePermissions($page->getSubpages()); } }; $registerImplicitePagePermissions(rex_be_controller::getPages()); foreach ([rex_perm::GENERAL, rex_perm::OPTIONS, rex_perm::EXTRAS] as $permgroup) { $field = $fieldContainer->addGroupedField($group, 'select', $permgroup); $field->setLabel(rex_i18n::msg('user_' . $permgroup)); $select = $field->getSelect(); $select->setMultiple(true); $perms = rex_perm::getAll($permgroup); $select->setSize(min(10, max(3, count($perms)))); $select->addArrayOptions($perms); } rex_extension::register('REX_FORM_INPUT_CLASS', function (rex_extension_point $ep) { return $ep->getParam('inputType') == 'perm_select' ? 'rex_form_perm_select_element' : null; }); $fieldIds = []; foreach (rex_complex_perm::getAll() as $key => $class) { $params = $class::getFieldParams(); if (!empty($params)) { $field = $fieldContainer->addGroupedField($group, 'perm_select', $key); $field->setLabel($params['label']); $field->setCheckboxLabel($params['all_label']); $fieldIds[] = $field->getAttribute('id'); if (rex_request('default_value', 'boolean')) {
<?php rex_perm::register('cache_loeschen[]');
<?php /** * Version. * * @author jan@kristinus.de * * @package redaxo5 */ $mypage = 'version'; rex_perm::register('version[live_version]', null, rex_perm::OPTIONS); // ***** an EPs andocken rex_extension::register('ART_INIT', function (rex_extension_point $ep) { $version = rex_request('rex_version', 'int'); if ($version != 1) { return; } rex_login::startSession(); if (!rex_backend_login::hasSession()) { throw new rex_exception('no permission for the working version'); } $article = $ep->getParam('article'); $article->setSliceRevision($version); if ($article instanceof rex_article_content) { $article->getContentAsQuery(); } $article->setEval(true); }); rex_extension::register('PAGE_CONTENT_HEADER', function (rex_extension_point $ep) { $params = $ep->getParams(); $return = '';
<?php /** * This file is part of the Sprog package. * * @author (c) Thomas Blum <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Sprog\Wildcard; class_alias('\\Sprog\\Wildcard', 'Wildcard'); rex_perm::register('sprog[wildcard]', null, rex_perm::OPTIONS); if (!rex::isBackend()) { \rex_extension::register('OUTPUT_FILTER', '\\Sprog\\Extension::replaceWildcards'); } if (rex::isBackend() && rex::getUser()) { \rex_extension::register('CLANG_ADDED', '\\Sprog\\Extension::clangAdded'); \rex_extension::register('CLANG_DELETED', '\\Sprog\\Extension::clangDeleted'); rex_extension::register('PAGES_PREPARED', function () { if (rex::getUser()->isAdmin()) { if (\rex_be_controller::getCurrentPage() == 'sprog/settings') { $func = rex_request('func', 'string'); if ($func == 'update') { \rex_config::set('sprog', 'wildcard_clang_switch', rex_request('clang_switch', 'bool')); } } } if (rex::getUser()->isAdmin() || rex::getUser()->hasPerm('sprog[wildcard]')) { $page = \rex_be_controller::getPageObject('sprog/wildcard'); if (Wildcard::isClangSwitchMode()) {
<?php /** @var rex_addon $this */ rex_user::setRoleClass('rex_user_role'); rex_perm::register('users[]', rex_i18n::msg('user_management')); rex_extension::register('COMPLEX_PERM_REMOVE_ITEM', 'rex_user_role::removeOrReplaceItem'); rex_extension::register('COMPLEX_PERM_REPLACE_ITEM', 'rex_user_role::removeOrReplaceItem');
<?php /** * Page Content Addon. * * @author markus[dot]staab[at]redaxo[dot]de Markus Staab * * @package redaxo5 */ rex_perm::register('moveSlice[]', null, rex_perm::OPTIONS); rex_complex_perm::register('modules', 'rex_module_perm'); if (rex::isBackend()) { rex_extension::register('PAGE_CHECKED', function () { if (rex_be_controller::getCurrentPagePart(1) == 'content') { rex_be_controller::getPageObject('structure')->setIsActive(true); } }); if (rex_be_controller::getCurrentPagePart(1) == 'system') { rex_system_setting::register(new rex_system_setting_default_template_id()); } rex_extension::register('CLANG_DELETED', function (rex_extension_point $ep) { $del = rex_sql::factory(); $del->setQuery('delete from ' . rex::getTablePrefix() . "article_slice where clang_id='" . $ep->getParam('clang')->getId() . "'"); }); } else { rex_extension::register('FE_OUTPUT', function (rex_extension_point $ep) { $content = $ep->getSubject(); $article = new rex_article_content(); $article->setCLang(rex_clang::getCurrentId()); if ($article->setArticleId(rex_article::getCurrentId())) { $content .= $article->getArticleTemplate();
$Config = rex_config::get('slice_ui'); if (empty($_SESSION['slice_ui'])) { slice_ui::emptyClipboard(1); } rex_extension::register('PAGE_BODY_ATTR', function ($ep) { $Subject = $ep->getSubject(); if ($_SESSION['slice_ui']['slice_id'] != 0) { $Subject['class'][] = 'copy'; } return $Subject; }); if (rex::isBackend() && is_object(rex::getUser())) { rex_perm::register('copy[]'); rex_perm::register('slice_ui[]', null, rex_perm::OPTIONS); rex_perm::register('slice_ui[settings]', null, rex_perm::OPTIONS); } if (rex::isBackend()) { rex_view::addCssFile($this->getAssetsUrl('slice_ui.css')); rex_view::addCssFile($this->getAssetsUrl('jquery-ui.datepicker.css')); rex_view::addJsFile($this->getAssetsUrl('slice_ui.js')); rex_view::addJsFile($this->getAssetsUrl('jquery-ui.datepicker.js')); } if (rex_post('update_slice_status') != 1 && rex_get('function') == '') { rex_extension::register('SLICE_SHOW', 'slice_ui::extendBackendSlices'); } rex_extension::register('SLICE_SHOW', 'slice_ui::isActive'); if (strpos(rex_request('page'), 'content/emptyclipboard') !== false) { slice_ui::emptyClipboard(); } if (!empty($Config['general']['sticky_slice_nav']) && $Config['general']['sticky_slice_nav']) {
if (!$title) { $title = $key; } $kurzbeschreibung = $plugin->getProperty('kurzbeschreibung'); if (!$kurzbeschreibung) { $kurzbeschreibung = $key; } $umgebung = $plugin->getProperty('umgebung'); if (!$umgebung) { $umgebung = $key; } $status = $plugin->getConfig('status'); if (!$status) { $status = 'kein Status vergeben'; } rex_perm::register('out5[' . $key . ']'); // with perms? $Page['subpages']['main']['subpages'][$key] = ['title' => $title, 'perm' => 'out5[' . $key . ']', 'icon' => 'rex-icon ' . $icon . '']; $content .= ' <tr> <td class="rex-table-icon"><a href="index.php?page=out5/' . $key . '&func=edit"><i class="rex-icon ' . $icon . '"></i></a></td> <td data-title="Name"> <a href="index.php?page=out5/' . $key . '&func=edit">' . $title . '</a> </td> <td data-title="Kurzbeschreibung" >' . $kurzbeschreibung . '</td> <td data-title="Umgebung">' . $umgebung . '</td>'; if ($status == 'deaktiviert') { $content .= ' <td data-title="Status"><a class="rex-offline" style="white-space: nowrap;" href="index.php?page=out5/uebersicht&func=setstatus&status=aktivieren&key=' . $key . '"><i class="rex-icon rex-icon-active-false"></i>' . $status . '</a></td>'; } else {
* Site Structure Addon. * * @author markus[dot]staab[at]redaxo[dot]de Markus Staab * * @package redaxo5 * * @var rex_addon $this */ rex_perm::register('moveArticle[]', null, rex_perm::OPTIONS); rex_perm::register('moveCategory[]', null, rex_perm::OPTIONS); rex_perm::register('copyArticle[]', null, rex_perm::OPTIONS); rex_perm::register('copyContent[]', null, rex_perm::OPTIONS); rex_perm::register('publishArticle[]', null, rex_perm::OPTIONS); rex_perm::register('publishCategory[]', null, rex_perm::OPTIONS); rex_perm::register('article2startarticle[]', null, rex_perm::OPTIONS); rex_perm::register('article2category[]', null, rex_perm::OPTIONS); rex_complex_perm::register('structure', 'rex_structure_perm'); require_once __DIR__ . '/functions/function_rex_url.php'; if (rex_request('article_id', 'int') == 0) { rex::setProperty('article_id', rex::getProperty('start_article_id')); } else { $article_id = rex_request('article_id', 'int'); $article_id = rex_article::get($article_id) ? $article_id : rex::getProperty('notfound_article_id'); rex::setProperty('article_id', $article_id); } if (rex::isBackend() && rex::getUser()) { rex_view::addJsFile($this->getAssetsUrl('linkmap.js')); rex_extension::register('PAGE_SIDEBAR', function () { $category_id = rex_request('category_id', 'int'); $article_id = rex_request('article_id', 'int'); $clang = rex_request('clang', 'int');