# HG changeset patch
# User Dan
# Date 1201641591 18000
# Node ID 92664d2efab881e129d83652d89863396bf2dbd1
# Parent 2ccb55995aefd54335054e3dddded8951bd33359
Rebranded source code as 1.1.1; added TinyMCE ACL rule as per Vadi's request: http://forum.enanocms.org/viewtopic.php?f=7&t=54
diff -r 2ccb55995aef -r 92664d2efab8 ajax.php
--- a/ajax.php Sun Jan 27 23:45:53 2008 -0500
+++ b/ajax.php Tue Jan 29 16:19:51 2008 -0500
@@ -116,6 +116,7 @@
}
$auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$paths->page_protected ) );
+ $auth_wysiwyg = ( $session->get_permissions('edit_wysiwyg') );
$return = array(
'mode' => 'editor',
@@ -124,6 +125,7 @@
'auth_edit' => $auth_edit,
'time' => time(),
'require_captcha' => false,
+ 'allow_wysiwyg' => $auth_wysiwyg
);
if ( $auth_edit && !$session->user_logged_in && getConfig('guest_edit_require_captcha') == '1' )
diff -r 2ccb55995aef -r 92664d2efab8 cron.php
--- a/cron.php Sun Jan 27 23:45:53 2008 -0500
+++ b/cron.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/captcha.php
--- a/includes/captcha.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/captcha.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* captcha.php - visual confirmation system used during registration
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/clientside/jsres.php
--- a/includes/clientside/jsres.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/clientside/jsres.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* jsres.php - the Enano client-side runtime, a.k.a. AJAX on steroids
*
@@ -40,7 +40,7 @@
{
echo "/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* [Aggressively compressed] Javascript client code
* Copyright (C) 2006-2007 Dan Fuhry
* Enano is Free Software, licensed under the GNU General Public License; see http://enanocms.org/ for details.
diff -r 2ccb55995aef -r 92664d2efab8 includes/clientside/static/editor.js
--- a/includes/clientside/static/editor.js Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/clientside/static/editor.js Tue Jan 29 16:19:51 2008 -0500
@@ -83,12 +83,12 @@
// do we need to enter a captcha before saving the page?
var captcha_hash = ( response.require_captcha ) ? response.captcha_id : false;
- ajaxBuildEditor(response.src, (!response.auth_edit), response.time, captcha_hash);
+ ajaxBuildEditor(response.src, (!response.auth_edit), response.time, response.allow_wysiwyg, captcha_hash);
}
});
}
-function ajaxBuildEditor(content, readonly, timestamp, captcha_hash)
+function ajaxBuildEditor(content, readonly, timestamp, allow_wysiwyg, captcha_hash)
{
// Set flags
// We don't want the fancy confirmation framework to trigger if the user is only viewing the page source
@@ -110,45 +110,50 @@
//
// Plaintext/wikitext toggler
-
- var toggler = document.createElement('p');
- toggler.style.marginLeft = '0';
+ // Only build the editor if using TinyMCE is allowed. THIS IS WEAK
+ // AND CANNOT BE MADE ANY STRONGER.
- var span_wiki = document.createElement('span');
- var span_mce = document.createElement('span');
- span_wiki.id = 'enano_edit_btn_pt';
- span_mce.id = 'enano_edit_btn_mce';
- if ( readCookie('enano_editor_mode') == 'tinymce' )
+ if ( allow_wysiwyg )
{
- // Current selection is TinyMCE - make span_wiki have the link and span_mce be plaintext
- var a = document.createElement('a');
- a.href = '#';
- a.onclick = function() {
- ajaxSetEditorPlain();
- return false;
- };
- a.appendChild(document.createTextNode($lang.get('editor_btn_wikitext')));
- span_wiki.appendChild(a);
- toggler.appendChild(span_wiki);
- toggler.appendChild(document.createTextNode(' | '));
- span_mce.appendChild(document.createTextNode($lang.get('editor_btn_graphical')));
- toggler.appendChild(span_mce);
- }
- else
- {
- // Current selection is wikitext - set span_wiki to plaintext and span_mce to link
- span_wiki.appendChild(document.createTextNode($lang.get('editor_btn_wikitext')));
- toggler.appendChild(span_wiki);
- toggler.appendChild(document.createTextNode(' | '));
- var a = document.createElement('a');
- a.href = '#';
- a.onclick = function() {
- ajaxSetEditorMCE();
- return false;
- };
- a.appendChild(document.createTextNode($lang.get('editor_btn_graphical')));
- span_mce.appendChild(a);
- toggler.appendChild(span_mce);
+ var toggler = document.createElement('p');
+ toggler.style.marginLeft = '0';
+
+ var span_wiki = document.createElement('span');
+ var span_mce = document.createElement('span');
+ span_wiki.id = 'enano_edit_btn_pt';
+ span_mce.id = 'enano_edit_btn_mce';
+ if ( readCookie('enano_editor_mode') == 'tinymce' )
+ {
+ // Current selection is TinyMCE - make span_wiki have the link and span_mce be plaintext
+ var a = document.createElement('a');
+ a.href = '#';
+ a.onclick = function() {
+ ajaxSetEditorPlain();
+ return false;
+ };
+ a.appendChild(document.createTextNode($lang.get('editor_btn_wikitext')));
+ span_wiki.appendChild(a);
+ toggler.appendChild(span_wiki);
+ toggler.appendChild(document.createTextNode(' | '));
+ span_mce.appendChild(document.createTextNode($lang.get('editor_btn_graphical')));
+ toggler.appendChild(span_mce);
+ }
+ else
+ {
+ // Current selection is wikitext - set span_wiki to plaintext and span_mce to link
+ span_wiki.appendChild(document.createTextNode($lang.get('editor_btn_wikitext')));
+ toggler.appendChild(span_wiki);
+ toggler.appendChild(document.createTextNode(' | '));
+ var a = document.createElement('a');
+ a.href = '#';
+ a.onclick = function() {
+ ajaxSetEditorMCE();
+ return false;
+ };
+ a.appendChild(document.createTextNode($lang.get('editor_btn_graphical')));
+ span_mce.appendChild(a);
+ toggler.appendChild(span_mce);
+ }
}
// Form (to allow submits from MCE to trigger a real save)
@@ -364,7 +369,8 @@
}
// Put it all together...
- form.appendChild(toggler);
+ if ( allow_wysiwyg )
+ form.appendChild(toggler);
form.appendChild(preview_anchor);
form.appendChild(preview_container);
form.appendChild(ta_wrapper);
@@ -377,7 +383,7 @@
}
// If the editor preference is tinymce, switch the editor to TinyMCE now
- if ( readCookie('enano_editor_mode') == 'tinymce' )
+ if ( readCookie('enano_editor_mode') == 'tinymce' && allow_wysiwyg )
{
$dynano('ajaxEditArea').switchToMCE();
}
diff -r 2ccb55995aef -r 92664d2efab8 includes/clientside/static/l10n.js
--- a/includes/clientside/static/l10n.js Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/clientside/static/l10n.js Tue Jan 29 16:19:51 2008 -0500
@@ -18,7 +18,7 @@
return string_id;
if ( typeof(this.strings[catname][string_name]) != 'string' )
return string_id;
- return this.perform_subst(this.strings[catname][string_name], subst) + '**';
+ return this.perform_subst(this.strings[catname][string_name], subst);
}
this.perform_subst = function(str, subst)
diff -r 2ccb55995aef -r 92664d2efab8 includes/clientside/static/paginate.js
--- a/includes/clientside/static/paginate.js Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/clientside/static/paginate.js Tue Jan 29 16:19:51 2008 -0500
@@ -284,7 +284,7 @@
var regex = new RegExp('\"', 'g');
var submit_target = ( typeof(url_string) == 'object' ) ? ( toJSONString(url_string) ).replace(regex, '\'') : 'unescape(\'' + escape(url_string) + '\')';
var onclick = 'paginator_submit(this, '+num_pages+', '+perpage+', '+submit_target+'); return false;';
- div.innerHTML = $lang.get('paginate_lbl_goto_page') + '
» ×';
+ div.innerHTML = $lang.get('paginate_lbl_goto_page') + '
» ×';
var body = document.getElementsByTagName('body')[0];
domObjChangeOpac(0, div);
diff -r 2ccb55995aef -r 92664d2efab8 includes/comment.php
--- a/includes/comment.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/comment.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/constants.php
--- a/includes/constants.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/constants.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* constants.php - important defines used Enano-wide
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/email.php
--- a/includes/email.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/email.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/functions.php
--- a/includes/functions.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/functions.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
@@ -1175,7 +1175,8 @@
'1.0.1.1'=> 'Loch Ness internal bugfix build',
'1.0.2b1'=> 'Coblynau unstable',
'1.0.2' => 'Coblynau',
- '1.0.3' => 'Dyrad'
+ '1.0.3' => 'Dyrad',
+ '1.1.1' => 'Caoineag alpha 1',
);
$version = enano_version();
if ( isset($names[$version]) )
diff -r 2ccb55995aef -r 92664d2efab8 includes/http.php
--- a/includes/http.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/http.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* class_http.php - Pure PHP HTTP client library
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/js-compressor.php
--- a/includes/js-compressor.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/js-compressor.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* Javascript compression library - used to compact the client-side Javascript code (all 72KB of it!) to save some bandwidth
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/lang.php
--- a/includes/lang.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/lang.php Tue Jan 29 16:19:51 2008 -0500
@@ -554,7 +554,7 @@
$subs[$key] = strval($value);
$string = str_replace("%{$key}%", "{$subs[$key]}", $string);
}
- return $string . '*';
+ return $string;
}
} // class Language
diff -r 2ccb55995aef -r 92664d2efab8 includes/pageprocess.php
--- a/includes/pageprocess.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/pageprocess.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* pageprocess.php - intelligent retrieval of pages
* Copyright (C) 2006-2007 Dan Fuhry
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/paths.php
--- a/includes/paths.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/paths.php Tue Jan 29 16:19:51 2008 -0500
@@ -49,6 +49,7 @@
$session->register_acl_type('post_comments', AUTH_ALLOW, 'perm_post_comments', Array('read'), 'Article|User|Project|Template|File|Help|System|Category');
$session->register_acl_type('edit_comments', AUTH_ALLOW, 'perm_edit_comments', Array('post_comments'), 'Article|User|Project|Template|File|Help|System|Category');
$session->register_acl_type('edit_page', AUTH_WIKIMODE, 'perm_edit_page', Array('view_source'), 'Article|User|Project|Template|File|Help|System|Category');
+ $session->register_acl_type('edit_wysiwyg', AUTH_ALLOW, 'perm_edit_wysiwyg', Array('edit_page'), 'Article|User|Project|Template|File|Help|System|Category');
$session->register_acl_type('view_source', AUTH_WIKIMODE, 'perm_view_source', Array('read'), 'Article|User|Project|Template|File|Help|System|Category'); // Only used if the page is protected
$session->register_acl_type('mod_comments', AUTH_DISALLOW, 'perm_mod_comments', Array('edit_comments'), 'Article|User|Project|Template|File|Help|System|Category');
$session->register_acl_type('history_view', AUTH_WIKIMODE, 'perm_history_view', Array('read'), 'Article|User|Project|Template|File|Help|System|Category');
diff -r 2ccb55995aef -r 92664d2efab8 includes/plugins.php
--- a/includes/plugins.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/plugins.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/render.php
--- a/includes/render.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/render.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* render.php - handles fetching pages and parsing them into HTML
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/search.php
--- a/includes/search.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/search.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* search.php - algorithm used to search pages
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/sessions.php
--- a/includes/sessions.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/sessions.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* sessions.php - everything related to security and user management
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/stats.php
--- a/includes/stats.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/stats.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
* stats.php - handles statistics for pages (disablable in the admin CP)
*
diff -r 2ccb55995aef -r 92664d2efab8 includes/tagcloud.php
--- a/includes/tagcloud.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/tagcloud.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/template.php
--- a/includes/template.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/template.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 includes/wikiengine/Tables.php
--- a/includes/wikiengine/Tables.php Sun Jan 27 23:45:53 2008 -0500
+++ b/includes/wikiengine/Tables.php Tue Jan 29 16:19:51 2008 -0500
@@ -2,7 +2,7 @@
/*
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
- * Version 1.0.3 (Dyrad)
+ * Version 1.1.1 (Caoineag alpha 1)
* Copyright (C) 2006-2007 Dan Fuhry
*
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
diff -r 2ccb55995aef -r 92664d2efab8 index.php
--- a/index.php Sun Jan 27 23:45:53 2008 -0500
+++ b/index.php Tue Jan 29 16:19:51 2008 -0500
@@ -19,7 +19,7 @@
define('ENANO_INTERFACE_INDEX', '');
// For the mighty and brave.
- define('ENANO_DEBUG', '');
+ // define('ENANO_DEBUG', '');
// Set up gzip encoding before any output is sent
diff -r 2ccb55995aef -r 92664d2efab8 language/english/core.json
--- a/language/english/core.json Sun Jan 27 23:45:53 2008 -0500
+++ b/language/english/core.json Tue Jan 29 16:19:51 2008 -0500
@@ -417,6 +417,7 @@
edit_comments: 'Edit own comments',
edit_page: 'Edit page',
view_source: 'View source',
+ edit_wysiwyg: 'Use graphical editor (WEAK)',
mod_comments: 'Moderate comments',
history_view: 'View history/diffs',
history_rollback: 'Rollback history',
diff -r 2ccb55995aef -r 92664d2efab8 plugins/PrivateMessages.php
--- a/plugins/PrivateMessages.php Sun Jan 27 23:45:53 2008 -0500
+++ b/plugins/PrivateMessages.php Tue Jan 29 16:19:51 2008 -0500
@@ -4,7 +4,7 @@
Plugin URI: http://enanocms.org/
Description: plugin_privatemessages_desc
Author: Dan Fuhry
-Version: 1.0.3
+Version: 1.1.1
Author URI: http://enanocms.org/
*/
diff -r 2ccb55995aef -r 92664d2efab8 plugins/SpecialAdmin.php
--- a/plugins/SpecialAdmin.php Sun Jan 27 23:45:53 2008 -0500
+++ b/plugins/SpecialAdmin.php Tue Jan 29 16:19:51 2008 -0500
@@ -4,7 +4,7 @@
Plugin URI: http://enanocms.org/
Description: plugin_specialadmin_desc
Author: Dan Fuhry
-Version: 1.0.3
+Version: 1.1.1
Author URI: http://enanocms.org/
*/
@@ -1108,7 +1108,7 @@
{
echo '