Scribus <--> Charlie merge
authorDan
Fri, 11 Sep 2009 09:57:42 -0400
changeset 1112 679916c80599
parent 1111 8fae8fb3cbb1 (current diff)
parent 1110 1a3f374310ca (diff)
child 1113 000791abdc7e
Scribus <--> Charlie merge
--- 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']);
--- 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 += '<div style="margin: 10px 0 0 0;">' + toolbar + '</div>';
   edcon.appendChild(form);
   
--- 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') )
--- 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();
--- 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}';
--- 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 '</div>'; // tab:content
--- 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
--- 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;
--- 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' => '<em>\\1</em>',
     'underline' => '<span style="text-decoration: underline;">\\1</span>',
     'externalwithtext' => '<a href="\\1" onclick="window.open(this.href); return false;">\\2</a>',
-    'externalnotext' => '<a href="\\1" onclick="window.open(this.href); return false;">\\1</a>'
+    'externalnotext' => '<a href="\\1" onclick="window.open(this.href); return false;">\\1</a>',
+    'hr' => '<hr />'
   );
   
   public function heading($text, $pieces)
--- 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
--- 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 @@
 
 <code><nowiki>''Your text here''</nowiki></code>
 
-Create a link:
+Create an ''internal link'' to a page on your site:
 
 <code><nowiki>[[Page title]]</nowiki></code>
 
-Create a link, but using your own text:
+Create an internal link, but using your own text:
 
 <code><nowiki>[[Page title|Your text here]]</nowiki></code>
 
+Link to an external site:
+
+<code><nowiki>[http://www.example.com/ Your text here]</nowiki></code>
+
 Create a large heading:
 
 <code><nowiki>== Your text here ==</nowiki></code>
@@ -46,14 +50,14 @@
 
 <code><nowiki>==== Your text here ====</nowiki></code>
 
-Link to an external site:
-
-<code><nowiki>[http://www.example.com/ Your text here]</nowiki></code>
-
 == Visual editing ==
 
 If you prefer to design your documents in a more graphical way, click the <a href="#" onclick="return false;" class="abutton abutton_blue image"><img width="16" height="16" src="images/spacer.gif" style="background-image: url(images/editor/sprite.png); background-repeat: no-repeat; background-position: -112px 0px;" /> Convert to HTML</a> 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.
--- 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']) )
--- 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%;
 }