diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-01 15:28:34 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-01 15:28:34 +0000 |
| commit | ca460de5458e35b012e643b2af4880312c06d0f6 (patch) | |
| tree | ebe8e430f2a863ae7b6671ea3e51ff1eaee0bb7a /wp-inst/wp-includes | |
| parent | 814b39931c8ff188122ba77b78388b4fbe7008df (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@454 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes')
| -rw-r--r-- | wp-inst/wp-includes/capabilities.php | 19 | ||||
| -rw-r--r-- | wp-inst/wp-includes/classes.php | 4 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions-compat.php | 4 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions-formatting.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions.php | 19 | ||||
| -rw-r--r-- | wp-inst/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js | 83 | ||||
| -rw-r--r-- | wp-inst/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif | bin | 0 -> 155 bytes | |||
| -rw-r--r-- | wp-inst/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif | bin | 0 -> 153 bytes | |||
| -rw-r--r-- | wp-inst/wp-includes/js/tinymce/plugins/directionality/langs/en.js | 6 | ||||
| -rw-r--r-- | wp-inst/wp-includes/version.php | 2 |
10 files changed, 132 insertions, 7 deletions
diff --git a/wp-inst/wp-includes/capabilities.php b/wp-inst/wp-includes/capabilities.php index 602a97f..b4dfc0b 100644 --- a/wp-inst/wp-includes/capabilities.php +++ b/wp-inst/wp-includes/capabilities.php @@ -26,8 +26,9 @@ class WP_Roles { if ( isset($this->roles[$role]) ) return; - $this->roles[$role] = array('name' => $display_name, - 'capabilities' => $capabilities); + $this->roles[$role] = array( + 'name' => $display_name, + 'capabilities' => $capabilities); update_option($this->role_key, $this->roles); $this->role_objects[$role] = new WP_Role($role, $capabilities); $this->role_names[$role] = $display_name; @@ -280,13 +281,25 @@ function current_user_can($capability) { return call_user_func_array(array(&$current_user, 'has_cap'), $args); } -// Convenience wrapper around $wp_roles. +// Convenience wrappers around $wp_roles. function get_role($role) { global $wp_roles; return $wp_roles->get_role($role); } +function add_role($role, $display_name, $capabilities = '') { + global $wp_roles; + + return $wp_roles->add_role($role, $display_name, $capabilities = ''); +} + +function remove_role($role) { + global $wp_roles; + + return $wp_roles->remove_role($role); +} + // // These are deprecated. Use current_user_can(). // diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php index 59de66d..9d3016f 100644 --- a/wp-inst/wp-includes/classes.php +++ b/wp-inst/wp-includes/classes.php @@ -1470,8 +1470,12 @@ class WP { if ( ! empty($pathinfo) && ($wp_rewrite->index != $pathinfo) ) { $request = $pathinfo; } else { + // If the request uri is the index, blank it out so that we don't try to match it against a rule. + if ( $req_uri == $wp_rewrite->index ) + $req_uri = ''; $request = $req_uri; } + $this->request = $request; // Look for matches. diff --git a/wp-inst/wp-includes/functions-compat.php b/wp-inst/wp-includes/functions-compat.php index 89716bc..bc077ab 100644 --- a/wp-inst/wp-includes/functions-compat.php +++ b/wp-inst/wp-includes/functions-compat.php @@ -64,7 +64,7 @@ if (!defined('CASE_UPPER')) { * @link http://php.net/function.array_change_key_case * @author Stephan Schmidt <schst@php.net> * @author Aidan Lister <aidan@php.net> - * @version $Revision: 3198 $ + * @version $Revision: 3245 $ * @since PHP 4.2.0 * @require PHP 4.0.0 (user_error) */ @@ -91,7 +91,7 @@ if (!function_exists('array_change_key_case')) { /* Added in PHP 4.3.0 */ -if( !(function_exists('glob')) ): +if( !function_exists('glob') ): function glob($pattern) { // get pathname (everything up until the last / or \) $path=$output=null; diff --git a/wp-inst/wp-includes/functions-formatting.php b/wp-inst/wp-includes/functions-formatting.php index c179df2..8b959d4 100644 --- a/wp-inst/wp-includes/functions-formatting.php +++ b/wp-inst/wp-includes/functions-formatting.php @@ -994,7 +994,7 @@ function ent2ncr($text) { function wp_richedit_pre($text) { // Filtering a blank results in an annoying <br />\n - if ( empty($text) ) return ''; + if ( empty($text) ) return '<p> </p>'; $output = $text; $output = html_entity_decode($output); // undoes format_to_edit() diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index 8921cb5..d53a165 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -2154,6 +2154,25 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) { // FIXME: Need to delete username keyed cache object. } +function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { + global $wpdb; + if ( !is_numeric( $user_id ) ) + return false; + $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); + + if ( is_array($meta_value) || is_object($meta_value) ) + $meta_value = serialize($meta_value); + $meta_value = trim( $meta_value ); + + if ( ! empty($meta_value) ) + $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key' AND meta_value = '$meta_value'"); + else + $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); + + wp_cache_delete($user_id, 'users'); + // FIXME: Need to delete username keyed cache object. +} + function register_activation_hook($file, $function) { $file = plugin_basename($file); diff --git a/wp-inst/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-inst/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js new file mode 100644 index 0000000..c866b53 --- /dev/null +++ b/wp-inst/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js @@ -0,0 +1,83 @@ +/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn,cs,da,he,no,de,hu,ru,ru_KOI8-R,ru_UTF-8,es,cy,is,pl');
+
+function TinyMCE_directionality_getInfo() {
+ return {
+ longname : 'Directionality',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+};
+
+function TinyMCE_directionality_getControlHTML(control_name) {
+ switch (control_name) {
+ case "ltr":
+ var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;';
+ return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_ltr" src="{$pluginurl}/images/ltr.gif" title="{$lang_directionality_ltr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>'
+ + '<div class="zerosize"><input type="button" accesskey="." onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\',false);" /></div>';
+
+ case "rtl":
+ var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;';
+ return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_rtl" src="{$pluginurl}/images/rtl.gif" title="{$lang_directionality_rtl_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>'
+ + '<div class="zerosize"><input type="button" accesskey="," onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\',false);" /></div>';
+ }
+
+ return "";
+}
+
+function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) {
+ // Handle commands
+ switch (command) {
+ case "mceDirectionLTR":
+ var inst = tinyMCE.getInstanceById(editor_id);
+ var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+ if (elm)
+ elm.setAttribute("dir", "ltr");
+
+ tinyMCE.triggerNodeChange(false);
+ return true;
+
+ case "mceDirectionRTL":
+ var inst = tinyMCE.getInstanceById(editor_id);
+ var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+
+ if (elm)
+ elm.setAttribute("dir", "rtl");
+
+ tinyMCE.triggerNodeChange(false);
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+}
+
+function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+ function getAttrib(elm, name) {
+ return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+ }
+
+ tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal', false);
+ tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal', false);
+
+ if (node == null)
+ return;
+
+ var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
+ if (!elm) {
+ tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonDisabled', true);
+ tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonDisabled', true);
+ return;
+ }
+
+ var dir = getAttrib(elm, "dir");
+ if (dir == "ltr" || dir == "")
+ tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected', false);
+ else
+ tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected', false);
+
+ return true;
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif b/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif Binary files differnew file mode 100644 index 0000000..ac8f30c --- /dev/null +++ b/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/ltr.gif diff --git a/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif b/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif Binary files differnew file mode 100644 index 0000000..0348f99 --- /dev/null +++ b/wp-inst/wp-includes/js/tinymce/plugins/directionality/images/rtl.gif diff --git a/wp-inst/wp-includes/js/tinymce/plugins/directionality/langs/en.js b/wp-inst/wp-includes/js/tinymce/plugins/directionality/langs/en.js new file mode 100644 index 0000000..5b392fe --- /dev/null +++ b/wp-inst/wp-includes/js/tinymce/plugins/directionality/langs/en.js @@ -0,0 +1,6 @@ +// UK lang variables
+
+tinyMCE.addToLang('',{
+directionality_ltr_desc : 'Direction left to right (Alt-.)',
+directionality_rtl_desc : 'Direction right to left (Alt-,)'
+});
diff --git a/wp-inst/wp-includes/version.php b/wp-inst/wp-includes/version.php index bc7bcfb..6df6626 100644 --- a/wp-inst/wp-includes/version.php +++ b/wp-inst/wp-includes/version.php @@ -3,6 +3,6 @@ // This just holds the version number, in a separate file so we can bump it without cluttering the SVN $wp_version = 'MU'; // Let's just avoid confusion -$wp_db_version = 3199; +$wp_db_version = 3243; ?> |
