-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from alexplusde/pages
Umbau auf neue Pages-Struktur
- Loading branch information
Showing
7 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
echo rex_view::title(rex_addon::get('neues')->getProperty('page')['title']); | ||
|
||
$currentPage = rex_be_controller::getCurrentPageObject(); | ||
$wrapper = ''; | ||
if ($table_name = 'rex_neues_author') { | ||
if (!rex_request('table_name', 'string', '')) { | ||
$_REQUEST['table_name'] = $table_name; | ||
} | ||
|
||
if (true !== $currentPage->getItemAttr('show_title', false)) { | ||
rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { | ||
if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { | ||
return; | ||
} | ||
return ''; | ||
}, rex_extension::EARLY, ['table_name' => $table_name]); | ||
} | ||
|
||
if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { | ||
echo "<div class=\"$wrapper\">"; | ||
} | ||
} | ||
|
||
include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); | ||
|
||
if ($wrapper) { | ||
echo '</div>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
echo rex_view::title(rex_addon::get('neues')->getProperty('page')['title']); | ||
|
||
$currentPage = rex_be_controller::getCurrentPageObject(); | ||
$wrapper = ''; | ||
if ($table_name = 'rex_neues_category') { | ||
if (!rex_request('table_name', 'string', '')) { | ||
$_REQUEST['table_name'] = $table_name; | ||
} | ||
|
||
if (true !== $currentPage->getItemAttr('show_title', false)) { | ||
rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { | ||
if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { | ||
return; | ||
} | ||
return ''; | ||
}, rex_extension::EARLY, ['table_name' => $table_name]); | ||
} | ||
|
||
if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { | ||
echo "<div class=\"$wrapper\">"; | ||
} | ||
} | ||
|
||
include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); | ||
|
||
if ($wrapper) { | ||
echo '</div>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/** | ||
* @var rex_addon $this | ||
* @psalm-scope-this rex_addon | ||
*/ | ||
|
||
$mdFiles = []; | ||
foreach (glob(rex_addon::get('neues')->getPath('docs').'/*.md') ?: [] as $file) { | ||
$mdFiles[mb_substr(basename($file), 0, -3)] = $file; | ||
} | ||
|
||
$currenMDFile = rex_request('mdfile', 'string', '01_a_intro'); | ||
if (!array_key_exists($currenMDFile, $mdFiles)) { | ||
$currenMDFile = '01_a_intro'; | ||
} | ||
|
||
$page = rex_be_controller::getPageObject('neues/docs'); | ||
|
||
if (null !== $page) { | ||
foreach ($mdFiles as $key => $mdFile) { | ||
$keyWithoudPrio = mb_substr($key, 3); | ||
$currenMDFileWithoudPrio = mb_substr($currenMDFile, 3); | ||
$page->addSubpage( | ||
(new rex_be_page($key, rex_i18n::msg('neues_docs_'.$keyWithoudPrio))) | ||
->setSubPath($mdFile) | ||
->setHref('index.php?page=neues/docs&mdfile='.$key) | ||
->setIsActive($key == $currenMDFile) | ||
); | ||
} | ||
} | ||
|
||
echo rex_view::title($this->i18n('neues_title')); | ||
|
||
[$Toc, $Content] = rex_markdown::factory()->parseWithToc(rex_file::require($mdFiles[$currenMDFile]), 2, 3, [ | ||
rex_markdown::SOFT_LINE_BREAKS => false, | ||
rex_markdown::HIGHLIGHT_PHP => true, | ||
]); | ||
|
||
$fragment = new rex_fragment(); | ||
$fragment->setVar('content', $Content, false); | ||
$fragment->setVar('toc', $Toc, false); | ||
$content = $fragment->parse('core/page/docs.php'); | ||
|
||
$fragment = new rex_fragment(); | ||
$fragment->setVar('title', rex_i18n::msg('package_help') . ' ', false); | ||
$fragment->setVar('body', $content, false); | ||
echo $fragment->parse('core/page/section.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
echo rex_view::title(rex_addon::get('neues')->getProperty('page')['title']); | ||
|
||
$currentPage = rex_be_controller::getCurrentPageObject(); | ||
$wrapper = ''; | ||
if ($table_name = 'rex_neues_entry') { | ||
if (!rex_request('table_name', 'string', '')) { | ||
$_REQUEST['table_name'] = $table_name; | ||
} | ||
|
||
if (true !== $currentPage->getItemAttr('show_title', false)) { | ||
rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { | ||
if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { | ||
return; | ||
} | ||
return ''; | ||
}, rex_extension::EARLY, ['table_name' => $table_name]); | ||
} | ||
|
||
if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { | ||
echo "<div class=\"$wrapper\">"; | ||
} | ||
} | ||
|
||
include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); | ||
|
||
if ($wrapper) { | ||
echo '</div>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
echo rex_view::title(rex_addon::get('neues')->getProperty('page')['title']); | ||
|
||
$currentPage = rex_be_controller::getCurrentPageObject(); | ||
$wrapper = ''; | ||
if ($table_name = 'rex_neues_entry_Lang') { | ||
if (!rex_request('table_name', 'string', '')) { | ||
$_REQUEST['table_name'] = $table_name; | ||
} | ||
|
||
if (true !== $currentPage->getItemAttr('show_title', false)) { | ||
rex_extension::register('YFORM_MANAGER_DATA_PAGE_HEADER', static function ($ep) { | ||
if ($ep->getParam('yform')->table->getTableName() !== $ep->getParam('table_name')) { | ||
return; | ||
} | ||
return ''; | ||
}, rex_extension::EARLY, ['table_name' => $table_name]); | ||
} | ||
|
||
if ($wrapper = $currentPage->getItemAttr('wrapper_class', '')) { | ||
echo "<div class=\"$wrapper\">"; | ||
} | ||
} | ||
|
||
include rex_path::plugin('yform', 'manager', 'pages/data_edit.php'); | ||
|
||
if ($wrapper) { | ||
echo '</div>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<?php | ||
|
||
echo rex_view::title(rex_addon::get('neues')->getProperty('page')['title']); | ||
rex_be_controller::includeCurrentPageSubPath(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters