Skip to content

Commit

Permalink
Close cmsimple-xh#182: Separate page names from the content
Browse files Browse the repository at this point in the history
We change $cf[headings][show] to false, and hard-code this in the code,
so that we can remove this config option. This makes $cf[headings]
[format] unused, so we remove it as well. We also can get rid of the
page data fields 'heading' and 'show_heading', as the heading of the
page is independent of the page name now.
  • Loading branch information
cmb69 committed Mar 29, 2017
1 parent 120d32f commit 20c496b
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 125 deletions.
13 changes: 2 additions & 11 deletions 2lang/content/content.htm
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<html><head><title>Content-Datei</title>
<?php
$page_data_fields=array('url','last_edit','description','keywords','title','robots','heading','show_heading','template','published','show_last_edit','linked_to_menu','header_location','use_header_location','publication_date','expires');
$page_data_fields=array('url','last_edit','description','keywords','title','robots','template','published','show_last_edit','linked_to_menu','header_location','use_header_location','publication_date','expires');
$temp_data=array(
'url'=>'Startseite',
'last_edit'=>'1251465256',
'description'=>'',
'keywords'=>'',
'title'=>'',
'robots'=>'',
'heading'=>'',
'show_heading'=>'',
'template'=>'',
'published'=>'',
'show_last_edit'=>'',
Expand All @@ -26,8 +24,6 @@
'keywords'=>'',
'title'=>'',
'robots'=>'',
'heading'=>'',
'show_heading'=>'',
'template'=>'',
'published'=>'',
'show_last_edit'=>'',
Expand All @@ -38,6 +34,7 @@
'expires'=>''
);
?>
<h1>Welcome to CMSimple_XH</h1>
<p>Congratulations on your new <strong>Language</strong> installation of CMSimple_XH.</p>
<p>You can login with the <strong>password of your main site</strong>. You will find the login link at the bottom of the page in the footer.</p>
<p>Please read about file permissions and security issues in the <a href="http://www.cmsimple-xh.org/wiki/doku.php/installation">CMSimple_XH Wiki »</a></p>
Expand All @@ -64,8 +61,6 @@ <h4>The CMSimple_XH links</h4>
'keywords'=>'',
'title'=>'',
'robots'=>'',
'heading'=>'',
'show_heading'=>'0',
'template'=>'0',
'published'=>'1',
'show_last_edit'=>'0',
Expand Down Expand Up @@ -93,8 +88,6 @@ <h4>Newsbox News01</h4>
'keywords'=>'',
'title'=>'',
'robots'=>'',
'heading'=>'',
'show_heading'=>'0',
'template'=>'0',
'published'=>'1',
'show_last_edit'=>'0',
Expand Down Expand Up @@ -122,8 +115,6 @@ <h4>Newsbox News02</h4>
'keywords'=>'',
'title'=>'',
'robots'=>'',
'heading'=>'',
'show_heading'=>'0',
'template'=>'0',
'published'=>'1',
'show_last_edit'=>'0',
Expand Down
4 changes: 0 additions & 4 deletions cmsimple/classes/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ protected function prepareContent($content, $pageIndex)
global $cf, $s, $h;

$s = $pageIndex;
// we have to add the page heading, if visible in content
if ($cf['headings']['show']) {
$content = $h[$s] . $content;
}
$content = strip_tags(evaluate_plugincall($content));
$s = -1;
if (method_exists('\Normalizer', 'normalize')) {
Expand Down
1 change: 0 additions & 1 deletion cmsimple/metaconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
$mcf['uri']['length']="hidden";
$mcf['editmenu']['scroll']="bool";
$mcf['editmenu']['external']="xfunction:XH_registeredEditmenuPlugins";
$mcf['headings']['show']="bool";
$mcf['mode']['advanced']="bool";

?>
8 changes: 0 additions & 8 deletions cmsimple/tplfuncs.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,6 @@ function content()
global $h, $s, $o, $c, $edit, $cf;
$heading = '';

if ($cf['headings']['show'] && $s > -1) {
if (preg_match('/<!--XH_ml[1-9]:(.+)-->/isU', $c[$s], $matches)) {
$heading = sprintf($cf['headings']['format'], $matches[1]);
}
}
if (!($edit && XH_ADM) && $s > -1) {
if (isset($_GET['search'])) {
$search = XH_hsc(stsl($_GET['search']));
Expand All @@ -479,9 +474,6 @@ function content()
$o .= $heading . preg_replace('/#CMSimple (.*?)#/is', '', $c[$s]);
return preg_replace('/<!--XH_ml[1-9]:.*?-->/isu', '', $o);
} else {
if ($s > -1 && ($cf['headings']['show'] || ($edit && XH_ADM))) {
$o = sprintf($cf['headings']['format'], $h[$s]) . $o;
}

This comment has been minimized.

Copy link
@cmb69

cmb69 Mar 29, 2017

Author Owner

We have to consider whether to bring this back; it shows the page name/title above the editor tabs.

return preg_replace('/<!--XH_ml[1-9]:.*?-->/isu', '', $o);
}
}
Expand Down

0 comments on commit 20c496b

Please sign in to comment.