First commit
This commit is contained in:
40
cms/plugins/convert_h1split/css/stylesheet.css
Normal file
40
cms/plugins/convert_h1split/css/stylesheet.css
Normal file
@ -0,0 +1,40 @@
|
||||
|
||||
.cch1s_container {
|
||||
clear: both;
|
||||
max-width: 600px;
|
||||
background: #e0e6e9;
|
||||
color: #333;
|
||||
border: 3px solid #900;
|
||||
border-radius: 5px;
|
||||
padding: 6px 16px;
|
||||
margin: 0 0 24px 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.cch1s_todo {
|
||||
color: #900;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cch1s_done {
|
||||
background: #080;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.cch1s_container hr {
|
||||
height: 2px;
|
||||
clear: both;
|
||||
color: #567;
|
||||
background-color: #567;
|
||||
border: 0;
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.cch1s_container a:link {color: #258; text-decoration: none;}
|
||||
.cch1s_container a:visited {color: #258; text-decoration: none;}
|
||||
.cch1s_container a:hover {color: #c60; text-decoration: underline;}
|
||||
.cch1s_container a:active {color: #c60; text-decoration: underline;}
|
||||
.cch1s_container a:focus {color: #c60; text-decoration: underline;}
|
160
cms/plugins/convert_h1split/index.php
Normal file
160
cms/plugins/convert_h1split/index.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
if (!defined('CMSIMPLE_VERSION') || preg_match('#/convert_h1split/index.php#i',$_SERVER['SCRIPT_NAME']))
|
||||
{
|
||||
die('no direct access');
|
||||
}
|
||||
|
||||
if(!defined('PLUGINLOADER')) {
|
||||
die('Plugin '. basename(dirname(__FILE__)) . ' requires a newer version of the Pluginloader. No direct access.');
|
||||
}
|
||||
|
||||
|
||||
// convert content to h1only splitting
|
||||
|
||||
if ($adm && isset($_GET['convert_content_to_h1only']) && !strstr(file_get_contents('./content/content.php'),'class="_level1_page_"'))
|
||||
{
|
||||
copy($pth['file']['content'], $pth['folder']['content'] . 'SIK_content_4-to-5_' . date("Ymd_His") . '.php');
|
||||
copy($pth['file']['pagedata'], $pth['folder']['content'] . 'SIK_pagedata_4-to-5_' . date("Ymd_His") . '.php');
|
||||
|
||||
$contemp = file_get_contents('./content/content.php');
|
||||
|
||||
// create CMSimple 5 headings
|
||||
if($cf['menu']['levels'] == '6')
|
||||
{
|
||||
// clean h1-6 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
$contemp = preg_replace('/<h2.*?>/i','<h2>',$contemp);
|
||||
$contemp = preg_replace('/<h3.*?>/i','<h3>',$contemp);
|
||||
$contemp = preg_replace('/<h4.*?>/i','<h4>',$contemp);
|
||||
$contemp = preg_replace('/<h5.*?>/i','<h5>',$contemp);
|
||||
$contemp = preg_replace('/<h6.*?>/i','<h6>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
$contemp = str_ireplace('<h2>','<h1 class="_level2_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h2>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h3>','<h1 class="_level3_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h3>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h4>','<h1 class="_level4_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h4>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h5>','<h1 class="_level5_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h5>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h6>','<h1 class="_level6_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h6>','</h1>',$contemp);
|
||||
}
|
||||
|
||||
if($cf['menu']['levels'] == '5')
|
||||
{
|
||||
// clean h1-5 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
$contemp = preg_replace('/<h2.*?>/i','<h2>',$contemp);
|
||||
$contemp = preg_replace('/<h3.*?>/i','<h3>',$contemp);
|
||||
$contemp = preg_replace('/<h4.*?>/i','<h4>',$contemp);
|
||||
$contemp = preg_replace('/<h5.*?>/i','<h5>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
$contemp = str_ireplace('<h2>','<h1 class="_level2_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h2>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h3>','<h1 class="_level3_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h3>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h4>','<h1 class="_level4_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h4>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h5>','<h1 class="_level5_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h5>','</h1>',$contemp);
|
||||
}
|
||||
|
||||
if($cf['menu']['levels'] == '4')
|
||||
{
|
||||
// clean h1-4 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
$contemp = preg_replace('/<h2.*?>/i','<h2>',$contemp);
|
||||
$contemp = preg_replace('/<h3.*?>/i','<h3>',$contemp);
|
||||
$contemp = preg_replace('/<h4.*?>/i','<h4>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
$contemp = str_ireplace('<h2>','<h1 class="_level2_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h2>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h3>','<h1 class="_level3_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h3>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h4>','<h1 class="_level4_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h4>','</h1>',$contemp);
|
||||
}
|
||||
|
||||
if($cf['menu']['levels'] == '3')
|
||||
{
|
||||
// clean h1-3 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
$contemp = preg_replace('/<h2.*?>/i','<h2>',$contemp);
|
||||
$contemp = preg_replace('/<h3.*?>/i','<h3>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
$contemp = str_ireplace('<h2>','<h1 class="_level2_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h2>','</h1>',$contemp);
|
||||
$contemp = str_ireplace('<h3>','<h1 class="_level3_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h3>','</h1>',$contemp);
|
||||
}
|
||||
|
||||
if($cf['menu']['levels'] == '2')
|
||||
{
|
||||
// clean h1-2 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
$contemp = preg_replace('/<h2.*?>/i','<h2>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
$contemp = str_ireplace('<h2>','<h1 class="_level2_page_">',$contemp);
|
||||
$contemp = str_ireplace('</h2>','</h1>',$contemp);
|
||||
}
|
||||
|
||||
if($cf['menu']['levels'] == '1')
|
||||
{
|
||||
// clean h1 tags
|
||||
$contemp = preg_replace('/<h1.*?>/i','<h1>',$contemp);
|
||||
|
||||
$contemp = str_ireplace('<h1>','<h1 class="_level1_page_">',$contemp);
|
||||
}
|
||||
|
||||
$content4 = $contemp;
|
||||
|
||||
|
||||
// write content.php
|
||||
$h1only_convertContentHandle = './content/content.php';
|
||||
|
||||
$content4handle = fopen($h1only_convertContentHandle, "w+");
|
||||
fwrite($content4handle,$content4);
|
||||
fclose($content4handle);
|
||||
|
||||
header('Location: ./?converted_content_to_h1only');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// plugin output
|
||||
|
||||
if($adm && $cf['use']['h1only_pagesplitting'] == 'true' && !strstr(file_get_contents('./content/content.php'),'class="_level1_page_"'))
|
||||
{
|
||||
$o.= '<div class="cch1s_container">';
|
||||
|
||||
$o.= '
|
||||
<h1>' . $plugin_tx['convert_content']['headline_plugin'] . '</h1>
|
||||
<p>' . $plugin_tx['convert_content']['text_config_changed'] . '</p>
|
||||
<div style="background: #fff; border: 2px solid; padding: 0 12px;">
|
||||
<p>' . $plugin_tx['convert_content']['text_config_changed_back1'] . '</p>
|
||||
<p>' . $plugin_tx['convert_content']['text_config_changed_back2'] . '</p>
|
||||
<!-- <p style="text-align: right;"><a href="./?file=config&action=array"><b>Zur CMS Konfiguration »</b></a></p> -->
|
||||
</div>
|
||||
';
|
||||
|
||||
$o.= '<p>' . $plugin_tx['convert_content']['text_plugin_description'] . '</p>
|
||||
<p class="cmsimplecore_warning" style="text-align: center; padding: 12px;"><b>' . $plugin_tx['convert_content']['text_usage_hint'] . '<br>
|
||||
' . $plugin_tx['convert_content']['text_backup_hint'] . '</b></p>
|
||||
';
|
||||
$o.= '<p style="text-align: right;"><br><a href="./?convert_content_to_h1only"><b>' . $plugin_tx['convert_content']['text_convert_content'] . ' h1only_pagesplitting »</b></a></p>';
|
||||
$o.= '</div>';
|
||||
}
|
||||
|
||||
if(isset($_GET['converted_content_to_h1only']))
|
||||
{
|
||||
$o.= '<p class="cch1s_done">' . $plugin_tx['convert_content']['text_conversion_complete'] . '</p>';
|
||||
}
|
||||
|
||||
?>
|
16
cms/plugins/convert_h1split/languages/de.php
Normal file
16
cms/plugins/convert_h1split/languages/de.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php // utf-8 Marker: äöü
|
||||
|
||||
$plugin_tx['convert_content']['headline_plugin']="Plugin convert_h1split";
|
||||
$plugin_tx['convert_content']['text_backup_hint']="Machen Sie ein Backup der gesamten Installation, bevor Sie irgendetwas tun!";
|
||||
$plugin_tx['convert_content']['text_config_changed']="Sie haben die CMS Konfiguration auf h1only_pagesplitting umgestellt.";
|
||||
$plugin_tx['convert_content']['text_config_changed_back1']="Sie können zur alten Splitting Methode zurückkehren, indem Sie in der CMS Konfiguration das folgende Feld leer lassen:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back2']="Einstellungen => CMS => Use => H1only_pagesplitting:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back3']="Zur CMS Konfiguration »";
|
||||
$plugin_tx['convert_content']['text_conversion_complete']="Die Konvertierung zu h1only_pagesplitting ist komplett.";
|
||||
$plugin_tx['convert_content']['text_convert_content']="Konvertiere die Inhaltsdatei (content.php) zu ";
|
||||
$plugin_tx['convert_content']['text_h1only_pagesplitting']="h1only_pagesplitting";
|
||||
$plugin_tx['convert_content']['text_plugin_description']="Jetzt müssen Sie noch Ihre Inhaltsdatei (content.php) auf die neue Seitensplitting-Methode h1only_pagesplitting umstellen. Dabei werden alle evtl. vorhandenen Styles, Klassen und IDs der Hauptüberschriften der CMSimple Seiten entfernt.";
|
||||
$plugin_tx['convert_content']['text_usage_hint']="Verwenden Sie diese Funktionen nicht auf öffentlichen Internetseiten!";
|
||||
$plugin_tx['convert_content']['utf8_marker']="äöü";
|
||||
|
||||
?>
|
16
cms/plugins/convert_h1split/languages/default.php
Normal file
16
cms/plugins/convert_h1split/languages/default.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php // utf-8 Marker: äöü
|
||||
|
||||
$plugin_tx['convert_content']['headline_plugin']="Plugin convert_h1split";
|
||||
$plugin_tx['convert_content']['text_backup_hint']="Make a backup of the whole installation, before you do anything!";
|
||||
$plugin_tx['convert_content']['text_config_changed']="You have changed the CMS configuration to h1only_pagesplitting.";
|
||||
$plugin_tx['convert_content']['text_config_changed_back1']="You can go back to the old splitting method by leaving the following field blank in the CMS configuration:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back2']="Settings => CMS => Use => H1only_pagesplitting:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back3']="To the CMS configuration »";
|
||||
$plugin_tx['convert_content']['text_conversion_complete']="Converting to h1only_pagesplitting is complete.";
|
||||
$plugin_tx['convert_content']['text_convert_content']="Convert content file (content.php) to ";
|
||||
$plugin_tx['convert_content']['text_h1only_pagesplitting']="h1only_pagesplitting";
|
||||
$plugin_tx['convert_content']['text_plugin_description']="Now you have to convert your content file (content.php) to the new page-splitting method h1only_pagesplitting. All eventual existing styles, classes and IDs of the main headings of the CMSimple pages will be removed.";
|
||||
$plugin_tx['convert_content']['text_usage_hint']="Do not use this functions on public websites!";
|
||||
$plugin_tx['convert_content']['utf8_marker']="äöü";
|
||||
|
||||
?>
|
16
cms/plugins/convert_h1split/languages/en.php
Normal file
16
cms/plugins/convert_h1split/languages/en.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php // utf-8 Marker: äöü
|
||||
|
||||
$plugin_tx['convert_content']['headline_plugin']="Plugin convert_h1split";
|
||||
$plugin_tx['convert_content']['text_backup_hint']="Make a backup of the whole installation, before you do anything!";
|
||||
$plugin_tx['convert_content']['text_config_changed']="You have changed the CMS configuration to h1only_pagesplitting.";
|
||||
$plugin_tx['convert_content']['text_config_changed_back1']="You can go back to the old splitting method by leaving the following field blank in the CMS configuration:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back2']="Settings => CMS => Use => H1only_pagesplitting:";
|
||||
$plugin_tx['convert_content']['text_config_changed_back3']="To the CMS configuration »";
|
||||
$plugin_tx['convert_content']['text_conversion_complete']="Converting to h1only_pagesplitting is complete.";
|
||||
$plugin_tx['convert_content']['text_convert_content']="Convert content file (content.php) to ";
|
||||
$plugin_tx['convert_content']['text_h1only_pagesplitting']="h1only_pagesplitting";
|
||||
$plugin_tx['convert_content']['text_plugin_description']="Now you have to convert your content file (content.php) to the new page-splitting method h1only_pagesplitting. All eventual existing styles, classes and IDs of the main headings of the CMSimple pages will be removed.";
|
||||
$plugin_tx['convert_content']['text_usage_hint']="Do not use this functions on public websites!";
|
||||
$plugin_tx['convert_content']['utf8_marker']="äöü";
|
||||
|
||||
?>
|
Reference in New Issue
Block a user