From cbd44f0ddd977d9c0b0a4b0cb64b7b590f93a5bd Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sat, 11 Aug 2012 05:00:50 +0000 Subject: [PATCH] Custom Pages "new page" fix. --- e107_admin/cpage.php | 32 ++++++++++++++++++-------------- e107_plugins/tinymce/e_meta.php | 12 +++++++++++- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index a8b9b383b..112f40a4d 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -292,10 +292,11 @@ class page_admin_ui extends e_admin_ui { $count = varset($_GET['count']); $frm = e107::getForm(); - $text .= "
\n"; + $text = "
\n"; $text .= "
Title: ".$frm->text('page_subtitle[]', '', 250)."
\n"; - $text .= $frm->bbarea('data_'.intval($count), '', 'page','help','large'); + $text .= $frm->bbarea('data_'.(intval($count)), '', 'page','page','large'); $text .= "
"; + // $text .= 'name='.$nm."
page=".$page."
help_mode=". $help_mod."
htlp_tagid=".$help_tagid."
size=".$size; echo $text; exit; // return $text; @@ -592,35 +593,37 @@ class page_admin_ui extends e_admin_ui } $pages = preg_split("/\[newpage(.*?)\]/si", $textareaValue, -1, PREG_SPLIT_NO_EMPTY); - - - $c= 0; + + $c= 1; $titles[0] = ""; + $text .= ""; - $c= 0; - foreach($pages as $page) + $c= 1; + foreach($pages as $curval) { - $titles[] = isset($pt[1][$c]) ? $pt[1][$c] : ""; + $titles[] = isset($pt[1][($c-1)]) ? $pt[1][($c-1)] : ""; $id = "page_".$c; $nm = $name."_".$c; $text .= "
\n"; - $text .= "
Title: ".$frm->text('page_subtitle[]', $titles[($c+1)], 250)."
\n"; - $text .= $frm->bbarea($nm, $page, $help_mod,$help_tagid,$size,$counter); + $text .= "
Title: ".$frm->text('page_subtitle['.$c.']', $titles[($c)], 250)."
\n"; + $text .= $frm->bbarea($nm, $curval, $help_mod,$help_tagid,$size,$counter); $text .= "
"; + // $text .= 'name='.$nm."
page=".$page."
help_mode=". $help_mod."
htlp_tagid=".$help_tagid."
size=".$size; $c++; } - $text .= ""; - + $text .= ""; + + $text .= ""; return $text; } @@ -712,7 +715,7 @@ class page_admin_ui extends e_admin_ui $page_title = $tp->toDB($_POST['page_title']); - // print_a($_POST); + // print_a($_POST); // if(is_array($_POST['data']) && is_array($_POST['subtitle'])) @@ -731,6 +734,7 @@ class page_admin_ui extends e_admin_ui } // echo nl2br($newData); + // return; $page_text = $tp->toDB($newData); $pauthor = ($_POST['page_display_authordate_flag'] ? USERID : 0); // Ideally, this check should be done in the front-end. diff --git a/e107_plugins/tinymce/e_meta.php b/e107_plugins/tinymce/e_meta.php index e73e35663..a2ddb41dd 100644 --- a/e107_plugins/tinymce/e_meta.php +++ b/e107_plugins/tinymce/e_meta.php @@ -19,7 +19,7 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") ) if(e_PAGE != 'image.php') { e107::js('tinymce','tiny_mce.js','jquery'); - e107::js('tinymce','wysiwyg.php','jquery'); + e107::js('tinymce','wysiwyg.php','jquery',5); } else { @@ -39,6 +39,13 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") ) $('#bbcode-panel-'+id+'--preview').hide(); }); + + $('.e-wysiwyg').live('click',function(){ + var id = $(this).attr('id'); // eg. news-body + $('#bbcode-panel-'+id+'--preview').hide(); + $('#'+id).after('
Switch to BBCODE
'); + tinyMCE.execCommand('mceAddControl', false, id); + }); $('a.e-wysiwyg-toggle').toggle(function(){ @@ -60,6 +67,9 @@ if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php") ) tinyMCE.execCommand('mceInsertRawHTML',false,html); tinyMCEPopup.close(); }); + + +