# HG changeset patch # User Dan # Date 1252677462 14400 # Node ID 679916c805994414fd118af7b5a50aef067885e1 # Parent 8fae8fb3cbb1ca45d89dc8d8b4b8890006ead74e# Parent 1a3f374310ca3209426598284a120512d2689827 Scribus <--> Charlie merge diff -r 8fae8fb3cbb1 -r 679916c80599 ajax.php --- a/ajax.php Sun Aug 30 00:05:33 2009 -0400 +++ b/ajax.php Fri Sep 11 09:57:42 2009 -0400 @@ -60,7 +60,7 @@ $src = ''; } - $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$paths->page_protected ) ); + $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$page->ns->page_protected ) ); $auth_wysiwyg = ( $session->get_permissions('edit_wysiwyg') ); $return = array( @@ -75,7 +75,7 @@ 'have_draft' => false ); - $return['page_format'] = $paths->cpage['page_format']; + $return['page_format'] = $page->ns->cdata['page_format']; if ( $return['page_format'] == 'xhtml' ) { // gently process headings to make tinymce format them correctly @@ -491,7 +491,7 @@ switch($_GET['to']) { case 'xhtml': - $result = RenderMan::render($_POST['text'], RENDER_WIKI_DEFAULT | RENDER_BLOCKONLY); + $result = RenderMan::render($_POST['text'], RENDER_BLOCK | RENDER_NOSMILIES, false); break; case 'wikitext': $result = RenderMan::reverse_render($_POST['text']); diff -r 8fae8fb3cbb1 -r 679916c80599 includes/clientside/static/editor.js --- a/includes/clientside/static/editor.js Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/clientside/static/editor.js Fri Sep 11 09:57:42 2009 -0400 @@ -441,7 +441,8 @@ form.appendChild(preview_anchor); form.appendChild(preview_container); form.appendChild(ta_wrapper); - form.appendChild(tblholder); + if ( !readonly ) + form.appendChild(tblholder); form.innerHTML += '
' + toolbar + '
'; edcon.appendChild(form); diff -r 8fae8fb3cbb1 -r 679916c80599 includes/common.php --- a/includes/common.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/common.php Fri Sep 11 09:57:42 2009 -0400 @@ -389,8 +389,8 @@ // For special and administration pages, sometimes there is a "preloader" function that must be run // before the session manager and/or path manager get the init signal. Call it here. - $title = get_title(true); - list($page_id, $namespace) = RenderMan::strToPageID($title); + $urlname = get_title(true); + list($page_id, $namespace) = RenderMan::strToPageID($urlname); list($page_id_top) = explode('/', $page_id); $fname = "page_{$namespace}_{$page_id_top}_preloader"; if( ( $namespace == 'Admin' || $namespace == 'Special' ) && function_exists($fname)) @@ -426,7 +426,7 @@ profiler_log('Ran session_started hook'); - $paths->init($title); + $paths->init($urlname); // setup output format if ( defined('ENANO_OUTPUT_FORMAT') ) diff -r 8fae8fb3cbb1 -r 679916c80599 includes/functions.php --- a/includes/functions.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/functions.php Fri Sep 11 09:57:42 2009 -0400 @@ -3157,11 +3157,18 @@ { global $do_gzip; + $gzip_supported = false; + if ( isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) + { + $encodings = explode(',', $_SERVER['HTTP_ACCEPT_ENCODING']); + $gzip_supported = in_array('gzip', $encodings) || in_array('deflate', $encodings); + } + // // Compress buffered output if required and send to browser // Sorry, doesn't work in IE. What else is new? // - if ( $do_gzip && function_exists('gzdeflate') && !strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && !headers_sent() ) + if ( $do_gzip && function_exists('gzdeflate') && !strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') && !headers_sent() && $gzip_supported ) { $gzip_contents = ob_get_contents(); ob_end_clean(); diff -r 8fae8fb3cbb1 -r 679916c80599 includes/namespaces/default.php --- a/includes/namespaces/default.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/namespaces/default.php Fri Sep 11 09:57:42 2009 -0400 @@ -435,7 +435,7 @@ // Page format is XHTML. This means we want to disable functionality that MCE takes care of, while still retaining // the ability to wikilink, the ability to use images, etc. Basically, RENDER_INLINEONLY disables all behavior in // the rendering engine/Text_Wiki that conflicts with MCE. - $text = '?>' . RenderMan::render($text, RENDER_WIKI_DEFAULT | RENDER_INLINEONLY); + $text = '?>' . RenderMan::render($text, RENDER_INLINE); } } else @@ -533,11 +533,13 @@ } } - public function error_404($userpage = false) + public function error_404() { global $db, $session, $paths, $template, $plugins; // Common objects global $lang, $output; + $userpage = $this->namespace == 'User'; + @header('HTTP/1.1 404 Not Found'); $msg = ( $pp = $paths->sysmsg('Page_not_found') ) ? $pp : '{STANDARD404}'; diff -r 8fae8fb3cbb1 -r 679916c80599 includes/namespaces/user.php --- a/includes/namespaces/user.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/namespaces/user.php Fri Sep 11 09:57:42 2009 -0400 @@ -439,7 +439,7 @@ } else { - $this->error_404(true); + $this->error_404(); } echo ''; // tab:content diff -r 8fae8fb3cbb1 -r 679916c80599 includes/render.php --- a/includes/render.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/render.php Fri Sep 11 09:57:42 2009 -0400 @@ -164,7 +164,7 @@ if ( !$smilies ) $flags |= RENDER_NOSMILIES; - if ( $flags & ~RENDER_NOSMILIES ) + if ( !($flags & RENDER_NOSMILIES) ) { $text = RenderMan::smilieyize($text); } @@ -217,6 +217,50 @@ { // FIXME: Where is noinclude/nodisplay being processed in the pipeline? (Seems to be processed, but not here) } + + // + // Set rules for the rendering process + // + + if ( $flags & RENDER_BLOCK && !($flags & RENDER_INLINE) ) + { + // block only + $carpenter->disable_all_rules(); + foreach ( array('blockquote', 'tables', 'heading', 'hr', 'multilist', 'bold', 'italic', 'underline', 'paragraph', 'blockquotepost') as $rule ) + { + $carpenter->enable_rule($rule); + } + + $code = $plugins->setHook('render_block_only'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + } + else if ( $flags & RENDER_INLINE && !($flags & RENDER_BLOCK) ) + { + // inline only + $carpenter->disable_all_rules(); + foreach ( array('bold', 'italic', 'underline', 'externalwithtext', 'externalnotext', 'image', 'internallink') as $rule ) + { + $carpenter->enable_rule($rule); + } + + $code = $plugins->setHook('render_inline_only'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + } + else + { + // full render + $code = $plugins->setHook('render_full'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + } $text = $carpenter->render($text); // For plugin compat diff -r 8fae8fb3cbb1 -r 679916c80599 includes/wikiengine/parse_mediawiki.php --- a/includes/wikiengine/parse_mediawiki.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/wikiengine/parse_mediawiki.php Fri Sep 11 09:57:42 2009 -0400 @@ -18,7 +18,8 @@ 'italic' => "/''(.+?)''/", 'underline' => '/__(.+?)__/', 'externalwithtext' => '#\[((?:https?|irc|ftp)://.+?) (.+?)\]#', - 'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#' + 'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#', + 'hr' => '/^[-]{4,} *$/m' ); private $blockquote_rand_id; diff -r 8fae8fb3cbb1 -r 679916c80599 includes/wikiengine/render_xhtml.php --- a/includes/wikiengine/render_xhtml.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/wikiengine/render_xhtml.php Fri Sep 11 09:57:42 2009 -0400 @@ -20,7 +20,8 @@ 'italic' => '\\1', 'underline' => '\\1', 'externalwithtext' => '\\2', - 'externalnotext' => '\\1' + 'externalnotext' => '\\1', + 'hr' => '
' ); public function heading($text, $pieces) diff -r 8fae8fb3cbb1 -r 679916c80599 includes/wikiformat.php --- a/includes/wikiformat.php Sun Aug 30 00:05:33 2009 -0400 +++ b/includes/wikiformat.php Fri Sep 11 09:57:42 2009 -0400 @@ -62,6 +62,7 @@ 'blockquote', 'tables', 'heading', + 'hr', // note: can't be named list ("list" is a PHP language construct) 'multilist', 'bold', @@ -315,6 +316,29 @@ } /** + * Disables all rules. + * @return null + */ + + public function disable_all_rules() + { + $this->rules = array(); + return null; + } + + /** + * Enables a rule + * @param string rule + * @return null + */ + + public function enable_rule($rule) + { + $this->rules[] = $rule; + return null; + } + + /** * Make a rule exclusive (the only one called) * @param string stage * @return null diff -r 8fae8fb3cbb1 -r 679916c80599 language/english/install/default-tutorial/Creating_and_editing_pages.txt --- a/language/english/install/default-tutorial/Creating_and_editing_pages.txt Sun Aug 30 00:05:33 2009 -0400 +++ b/language/english/install/default-tutorial/Creating_and_editing_pages.txt Fri Sep 11 09:57:42 2009 -0400 @@ -26,14 +26,18 @@ ''Your text here'' -Create a link: +Create an ''internal link'' to a page on your site: [[Page title]] -Create a link, but using your own text: +Create an internal link, but using your own text: [[Page title|Your text here]] +Link to an external site: + +[http://www.example.com/ Your text here] + Create a large heading: == Your text here == @@ -46,14 +50,14 @@ ==== Your text here ==== -Link to an external site: - -[http://www.example.com/ Your text here] - == Visual editing == If you prefer to design your documents in a more graphical way, click the Convert to HTML button in the editor. Enano includes [http://tinymce.moxiecode.com/ TinyMCE], a widely-used graphical editor for the web. +== Advanced wikitext == + +See [http://docs.enanocms.org/Help:Appendix_A Appendix A] in the Enano documentation for some more advanced wikitext formatting tips. + == Moving up from Enano 1.0? == Good news: You don't have to learn anything new to use Enano 1.2's formatting syntax or editor. We've improved the interface of the editor a lot though. Enano 1.2 also has new features like auto-saving and the ability to detect when someone else saves the page while you're working on it. Another new feature is a guard against automatically closing out the editor, so it's much harder to lose a page you're working on. diff -r 8fae8fb3cbb1 -r 679916c80599 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Sun Aug 30 00:05:33 2009 -0400 +++ b/plugins/SpecialUserFuncs.php Fri Sep 11 09:57:42 2009 -0400 @@ -425,7 +425,7 @@ global $lang; require_once( ENANO_ROOT . '/includes/math.php' ); - $paths->fullpage = $GLOBALS['title']; + $paths->fullpage = $GLOBALS['urlname']; if ( $paths->getParam(0) === 'action.json' ) { if ( !isset($_POST['r']) ) diff -r 8fae8fb3cbb1 -r 679916c80599 themes/enanium/css/babygrand.css --- a/themes/enanium/css/babygrand.css Sun Aug 30 00:05:33 2009 -0400 +++ b/themes/enanium/css/babygrand.css Fri Sep 11 09:57:42 2009 -0400 @@ -23,6 +23,11 @@ font-size: 9pt; } +body#tinymce { + background-image: none; + background-color: #f0f0f0; +} + table#body-wrapper { width: 100%; }