* 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(); } else { $content .= 'Kein Startartikel selektiert / No starting Article selected. Please click here to enter <a href="' . rex_url::backendController() . '">redaxo</a>'; rex_response::sendPage($content);
$n = []; $n['label'] = '<label for="rex-id-lang">' . rex_i18n::msg('backend_language') . '</label>'; $n['field'] = $sel_lang->get(); $formElements[] = $n; $fragment = new rex_fragment(); $fragment->setVar('elements', $formElements, false); $elements .= $fragment->parse('core/form/form.php'); $formElements = []; $n = []; $n['label'] = '<label for="rex-id-debug">' . rex_i18n::msg('debug_mode') . '</label>'; $n['field'] = '<input type="checkbox" id="rex-id-debug" name="settings[debug]" value="1" ' . (rex::isDebugMode() ? 'checked="checked" ' : '') . '/>'; $formElements[] = $n; $fragment = new rex_fragment(); $fragment->setVar('elements', $formElements, false); $elements .= $fragment->parse('core/form/checkbox.php'); foreach (rex_system_setting::getAll() as $setting) { $field = $setting->getField(); if (!$field instanceof rex_form_element) { throw new rex_exception(get_class($setting) . '::getField() must return a rex_form_element!'); } $field->setAttribute('name', 'settings[' . $setting->getKey() . ']'); $elements .= $field->get(); } $content[] = $elements; $fragment = new rex_fragment(); $fragment->setVar('content', $content, false); $content = $fragment->parse('core/page/grid.php'); $formElements = []; $n = []; $n['field'] = '<button class="btn btn-save rex-form-aligned" type="submit" name="sendit"' . rex::getAccesskey(rex_i18n::msg('system_update'), 'save') . '>' . rex_i18n::msg('system_update') . '</button>'; $formElements[] = $n;
// check if a new category was folded $category_id = rex_request('toggle_category_id', 'int', -1); $category_id = rex_category::get($category_id) ? $category_id : -1; $tree = ''; $tree .= '<div id="rex-sitemap">'; // TODO remove container (just their to get some linkmap styles) $tree .= '<div id="rex-linkmap">'; $categoryTree = new rex_sitemap_category_tree($context); $tree .= $categoryTree->getTree($category_id); $tree .= '</div>'; $tree .= '</div>'; return $tree; }); if (rex_be_controller::getCurrentPagePart(1) == 'system') { rex_system_setting::register(new rex_system_setting_article_id('start_article_id')); rex_system_setting::register(new rex_system_setting_article_id('notfound_article_id')); } } rex_extension::register('CLANG_ADDED', function (rex_extension_point $ep) { $firstLang = rex_sql::factory(); $firstLang->setQuery('select * from ' . rex::getTablePrefix() . 'article where clang_id=?', [rex_clang::getStartId()]); $fields = $firstLang->getFieldnames(); $newLang = rex_sql::factory(); // $newLang->setDebug(); foreach ($firstLang as $firstLangArt) { $newLang->setTable(rex::getTablePrefix() . 'article'); foreach ($fields as $key => $value) { if ($value == 'pid') { echo ''; } elseif ($value == 'clang_id') { $newLang->setValue('clang_id', $ep->getParam('clang')->getId());