Merge branch 'develop' into issue/#3062

* develop: (68 commits)
  Added documentation
  update to the translation
  update to the translations
  translation docs now contain basic usage of the Transifex client
  - Replace TinyMCE-enabled filebrowser.tpl by filebrowser_plain.tpl content
  - Remove misc TinyMCE mentions in docs and minifyjs
  - Remove $theme_richtext_editor boot var - Remove "richtext" feature - Remove fix_mce_lf() function - Remove nomce parameter
  - Remove TinyMCE mentions in themes
  - Remove tinyMCE mentions or convert to addeditortext() - Remove $editselect template value
  Remove tinyMCE libraries
  limit the description of the meta tag to 160 characters in /mod/display
  Improved handling of non string values in the config
  Bugfix: Caching of non string cache values now works.
  Reformatted stuff, improved query
  Auto-focus first input field of modal when shown
  Use cache instead of config for storing last proc_run time
  Some added logging
  Bugfix for masses of php warnings
  Rearranged the logging
  Some changed logging
  ...

# Conflicts:
#	view/theme/frost-mobile/js/theme.js
#	view/theme/frost/js/theme.js
This commit is contained in:
Hypolite Petovan 2017-01-27 15:30:21 -05:00
commit c38a5e443d
438 changed files with 108865 additions and 144355 deletions

3
.gitignore vendored
View file

@ -48,3 +48,6 @@ nbproject
/php_friendica.phpproj /php_friendica.phpproj
/php_friendica.sln /php_friendica.sln
/php_friendica.phpproj.user /php_friendica.phpproj.user
#ignore things from transifex-client
venv/

9
.tx/config Normal file
View file

@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
[friendica.messagespo]
file_filter = view/lang/<lang>/messages.po
source_file = util/messages.po
source_lang = en
type = PO

View file

@ -64,5 +64,34 @@ If you only want to translate friendica into another language you wont need any
For further information see the utils/README file. For further information see the utils/README file.
[1]: https://www.transifex.com/projects/p/friendica/ Transifex-Client
----------------
Transifex has a client program which let you interact with the translation files in a similar way to git.
Help for the client can be found at the [Transifex Help Center] [2].
Here we will only cover basic usage.
After installation of the client, you should have a `tx` command available on your system.
To use it, first create a configuration file with your credentials.
On Linux this file should be placed into your home directory `~/.transifexrc`.
The content of the file should be something like the following:
[https://www.transifex.com]
username = user
token =
password = p@ssw0rd
hostname = https://www.transifex.com
Since Friendica version 3.5.1 we ship configuration files for the Transifex client in the core repository and the addon repository.
To update the translation files after you have translated strings of e.g. Esperanto in the web-UI of transifex you can use `tx` to download the file.
$> tx pull -l eo
And then use the `po2php` utility described above to convert the `messages.po` file to the `strings.php` file Friendica is loading.
$> php util/po2php.php view/lang/eo/messages.po
Afterwards, just commit the two changed files to a feature branch of your Friendica repository, push the changes to github and open a pull request for your changes.
[1]: https://www.transifex.com/projects/p/friendica/
[2]: https://docs.transifex.com/client/introduction

View file

@ -19,6 +19,8 @@
require_once('include/autoloader.php'); require_once('include/autoloader.php');
use \Friendica\Core\Config;
require_once('include/config.php'); require_once('include/config.php');
require_once('include/network.php'); require_once('include/network.php');
require_once('include/plugin.php'); require_once('include/plugin.php');
@ -38,7 +40,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5.1-dev' ); define ( 'FRIENDICA_VERSION', '3.5.1-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1212 ); define ( 'DB_UPDATE_VERSION', 1213 );
/** /**
* @brief Constant with a HTML line break. * @brief Constant with a HTML line break.
@ -530,7 +532,6 @@ class App {
public $videoheight = 350; public $videoheight = 350;
public $force_max_items = 0; public $force_max_items = 0;
public $theme_thread_allow = true; public $theme_thread_allow = true;
public $theme_richtext_editor = true;
public $theme_events_in_profile = true; public $theme_events_in_profile = true;
/** /**
@ -823,24 +824,22 @@ class App {
$scheme = $this->scheme; $scheme = $this->scheme;
if ((x($this->config, 'system')) && (x($this->config['system'], 'ssl_policy'))) { if (Config::get('system', 'ssl_policy') === SSL_POLICY_FULL) {
if (intval($this->config['system']['ssl_policy']) === SSL_POLICY_FULL) { $scheme = 'https';
}
// Basically, we have $ssl = true on any links which can only be seen by a logged in user
// (and also the login link). Anything seen by an outsider will have it turned off.
if (Config::get('system', 'ssl_policy') == SSL_POLICY_SELFSIGN) {
if ($ssl) {
$scheme = 'https'; $scheme = 'https';
} } else {
$scheme = 'http';
// Basically, we have $ssl = true on any links which can only be seen by a logged in user
// (and also the login link). Anything seen by an outsider will have it turned off.
if ($this->config['system']['ssl_policy'] == SSL_POLICY_SELFSIGN) {
if ($ssl) {
$scheme = 'https';
} else {
$scheme = 'http';
}
} }
} }
if (get_config('config', 'hostname') != '') { if (Config::get('config', 'hostname') != '') {
$this->hostname = get_config('config', 'hostname'); $this->hostname = get_config('config', 'hostname');
} }
@ -1390,11 +1389,15 @@ class App {
// If the last worker fork was less than 10 seconds before then don't fork another one. // If the last worker fork was less than 10 seconds before then don't fork another one.
// This should prevent the forking of masses of workers. // This should prevent the forking of masses of workers.
if (get_config("system", "worker")) { if (get_config("system", "worker")) {
if ((time() - get_config("system", "proc_run_started")) < 10) $cachekey = "app:proc_run:started";
return; $result = Cache::get($cachekey);
if (!is_null($result)) {
if ((time() - $result) < 10) {
return;
}
}
// Set the timestamp of the last proc_run // Set the timestamp of the last proc_run
set_config("system", "proc_run_started", time()); Cache::set($cachekey, time(), CACHE_MINUTE);
} }
$args[0] = ((x($this->config,'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php'); $args[0] = ((x($this->config,'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php');
@ -1474,9 +1477,7 @@ function system_unavailable() {
function clean_urls() { function clean_urls() {
$a = get_app(); $a = get_app();
// if($a->config['system']['clean_urls'])
return true; return true;
// return false;
} }
function z_path() { function z_path() {
@ -1570,7 +1571,7 @@ function update_db(App $a) {
$stored = intval($build); $stored = intval($build);
$current = intval(DB_UPDATE_VERSION); $current = intval(DB_UPDATE_VERSION);
if($stored < $current) { if($stored < $current) {
load_config('database'); Config::load('database');
// We're reporting a different version than what is currently installed. // We're reporting a different version than what is currently installed.
// Run any existing update scripts to bring the database up to current. // Run any existing update scripts to bring the database up to current.
@ -2040,16 +2041,18 @@ function current_theme(){
// $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet(); // $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet();
$is_mobile = $a->is_mobile || $a->is_tablet; $is_mobile = $a->is_mobile || $a->is_tablet;
$standard_system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); $standard_system_theme = Config::get('system', 'theme', '');
$standard_theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $standard_system_theme); $standard_theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $standard_system_theme);
if($is_mobile) { if ($is_mobile) {
if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { if (isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
$system_theme = $standard_system_theme; $system_theme = $standard_system_theme;
$theme_name = $standard_theme_name; $theme_name = $standard_theme_name;
} } else {
else { $system_theme = Config::get('system', 'mobile-theme', '');
$system_theme = ((isset($a->config['system']['mobile-theme'])) ? $a->config['system']['mobile-theme'] : $standard_system_theme); if ($system_theme == '') {
$system_theme = $standard_system_theme;
}
$theme_name = ((isset($_SESSION) && x($_SESSION,'mobile-theme')) ? $_SESSION['mobile-theme'] : $system_theme); $theme_name = ((isset($_SESSION) && x($_SESSION,'mobile-theme')) ? $_SESSION['mobile-theme'] : $system_theme);
if($theme_name === '---') { if($theme_name === '---') {

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 3.5.1-dev (Asparagus) -- Friendica 3.5.1-dev (Asparagus)
-- DB_UPDATE_VERSION 1212 -- DB_UPDATE_VERSION 1213
-- ------------------------------------------ -- ------------------------------------------
@ -9,13 +9,14 @@
-- --
CREATE TABLE IF NOT EXISTS `addon` ( CREATE TABLE IF NOT EXISTS `addon` (
`id` int(11) NOT NULL auto_increment, `id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL DEFAULT '', `name` varchar(190) NOT NULL DEFAULT '',
`version` varchar(255) NOT NULL DEFAULT '', `version` varchar(255) NOT NULL DEFAULT '',
`installed` tinyint(1) NOT NULL DEFAULT 0, `installed` tinyint(1) NOT NULL DEFAULT 0,
`hidden` tinyint(1) NOT NULL DEFAULT 0, `hidden` tinyint(1) NOT NULL DEFAULT 0,
`timestamp` bigint(20) NOT NULL DEFAULT 0, `timestamp` bigint(20) NOT NULL DEFAULT 0,
`plugin_admin` tinyint(1) NOT NULL DEFAULT 0, `plugin_admin` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`) PRIMARY KEY(`id`),
UNIQUE INDEX `name` (`name`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -55,11 +56,10 @@ CREATE TABLE IF NOT EXISTS `auth_codes` (
-- --
CREATE TABLE IF NOT EXISTS `cache` ( CREATE TABLE IF NOT EXISTS `cache` (
`k` varbinary(255) NOT NULL, `k` varbinary(255) NOT NULL,
`v` text, `v` mediumtext,
`expire_mode` int(11) NOT NULL DEFAULT 0, `expire_mode` int(11) NOT NULL DEFAULT 0,
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`k`), PRIMARY KEY(`k`),
INDEX `updated` (`updated`),
INDEX `expire_mode_updated` (`expire_mode`,`updated`) INDEX `expire_mode_updated` (`expire_mode`,`updated`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -96,7 +96,7 @@ CREATE TABLE IF NOT EXISTS `config` (
`id` int(10) unsigned NOT NULL auto_increment, `id` int(10) unsigned NOT NULL auto_increment,
`cat` varbinary(255) NOT NULL DEFAULT '', `cat` varbinary(255) NOT NULL DEFAULT '',
`k` varbinary(255) NOT NULL DEFAULT '', `k` varbinary(255) NOT NULL DEFAULT '',
`v` text, `v` mediumtext,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
UNIQUE INDEX `cat_k` (`cat`,`k`) UNIQUE INDEX `cat_k` (`cat`,`k`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -172,18 +172,20 @@ CREATE TABLE IF NOT EXISTS `contact` (
`bd` date NOT NULL DEFAULT '0000-00-00', `bd` date NOT NULL DEFAULT '0000-00-00',
`notify_new_posts` tinyint(1) NOT NULL DEFAULT 0, `notify_new_posts` tinyint(1) NOT NULL DEFAULT 0,
`fetch_further_information` tinyint(1) NOT NULL DEFAULT 0, `fetch_further_information` tinyint(1) NOT NULL DEFAULT 0,
`ffi_keyword_blacklist` mediumtext, `ffi_keyword_blacklist` text,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid_name` (`uid`,`name`), INDEX `uid_name` (`uid`,`name`),
INDEX `uid_self` (`uid`,`self`), INDEX `self_uid` (`self`,`uid`),
INDEX `alias_uid` (`alias`(32),`uid`), INDEX `alias_uid` (`alias`(32),`uid`),
INDEX `uid_pending` (`uid`,`pending`), INDEX `pending_uid` (`pending`,`uid`),
INDEX `uid_blocked` (`uid`,`blocked`), INDEX `blocked_uid` (`blocked`,`uid`),
INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`), INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`),
INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)), INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)),
INDEX `addr_uid` (`addr`(32),`uid`), INDEX `addr_uid` (`addr`(32),`uid`),
INDEX `nurl_uid` (`nurl`(32),`uid`), INDEX `nurl_uid` (`nurl`(32),`uid`),
INDEX `nick_uid` (`nick`(32),`uid`) INDEX `nick_uid` (`nick`(32),`uid`),
INDEX `dfrn-id` (`dfrn-id`),
INDEX `issued-id` (`issued-id`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -192,12 +194,12 @@ CREATE TABLE IF NOT EXISTS `contact` (
CREATE TABLE IF NOT EXISTS `conv` ( CREATE TABLE IF NOT EXISTS `conv` (
`id` int(10) unsigned NOT NULL auto_increment, `id` int(10) unsigned NOT NULL auto_increment,
`guid` varchar(64) NOT NULL DEFAULT '', `guid` varchar(64) NOT NULL DEFAULT '',
`recips` mediumtext, `recips` text,
`uid` int(11) NOT NULL DEFAULT 0, `uid` int(11) NOT NULL DEFAULT 0,
`creator` varchar(255) NOT NULL DEFAULT '', `creator` varchar(255) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`subject` mediumtext, `subject` text,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid` (`uid`) INDEX `uid` (`uid`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -264,7 +266,8 @@ CREATE TABLE IF NOT EXISTS `fcontact` (
`pubkey` text, `pubkey` text,
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `addr` (`addr`(32)) INDEX `addr` (`addr`(32)),
INDEX `url` (`url`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -349,10 +352,11 @@ CREATE TABLE IF NOT EXISTS `gcontact` (
`generation` tinyint(3) NOT NULL DEFAULT 0, `generation` tinyint(3) NOT NULL DEFAULT 0,
`server_url` varchar(255) NOT NULL DEFAULT '', `server_url` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `nurl` (`nurl`(32)), INDEX `nurl` (`nurl`(64)),
INDEX `name` (`name`(32)), INDEX `name` (`name`(64)),
INDEX `nick` (`nick`(32)), INDEX `nick` (`nick`(32)),
INDEX `addr` (`addr`(32)), INDEX `addr` (`addr`(64)),
INDEX `hide_network_updated` (`hide`,`network`,`updated`),
INDEX `updated` (`updated`) INDEX `updated` (`updated`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -368,8 +372,7 @@ CREATE TABLE IF NOT EXISTS `glink` (
`updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`), UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`),
INDEX `gcid` (`gcid`), INDEX `gcid` (`gcid`)
INDEX `zcid` (`zcid`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -394,8 +397,8 @@ CREATE TABLE IF NOT EXISTS `group_member` (
`gid` int(10) unsigned NOT NULL DEFAULT 0, `gid` int(10) unsigned NOT NULL DEFAULT 0,
`contact-id` int(10) unsigned NOT NULL DEFAULT 0, `contact-id` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `cid_contactid` (`cid`,`contact-id`), INDEX `contactid` (`contact-id`),
INDEX `uid_contactid` (`uid`,`contact-id`), INDEX `gid_contactid` (`gid`,`contact-id`),
UNIQUE INDEX `uid_gid_contactid` (`uid`,`gid`,`contact-id`) UNIQUE INDEX `uid_gid_contactid` (`uid`,`gid`,`contact-id`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -432,7 +435,7 @@ CREATE TABLE IF NOT EXISTS `hook` (
`function` varchar(255) NOT NULL DEFAULT '', `function` varchar(255) NOT NULL DEFAULT '',
`priority` int(11) unsigned NOT NULL DEFAULT 0, `priority` int(11) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `hook_file_function` (`hook`(30),`file`(60),`function`(30)) UNIQUE INDEX `hook_file_function` (`hook`(50),`file`(80),`function`(60))
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -532,18 +535,13 @@ CREATE TABLE IF NOT EXISTS `item` (
INDEX `uid_created` (`uid`,`created`), INDEX `uid_created` (`uid`,`created`),
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_network_received` (`uid`,`network`,`received`),
INDEX `uid_received` (`uid`,`received`),
INDEX `uid_network_commented` (`uid`,`network`,`commented`), INDEX `uid_network_commented` (`uid`,`network`,`commented`),
INDEX `uid_title` (`uid`,`title`),
INDEX `uid_thrparent` (`uid`,`thr-parent`), INDEX `uid_thrparent` (`uid`,`thr-parent`),
INDEX `uid_parenturi` (`uid`,`parent-uri`), INDEX `uid_parenturi` (`uid`,`parent-uri`),
INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
INDEX `authorid_created` (`author-id`,`created`), INDEX `authorid_created` (`author-id`,`created`),
INDEX `uid_uri` (`uid`,`uri`), INDEX `uid_uri` (`uid`,`uri`),
INDEX `uid_wall_created` (`uid`,`wall`,`created`),
INDEX `resource-id` (`resource-id`), INDEX `resource-id` (`resource-id`),
INDEX `uid_type` (`uid`,`type`),
INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)), INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)),
INDEX `uid_type_changed` (`uid`,`type`,`changed`), INDEX `uid_type_changed` (`uid`,`type`,`changed`),
INDEX `contactid_verb` (`contact-id`,`verb`), INDEX `contactid_verb` (`contact-id`,`verb`),
@ -603,7 +601,6 @@ CREATE TABLE IF NOT EXISTS `mail` (
`parent-uri` varchar(255) NOT NULL DEFAULT '', `parent-uri` varchar(255) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `uid_seen` (`uid`,`seen`), INDEX `uid_seen` (`uid`,`seen`),
INDEX `convid` (`convid`), INDEX `convid` (`convid`),
INDEX `uri` (`uri`(64)), INDEX `uri` (`uri`(64)),
@ -638,7 +635,7 @@ CREATE TABLE IF NOT EXISTS `manage` (
`uid` int(11) NOT NULL DEFAULT 0, `uid` int(11) NOT NULL DEFAULT 0,
`mid` int(11) NOT NULL DEFAULT 0, `mid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid_mid` (`uid`,`mid`) UNIQUE INDEX `uid_mid` (`uid`,`mid`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -663,11 +660,10 @@ CREATE TABLE IF NOT EXISTS `notify` (
`name_cache` tinytext, `name_cache` tinytext,
`msg_cache` mediumtext, `msg_cache` mediumtext,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid_hash` (`uid`,`hash`), INDEX `hash_uid` (`hash`,`uid`),
INDEX `uid_seen_date` (`uid`,`seen`,`date`), INDEX `seen_uid_date` (`seen`,`uid`,`date`),
INDEX `uid_type_link` (`uid`,`type`,`link`), INDEX `uid_date` (`uid`,`date`),
INDEX `uid_link` (`uid`,`link`), INDEX `uid_type_link` (`uid`,`type`,`link`)
INDEX `uid_date` (`uid`,`date`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -679,8 +675,7 @@ CREATE TABLE IF NOT EXISTS `notify-threads` (
`master-parent-item` int(10) unsigned NOT NULL DEFAULT 0, `master-parent-item` int(10) unsigned NOT NULL DEFAULT 0,
`parent-item` int(10) unsigned NOT NULL DEFAULT 0, `parent-item` int(10) unsigned NOT NULL DEFAULT 0,
`receiver-uid` int(11) NOT NULL DEFAULT 0, `receiver-uid` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`), PRIMARY KEY(`id`)
INDEX `master-parent-item` (`master-parent-item`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -688,7 +683,7 @@ CREATE TABLE IF NOT EXISTS `notify-threads` (
-- --
CREATE TABLE IF NOT EXISTS `oembed` ( CREATE TABLE IF NOT EXISTS `oembed` (
`url` varbinary(255) NOT NULL, `url` varbinary(255) NOT NULL,
`content` text, `content` mediumtext,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`url`), PRIMARY KEY(`url`),
INDEX `created` (`created`) INDEX `created` (`created`)
@ -701,7 +696,7 @@ CREATE TABLE IF NOT EXISTS `parsed_url` (
`url` varbinary(255) NOT NULL, `url` varbinary(255) NOT NULL,
`guessing` tinyint(1) NOT NULL DEFAULT 0, `guessing` tinyint(1) NOT NULL DEFAULT 0,
`oembed` tinyint(1) NOT NULL DEFAULT 0, `oembed` tinyint(1) NOT NULL DEFAULT 0,
`content` text, `content` mediumtext,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`url`,`guessing`,`oembed`), PRIMARY KEY(`url`,`guessing`,`oembed`),
INDEX `created` (`created`) INDEX `created` (`created`)
@ -749,7 +744,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid_contactid` (`uid`,`contact-id`), INDEX `uid_contactid` (`uid`,`contact-id`),
INDEX `uid_profile` (`uid`,`profile`), INDEX `uid_profile` (`uid`,`profile`),
INDEX `uid_album_created` (`uid`,`album`(32),`created`), INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`(64),`created`), INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`(64),`created`),
INDEX `resource-id` (`resource-id`(64)) INDEX `resource-id` (`resource-id`(64))
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -760,16 +755,16 @@ CREATE TABLE IF NOT EXISTS `photo` (
CREATE TABLE IF NOT EXISTS `poll` ( CREATE TABLE IF NOT EXISTS `poll` (
`id` int(11) NOT NULL auto_increment, `id` int(11) NOT NULL auto_increment,
`uid` int(11) NOT NULL DEFAULT 0, `uid` int(11) NOT NULL DEFAULT 0,
`q0` mediumtext, `q0` text,
`q1` mediumtext, `q1` text,
`q2` mediumtext, `q2` text,
`q3` mediumtext, `q3` text,
`q4` mediumtext, `q4` text,
`q5` mediumtext, `q5` text,
`q6` mediumtext, `q6` text,
`q7` mediumtext, `q7` text,
`q8` mediumtext, `q8` text,
`q9` mediumtext, `q9` text,
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
INDEX `uid` (`uid`) INDEX `uid` (`uid`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
@ -843,7 +838,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
`thumb` varchar(255) NOT NULL DEFAULT '', `thumb` varchar(255) NOT NULL DEFAULT '',
`publish` tinyint(1) NOT NULL DEFAULT 0, `publish` tinyint(1) NOT NULL DEFAULT 0,
`net-publish` tinyint(1) NOT NULL DEFAULT 0, `net-publish` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY(`id`) PRIMARY KEY(`id`),
INDEX `uid_is-default` (`uid`,`is-default`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;
-- --
@ -979,8 +975,6 @@ CREATE TABLE IF NOT EXISTS `term` (
`uid` int(10) unsigned NOT NULL DEFAULT 0, `uid` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY(`tid`), PRIMARY KEY(`tid`),
INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`), INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`),
INDEX `uid_term_tid` (`uid`,`term`(32),`tid`),
INDEX `type_term` (`type`,`term`(32)),
INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`), INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`),
INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)), INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)),
INDEX `guid` (`guid`(64)) INDEX `guid` (`guid`(64))
@ -1017,8 +1011,6 @@ CREATE TABLE IF NOT EXISTS `thread` (
`mention` tinyint(1) NOT NULL DEFAULT 0, `mention` tinyint(1) NOT NULL DEFAULT 0,
`network` varchar(32) NOT NULL DEFAULT '', `network` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY(`iid`), PRIMARY KEY(`iid`),
INDEX `created` (`created`),
INDEX `commented` (`commented`),
INDEX `uid_network_commented` (`uid`,`network`,`commented`), INDEX `uid_network_commented` (`uid`,`network`,`commented`),
INDEX `uid_network_created` (`uid`,`network`,`created`), INDEX `uid_network_created` (`uid`,`network`,`created`),
INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`), INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
@ -1111,7 +1103,6 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`pid` int(11) NOT NULL DEFAULT 0, `pid` int(11) NOT NULL DEFAULT 0,
`executed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `executed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY(`id`), PRIMARY KEY(`id`)
INDEX `created` (`created`)
) DEFAULT CHARSET=utf8mb4; ) DEFAULT CHARSET=utf8mb4;

View file

@ -43,29 +43,29 @@ We recommend to talk to the admin(s) of the affected friendica server. (Admins,
###How can I upload images, files, links, videos and sound files to posts? ###How can I upload images, files, links, videos and sound files to posts?
You can upload images from your computer by using the [editor](help/Text_editor). You can upload images from your computer using the [editor](help/Text_editor).
An overview of all uploaded images is listed at *yourpage.com/photos/profilename*. An overview of all uploaded images is listed at *yourpage.com/photos/profilename*.
On that page, you can also upload images directly and choose, if your contacts shall receive a message about this upload. On that page, you can also upload images directly and choose if your contacts will receive a message about this upload.
Generally, you could attach every kind of file to a post. Generally, you can attach any kind of file to a post.
This is possible by using the "paper-clip"-symbol in the editor. This is possible by using the "paper-clip"-symbol in the editor.
These files will be linked to your post and can be downloaded by your contacts. These files will be linked to your post and can be downloaded by your contacts.
But it's not possible to get a preview for these ones. But it's not possible to get a preview for these items.
Because of this, this upload method is recommended for office or zipped files. Because of this, this upload method is only recommended for office or zipped files.
If you want share content from Dropbox, Owncloud or any other [filehoster](http://en.wikipedia.org/wiki/Comparison_of_file_hosting_services), use the "link"-button (chain-symbol). If you want to share content from Dropbox, Owncloud or any other [filehoster](http://en.wikipedia.org/wiki/Comparison_of_file_hosting_services), use the "link"-button (chain-symbol).
When you're adding URLs of other webpages with the "link"-button, Friendica tries to create a small preview. When you're adding URLs of other webpages with the "link"-button, Friendica tries to create a small preview.
If this doesn't work, try to add the link by typing: [url=http://example.com]*self-chosen name*[/url]. If this doesn't work, try to add the link by typing: [url=http://example.com]*self-chosen name*[/url].
You can also add video and audio files to posts. You can also add video and audio files to posts.
But instead of a direct upload you have to use one of the following methods: However, instead of a direct upload you have to use one of the following methods:
1. Add the video or audio link of a hoster (Youtube, Vimeo, Soundcloud and everyone else with oembed/opengraph-support). Videos will be shown with a preview image you can click on to start it. SoundCloud directly inserts a player to your post. 1. Add the video or audio link of a hoster (Youtube, Vimeo, Soundcloud and anyone else with oembed/opengraph-support). Videos will be shown with a preview image you can click on to start. SoundCloud directly inserts a player to your post.
2. If you have your own server, you can upload multimedia files via FTP and insert the URL. 2. If you have your own server, you can upload multimedia files via FTP and insert the URL.
Friendica is using HTML5 for embedding content. Friendica uses HTML5 for embedding content.
Therefore, the supported files are depending on your browser and operating system. Therefore, the supported files are dependent on your browser and operating system.
Some supported filetypes are WebM, MP4, MP3 and OGG. Some supported filetypes are WebM, MP4, MP3 and OGG.
See Wikipedia for more of them ([video](http://en.wikipedia.org/wiki/HTML5_video), [audio](http://en.wikipedia.org/wiki/HTML5_audio)). See Wikipedia for more of them ([video](http://en.wikipedia.org/wiki/HTML5_video), [audio](http://en.wikipedia.org/wiki/HTML5_audio)).
@ -188,7 +188,7 @@ Admin
###Can I configure multiple domains with the same code instance? ###Can I configure multiple domains with the same code instance?
No, this function is not supported anymore starting from Friendica 3.3. No, this function is no longer supported from Friendica 3.3 onwards.
<a name="sources"></a> <a name="sources"></a>
@ -202,12 +202,12 @@ Addons are listed at [this page](https://github.com/friendica/friendica-addons).
If you are searching for new themes, you can find them at [Friendica-Themes.com](http://friendica-themes.com/) If you are searching for new themes, you can find them at [Friendica-Themes.com](http://friendica-themes.com/)
<a name="adminaccount1"></a> <a name="adminaccount1"></a>
###I've changed the my email address now the admin panel is gone? ###I've changed my email address now the admin panel is gone?
Have a look into your <tt>.htconfig.php</tt> and fix your email address there. Have a look into your <tt>.htconfig.php</tt> and fix your email address there.
<a name="adminaccount2"></a> <a name="adminaccount2"></a>
###Can there be more then just one admin for a node? ###Can there be more then one admin for a node?
Yes. You just have to list more then one email address in the Yes. You just have to list more then one email address in the
<tt>.htconfig.php</tt> file. The listed emails need to be separated by a comma. <tt>.htconfig.php</tt> file. The listed emails need to be separated by a comma.

View file

@ -36,7 +36,7 @@ Therefore this document does not yet cover all the options
Set the content for the site banner. Set the content for the site banner.
The default logo is the Friendica logo and name. The default logo is the Friendica logo and name.
You may wish to provide HTML/CSS to style and/or position this content, as it may not be themed by default. You may wish to provide HTML/CSS to style and/or position this content, as it may not be themed by default.
#### Language #### Language
@ -65,7 +65,7 @@ You may find a lot of spammers trying to register on your site.
During testing we discovered that since these registrations were automatic, the "Full Name" field was often set to just an account name with no space between first and last name. During testing we discovered that since these registrations were automatic, the "Full Name" field was often set to just an account name with no space between first and last name.
If you would like to support people with only one name as their full name, you may change this setting to true. If you would like to support people with only one name as their full name, you may change this setting to true.
Default is false. Default is false.
#### OpenID #### OpenID
By default, OpenID may be used for both registration and logins. By default, OpenID may be used for both registration and logins.
@ -80,7 +80,7 @@ By default, logged in users can register additional accounts for use as pages.
These will still require approval if the registration policy is set to *require approval* These will still require approval if the registration policy is set to *require approval*
You may prohibit logged in users from creating additional accounts by setting *block multible registrations* to true. You may prohibit logged in users from creating additional accounts by setting *block multible registrations* to true.
Default is false. Default is false.
### File upload ### File upload
#### Maximum Image Size #### Maximum Image Size
@ -94,7 +94,7 @@ The default is set to 0, which means no limits.
This configures the URL to update the global directory, and is supplied in the default configuration. This configures the URL to update the global directory, and is supplied in the default configuration.
The undocumented part is that if this is not set, the global directory is completely unavailable to the application. The undocumented part is that if this is not set, the global directory is completely unavailable to the application.
This allows a private community to be completely isolated from the global network. This allows a private community to be completely isolated from the global network.
#### Force Publish #### Force Publish
@ -130,7 +130,7 @@ Wildcards are accepted.
(Wildcard support on Windows platforms requires PHP5.3). (Wildcard support on Windows platforms requires PHP5.3).
By default, any (valid) email address is allowed in registrations. By default, any (valid) email address is allowed in registrations.
#### Allow Users to set remote_self #### Allow Users to set remote_self
If you enable the `Allow Users to set remote_self` users can select Atom feeds from their contact list being their *remote self* in die advanced contact settings. If you enable the `Allow Users to set remote_self` users can select Atom feeds from their contact list being their *remote self* in die advanced contact settings.
Which means that postings by the remote self are automatically reposted by Friendica in their names. Which means that postings by the remote self are automatically reposted by Friendica in their names.
@ -165,7 +165,7 @@ By default Friendica allows SSL communication between websites that have "self-s
For the widest compatibility with browsers and other networks we do not recommend using self-signed certificates, but we will not prevent you from using them. For the widest compatibility with browsers and other networks we do not recommend using self-signed certificates, but we will not prevent you from using them.
SSL encrypts all the data transmitted between sites (and to your browser). SSL encrypts all the data transmitted between sites (and to your browser).
This allows you to have completely encrypted communications, and also protect your login session from hijacking. This allows you to have completely encrypted communications, and also protect your login session from hijacking.
Self-signed certificates can be generated for free, without paying top-dollar for a website SSL certificate. Self-signed certificates can be generated for free, without paying top-dollar for a website SSL certificate.
However these aren't looked upon favourably in the security community because they can be subject to so-called "man-in-the-middle" attacks. However these aren't looked upon favourably in the security community because they can be subject to so-called "man-in-the-middle" attacks.
If you wish, you can turn on strict certificate checking. If you wish, you can turn on strict certificate checking.
This will mean you cannot connect (at all) to self-signed SSL sites. This will mean you cannot connect (at all) to self-signed SSL sites.
@ -213,8 +213,7 @@ To select a default theme for the Friendica node, see the *Site* section of the
## Additional Features ## Additional Features
There are several optional features in Friendica. There are several optional features in Friendica like the *dislike* button.
Like the *dislike* button or the usage of a *richtext editor* for composing new postings.
In this section of the admin panel you can select a default setting for your node and eventually fix it, so users cannot change the setting anymore. In this section of the admin panel you can select a default setting for your node and eventually fix it, so users cannot change the setting anymore.
## DB Updates ## DB Updates
@ -270,7 +269,7 @@ You should set up some kind of [log rotation](https://en.wikipedia.org/wiki/Log_
By default PHP warnings and error messages are supressed. By default PHP warnings and error messages are supressed.
If you want to enable those, you have to activate them in the ``.htconfig.php`` file. If you want to enable those, you have to activate them in the ``.htconfig.php`` file.
Use the following settings to redirect PHP errors to a file. Use the following settings to redirect PHP errors to a file.
Config: Config:
@ -283,7 +282,7 @@ This will put all PHP errors in the file php.out (which must be writeable by the
Undeclared variables are occasionally referenced in the program and therefore we do not recommend using `E_NOTICE` or `E_ALL`. Undeclared variables are occasionally referenced in the program and therefore we do not recommend using `E_NOTICE` or `E_ALL`.
The vast majority of issues reported at these levels are completely harmless. The vast majority of issues reported at these levels are completely harmless.
Please report to the developers any errors you encounter in the logs using the recommended settings above. Please report to the developers any errors you encounter in the logs using the recommended settings above.
They generally indicate issues which need to be resolved. They generally indicate issues which need to be resolved.
If you encounter a blank (white) page when using the application, view the PHP logs - as this almost always indicates an error has occurred. If you encounter a blank (white) page when using the application, view the PHP logs - as this almost always indicates an error has occurred.

View file

@ -1,7 +1,7 @@
<style> <style>
figure { border: 4px #eeeeee solid; } figure { border: 4px #eeeeee solid; }
figure img { padding: 2px; } figure img { padding: 2px; }
figure figcaption { background: #eeeeee; color: #444444; padding: 2px; font-style: italic;} figure figcaption { background: #eeeeee; color: #444444; padding: 2px; font-style: italic;}
</style> </style>
Creating posts Creating posts
@ -9,7 +9,7 @@ Creating posts
* [Home](help) * [Home](help)
Here you can find an overview of the different ways to create and edit your post. Here you can find an overview of the different ways to create and edit your post.
One click on "Share" text box on top of your Home or Network page, and the post editor shows up: One click on "Share" text box on top of your Home or Network page, and the post editor shows up:
@ -42,7 +42,7 @@ The icons under the text area are there to help you to write posts quickly:
<img src="doc/img/video.png" width="32" height="32" alt="video" align="left"> Add a video. Enter the url to a video (ogg) or to a video page on youtube or vimeo, and it will be embedded in your post with a preview. Friendica is using [HTML5](http://en.wikipedia.org/wiki/HTML5_video) for embedding content. Therefore, the supported files are depending on your browser and operating system (OS). Some filetypes are WebM, MP4 and OGG.* <img src="doc/img/video.png" width="32" height="32" alt="video" align="left"> Add a video. Enter the url to a video (ogg) or to a video page on youtube or vimeo, and it will be embedded in your post with a preview. Friendica is using [HTML5](http://en.wikipedia.org/wiki/HTML5_video) for embedding content. Therefore, the supported files are depending on your browser and operating system (OS). Some filetypes are WebM, MP4 and OGG.*
<p style="clear:both;"></p> <p style="clear:both;"></p>
<img src="doc/img/mic.png" width="32" height="32" alt="mic" align="left" style="padding-bottom: 20px;"> Add an audio. Same as video, but for audio. Depending on your browser and operation system MP3, OGG and AAC are supported. Additionally, you are able to add URLs from audiohosters like Soundcloud. <img src="doc/img/mic.png" width="32" height="32" alt="mic" align="left" style="padding-bottom: 20px;"> Add an audio. Same as video, but for audio. Depending on your browser and operation system MP3, OGG and AAC are supported. Additionally, you are able to add URLs from audiohosters like Soundcloud.
<p style="clear:both;"></p> <p style="clear:both;"></p>
@ -88,26 +88,11 @@ Click on "show" under contact name to hide the post to everyone but selected.
Click on "Visible to everybody" to make the post public again. Click on "Visible to everybody" to make the post public again.
If you have defined some groups, you can check "show" for groups also. All contact in that group will see the post. If you have defined some groups, you can check "show" for groups also. All contact in that group will see the post.
If you want to hide the post to one contact of a group selected for "show", click "don't show" under contact name. If you want to hide the post to one contact of a group selected for "show", click "don't show" under contact name.
Click again on "show" or "don't show" to switch it off. Click again on "show" or "don't show" to switch it off.
You can search for contacts or groups with the search box. You can search for contacts or groups with the search box.
See also [Group and Privacy](help/Groups-and-Privacy) See also [Group and Privacy](help/Groups-and-Privacy)
WYSIAWYG (What You See Is About What You Get)
--------------------------------------------------
Friendica can use TinyMCE as rich text editor. This way you can write beatifull post without the need to know [BBCode](help/BBCode).
By default, rich editor is disabled. You can enable it from Settings -> [Aditional features](settings/features) page, turn on Richtext Editor and click "Submit".
<figure>
<img src="doc/img/friendica_rich_editor.png" alt="default editor">
<figcaption>Rich editor, with default Friendica theme (duepuntozero)</figcaption>
</figure>

View file

@ -25,6 +25,14 @@ Example: To set the directory value please add this line to your .htconfig.php:
* **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed. * **allowed_link_protocols** (Array) - Allowed protocols in links URLs, add at your own risk. http is always allowed.
* **birthday_input_format** - Default value is "ymd". * **birthday_input_format** - Default value is "ymd".
* **block_local_dir** (Boolean) - Blocks the access to the directory of the local users. * **block_local_dir** (Boolean) - Blocks the access to the directory of the local users.
* **curl_range_bytes** - Maximum number of bytes that should be fetched. Default is 0, which mean "no limit".
* **db_log** - Name of a logfile to log slow database queries
* **db_loglimit** - If a database call lasts longer than this value it is logged
* **db_log_index** - Name of a logfile to log queries with bad indexes
* **db_log_index_watch** - Watchlist of indexes to watch
* **db_loglimit_index** - Number of index rows needed to be logged for indexes on the watchlist
* **db_loglimit_index_high** - Number of index rows to be logged anyway (for any index)
* **db_log_index_blacklist** - Blacklist of indexes that shouldn't be watched
* **dbclean** (Boolean) - Enable the automatic database cleanup process * **dbclean** (Boolean) - Enable the automatic database cleanup process
* **default_service_class** - * **default_service_class** -
* **delivery_batch_count** - Number of deliveries per process. Default value is 1. (Disabled when using the worker) * **delivery_batch_count** - Number of deliveries per process. Default value is 1. (Disabled when using the worker)

View file

@ -66,5 +66,35 @@ If you only want to translate friendica into another language you wont need any
For further information see the utils/README file. For further information see the utils/README file.
[1]: https://www.transifex.com/projects/p/friendica/ Transifex-Client
----------------
Transifex has a client program which let you interact with the translation files in a similar way to git.
Help for the client can be found at the [Transifex Help Center] [2].
Here we will only cover basic usage.
After installation of the client, you should have a `tx` command available on your system.
To use it, first create a configuration file with your credentials.
On Linux this file should be placed into your home directory `~/.transifexrc`.
The content of the file should be something like the following:
[https://www.transifex.com]
username = user
token =
password = p@ssw0rd
hostname = https://www.transifex.com
Since Friendica version 3.5.1 we ship configuration files for the Transifex client in the core repository and the addon repository.
To update the translation files after you have translated strings of e.g. Esperanto in the web-UI of transifex you can use `tx` to download the file.
$> tx pull -l eo
And then use the `po2php` utility described above to convert the `messages.po` file to the `strings.php` file Friendica is loading.
$> php util/po2php.php view/lang/eo/messages.po
Afterwards, just commit the two changed files to a feature branch of your Friendica repository, push the changes to github and open a pull request for your changes.
[1]: https://www.transifex.com/projects/p/friendica/
[2]: https://docs.transifex.com/client/introduction

View file

@ -22,6 +22,8 @@ use dbm;
*/ */
class Config { class Config {
private static $cache;
/** /**
* @brief Loads all configuration values of family into a cached storage. * @brief Loads all configuration values of family into a cached storage.
* *
@ -32,10 +34,17 @@ class Config {
* The category of the configuration value * The category of the configuration value
* @return void * @return void
*/ */
public static function load($family) { public static function load($family = "config") {
// We don't preload "system" anymore.
// This reduces the number of database reads a lot.
if ($family === 'system') {
return;
}
$a = get_app(); $a = get_app();
$r = q("SELECT `v`, `k` FROM `config` WHERE `cat` = '%s' ORDER BY `cat`, `k`, `id`", dbesc($family)); $r = q("SELECT `v`, `k` FROM `config` WHERE `cat` = '%s'", dbesc($family));
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
foreach ($r as $rr) { foreach ($r as $rr) {
$k = $rr['k']; $k = $rr['k'];
@ -43,11 +52,9 @@ class Config {
$a->config[$k] = $rr['v']; $a->config[$k] = $rr['v'];
} else { } else {
$a->config[$family][$k] = $rr['v']; $a->config[$family][$k] = $rr['v'];
self::$cache[$family][$k] = $rr['v'];
} }
} }
} else if ($family != 'config') {
// Negative caching
$a->config[$family] = "!<unset>!";
} }
} }
@ -78,34 +85,38 @@ class Config {
$a = get_app(); $a = get_app();
if (!$refresh) { if (!$refresh) {
// Looking if the whole family isn't set
if (isset($a->config[$family])) {
if ($a->config[$family] === '!<unset>!') {
return $default_value;
}
}
if (isset($a->config[$family][$key])) { // Do we have the cached value? Then return it
if ($a->config[$family][$key] === '!<unset>!') { if (isset(self::$cache[$family][$key])) {
if (self::$cache[$family][$key] === '!<unset>!') {
return $default_value; return $default_value;
} else {
return self::$cache[$family][$key];
} }
return $a->config[$family][$key];
} }
} }
$ret = q("SELECT `v` FROM `config` WHERE `cat` = '%s' AND `k` = '%s' ORDER BY `id` DESC LIMIT 1", $ret = q("SELECT `v` FROM `config` WHERE `cat` = '%s' AND `k` = '%s'",
dbesc($family), dbesc($family),
dbesc($key) dbesc($key)
); );
if (count($ret)) { if (dbm::is_result($ret)) {
// manage array value // manage array value
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); $val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret[0]['v']) ? unserialize($ret[0]['v']) : $ret[0]['v']);
$a->config[$family][$key] = $val;
// Assign the value from the database to the cache
self::$cache[$family][$key] = $val;
return $val; return $val;
} else { } elseif (isset($a->config[$family][$key])) {
$a->config[$family][$key] = '!<unset>!';
// Assign the value (mostly) from the .htconfig.php to the cache
self::$cache[$family][$key] = $a->config[$family][$key];
return $a->config[$family][$key];
} }
self::$cache[$family][$key] = '!<unset>!';
return $default_value; return $default_value;
} }
@ -128,17 +139,28 @@ class Config {
public static function set($family, $key, $value) { public static function set($family, $key, $value) {
$a = get_app(); $a = get_app();
// We store our setting values in a string variable.
// So we have to do the conversion here so that the compare below works.
// The exception are array values.
$dbvalue = (!is_array($value) ? (string)$value : $value);
$stored = self::get($family, $key); $stored = self::get($family, $key);
if ($stored == $value) { if ($stored === $dbvalue) {
return true; return true;
} }
$a->config[$family][$key] = $value; if ($family === 'config') {
$a->config[$key] = $dbvalue;
} elseif ($family != 'system') {
$a->config[$family][$key] = $dbvalue;
}
// Assign the just added value to the cache
self::$cache[$family][$key] = $dbvalue;
// manage array value // manage array value
$dbvalue = (is_array($value) ? serialize($value) : $value); $dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
$dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue);
if (is_null($stored)) { if (is_null($stored)) {
$ret = q("INSERT INTO `config` (`cat`, `k`, `v`) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'", $ret = q("INSERT INTO `config` (`cat`, `k`, `v`) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE `v` = '%s'",
@ -174,9 +196,8 @@ class Config {
*/ */
public static function delete($family, $key) { public static function delete($family, $key) {
$a = get_app(); if (isset(self::$cache[$family][$key])) {
if (x($a->config[$family],$key)) { unset(self::$cache[$family][$key]);
unset($a->config[$family][$key]);
} }
$ret = q("DELETE FROM `config` WHERE `cat` = '%s' AND `k` = '%s'", $ret = q("DELETE FROM `config` WHERE `cat` = '%s' AND `k` = '%s'",
dbesc($family), dbesc($family),
@ -185,5 +206,4 @@ class Config {
return $ret; return $ret;
} }
} }

View file

@ -715,11 +715,19 @@ class Probe {
$photos = $xpath->query("//*[contains(concat(' ', @class, ' '), ' photo ') or contains(concat(' ', @class, ' '), ' avatar ')]", $vcard); // */ $photos = $xpath->query("//*[contains(concat(' ', @class, ' '), ' photo ') or contains(concat(' ', @class, ' '), ' avatar ')]", $vcard); // */
foreach ($photos AS $photo) { foreach ($photos AS $photo) {
$attr = array(); $attr = array();
foreach ($photo->attributes as $attribute) foreach ($photo->attributes as $attribute) {
$attr[$attribute->name] = trim($attribute->value); $attr[$attribute->name] = trim($attribute->value);
}
if (isset($attr["src"]) AND isset($attr["width"])) if (isset($attr["src"]) AND isset($attr["width"])) {
$avatar[$attr["width"]] = $attr["src"]; $avatar[$attr["width"]] = $attr["src"];
}
// We don't have a width. So we just take everything that we got.
// This is a Hubzilla workaround which doesn't send a width.
if ((sizeof($avatar) == 0) AND isset($attr["src"])) {
$avatar[] = $attr["src"];
}
} }
if (sizeof($avatar)) { if (sizeof($avatar)) {

View file

@ -495,6 +495,8 @@ function acl_lookup(App $a, $out_type = 'json') {
if ($type=='' || $type=='g'){ if ($type=='' || $type=='g'){
/// @todo We should cache this query.
// This can be done when we can delete cache entries via wildcard
$r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids $r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids
FROM `group` FROM `group`
INNER JOIN `group_member` ON `group_member`.`gid`=`group`.`id` AND `group_member`.`uid` = `group`.`uid` INNER JOIN `group_member` ON `group_member`.`gid`=`group`.`id` AND `group_member`.`uid` = `group`.`uid`

View file

@ -5,6 +5,9 @@
* *
* @todo Automatically detect if incoming data is HTML or BBCode * @todo Automatically detect if incoming data is HTML or BBCode
*/ */
use \Friendica\Core\Config;
require_once('include/HTTPExceptions.php'); require_once('include/HTTPExceptions.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
@ -2344,6 +2347,9 @@
* dislikes => int count * dislikes => int count
*/ */
function api_format_items_activities(&$item, $type = "json") { function api_format_items_activities(&$item, $type = "json") {
$a = get_app();
$activities = array( $activities = array(
'like' => array(), 'like' => array(),
'dislike' => array(), 'dislike' => array(),
@ -2521,9 +2527,9 @@
// Retweets are only valid for top postings // Retweets are only valid for top postings
// It doesn't work reliable with the link if its a feed // It doesn't work reliable with the link if its a feed
#$IsRetweet = ($item['owner-link'] != $item['author-link']); //$IsRetweet = ($item['owner-link'] != $item['author-link']);
#if ($IsRetweet) //if ($IsRetweet)
# $IsRetweet = (($item['owner-name'] != $item['author-name']) OR ($item['owner-avatar'] != $item['author-avatar'])); // $IsRetweet = (($item['owner-name'] != $item['author-name']) OR ($item['owner-avatar'] != $item['author-avatar']));
if ($item["id"] == $item["parent"]) { if ($item["id"] == $item["parent"]) {
@ -2693,11 +2699,11 @@
$logo = App::get_baseurl() . '/images/friendica-64.png'; $logo = App::get_baseurl() . '/images/friendica-64.png';
$email = $a->config['admin_email']; $email = $a->config['admin_email'];
$closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false'); $closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false');
$private = (($a->config['system']['block_public']) ? 'true' : 'false'); $private = ((Config::get('system', 'block_public')) ? 'true' : 'false');
$textlimit = (string) (($a->config['max_import_size']) ? $a->config['max_import_size'] : 200000); $textlimit = (string) (($a->config['max_import_size']) ? $a->config['max_import_size'] : 200000);
if($a->config['api_import_size']) if($a->config['api_import_size'])
$texlimit = string($a->config['api_import_size']); $texlimit = string($a->config['api_import_size']);
$ssl = (($a->config['system']['have_ssl']) ? 'true' : 'false'); $ssl = ((Config::get('system', 'have_ssl')) ? 'true' : 'false');
$sslserver = (($ssl === 'true') ? str_replace('http:','https:',App::get_baseurl()) : ''); $sslserver = (($ssl === 'true') ? str_replace('http:','https:',App::get_baseurl()) : '');
$config = array( $config = array(

View file

@ -186,7 +186,7 @@ class Cache {
set_config("system", "cache_cleared_half_hour", time()); set_config("system", "cache_cleared_half_hour", time());
} }
if (($max_level <= CACHE_QUARTER_HOUR) AND (get_config("system", "cache_cleared_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) { if (($max_level <= CACHE_QUARTER_HOUR) AND (get_config("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d", q("DELETE FROM `cache` WHERE `updated` < '%s' AND `expire_mode` = %d",
dbesc(datetime_convert('UTC','UTC',"now - 15 minutes")), intval(CACHE_QUARTER_HOUR)); dbesc(datetime_convert('UTC','UTC',"now - 15 minutes")), intval(CACHE_QUARTER_HOUR));

View file

@ -1,5 +1,7 @@
<?php /** @file */ <?php /** @file */
use \Friendica\Core\Config;
require_once('boot.php'); require_once('boot.php');
// Everything we need to boot standalone 'background' processes // Everything we need to boot standalone 'background' processes
@ -8,21 +10,20 @@ function cli_startup() {
global $a, $db; global $a, $db;
if(is_null($a)) { if (is_null($a)) {
$a = new App; $a = new App;
} }
if(is_null($db)) { if (is_null($db)) {
@include(".htconfig.php"); @include(".htconfig.php");
require_once("dba.php"); require_once("dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data); $db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
require_once('include/session.php'); require_once('include/session.php');
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -90,7 +90,7 @@ function networks_widget($baseurl,$selected = '') {
$extra_sql = unavailable_networks(); $extra_sql = unavailable_networks();
$r = q("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = %d AND NOT `self` $extra_sql ORDER BY `network`", $r = q("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = %d AND `network` != '' $extra_sql ORDER BY `network`",
intval(local_user()) intval(local_user())
); );

View file

@ -1170,23 +1170,14 @@ function format_like($cnt,$arr,$type,$id) {
function status_editor($a,$x, $notes_cid = 0, $popup=false) { function status_editor($a,$x, $notes_cid = 0, $popup=false) {
$o = ''; $o = '';
$geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : ''); $geotag = (($x['allow_location']) ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '');
/* $plaintext = false;
if( local_user() && (intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled(local_user(),'richtext')) )
$plaintext = true;*/
$plaintext = true;
if( local_user() && feature_enabled(local_user(),'richtext') )
$plaintext = false;
$tpl = get_markup_template('jot-header.tpl'); $tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array( $a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true', '$newpost' => 'true',
'$baseurl' => App::get_baseurl(true), '$baseurl' => App::get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$geotag' => $geotag, '$geotag' => $geotag,
'$nickname' => $x['nickname'], '$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'), '$ispublic' => t('Visible to <strong>everybody</strong>'),
@ -1199,12 +1190,10 @@ function status_editor($a,$x, $notes_cid = 0, $popup=false) {
'$delitems' => t('Delete item(s)?') '$delitems' => t('Delete item(s)?')
)); ));
$tpl = get_markup_template('jot-end.tpl'); $tpl = get_markup_template('jot-end.tpl');
$a->page['end'] .= replace_macros($tpl, array( $a->page['end'] .= replace_macros($tpl, array(
'$newpost' => 'true', '$newpost' => 'true',
'$baseurl' => App::get_baseurl(true), '$baseurl' => App::get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$geotag' => $geotag, '$geotag' => $geotag,
'$nickname' => $x['nickname'], '$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'), '$ispublic' => t('Visible to <strong>everybody</strong>'),

View file

@ -5,6 +5,9 @@
* *
* This script is started from mod/item.php to save some time when doing a post. * This script is started from mod/item.php to save some time when doing a post.
*/ */
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/threads.php"); require_once("include/threads.php");
@ -21,8 +24,7 @@ function create_shadowentry_run($argv, $argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
if ($argc != 2) { if ($argc != 2) {
return; return;

View file

@ -10,6 +10,8 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
chdir($directory); chdir($directory);
} }
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/photos.php"); require_once("include/photos.php");
require_once("include/user.php"); require_once("include/user.php");
@ -38,8 +40,7 @@ function cron_run(&$argv, &$argc){
require_once('mod/nodeinfo.php'); require_once('mod/nodeinfo.php');
require_once('include/post_update.php'); require_once('include/post_update.php');
load_config('config'); Config::load();
load_config('system');
// Don't check this stuff if the function is called by the poller // Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run") { if (App::callstack() != "poller_run") {
@ -239,11 +240,13 @@ function cron_poll_contacts($argc, $argv) {
: '' : ''
); );
$contacts = q("SELECT `contact`.`id` FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` $contacts = q("SELECT `contact`.`id` FROM `user`
WHERE `rel` IN (%d, %d) AND `poll` != '' AND `network` IN ('%s', '%s', '%s', '%s', '%s', '%s') STRAIGHT_JOIN `contact`
$sql_extra ON `contact`.`uid` = `user`.`uid` AND `contact`.`rel` IN (%d, %d) AND `contact`.`poll` != ''
AND NOT `self` AND NOT `contact`.`blocked` AND NOT `contact`.`readonly` AND NOT `contact`.`archive` AND `contact`.`network` IN ('%s', '%s', '%s', '%s', '%s', '%s') $sql_extra
AND NOT `user`.`account_expired` AND NOT `user`.`account_removed` $abandon_sql ORDER BY RAND()", AND NOT `contact`.`self` AND NOT `contact`.`blocked` AND NOT `contact`.`readonly`
AND NOT `contact`.`archive`
WHERE NOT `user`.`account_expired` AND NOT `user`.`account_removed` $abandon_sql ORDER BY RAND()",
intval(CONTACT_IS_SHARING), intval(CONTACT_IS_SHARING),
intval(CONTACT_IS_FRIEND), intval(CONTACT_IS_FRIEND),
dbesc(NETWORK_DFRN), dbesc(NETWORK_DFRN),
@ -264,8 +267,9 @@ function cron_poll_contacts($argc, $argv) {
intval($c['id']) intval($c['id'])
); );
if (dbm::is_result($res)) if (!dbm::is_result($res)) {
continue; continue;
}
foreach($res as $contact) { foreach($res as $contact) {

View file

@ -1,7 +1,8 @@
<?php <?php
require_once("boot.php"); use \Friendica\Core\Config;
require_once("boot.php");
function cronhooks_run(&$argv, &$argc){ function cronhooks_run(&$argv, &$argc){
global $a, $db; global $a, $db;
@ -20,8 +21,7 @@ function cronhooks_run(&$argv, &$argc){
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
load_config('config'); Config::load();
load_config('system');
// Don't check this stuff if the function is called by the poller // Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run") { if (App::callstack() != "poller_run") {

View file

@ -1,4 +1,6 @@
<?php <?php
use \Friendica\Core\Config;
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) { if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]); $directory = dirname($_SERVER["argv"][0]);
@ -33,8 +35,7 @@ function cronjobs_run(&$argv, &$argc){
require_once('include/post_update.php'); require_once('include/post_update.php');
require_once('mod/nodeinfo.php'); require_once('mod/nodeinfo.php');
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -4,6 +4,7 @@
* @brief Some functions for date and time related tasks. * @brief Some functions for date and time related tasks.
*/ */
use \Friendica\Core\Config;
/** /**
* @brief Two-level sort for timezones. * @brief Two-level sort for timezones.
@ -271,8 +272,9 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke
$lang = substr(get_browser_language(), 0, 2); $lang = substr(get_browser_language(), 0, 2);
// Check if the detected language is supported by the picker // Check if the detected language is supported by the picker
if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) {
$lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en'); $lang = Config::get('system', 'language', 'en');
}
$o = ''; $o = '';
$dateformat = ''; $dateformat = '';

View file

@ -138,6 +138,62 @@ class dba {
return $return; return $return;
} }
/**
* @brief Analyze a database query and log this if some conditions are met.
*
* @param string $query The database query that will be analyzed
*/
public function log_index($query) {
$a = get_app();
if ($a->config["system"]["db_log_index"] == "") {
return;
}
// Don't explain an explain statement
if (strtolower(substr($query, 0, 7)) == "explain") {
return;
}
// Only do the explain on "select", "update" and "delete"
if (!in_array(strtolower(substr($query, 0, 6)), array("select", "update", "delete"))) {
return;
}
$r = $this->q("EXPLAIN ".$query);
if (!dbm::is_result($r)) {
return;
}
$watchlist = explode(',', $a->config["system"]["db_log_index_watch"]);
$blacklist = explode(',', $a->config["system"]["db_log_index_blacklist"]);
foreach ($r AS $row) {
if ((intval($a->config["system"]["db_loglimit_index"]) > 0)) {
$log = (in_array($row['key'], $watchlist) AND
($row['rows'] >= intval($a->config["system"]["db_loglimit_index"])));
} else
$log = false;
if ((intval($a->config["system"]["db_loglimit_index_high"]) > 0) AND ($row['rows'] >= intval($a->config["system"]["db_loglimit_index_high"]))) {
$log = true;
}
if (in_array($row['key'], $blacklist) OR ($row['key'] == "")) {
$log = false;
}
if ($log) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
@file_put_contents($a->config["system"]["db_log_index"], datetime_convert()."\t".
$row['key']."\t".$row['rows']."\t".$row['Extra']."\t".
basename($backtrace[1]["file"])."\t".
$backtrace[1]["line"]."\t".$backtrace[2]["function"]."\t".
substr($query, 0, 2000)."\n", FILE_APPEND);
}
}
}
public function q($sql, $onlyquery = false) { public function q($sql, $onlyquery = false) {
$a = get_app(); $a = get_app();
@ -375,6 +431,9 @@ function q($sql) {
//logger("dba: q: $stmt", LOGGER_ALL); //logger("dba: q: $stmt", LOGGER_ALL);
if ($stmt === false) if ($stmt === false)
logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG); logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG);
$db->log_index($stmt);
return $db->q($stmt); return $db->q($stmt);
} }
@ -408,6 +467,9 @@ function qu($sql) {
$stmt = @vsprintf($sql,$args); // Disabled warnings $stmt = @vsprintf($sql,$args); // Disabled warnings
if ($stmt === false) if ($stmt === false)
logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG); logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG);
$db->log_index($stmt);
$db->q("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;"); $db->q("SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;");
$retval = $db->q($stmt); $retval = $db->q($stmt);
$db->q("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;"); $db->q("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;");

View file

@ -23,8 +23,7 @@ function dbclean_run(&$argv, &$argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
Config::load('config'); Config::load();
Config::load('system');
if (!Config::get('system', 'dbclean', false)) { if (!Config::get('system', 'dbclean', false)) {
return; return;

View file

@ -176,15 +176,6 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
$definition = db_definition($charset); $definition = db_definition($charset);
} }
// Ensure index conversion to unique removes duplicates
$sql_config = "SET session old_alter_table=1;";
if ($verbose) {
echo $sql_config."\n";
}
if ($action) {
$db->q($sql_config);
}
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements // MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
if ((version_compare($db->server_info(), '5.7.4') >= 0) AND if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
!(strpos($db->server_info(), 'MariaDB') !== false)) { !(strpos($db->server_info(), 'MariaDB') !== false)) {
@ -204,6 +195,27 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
} }
$is_new_table = True; $is_new_table = True;
} else { } else {
$is_unique = false;
$temp_name = $name;
foreach ($structure["indexes"] AS $indexname => $fieldnames) {
if (isset($database[$name]["indexes"][$indexname])) {
$current_index_definition = implode(",",$database[$name]["indexes"][$indexname]);
} else {
$current_index_definition = "__NOT_SET__";
}
$new_index_definition = implode(",",$fieldnames);
if ($current_index_definition != $new_index_definition) {
if ($fieldnames[0] == "UNIQUE") {
$is_unique = true;
// Deactivated. See below for the reason
//if ($ignore == "") {
// $temp_name = "temp-".$name;
//}
}
}
}
/* /*
* Drop the index if it isn't present in the definition * Drop the index if it isn't present in the definition
* or the definition differ from current status * or the definition differ from current status
@ -219,7 +231,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($current_index_definition != $new_index_definition && substr($indexname, 0, 6) != 'local_') { if ($current_index_definition != $new_index_definition && substr($indexname, 0, 6) != 'local_') {
$sql2=db_drop_index($indexname); $sql2=db_drop_index($indexname);
if ($sql3 == "") { if ($sql3 == "") {
$sql3 = "ALTER".$ignore." TABLE `".$name."` ".$sql2; $sql3 = "ALTER".$ignore." TABLE `".$temp_name."` ".$sql2;
} else { } else {
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -230,7 +242,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if (!isset($database[$name]["fields"][$fieldname])) { if (!isset($database[$name]["fields"][$fieldname])) {
$sql2=db_add_table_field($fieldname, $parameters); $sql2=db_add_table_field($fieldname, $parameters);
if ($sql3 == "") { if ($sql3 == "") {
$sql3 = "ALTER TABLE `".$name."` ".$sql2; $sql3 = "ALTER TABLE `".$temp_name."` ".$sql2;
} else { } else {
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -241,7 +253,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($current_field_definition != $new_field_definition) { if ($current_field_definition != $new_field_definition) {
$sql2=db_modify_table_field($fieldname, $parameters); $sql2=db_modify_table_field($fieldname, $parameters);
if ($sql3 == "") { if ($sql3 == "") {
$sql3 = "ALTER TABLE `".$name."` ".$sql2; $sql3 = "ALTER TABLE `".$temp_name."` ".$sql2;
} else { } else {
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -268,7 +280,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
$sql2=db_create_index($indexname, $fieldnames); $sql2=db_create_index($indexname, $fieldnames);
if ($sql2 != "") { if ($sql2 != "") {
if ($sql3 == "") if ($sql3 == "")
$sql3 = "ALTER" . $ignore . " TABLE `".$name."` ".$sql2; $sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
else else
$sql3 .= ", ".$sql2; $sql3 .= ", ".$sql2;
} }
@ -278,13 +290,77 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
if ($sql3 != "") { if ($sql3 != "") {
$sql3 .= ";"; $sql3 .= ";";
if ($verbose) if ($verbose) {
// Ensure index conversion to unique removes duplicates
if ($is_unique) {
// By now the alternative is commented out.
// This is a preparation for the time when we found a good SQL routine.
//if ($ignore != "") {
echo "SET session old_alter_table=1;\n";
//} else {
// echo "CREATE TABLE `".$temp_name."` LIKE `".$name."`;\n";
//}
}
echo $sql3."\n"; echo $sql3."\n";
if ($is_unique) {
// By now the alternative is commented out.
// This is a preparation for the time when we found a good SQL routine.
//if ($ignore != "") {
echo "SET session old_alter_table=0;\n";
//} else {
// echo "INSERT IGNORE INTO `".$temp_name."` SELECT * FROM `".$name."`;\n";
// echo "DROP TABLE `".$name."`;\n";
// echo "RENAME TABLE `".$temp_name."` TO `".$name."`;\n";
//}
}
}
if ($action) { if ($action) {
// Ensure index conversion to unique removes duplicates
if ($is_unique) {
// By now the alternative is commented out.
// This is a preparation for the time when we found a good SQL routine.
//if ($ignore != "") {
$db->q("SET session old_alter_table=1;");
//} else {
// $r = $db->q("CREATE TABLE `".$temp_name."` LIKE `".$name."`;");
// if (!dbm::is_result($r)) {
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
// return $errors;
// }
//}
}
$r = @$db->q($sql3); $r = @$db->q($sql3);
if (dbm::is_result($r)) if (!dbm::is_result($r))
$errors .= t('Errors encountered performing database changes.').$sql3.EOL; $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
if ($is_unique) {
// By now the alternative is commented out.
// This is a preparation for the time when we found a good SQL routine.
//if ($ignore != "") {
$db->q("SET session old_alter_table=0;");
//} else {
// We have to check if "INSERT IGNORE" will work on newer MySQL versions
// $r = $db->q("INSERT IGNORE INTO `".$temp_name."` SELECT * FROM `".$name."`;");
// if (!dbm::is_result($r)) {
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
// return $errors;
// }
// $r = $db->q("DROP TABLE `".$name."`;");
// if (!dbm::is_result($r)) {
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
// return $errors;
// }
// $r = $db->q("RENAME TABLE `".$temp_name."` TO `".$name."`;");
// if (!dbm::is_result($r)) {
// $errors .= t('Errors encountered performing database changes.').$sql3.EOL;
// return $errors;
// }
//}
}
} }
} }
} }
@ -419,7 +495,7 @@ function db_definition($charset) {
$database["addon"] = array( $database["addon"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "name" => array("type" => "varchar(190)", "not null" => "1", "default" => ""),
"version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
@ -428,6 +504,7 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"name" => array("UNIQUE", "name"),
) )
); );
$database["attach"] = array( $database["attach"] = array(
@ -465,13 +542,12 @@ function db_definition($charset) {
$database["cache"] = array( $database["cache"] = array(
"fields" => array( "fields" => array(
"k" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"), "k" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"),
"v" => array("type" => "text"), "v" => array("type" => "mediumtext"),
"expire_mode" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "expire_mode" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("k"), "PRIMARY" => array("k"),
"updated" => array("updated"),
"expire_mode_updated" => array("expire_mode", "updated"), "expire_mode_updated" => array("expire_mode", "updated"),
) )
); );
@ -506,7 +582,7 @@ function db_definition($charset) {
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""), "cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""),
"k" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""), "k" => array("type" => "varbinary(255)", "not null" => "1", "default" => ""),
"v" => array("type" => "text"), "v" => array("type" => "mediumtext"),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -582,32 +658,34 @@ function db_definition($charset) {
"bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"), "bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"),
"notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"ffi_keyword_blacklist" => array("type" => "mediumtext"), "ffi_keyword_blacklist" => array("type" => "text"),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid_name" => array("uid", "name"), "uid_name" => array("uid", "name"),
"uid_self" => array("uid", "self"), "self_uid" => array("self", "uid"),
"alias_uid" => array("alias(32)", "uid"), "alias_uid" => array("alias(32)", "uid"),
"uid_pending" => array("uid", "pending"), "pending_uid" => array("pending", "uid"),
"uid_blocked" => array("uid", "blocked"), "blocked_uid" => array("blocked", "uid"),
"uid_rel_network_poll" => array("uid", "rel", "network", "poll(64)", "archive"), "uid_rel_network_poll" => array("uid", "rel", "network", "poll(64)", "archive"),
"uid_network_batch" => array("uid", "network", "batch(64)"), "uid_network_batch" => array("uid", "network", "batch(64)"),
"addr_uid" => array("addr(32)", "uid"), "addr_uid" => array("addr(32)", "uid"),
"nurl_uid" => array("nurl(32)", "uid"), "nurl_uid" => array("nurl(32)", "uid"),
"nick_uid" => array("nick(32)", "uid"), "nick_uid" => array("nick(32)", "uid"),
"dfrn-id" => array("dfrn-id"),
"issued-id" => array("issued-id"),
) )
); );
$database["conv"] = array( $database["conv"] = array(
"fields" => array( "fields" => array(
"id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""),
"recips" => array("type" => "mediumtext"), "recips" => array("type" => "text"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"subject" => array("type" => "mediumtext"), "subject" => array("type" => "text"),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -677,6 +755,7 @@ function db_definition($charset) {
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"addr" => array("addr(32)"), "addr" => array("addr(32)"),
"url" => array("url"),
) )
); );
$database["ffinder"] = array( $database["ffinder"] = array(
@ -761,10 +840,11 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"nurl" => array("nurl(32)"), "nurl" => array("nurl(64)"),
"name" => array("name(32)"), "name" => array("name(64)"),
"nick" => array("nick(32)"), "nick" => array("nick(32)"),
"addr" => array("addr(32)"), "addr" => array("addr(64)"),
"hide_network_updated" => array("hide", "network", "updated"),
"updated" => array("updated"), "updated" => array("updated"),
) )
); );
@ -781,7 +861,6 @@ function db_definition($charset) {
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"cid_uid_gcid_zcid" => array("UNIQUE", "cid","uid","gcid","zcid"), "cid_uid_gcid_zcid" => array("UNIQUE", "cid","uid","gcid","zcid"),
"gcid" => array("gcid"), "gcid" => array("gcid"),
"zcid" => array("zcid"),
) )
); );
$database["group"] = array( $database["group"] = array(
@ -806,8 +885,8 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"contactid" => array("contact-id"),
"gid_contactid" => array("gid", "contact-id"), "gid_contactid" => array("gid", "contact-id"),
"uid_contactid" => array("uid", "contact-id"),
"uid_gid_contactid" => array("UNIQUE", "uid", "gid", "contact-id"), "uid_gid_contactid" => array("UNIQUE", "uid", "gid", "contact-id"),
) )
); );
@ -844,7 +923,7 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"hook_file_function" => array("hook(30)","file(60)","function(30)"), "hook_file_function" => array("UNIQUE", "hook(50)","file(80)","function(60)"),
) )
); );
$database["intro"] = array( $database["intro"] = array(
@ -944,19 +1023,14 @@ function db_definition($charset) {
"uid_created" => array("uid","created"), "uid_created" => array("uid","created"),
"uid_unseen_contactid" => array("uid","unseen","contact-id"), "uid_unseen_contactid" => array("uid","unseen","contact-id"),
"uid_network_received" => array("uid","network","received"), "uid_network_received" => array("uid","network","received"),
"uid_received" => array("uid","received"),
"uid_network_commented" => array("uid","network","commented"), "uid_network_commented" => array("uid","network","commented"),
"uid_title" => array("uid","title"),
"uid_thrparent" => array("uid","thr-parent"), "uid_thrparent" => array("uid","thr-parent"),
"uid_parenturi" => array("uid","parent-uri"), "uid_parenturi" => array("uid","parent-uri"),
"uid_contactid_id" => array("uid","contact-id","id"),
"uid_contactid_created" => array("uid","contact-id","created"), "uid_contactid_created" => array("uid","contact-id","created"),
"authorid_created" => array("author-id","created"), "authorid_created" => array("author-id","created"),
"uid_uri" => array("uid", "uri"), "uid_uri" => array("uid", "uri"),
"uid_wall_created" => array("uid","wall","created"),
"resource-id" => array("resource-id"), "resource-id" => array("resource-id"),
"uid_type" => array("uid","type"), "contactid_allowcid_allowpid_denycid_denygid" => array("contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"), //
"contactid_allowcid_allowpid_denycid_denygid" => array("contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"),
"uid_type_changed" => array("uid","type","changed"), "uid_type_changed" => array("uid","type","changed"),
"contactid_verb" => array("contact-id","verb"), "contactid_verb" => array("contact-id","verb"),
"deleted_changed" => array("deleted","changed"), "deleted_changed" => array("deleted","changed"),
@ -1015,7 +1089,6 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid" => array("uid"),
"uid_seen" => array("uid", "seen"), "uid_seen" => array("uid", "seen"),
"convid" => array("convid"), "convid" => array("convid"),
"uri" => array("uri(64)"), "uri" => array("uri(64)"),
@ -1050,7 +1123,7 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid_mid" => array("uid","mid"), "uid_mid" => array("UNIQUE", "uid","mid"),
) )
); );
$database["notify"] = array( $database["notify"] = array(
@ -1075,11 +1148,10 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid_hash" => array("uid", "hash"), "hash_uid" => array("hash", "uid"),
"uid_seen_date" => array("uid", "seen", "date"), "seen_uid_date" => array("seen", "uid", "date"),
"uid_type_link" => array("uid", "type", "link"),
"uid_link" => array("uid", "link"),
"uid_date" => array("uid", "date"), "uid_date" => array("uid", "date"),
"uid_type_link" => array("uid", "type", "link"),
) )
); );
$database["notify-threads"] = array( $database["notify-threads"] = array(
@ -1092,13 +1164,12 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"master-parent-item" => array("master-parent-item"),
) )
); );
$database["oembed"] = array( $database["oembed"] = array(
"fields" => array( "fields" => array(
"url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"), "url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"),
"content" => array("type" => "text"), "content" => array("type" => "mediumtext"),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
), ),
"indexes" => array( "indexes" => array(
@ -1111,7 +1182,7 @@ function db_definition($charset) {
"url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"), "url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1"),
"guessing" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"), "guessing" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
"oembed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"), "oembed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0", "primary" => "1"),
"content" => array("type" => "text"), "content" => array("type" => "mediumtext"),
"created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
), ),
"indexes" => array( "indexes" => array(
@ -1161,7 +1232,7 @@ function db_definition($charset) {
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid_contactid" => array("uid", "contact-id"), "uid_contactid" => array("uid", "contact-id"),
"uid_profile" => array("uid", "profile"), "uid_profile" => array("uid", "profile"),
"uid_album_created" => array("uid", "album(32)", "created"), "uid_album_scale_created" => array("uid", "album(32)", "scale", "created"),
"uid_album_resource-id_created" => array("uid", "album(32)", "resource-id(64)", "created"), "uid_album_resource-id_created" => array("uid", "album(32)", "resource-id(64)", "created"),
"resource-id" => array("resource-id(64)"), "resource-id" => array("resource-id(64)"),
) )
@ -1170,16 +1241,16 @@ function db_definition($charset) {
"fields" => array( "fields" => array(
"id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"),
"uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"q0" => array("type" => "mediumtext"), "q0" => array("type" => "text"),
"q1" => array("type" => "mediumtext"), "q1" => array("type" => "text"),
"q2" => array("type" => "mediumtext"), "q2" => array("type" => "text"),
"q3" => array("type" => "mediumtext"), "q3" => array("type" => "text"),
"q4" => array("type" => "mediumtext"), "q4" => array("type" => "text"),
"q5" => array("type" => "mediumtext"), "q5" => array("type" => "text"),
"q6" => array("type" => "mediumtext"), "q6" => array("type" => "text"),
"q7" => array("type" => "mediumtext"), "q7" => array("type" => "text"),
"q8" => array("type" => "mediumtext"), "q8" => array("type" => "text"),
"q9" => array("type" => "mediumtext"), "q9" => array("type" => "text"),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
@ -1256,6 +1327,7 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"uid_is-default" => array("uid", "is-default"),
) )
); );
$database["profile_check"] = array( $database["profile_check"] = array(
@ -1391,8 +1463,6 @@ function db_definition($charset) {
"indexes" => array( "indexes" => array(
"PRIMARY" => array("tid"), "PRIMARY" => array("tid"),
"oid_otype_type_term" => array("oid","otype","type","term"), "oid_otype_type_term" => array("oid","otype","type","term"),
"uid_term_tid" => array("uid","term(32)","tid"),
"type_term" => array("type","term(32)"),
"uid_otype_type_term_global_created" => array("uid","otype","type","term(32)","global","created"), "uid_otype_type_term_global_created" => array("uid","otype","type","term(32)","global","created"),
"uid_otype_type_url" => array("uid","otype","type","url(64)"), "uid_otype_type_url" => array("uid","otype","type","url(64)"),
"guid" => array("guid(64)"), "guid" => array("guid(64)"),
@ -1429,8 +1499,6 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("iid"), "PRIMARY" => array("iid"),
"created" => array("created"),
"commented" => array("commented"),
"uid_network_commented" => array("uid","network","commented"), "uid_network_commented" => array("uid","network","commented"),
"uid_network_created" => array("uid","network","created"), "uid_network_created" => array("uid","network","created"),
"uid_contactid_commented" => array("uid","contact-id","commented"), "uid_contactid_commented" => array("uid","contact-id","commented"),
@ -1524,7 +1592,6 @@ function db_definition($charset) {
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("id"), "PRIMARY" => array("id"),
"created" => array("created"),
) )
); );

View file

@ -1,5 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
function dbupdate_run(&$argv, &$argc) { function dbupdate_run(&$argv, &$argc) {
@ -16,8 +18,7 @@ function dbupdate_run(&$argv, &$argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
update_db($a); update_db($a);
} }

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
require_once('include/html2plain.php'); require_once('include/html2plain.php');
@ -10,7 +13,7 @@ require_once("include/dfrn.php");
function delivery_run(&$argv, &$argc){ function delivery_run(&$argv, &$argc){
global $a, $db; global $a, $db;
if (is_null($a)){ if (is_null($a)) {
$a = new App; $a = new App;
} }
@ -27,13 +30,13 @@ function delivery_run(&$argv, &$argc){
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once('include/email.php'); require_once('include/email.php');
load_config('config'); Config::load();
load_config('system');
load_hooks(); load_hooks();
if ($argc < 3) if ($argc < 3) {
return; return;
}
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));
@ -42,10 +45,11 @@ function delivery_run(&$argv, &$argc){
$cmd = $argv[1]; $cmd = $argv[1];
$item_id = intval($argv[2]); $item_id = intval($argv[2]);
for($x = 3; $x < $argc; $x ++) { for ($x = 3; $x < $argc; $x ++) {
$contact_id = intval($argv[$x]); $contact_id = intval($argv[$x]);
/// @todo When switching completely to the worker we won't need this anymore
// Some other process may have delivered this item already. // Some other process may have delivered this item already.
$r = q("SELECT * FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d LIMIT 1", $r = q("SELECT * FROM `deliverq` WHERE `cmd` = '%s' AND `item` = %d AND `contact` = %d LIMIT 1",
@ -57,8 +61,9 @@ function delivery_run(&$argv, &$argc){
continue; continue;
} }
if ($a->maxload_reached()) if ($a->maxload_reached()) {
return; return;
}
// It's ours to deliver. Remove it from the queue. // It's ours to deliver. Remove it from the queue.
@ -68,8 +73,9 @@ function delivery_run(&$argv, &$argc){
dbesc($contact_id) dbesc($contact_id)
); );
if (!$item_id || !$contact_id) if (!$item_id || !$contact_id) {
continue; continue;
}
$expire = false; $expire = false;
$mail = false; $mail = false;
@ -90,14 +96,13 @@ function delivery_run(&$argv, &$argc){
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1", $message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
intval($item_id) intval($item_id)
); );
if (!count($message)){ if (!count($message)) {
return; return;
} }
$uid = $message[0]['uid']; $uid = $message[0]['uid'];
$recipients[] = $message[0]['contact-id']; $recipients[] = $message[0]['contact-id'];
$item = $message[0]; $item = $message[0];
} } elseif ($cmd === 'expire') {
elseif ($cmd === 'expire') {
$normal_mode = false; $normal_mode = false;
$expire = true; $expire = true;
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
@ -106,18 +111,19 @@ function delivery_run(&$argv, &$argc){
); );
$uid = $item_id; $uid = $item_id;
$item_id = 0; $item_id = 0;
if (!count($items)) if (!count($items)) {
continue; continue;
} }
elseif ($cmd === 'suggest') { } elseif ($cmd === 'suggest') {
$normal_mode = false; $normal_mode = false;
$fsuggest = true; $fsuggest = true;
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1", $suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
intval($item_id) intval($item_id)
); );
if (!count($suggest)) if (!count($suggest)) {
return; return;
}
$uid = $suggest[0]['uid']; $uid = $suggest[0]['uid'];
$recipients[] = $suggest[0]['cid']; $recipients[] = $suggest[0]['cid'];
$item = $suggest[0]; $item = $suggest[0];
@ -151,26 +157,33 @@ function delivery_run(&$argv, &$argc){
$icontacts = null; $icontacts = null;
$contacts_arr = array(); $contacts_arr = array();
foreach($items as $item) foreach ($items as $item) {
if (!in_array($item['contact-id'],$contacts_arr)) if (!in_array($item['contact-id'],$contacts_arr)) {
$contacts_arr[] = intval($item['contact-id']); $contacts_arr[] = intval($item['contact-id']);
}
}
if (count($contacts_arr)) { if (count($contacts_arr)) {
$str_contacts = implode(',',$contacts_arr); $str_contacts = implode(',',$contacts_arr);
$icontacts = q("SELECT * FROM `contact` $icontacts = q("SELECT * FROM `contact`
WHERE `id` IN ( $str_contacts ) " WHERE `id` IN ( $str_contacts ) "
); );
} }
if ( !($icontacts && count($icontacts))) if ( !($icontacts && count($icontacts))) {
continue; continue;
}
// avoid race condition with deleting entries // avoid race condition with deleting entries
if ($items[0]['deleted']) { if ($items[0]['deleted']) {
foreach($items as $item) foreach ($items as $item) {
$item['deleted'] = 1; $item['deleted'] = 1;
}
} }
if ((count($items) == 1) && ($items[0]['uri'] === $items[0]['parent-uri'])) { // When commenting too fast after delivery, a post wasn't recognized as top level post.
// The count then showed more than one entry. The additional check should help.
// The check for the "count" should be superfluous, but I'm not totally sure by now, so we keep it.
if ((($items[0]['id'] == $item_id) || (count($items) == 1)) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
logger('delivery: top level post'); logger('delivery: top level post');
$top_level = true; $top_level = true;
} }
@ -184,8 +197,9 @@ function delivery_run(&$argv, &$argc){
intval($uid) intval($uid)
); );
if (!dbm::is_result($r)) if (!dbm::is_result($r)) {
continue; continue;
}
$owner = $r[0]; $owner = $r[0];
@ -217,9 +231,9 @@ function delivery_run(&$argv, &$argc){
$localhost = $a->get_hostname(); $localhost = $a->get_hostname();
if (strpos($localhost,':')) if (strpos($localhost,':')) {
$localhost = substr($localhost,0,strpos($localhost,':')); $localhost = substr($localhost,0,strpos($localhost,':'));
}
/** /**
* *
* Be VERY CAREFUL if you make any changes to the following line. Seemingly innocuous changes * Be VERY CAREFUL if you make any changes to the following line. Seemingly innocuous changes
@ -254,12 +268,12 @@ function delivery_run(&$argv, &$argc){
intval($contact_id) intval($contact_id)
); );
if (dbm::is_result($r)) if (dbm::is_result($r)) {
$contact = $r[0]; $contact = $r[0];
}
if ($contact['self']) if ($contact['self']) {
continue; continue;
}
$deliver_status = 0; $deliver_status = 0;
logger("main delivery by delivery: followup=$followup mail=$mail fsuggest=$fsuggest relocate=$relocate - network ".$contact['network']); logger("main delivery by delivery: followup=$followup mail=$mail fsuggest=$fsuggest relocate=$relocate - network ".$contact['network']);
@ -275,13 +289,14 @@ function delivery_run(&$argv, &$argc){
} elseif ($fsuggest) { } elseif ($fsuggest) {
$atom = dfrn::fsuggest($item, $owner); $atom = dfrn::fsuggest($item, $owner);
q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id'])); q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id']));
} elseif ($relocate) } elseif ($relocate) {
$atom = dfrn::relocate($owner, $uid); $atom = dfrn::relocate($owner, $uid);
elseif ($followup) { } elseif ($followup) {
$msgitems = array(); $msgitems = array();
foreach($items as $item) { // there is only one item foreach ($items as $item) { // there is only one item
if (!$item['parent']) if (!$item['parent']) {
continue; continue;
}
if ($item['id'] == $item_id) { if ($item['id'] == $item_id) {
logger('followup: item: '. print_r($item,true), LOGGER_DATA); logger('followup: item: '. print_r($item,true), LOGGER_DATA);
$msgitems[] = $item; $msgitems[] = $item;
@ -290,17 +305,20 @@ function delivery_run(&$argv, &$argc){
$atom = dfrn::entries($msgitems,$owner); $atom = dfrn::entries($msgitems,$owner);
} else { } else {
$msgitems = array(); $msgitems = array();
foreach($items as $item) { foreach ($items as $item) {
if (!$item['parent']) if (!$item['parent']) {
continue; continue;
}
// private emails may be in included in public conversations. Filter them. // private emails may be in included in public conversations. Filter them.
if ($public_message && $item['private']) if ($public_message && $item['private']) {
continue; continue;
}
$item_contact = get_item_contact($item,$icontacts); $item_contact = get_item_contact($item,$icontacts);
if (!$item_contact) if (!$item_contact) {
continue; continue;
}
if ($normal_mode) { if ($normal_mode) {
if ($item_id == $item['id'] || $item['id'] == $item['parent']) { if ($item_id == $item['id'] || $item['id'] == $item['parent']) {
@ -326,10 +344,11 @@ function delivery_run(&$argv, &$argc){
if (link_compare($basepath,App::get_baseurl())) { if (link_compare($basepath,App::get_baseurl())) {
$nickname = basename($contact['url']); $nickname = basename($contact['url']);
if ($contact['issued-id']) if ($contact['issued-id']) {
$sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($contact['issued-id'])); $sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($contact['issued-id']));
else } else {
$sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($contact['dfrn-id'])); $sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($contact['dfrn-id']));
}
$x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`, $x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
`contact`.`pubkey` AS `cpubkey`, `contact`.`pubkey` AS `cpubkey`,
@ -362,19 +381,20 @@ function delivery_run(&$argv, &$argc){
// If we are setup as a soapbox we aren't accepting top level posts from this person // If we are setup as a soapbox we aren't accepting top level posts from this person
if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) if (($x[0]['page-flags'] == PAGE_SOAPBOX) AND $top_level) {
break; break;
}
logger('mod-delivery: local delivery'); logger('mod-delivery: local delivery');
dfrn::import($atom, $x[0]); dfrn::import($atom, $x[0]);
break; break;
} }
} }
if (!was_recently_delayed($contact['id'])) if (!was_recently_delayed($contact['id'])) {
$deliver_status = dfrn::deliver($owner,$contact,$atom); $deliver_status = dfrn::deliver($owner,$contact,$atom);
else } else {
$deliver_status = (-1); $deliver_status = (-1);
}
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status); logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
@ -393,10 +413,12 @@ function delivery_run(&$argv, &$argc){
case NETWORK_OSTATUS: case NETWORK_OSTATUS:
// Do not send to otatus if we are not configured to send to public networks // Do not send to otatus if we are not configured to send to public networks
if ($owner['prvnets']) if ($owner['prvnets']) {
break; break;
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) }
if (get_config('system','ostatus_disabled') || get_config('system','dfrn_only')) {
break; break;
}
// There is currently no code here to distribute anything to OStatus. // There is currently no code here to distribute anything to OStatus.
// This is done in "notifier.php" (See "url_recipients" and "push_notify") // This is done in "notifier.php" (See "url_recipients" and "push_notify")
@ -405,20 +427,22 @@ function delivery_run(&$argv, &$argc){
case NETWORK_MAIL: case NETWORK_MAIL:
case NETWORK_MAIL2: case NETWORK_MAIL2:
if (get_config('system','dfrn_only')) if (get_config('system','dfrn_only')) {
break; break;
}
// WARNING: does not currently convert to RFC2047 header encodings, etc. // WARNING: does not currently convert to RFC2047 header encodings, etc.
$addr = $contact['addr']; $addr = $contact['addr'];
if (!strlen($addr)) if (!strlen($addr)) {
break; break;
}
if ($cmd === 'wall-new' || $cmd === 'comment-new') { if ($cmd === 'wall-new' || $cmd === 'comment-new') {
$it = null; $it = null;
if ($cmd === 'wall-new') if ($cmd === 'wall-new') {
$it = $items[0]; $it = $items[0];
else { } else {
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($argv[2]), intval($argv[2]),
intval($uid) intval($uid)
@ -451,10 +475,12 @@ function delivery_run(&$argv, &$argc){
if ($reply_to) { if ($reply_to) {
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$reply_to.'>'."\n"; $headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$reply_to.'>'."\n";
$headers .= 'Sender: '.$local_user[0]['email']."\n"; $headers .= 'Sender: '.$local_user[0]['email']."\n";
} else } else {
$headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n"; $headers = 'From: '.email_header_encode($local_user[0]['username'],'UTF-8').' <'.$local_user[0]['email'].'>'."\n";
} else }
} else {
$headers = 'From: '. email_header_encode($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n"; $headers = 'From: '. email_header_encode($local_user[0]['username'],'UTF-8') .' <'. t('noreply') .'@'.$a->get_hostname() .'>'. "\n";
}
//if ($reply_to) //if ($reply_to)
// $headers .= 'Reply-to: '.$reply_to . "\n"; // $headers .= 'Reply-to: '.$reply_to . "\n";
@ -478,9 +504,9 @@ function delivery_run(&$argv, &$argc){
dbesc($it['parent-uri']), dbesc($it['parent-uri']),
intval($uid)); intval($uid));
if (dbm::is_result($r) AND ($r[0]['title'] != '')) if (dbm::is_result($r) AND ($r[0]['title'] != '')) {
$subject = $r[0]['title']; $subject = $r[0]['title'];
else { } else {
$r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1", $r = q("SELECT `title` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($it['parent-uri']), dbesc($it['parent-uri']),
intval($uid)); intval($uid));

View file

@ -194,7 +194,7 @@ class dfrn {
`contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`, `contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`,
`contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`sign`.`signed_text`, `sign`.`signature`, `sign`.`signer` `sign`.`signed_text`, `sign`.`signature`, `sign`.`signer`
FROM `item` USE INDEX (`uid_wall_changed`, `uid_type_changed`) $sql_post_table FROM `item` USE INDEX (`uid_wall_changed`) $sql_post_table
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id`

View file

@ -45,13 +45,13 @@ class Diaspora {
foreach($servers AS $server) { foreach($servers AS $server) {
$server = trim($server); $server = trim($server);
$addr = "relay@".str_replace("http://", "", normalise_link($server));
$batch = $server."/receive/public"; $batch = $server."/receive/public";
$relais = q("SELECT `batch`, `id`, `name`,`network` FROM `contact` WHERE `uid` = 0 AND `batch` = '%s' LIMIT 1", dbesc($batch)); $relais = q("SELECT `batch`, `id`, `name`,`network` FROM `contact` WHERE `uid` = 0 AND `batch` = '%s' AND `addr` = '%s' AND `nurl` = '%s' LIMIT 1",
dbesc($batch), dbesc($addr), dbesc(normalise_link($server)));
if (!$relais) { if (!$relais) {
$addr = "relay@".str_replace("http://", "", normalise_link($server));
$r = q("INSERT INTO `contact` (`uid`, `created`, `name`, `nick`, `addr`, `url`, `nurl`, `batch`, `network`, `rel`, `blocked`, `pending`, `writable`, `name-date`, `uri-date`, `avatar-date`) $r = q("INSERT INTO `contact` (`uid`, `created`, `name`, `nick`, `addr`, `url`, `nurl`, `batch`, `network`, `rel`, `blocked`, `pending`, `writable`, `name-date`, `uri-date`, `avatar-date`)
VALUES (0, '%s', '%s', 'relay', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, '%s', '%s', '%s')", VALUES (0, '%s', '%s', 'relay', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, '%s', '%s', '%s')",
datetime_convert(), datetime_convert(),

View file

@ -1,6 +1,8 @@
<?php <?php
require_once("boot.php"); require_once("boot.php");
use \Friendica\Core\Config;
function directory_run(&$argv, &$argc){ function directory_run(&$argv, &$argc){
global $a, $db; global $a, $db;
@ -15,15 +17,11 @@ function directory_run(&$argv, &$argc){
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
load_config('config'); Config::load();
load_config('system');
if($argc != 2) if($argc != 2)
return; return;
load_config('system');
load_hooks(); load_hooks();

View file

@ -1,9 +1,10 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/socgraph.php"); require_once("include/socgraph.php");
function discover_poco_run(&$argv, &$argc){ function discover_poco_run(&$argv, &$argc){
global $a, $db; global $a, $db;
@ -21,8 +22,7 @@ function discover_poco_run(&$argv, &$argc){
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
load_config('config'); Config::load();
load_config('system');
// Don't check this stuff if the function is called by the poller // Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run") if (App::callstack() != "poller_run")

View file

@ -206,7 +206,7 @@ function bbtoevent($s) {
} }
function sort_by_date(App $a) { function sort_by_date($a) {
usort($a,'ev_compare'); usort($a,'ev_compare');
return $a; return $a;
@ -510,7 +510,7 @@ function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
// query for the event by event id // query for the event by event id
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
STRAIGHT_JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
WHERE `event`.`uid` = %d AND `event`.`id` = %d $sql_extra", WHERE `event`.`uid` = %d AND `event`.`id` = %d $sql_extra",
intval($owner_uid), intval($owner_uid),
intval($event_params["event_id"]) intval($event_params["event_id"])
@ -543,7 +543,7 @@ function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
// query for the event by date // query for the event by date
$r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`, $r = q("SELECT `event`.*, `item`.`id` AS `itemid`,`item`.`plink`,
`item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event` `item`.`author-name`, `item`.`author-avatar`, `item`.`author-link` FROM `event`
STRAIGHT_JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid` LEFT JOIN `item` ON `item`.`event-id` = `event`.`id` AND `item`.`uid` = `event`.`uid`
WHERE `event`.`uid` = %d AND event.ignore = %d WHERE `event`.`uid` = %d AND event.ignore = %d
AND ((`adjust` = 0 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s') AND ((`adjust` = 0 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s')
OR (`adjust` = 1 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s')) OR (`adjust` = 1 AND (`finish` >= '%s' OR (nofinish AND start >= '%s')) AND `start` <= '%s'))

View file

@ -1,5 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
function expire_run(&$argv, &$argc){ function expire_run(&$argv, &$argc){
@ -10,19 +12,18 @@ function expire_run(&$argv, &$argc){
} }
if(is_null($db)) { if(is_null($db)) {
@include(".htconfig.php"); @include(".htconfig.php");
require_once("include/dba.php"); require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data); $db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
}; };
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
require_once('include/items.php'); require_once('include/items.php');
require_once('include/Contact.php'); require_once('include/Contact.php');
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -11,11 +11,6 @@
* @return boolean * @return boolean
*/ */
function feature_enabled($uid, $feature) { function feature_enabled($uid, $feature) {
if (($feature == 'richtext') AND !get_app()->theme_richtext_editor) {
return false;
}
$x = get_config('feature_lock', $feature); $x = get_config('feature_lock', $feature);
if ($x === false) { if ($x === false) {
@ -35,7 +30,7 @@ function feature_enabled($uid, $feature) {
/** /**
* @brief check if feature is enabled or disabled by default * @brief check if feature is enabled or disabled by default
* *
* @param string $feature * @param string $feature
* @return boolean * @return boolean
*/ */
@ -52,13 +47,13 @@ function get_feature_default($feature) {
/** /**
* @brief Get a list of all available features * @brief Get a list of all available features
* *
* The array includes the setting group, the setting name, * The array includes the setting group, the setting name,
* explainations for the setting and if it's enabled or disabled * explainations for the setting and if it's enabled or disabled
* by default * by default
* *
* @param bool $filtered True removes any locked features * @param bool $filtered True removes any locked features
* *
* @return array * @return array
*/ */
function get_features($filtered = true) { function get_features($filtered = true) {
@ -77,7 +72,6 @@ function get_features($filtered = true) {
// Post composition // Post composition
'composition' => array( 'composition' => array(
t('Post Composition Features'), t('Post Composition Features'),
array('richtext', t('Richtext Editor'), t('Enable richtext editor'), false, get_config('feature_lock','richtext')),
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')), array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, get_config('feature_lock','preview')),
array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')), array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, get_config('feature_lock','aclautomention')),
), ),
@ -142,11 +136,6 @@ function get_features($filtered = true) {
} }
} }
// Remove the richtext editor setting if the theme doesn't support it
if (!get_app()->theme_richtext_editor) {
unset($arr['composition'][1]);
}
call_hooks('get_features',$arr); call_hooks('get_features',$arr);
return $arr; return $arr;
} }

View file

@ -1,5 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once('include/Scrape.php'); require_once('include/Scrape.php');
require_once('include/socgraph.php'); require_once('include/socgraph.php');
@ -21,8 +23,7 @@ function gprobe_run(&$argv, &$argc){
require_once('include/session.php'); require_once('include/session.php');
require_once('include/datetime.php'); require_once('include/datetime.php');
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -6,6 +6,7 @@
require_once('include/ForumManager.php'); require_once('include/ForumManager.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once("mod/proxy.php"); require_once("mod/proxy.php");
require_once('include/cache.php');
/** /**
* *
@ -453,15 +454,21 @@ function get_birthdays() {
$bd_format = t('g A l F d') ; // 8 AM Friday January 18 $bd_format = t('g A l F d') ; // 8 AM Friday January 18
$bd_short = t('F d'); $bd_short = t('F d');
$r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event` $cachekey = "get_birthdays:".local_user();
INNER JOIN `contact` ON `contact`.`id` = `event`.`cid` $r = Cache::get($cachekey);
WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s' if (is_null($r)) {
ORDER BY `start` ASC ", $r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
intval(local_user()), INNER JOIN `contact` ON `contact`.`id` = `event`.`cid`
dbesc(datetime_convert('UTC','UTC','now + 6 days')), WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s'
dbesc(datetime_convert('UTC','UTC','now')) ORDER BY `start` ASC ",
); intval(local_user()),
dbesc(datetime_convert('UTC','UTC','now + 6 days')),
dbesc(datetime_convert('UTC','UTC','now'))
);
if (dbm::is_result($r)) {
Cache::set($cachekey, $r, CACHE_HOUR);
}
}
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
$total = 0; $total = 0;
$now = strtotime('now'); $now = strtotime('now');

View file

@ -4,6 +4,8 @@
* @file include/network.php * @file include/network.php
*/ */
use \Friendica\Core\Config;
require_once("include/xml.php"); require_once("include/xml.php");
require_once('include/Probe.php'); require_once('include/Probe.php');
@ -93,7 +95,10 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
@curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent()); @curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
$range = intval(Config::get('system', 'curl_range_bytes', 0));
if ($range > 0) {
@curl_setopt($ch, CURLOPT_RANGE, '0-'.$range);
}
if(x($opts,'headers')){ if(x($opts,'headers')){
@curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']); @curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
require_once('include/html2plain.php'); require_once('include/html2plain.php');
@ -43,11 +46,11 @@ require_once('include/salmon.php');
function notifier_run(&$argv, &$argc){ function notifier_run(&$argv, &$argc){
global $a, $db; global $a, $db;
if(is_null($a)){ if (is_null($a)) {
$a = new App; $a = new App;
} }
if(is_null($db)) { if (is_null($db)) {
@include(".htconfig.php"); @include(".htconfig.php");
require_once("include/dba.php"); require_once("include/dba.php");
$db = new dba($db_host, $db_user, $db_pass, $db_data); $db = new dba($db_host, $db_user, $db_pass, $db_data);
@ -59,13 +62,14 @@ function notifier_run(&$argv, &$argc){
require_once('include/items.php'); require_once('include/items.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once('include/email.php'); require_once('include/email.php');
load_config('config');
load_config('system'); Config::load();
load_hooks(); load_hooks();
if($argc < 3) if ($argc < 3) {
return; return;
}
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));
@ -77,7 +81,7 @@ function notifier_run(&$argv, &$argc){
case 'mail': case 'mail':
default: default:
$item_id = intval($argv[2]); $item_id = intval($argv[2]);
if(! $item_id){ if (! $item_id) {
return; return;
} }
break; break;
@ -93,21 +97,20 @@ function notifier_run(&$argv, &$argc){
$normal_mode = true; $normal_mode = true;
if($cmd === 'mail') { if ($cmd === 'mail') {
$normal_mode = false; $normal_mode = false;
$mail = true; $mail = true;
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1", $message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
intval($item_id) intval($item_id)
); );
if(! count($message)){ if (! count($message)) {
return; return;
} }
$uid = $message[0]['uid']; $uid = $message[0]['uid'];
$recipients[] = $message[0]['contact-id']; $recipients[] = $message[0]['contact-id'];
$item = $message[0]; $item = $message[0];
} } elseif ($cmd === 'expire') {
elseif($cmd === 'expire') {
$normal_mode = false; $normal_mode = false;
$expire = true; $expire = true;
$items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1
@ -116,22 +119,23 @@ function notifier_run(&$argv, &$argc){
); );
$uid = $item_id; $uid = $item_id;
$item_id = 0; $item_id = 0;
if(! count($items)) if (! count($items)) {
return; return;
} }
elseif($cmd === 'suggest') { } elseif ($cmd === 'suggest') {
$normal_mode = false; $normal_mode = false;
$fsuggest = true; $fsuggest = true;
$suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1", $suggest = q("SELECT * FROM `fsuggest` WHERE `id` = %d LIMIT 1",
intval($item_id) intval($item_id)
); );
if(! count($suggest)) if (! count($suggest)) {
return; return;
}
$uid = $suggest[0]['uid']; $uid = $suggest[0]['uid'];
$recipients[] = $suggest[0]['cid']; $recipients[] = $suggest[0]['cid'];
$item = $suggest[0]; $item = $suggest[0];
} elseif($cmd === 'removeme') { } elseif ($cmd === 'removeme') {
$r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`, $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`,
`user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`, `user`.`timezone`, `user`.`nickname`, `user`.`sprvkey`, `user`.`spubkey`,
`user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid` `user`.`page-flags`, `user`.`prvnets`, `user`.`account-type`, `user`.`guid`
@ -150,15 +154,15 @@ function notifier_run(&$argv, &$argc){
$self = $r[0]; $self = $r[0];
$r = q("SELECT * FROM `contact` WHERE NOT `self` AND `uid` = %d", intval($item_id)); $r = q("SELECT * FROM `contact` WHERE NOT `self` AND `uid` = %d", intval($item_id));
if(!$r) if (!$r) {
return; return;
}
require_once('include/Contact.php'); require_once('include/Contact.php');
foreach($r as $contact) { foreach ($r as $contact) {
terminate_friendship($user, $self, $contact); terminate_friendship($user, $self, $contact);
} }
return; return;
} elseif($cmd === 'relocate') { } elseif ($cmd === 'relocate') {
$normal_mode = false; $normal_mode = false;
$relocate = true; $relocate = true;
$uid = $item_id; $uid = $item_id;
@ -170,7 +174,7 @@ function notifier_run(&$argv, &$argc){
intval($item_id) intval($item_id)
); );
if((! dbm::is_result($r)) || (! intval($r[0]['parent']))) { if ((! dbm::is_result($r)) || (! intval($r[0]['parent']))) {
return; return;
} }
@ -184,18 +188,19 @@ function notifier_run(&$argv, &$argc){
intval($parent_id) intval($parent_id)
); );
if(! count($items)) { if (! count($items)) {
return; return;
} }
// avoid race condition with deleting entries // avoid race condition with deleting entries
if($items[0]['deleted']) { if ($items[0]['deleted']) {
foreach($items as $item) foreach ($items as $item) {
$item['deleted'] = 1; $item['deleted'] = 1;
}
} }
if((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) { if ((count($items) == 1) && ($items[0]['id'] === $target_item['id']) && ($items[0]['uri'] === $items[0]['parent-uri'])) {
logger('notifier: top level post'); logger('notifier: top level post');
$top_level = true; $top_level = true;
} }
@ -220,6 +225,9 @@ function notifier_run(&$argv, &$argc){
$hub = get_config('system','huburl'); $hub = get_config('system','huburl');
// Should the post be transmitted to Diaspora?
$diaspora_delivery = true;
// If this is a public conversation, notify the feed hub // If this is a public conversation, notify the feed hub
$public_message = true; $public_message = true;
@ -229,7 +237,7 @@ function notifier_run(&$argv, &$argc){
// fill this in with a single salmon slap if applicable // fill this in with a single salmon slap if applicable
$slap = ''; $slap = '';
if(! ($mail || $fsuggest || $relocate)) { if (! ($mail || $fsuggest || $relocate)) {
$slap = ostatus::salmon($target_item,$owner); $slap = ostatus::salmon($target_item,$owner);
@ -240,7 +248,7 @@ function notifier_run(&$argv, &$argc){
$thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d", $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
dbesc($target_item["thr-parent"]), intval($target_item["uid"])); dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
logger('Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG); logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
// This is IMPORTANT!!!! // This is IMPORTANT!!!!
@ -264,9 +272,9 @@ function notifier_run(&$argv, &$argc){
$localhost = str_replace('www.','',$a->get_hostname()); $localhost = str_replace('www.','',$a->get_hostname());
if(strpos($localhost,':')) if (strpos($localhost,':')) {
$localhost = substr($localhost,0,strpos($localhost,':')); $localhost = substr($localhost,0,strpos($localhost,':'));
}
/** /**
* *
* Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes * Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes
@ -277,12 +285,12 @@ function notifier_run(&$argv, &$argc){
$relay_to_owner = false; $relay_to_owner = false;
if(!$top_level && ($parent['wall'] == 0) && !$expire && (stristr($target_item['uri'],$localhost))) { if (!$top_level && ($parent['wall'] == 0) && !$expire && (stristr($target_item['uri'],$localhost))) {
$relay_to_owner = true; $relay_to_owner = true;
} }
if(($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && !$top_level) { if (($cmd === 'uplink') && (intval($parent['forum_mode']) == 1) && !$top_level) {
$relay_to_owner = true; $relay_to_owner = true;
} }
@ -290,13 +298,13 @@ function notifier_run(&$argv, &$argc){
// we will just use it as a fallback test // we will just use it as a fallback test
// later we will be able to use it as the primary test of whether or not to relay. // later we will be able to use it as the primary test of whether or not to relay.
if(! $target_item['origin']) if (! $target_item['origin']) {
$relay_to_owner = false; $relay_to_owner = false;
}
if($parent['origin']) if ($parent['origin']) {
$relay_to_owner = false; $relay_to_owner = false;
}
if($relay_to_owner) { if ($relay_to_owner) {
logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG); logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG);
// local followup to remote post // local followup to remote post
$followup = true; $followup = true;
@ -322,9 +330,11 @@ function notifier_run(&$argv, &$argc){
intval($uid), intval($uid),
dbesc(NETWORK_DFRN) dbesc(NETWORK_DFRN)
); );
if (dbm::is_result($r)) if (dbm::is_result($r)) {
foreach($r as $rr) foreach ($r as $rr) {
$recipients_followup[] = $rr['id']; $recipients_followup[] = $rr['id'];
}
}
} }
} }
logger("Notify ".$target_item["guid"]." via PuSH: ".($push_notify?"Yes":"No"), LOGGER_DEBUG); logger("Notify ".$target_item["guid"]." via PuSH: ".($push_notify?"Yes":"No"), LOGGER_DEBUG);
@ -335,12 +345,12 @@ function notifier_run(&$argv, &$argc){
// don't send deletions onward for other people's stuff // don't send deletions onward for other people's stuff
if($target_item['deleted'] && (! intval($target_item['wall']))) { if ($target_item['deleted'] && (! intval($target_item['wall']))) {
logger('notifier: ignoring delete notification for non-wall item'); logger('notifier: ignoring delete notification for non-wall item');
return; return;
} }
if((strlen($parent['allow_cid'])) if ((strlen($parent['allow_cid']))
|| (strlen($parent['allow_gid'])) || (strlen($parent['allow_gid']))
|| (strlen($parent['deny_cid'])) || (strlen($parent['deny_cid']))
|| (strlen($parent['deny_gid']))) { || (strlen($parent['deny_gid']))) {
@ -355,24 +365,23 @@ function notifier_run(&$argv, &$argc){
// if our parent is a public forum (forum_mode == 1), uplink to the origional author causing // if our parent is a public forum (forum_mode == 1), uplink to the origional author causing
// a delivery fork. private groups (forum_mode == 2) do not uplink // a delivery fork. private groups (forum_mode == 2) do not uplink
if((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) { if ((intval($parent['forum_mode']) == 1) && (! $top_level) && ($cmd !== 'uplink')) {
proc_run(PRIORITY_HIGH,'include/notifier.php','uplink',$item_id); proc_run(PRIORITY_HIGH,'include/notifier.php','uplink',$item_id);
} }
$conversants = array(); $conversants = array();
foreach($items as $item) { foreach ($items as $item) {
$recipients[] = $item['contact-id']; $recipients[] = $item['contact-id'];
$conversants[] = $item['contact-id']; $conversants[] = $item['contact-id'];
// pull out additional tagged people to notify (if public message) // pull out additional tagged people to notify (if public message)
if($public_message && strlen($item['inform'])) { if ($public_message && strlen($item['inform'])) {
$people = explode(',',$item['inform']); $people = explode(',',$item['inform']);
foreach($people as $person) { foreach ($people as $person) {
if(substr($person,0,4) === 'cid:') { if (substr($person,0,4) === 'cid:') {
$recipients[] = intval(substr($person,4)); $recipients[] = intval(substr($person,4));
$conversants[] = intval(substr($person,4)); $conversants[] = intval(substr($person,4));
} } else {
else {
$url_recipients[] = substr($person,4); $url_recipients[] = substr($person,4);
} }
} }
@ -396,16 +405,19 @@ function notifier_run(&$argv, &$argc){
// We have not only to look at the parent, since it could be a Friendica thread. // We have not only to look at the parent, since it could be a Friendica thread.
if (($thr_parent AND ($thr_parent[0]['network'] == NETWORK_OSTATUS)) OR ($parent['network'] == NETWORK_OSTATUS)) { if (($thr_parent AND ($thr_parent[0]['network'] == NETWORK_OSTATUS)) OR ($parent['network'] == NETWORK_OSTATUS)) {
$diaspora_delivery = false;
logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG); logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG);
// Send a salmon to the parent author // Send a salmon to the parent author
$r = q("SELECT `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''", $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
dbesc(normalise_link($thr_parent[0]['author-link'])), dbesc(normalise_link($thr_parent[0]['author-link'])),
intval($uid)); intval($uid));
if ($r) if (dbm::is_result($r)) {
$probed_contact = $r[0]; $probed_contact = $r[0];
else } else {
$probed_contact = probe_url($thr_parent[0]['author-link']); $probed_contact = probe_url($thr_parent[0]['author-link']);
}
if ($probed_contact["notify"] != "") { if ($probed_contact["notify"] != "") {
logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]); logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
@ -413,13 +425,15 @@ function notifier_run(&$argv, &$argc){
} }
// Send a salmon to the parent owner // Send a salmon to the parent owner
$r = q("SELECT `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''", $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
dbesc(normalise_link($thr_parent[0]['owner-link'])), dbesc(normalise_link($thr_parent[0]['owner-link'])),
intval($uid)); intval($uid));
if ($r) if (dbm::is_result($r)) {
$probed_contact = $r[0]; $probed_contact = $r[0];
else } else {
$probed_contact = probe_url($thr_parent[0]['owner-link']); $probed_contact = probe_url($thr_parent[0]['owner-link']);
}
if ($probed_contact["notify"] != "") { if ($probed_contact["notify"] != "") {
logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]); logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"]; $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
@ -427,10 +441,10 @@ function notifier_run(&$argv, &$argc){
// Send a salmon notification to every person we mentioned in the post // Send a salmon notification to every person we mentioned in the post
$arr = explode(',',$target_item['tag']); $arr = explode(',',$target_item['tag']);
foreach($arr as $x) { foreach ($arr as $x) {
//logger('Checking tag '.$x, LOGGER_DEBUG); //logger('Checking tag '.$x, LOGGER_DEBUG);
$matches = null; $matches = null;
if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) { if (preg_match('/@\[url=([^\]]*)\]/',$x,$matches)) {
$probed_contact = probe_url($matches[1]); $probed_contact = probe_url($matches[1]);
if ($probed_contact["notify"] != "") { if ($probed_contact["notify"] != "") {
logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]); logger('Notify mentioned user '.$probed_contact["url"].': '.$probed_contact["notify"]);
@ -441,23 +455,19 @@ function notifier_run(&$argv, &$argc){
// It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora // It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')"; $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')";
} else } else {
$sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')"; $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')";
}
$r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra); } else {
if (dbm::is_result($r))
$contacts = $r;
} else
$public_message = false; $public_message = false;
}
// If this is a public message and pubmail is set on the parent, include all your email contacts // If this is a public message and pubmail is set on the parent, include all your email contacts
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if(! $mail_disabled) { if (! $mail_disabled) {
if((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid'])) if ((! strlen($target_item['allow_cid'])) && (! strlen($target_item['allow_gid']))
&& (! strlen($target_item['deny_cid'])) && (! strlen($target_item['deny_gid'])) && (! strlen($target_item['deny_cid'])) && (! strlen($target_item['deny_gid']))
&& (intval($target_item['pubmail']))) { && (intval($target_item['pubmail']))) {
$r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'", $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s'",
@ -465,39 +475,40 @@ function notifier_run(&$argv, &$argc){
dbesc(NETWORK_MAIL) dbesc(NETWORK_MAIL)
); );
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
foreach($r as $rr) foreach ($r as $rr) {
$recipients[] = $rr['id']; $recipients[] = $rr['id'];
}
} }
} }
} }
if($followup) if ($followup) {
$recip_str = implode(', ', $recipients_followup); $recip_str = implode(', ', $recipients_followup);
else } else {
$recip_str = implode(', ', $recipients); $recip_str = implode(', ', $recipients);
}
if ($relocate) if ($relocate) {
$r = $recipients_relocate; $r = $recipients_relocate;
else } else {
$r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`", $r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra,
dbesc($recip_str) dbesc($recip_str)
); );
}
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
// If we are using the worker we don't need a delivery interval // If we are using the worker we don't need a delivery interval
if (get_config("system", "worker")) if (get_config("system", "worker")) {
$interval = false; $interval = false;
}
// delivery loop // delivery loop
if (dbm::is_result($r)) { if (dbm::is_result($r)) {
foreach ($r as $contact) {
foreach($r as $contact) { if (!$contact['self']) {
if(!$contact['self']) { if (($contact['network'] === NETWORK_DIASPORA) && ($public_message)) {
if(($contact['network'] === NETWORK_DIASPORA) && ($public_message))
continue; continue;
}
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)", q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)",
dbesc($cmd), dbesc($cmd),
intval($item_id), intval($item_id),
@ -520,17 +531,18 @@ function notifier_run(&$argv, &$argc){
// When using the workerqueue, we don't need this functionality. // When using the workerqueue, we don't need this functionality.
$deliveries_per_process = intval(get_config('system','delivery_batch_count')); $deliveries_per_process = intval(get_config('system','delivery_batch_count'));
if (($deliveries_per_process <= 0) OR get_config("system", "worker")) if (($deliveries_per_process <= 0) OR get_config("system", "worker")) {
$deliveries_per_process = 1; $deliveries_per_process = 1;
}
$this_batch = array(); $this_batch = array();
for($x = 0; $x < count($r); $x ++) { for ($x = 0; $x < count($r); $x ++) {
$contact = $r[$x]; $contact = $r[$x];
if($contact['self']) if ($contact['self']) {
continue; continue;
}
logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG); logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
// potentially more than one recipient. Start a new process and space them out a bit. // potentially more than one recipient. Start a new process and space them out a bit.
@ -538,26 +550,28 @@ function notifier_run(&$argv, &$argc){
$this_batch[] = $contact['id']; $this_batch[] = $contact['id'];
if(count($this_batch) >= $deliveries_per_process) { if (count($this_batch) >= $deliveries_per_process) {
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch); proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
$this_batch = array(); $this_batch = array();
if($interval) if ($interval) {
@time_sleep_until(microtime(true) + (float) $interval); @time_sleep_until(microtime(true) + (float) $interval);
}
} }
continue; continue;
} }
// be sure to pick up any stragglers // be sure to pick up any stragglers
if(count($this_batch)) if (count($this_batch)) {
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch); proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$this_batch);
}
} }
// send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts // send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
// They are especially used for notifications to OStatus users that don't follow us. // They are especially used for notifications to OStatus users that don't follow us.
if($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) { if ($slap && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
if(!get_config('system','dfrn_only')) { if (!get_config('system','dfrn_only')) {
foreach($url_recipients as $url) { foreach ($url_recipients as $url) {
if ($url) { if ($url) {
logger('notifier: urldelivery: ' . $url); logger('notifier: urldelivery: ' . $url);
$deliver_status = slapper($owner,$url,$slap); $deliver_status = slapper($owner,$url,$slap);
@ -568,19 +582,23 @@ function notifier_run(&$argv, &$argc){
} }
if($public_message) { if ($public_message) {
if (!$followup) $r0 = array();
$r0 = Diaspora::relay_list(); $r1 = array();
else
$r0 = array();
$r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s' if ($diaspora_delivery) {
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()", if (!$followup) {
dbesc(NETWORK_DIASPORA), $r0 = Diaspora::relay_list();
intval($owner['uid']), }
intval(CONTACT_IS_SHARING)
); $r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s'
AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
dbesc(NETWORK_DIASPORA),
intval($owner['uid']),
intval(CONTACT_IS_SHARING)
);
}
$r2 = q("SELECT `id`, `name`,`network` FROM `contact` $r2 = q("SELECT `id`, `name`,`network` FROM `contact`
WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
@ -599,7 +617,7 @@ function notifier_run(&$argv, &$argc){
// throw everything into the queue in case we get killed // throw everything into the queue in case we get killed
foreach ($r as $rr) { foreach ($r as $rr) {
if((! $mail) && (! $fsuggest) && (! $followup)) { if ((! $mail) && (! $fsuggest) && (! $followup)) {
q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d) q("INSERT INTO `deliverq` (`cmd`,`item`,`contact`) VALUES ('%s', %d, %d)
ON DUPLICATE KEY UPDATE `cmd` = '%s', `item` = %d, `contact` = %d", ON DUPLICATE KEY UPDATE `cmd` = '%s', `item` = %d, `contact` = %d",
dbesc($cmd), intval($item_id), intval($rr['id']), dbesc($cmd), intval($item_id), intval($rr['id']),
@ -613,16 +631,17 @@ function notifier_run(&$argv, &$argc){
// except for Diaspora batch jobs // except for Diaspora batch jobs
// Don't deliver to folks who have already been delivered to // Don't deliver to folks who have already been delivered to
if(($rr['network'] !== NETWORK_DIASPORA) && (in_array($rr['id'],$conversants))) { if (($rr['network'] !== NETWORK_DIASPORA) && (in_array($rr['id'],$conversants))) {
logger('notifier: already delivered id=' . $rr['id']); logger('notifier: already delivered id=' . $rr['id']);
continue; continue;
} }
if((! $mail) && (! $fsuggest) && (! $followup)) { if ((! $mail) && (! $fsuggest) && (! $followup)) {
logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]); logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$rr['id']); proc_run(PRIORITY_HIGH,'include/delivery.php',$cmd,$item_id,$rr['id']);
if($interval) if ($interval) {
@time_sleep_until(microtime(true) + (float) $interval); @time_sleep_until(microtime(true) + (float) $interval);
}
} }
} }
} }
@ -632,13 +651,14 @@ function notifier_run(&$argv, &$argc){
} }
// Notify PuSH subscribers (Used for OStatus distribution of regular posts) // Notify PuSH subscribers (Used for OStatus distribution of regular posts)
if($push_notify AND strlen($hub)) { if ($push_notify AND strlen($hub)) {
$hubs = explode(',', $hub); $hubs = explode(',', $hub);
if(count($hubs)) { if (count($hubs)) {
foreach($hubs as $h) { foreach ($hubs as $h) {
$h = trim($h); $h = trim($h);
if(! strlen($h)) if (! strlen($h)) {
continue; continue;
}
if ($h === '[internal]') { if ($h === '[internal]') {
// Set push flag for PuSH subscribers to this topic, // Set push flag for PuSH subscribers to this topic,
@ -654,8 +674,9 @@ function notifier_run(&$argv, &$argc){
post_url($h,$params); post_url($h,$params);
logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code()); logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
} }
if(count($hubs) > 1) if (count($hubs) > 1) {
sleep(7); // try and avoid multiple hubs responding at precisely the same time sleep(7); // try and avoid multiple hubs responding at precisely the same time
}
} }
} }
@ -665,8 +686,9 @@ function notifier_run(&$argv, &$argc){
logger('notifier: calling hooks', LOGGER_DEBUG); logger('notifier: calling hooks', LOGGER_DEBUG);
if($normal_mode) if ($normal_mode) {
call_hooks('notifier_normal',$target_item); call_hooks('notifier_normal',$target_item);
}
call_hooks('notifier_end',$target_item); call_hooks('notifier_end',$target_item);

View file

@ -1,5 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/follow.php"); require_once("include/follow.php");
@ -32,8 +34,7 @@ function onepoll_run(&$argv, &$argc){
require_once('include/socgraph.php'); require_once('include/socgraph.php');
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -523,7 +523,9 @@ class ostatus {
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s'", $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s'",
intval($importer["uid"]), dbesc($item["parent-uri"])); intval($importer["uid"]), dbesc($item["parent-uri"]));
if (!$r AND ($related != "")) { // Only fetch missing stuff if it is a comment or reshare.
if (in_array($item["verb"], array(ACTIVITY_POST, ACTIVITY_SHARE)) AND
!dbm::is_result($r) AND ($related != "")) {
$reply_path = str_replace("/notice/", "/api/statuses/show/", $related).".atom"; $reply_path = str_replace("/notice/", "/api/statuses/show/", $related).".atom";
if ($reply_path != $related) { if ($reply_path != $related) {

View file

@ -10,6 +10,8 @@
* *
*/ */
use \Friendica\Core\Config;
require_once("include/dba.php"); require_once("include/dba.php");
if(! function_exists('get_browser_language')) { if(! function_exists('get_browser_language')) {
@ -47,12 +49,12 @@ function get_browser_language() {
break; break;
} }
} }
if(isset($preferred)) if (isset($preferred)) {
return $preferred; return $preferred;
}
// in case none matches, get the system wide configured language, or fall back to English // in case none matches, get the system wide configured language, or fall back to English
$a = get_app(); return Config::get('system', 'language', 'en');
return ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
}} }}

View file

@ -49,7 +49,7 @@ function photo_albums($uid, $update = false) {
/// @todo This query needs to be renewed. It is really slow /// @todo This query needs to be renewed. It is really slow
// At this time we just store the data in the cache // At this time we just store the data in the cache
$albums = qu("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album` $albums = qu("SELECT COUNT(DISTINCT `resource-id`) AS `total`, `album`
FROM `photo` USE INDEX (`uid_album_created`) FROM `photo`
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra
GROUP BY `album` ORDER BY `created` DESC", GROUP BY `album` ORDER BY `created` DESC",
intval($uid), intval($uid),
@ -59,7 +59,7 @@ function photo_albums($uid, $update = false) {
} else { } else {
// This query doesn't do the count and is much faster // This query doesn't do the count and is much faster
$albums = qu("SELECT DISTINCT(`album`), '' AS `total` $albums = qu("SELECT DISTINCT(`album`), '' AS `total`
FROM `photo` USE INDEX (`uid_album_created`) FROM `photo`
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra
GROUP BY `album` ORDER BY `created` DESC", GROUP BY `album` ORDER BY `created` DESC",
intval($uid), intval($uid),

View file

@ -272,12 +272,13 @@ function shortenmsg($msg, $limit, $twitter = false) {
$lines = explode("\n", $msg); $lines = explode("\n", $msg);
$msg = ""; $msg = "";
$recycle = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8'); $recycle = html_entity_decode("&#x2672; ", ENT_QUOTES, 'UTF-8');
$ellipsis = html_entity_decode("&#x2026;", ENT_QUOTES, 'UTF-8');
foreach ($lines AS $row=>$line) { foreach ($lines AS $row=>$line) {
if (iconv_strlen(trim($msg."\n".$line), "UTF-8") <= $limit) if (iconv_strlen(trim($msg."\n".$line), "UTF-8") <= $limit)
$msg = trim($msg."\n".$line); $msg = trim($msg."\n".$line);
// Is the new message empty by now or is it a reshared message? // Is the new message empty by now or is it a reshared message?
elseif (($msg == "") OR (($row == 1) AND (substr($msg, 0, 4) == $recycle))) elseif (($msg == "") OR (($row == 1) AND (substr($msg, 0, 4) == $recycle)))
$msg = iconv_substr(iconv_substr(trim($msg."\n".$line), 0, $limit, "UTF-8"), 0, -3, "UTF-8")."..."; $msg = iconv_substr(iconv_substr(trim($msg."\n".$line), 0, $limit, "UTF-8"), 0, -3, "UTF-8").$ellipsis;
else else
break; break;
} }

View file

@ -30,8 +30,9 @@ function poller_run($argv, $argc){
}; };
// Quit when in maintenance // Quit when in maintenance
if (get_config('system', 'maintenance', true)) if (Config::get('system', 'maintenance', true)) {
return; return;
}
$a->start_process(); $a->start_process();
@ -90,10 +91,8 @@ function poller_execute($queue) {
$mypid = getmypid(); $mypid = getmypid();
$cooldown = Config::get("system", "worker_cooldown", 0);
// Quit when in maintenance // Quit when in maintenance
if (get_config('system', 'maintenance', true)) { if (Config::get('system', 'maintenance', true)) {
return false; return false;
} }
@ -137,8 +136,6 @@ function poller_execute($queue) {
$argv = json_decode($queue["parameter"]); $argv = json_decode($queue["parameter"]);
$argc = count($argv);
// Check for existance and validity of the include file // Check for existance and validity of the include file
$include = $argv[0]; $include = $argv[0];
@ -153,23 +150,8 @@ function poller_execute($queue) {
$funcname = str_replace(".php", "", basename($argv[0]))."_run"; $funcname = str_replace(".php", "", basename($argv[0]))."_run";
if (function_exists($funcname)) { if (function_exists($funcname)) {
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." ".$queue["parameter"]);
// For better logging create a new process id for every worker call poller_exec_function($queue, $funcname, $argv);
// But preserve the old one for the worker
$old_process_id = $a->process_id;
$a->process_id = uniqid("wrk", true);
$funcname($argv, $argc);
$a->process_id = $old_process_id;
if ($cooldown > 0) {
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - in cooldown for ".$cooldown." seconds");
sleep($cooldown);
}
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done");
q("DELETE FROM `workerqueue` WHERE `id` = %d", intval($queue["id"])); q("DELETE FROM `workerqueue` WHERE `id` = %d", intval($queue["id"]));
} else { } else {
@ -179,6 +161,104 @@ function poller_execute($queue) {
return true; return true;
} }
/**
* @brief Execute a function from the queue
*
* @param array $queue Workerqueue entry
* @param string $funcname name of the function
* @param array $argv Array of values to be passed to the function
*/
function poller_exec_function($queue, $funcname, $argv) {
$a = get_app();
$mypid = getmypid();
$argc = count($argv);
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." ".$queue["parameter"]);
$stamp = (float)microtime(true);
// We use the callstack here to analyze the performance of executed worker entries.
// For this reason the variables have to be initialized.
if (Config::get("system", "profiler")) {
$a->performance["start"] = microtime(true);
$a->performance["database"] = 0;
$a->performance["database_write"] = 0;
$a->performance["network"] = 0;
$a->performance["file"] = 0;
$a->performance["rendering"] = 0;
$a->performance["parser"] = 0;
$a->performance["marktime"] = 0;
$a->performance["markstart"] = microtime(true);
$a->callstack = array();
}
// For better logging create a new process id for every worker call
// But preserve the old one for the worker
$old_process_id = $a->process_id;
$a->process_id = uniqid("wrk", true);
$funcname($argv, $argc);
$a->process_id = $old_process_id;
$duration = number_format(microtime(true) - $stamp, 3);
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - done in ".$duration." seconds.");
// Write down the performance values into the log
if (Config::get("system", "profiler")) {
$duration = microtime(true)-$a->performance["start"];
if (Config::get("rendertime", "callstack")) {
if (isset($a->callstack["database"])) {
$o = "\nDatabase Read:\n";
foreach ($a->callstack["database"] AS $func => $time) {
$time = round($time, 3);
if ($time > 0)
$o .= $func.": ".$time."\n";
}
}
if (isset($a->callstack["database_write"])) {
$o .= "\nDatabase Write:\n";
foreach ($a->callstack["database_write"] AS $func => $time) {
$time = round($time, 3);
if ($time > 0)
$o .= $func.": ".$time."\n";
}
}
if (isset($a->callstack["network"])) {
$o .= "\nNetwork:\n";
foreach ($a->callstack["network"] AS $func => $time) {
$time = round($time, 3);
if ($time > 0)
$o .= $func.": ".$time."\n";
}
}
} else {
$o = '';
}
logger("ID ".$queue["id"].": ".$funcname.": ".sprintf("DB: %s/%s, Net: %s, I/O: %s, Other: %s, Total: %s".$o,
number_format($a->performance["database"] - $a->performance["database_write"], 2),
number_format($a->performance["database_write"], 2),
number_format($a->performance["network"], 2),
number_format($a->performance["file"], 2),
number_format($duration - ($a->performance["database"] + $a->performance["network"] + $a->performance["file"]), 2),
number_format($duration, 2)),
LOGGER_DEBUG);
}
$cooldown = Config::get("system", "worker_cooldown", 0);
if ($cooldown > 0) {
logger("Process ".$mypid." - Prio ".$queue["priority"]." - ID ".$queue["id"].": ".$funcname." - in cooldown for ".$cooldown." seconds");
sleep($cooldown);
}
}
/** /**
* @brief Checks if the number of database connections has reached a critical limit. * @brief Checks if the number of database connections has reached a critical limit.
* *
@ -187,7 +267,7 @@ function poller_execute($queue) {
function poller_max_connections_reached() { function poller_max_connections_reached() {
// Fetch the max value from the config. This is needed when the system cannot detect the correct value by itself. // Fetch the max value from the config. This is needed when the system cannot detect the correct value by itself.
$max = get_config("system", "max_connections"); $max = Config::get("system", "max_connections");
// Fetch the percentage level where the poller will get active // Fetch the percentage level where the poller will get active
$maxlevel = Config::get("system", "max_connections_level", 75); $maxlevel = Config::get("system", "max_connections_level", 75);
@ -371,7 +451,7 @@ function poller_too_much_workers() {
logger("Load: ".$load."/".$maxsysload." - processes: ".$active."/".$entries." (".$processlist.") - maximum: ".$queues."/".$maxqueues, LOGGER_DEBUG); logger("Load: ".$load."/".$maxsysload." - processes: ".$active."/".$entries." (".$processlist.") - maximum: ".$queues."/".$maxqueues, LOGGER_DEBUG);
// Are there fewer workers running as possible? Then fork a new one. // Are there fewer workers running as possible? Then fork a new one.
if (!get_config("system", "worker_dont_fork") AND ($queues > ($active + 1)) AND ($entries > 1)) { if (!Config::get("system", "worker_dont_fork") AND ($queues > ($active + 1)) AND ($entries > 1)) {
logger("Active workers: ".$active."/".$queues." Fork a new worker.", LOGGER_DEBUG); logger("Active workers: ".$active."/".$queues." Fork a new worker.", LOGGER_DEBUG);
$args = array("php", "include/poller.php", "no_cron"); $args = array("php", "include/poller.php", "no_cron");
$a = get_app(); $a = get_app();
@ -500,7 +580,7 @@ function call_worker_if_idle() {
if (function_exists("proc_open")) { if (function_exists("proc_open")) {
// When was the last time that we called the worker? // When was the last time that we called the worker?
// Less than one minute? Then we quit // Less than one minute? Then we quit
if ((time() - get_config("system", "worker_started")) < 60) { if ((time() - Config::get("system", "worker_started")) < 60) {
return; return;
} }

View file

@ -239,7 +239,7 @@ function post_update_1206() {
logger("Start", LOGGER_DEBUG); logger("Start", LOGGER_DEBUG);
$r = q("SELECT `contact`.`id`, `contact`.`last-item`, $r = q("SELECT `contact`.`id`, `contact`.`last-item`,
(SELECT MAX(`changed`) FROM `item` FORCE INDEX (`uid_wall_changed`) WHERE `wall` AND `uid` = `user`.`uid`) AS `lastitem_date` (SELECT MAX(`changed`) FROM `item` USE INDEX (`uid_wall_changed`) WHERE `wall` AND `uid` = `user`.`uid`) AS `lastitem_date`
FROM `user` FROM `user`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`"); INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`");

View file

@ -72,8 +72,7 @@ function pubsubpublish_run(&$argv, &$argc){
require_once('include/items.php'); require_once('include/items.php');
load_config('config'); Config::load();
load_config('system');
// Don't check this stuff if the function is called by the poller // Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run") { if (App::callstack() != "poller_run") {

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once('include/queue_fn.php'); require_once('include/queue_fn.php');
require_once('include/dfrn.php'); require_once('include/dfrn.php');
@ -23,8 +26,7 @@ function queue_run(&$argv, &$argc){
require_once('include/bbcode.php'); require_once('include/bbcode.php');
require_once('include/socgraph.php'); require_once('include/socgraph.php');
load_config('config'); Config::load();
load_config('system');
// Don't check this stuff if the function is called by the poller // Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run") if (App::callstack() != "poller_run")

View file

@ -3,6 +3,9 @@
* @file include/remove_contact.php * @file include/remove_contact.php
* @brief Removes orphaned data from deleted contacts * @brief Removes orphaned data from deleted contacts
*/ */
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
function remove_contact_run($argv, $argc) { function remove_contact_run($argv, $argc) {
@ -19,8 +22,7 @@ function remove_contact_run($argv, $argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
if ($argc != 2) { if ($argc != 2) {
return; return;

View file

@ -64,8 +64,9 @@ function ref_session_write($id, $data) {
$default_expire = time() + 300; $default_expire = time() + 300;
$memcache = cache::memcache(); $memcache = cache::memcache();
if (is_object($memcache)) { $a = get_app();
$memcache->set(get_app()->get_hostname().":session:".$id, $data, MEMCACHE_COMPRESSED, $expire); if (is_object($memcache) AND is_object($a)) {
$memcache->set($a->get_hostname().":session:".$id, $data, MEMCACHE_COMPRESSED, $expire);
return true; return true;
} }

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/threads.php"); require_once("include/threads.php");
@ -14,8 +17,7 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
update_shadow_copy(); update_shadow_copy();
killme(); killme();

View file

@ -1529,7 +1529,7 @@ function get_gcontact_id($contact) {
if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))
$contact["url"] = clean_contact_url($contact["url"]); $contact["url"] = clean_contact_url($contact["url"]);
$r = q("SELECT `id`, `last_contact`, `last_failure`, `network` FROM `gcontact` WHERE `nurl` = '%s' ORDER BY `id` LIMIT 2", $r = q("SELECT `id`, `last_contact`, `last_failure`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 2",
dbesc(normalise_link($contact["url"]))); dbesc(normalise_link($contact["url"])));
if ($r) { if ($r) {

View file

@ -3,6 +3,9 @@
* @file include/spool_post.php * @file include/spool_post.php
* @brief Posts items that wer spooled because they couldn't be posted. * @brief Posts items that wer spooled because they couldn't be posted.
*/ */
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/items.php"); require_once("include/items.php");
@ -20,8 +23,7 @@ function spool_post_run($argv, $argc) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
$path = get_spoolpath(); $path = get_spoolpath();

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/tags.php"); require_once("include/tags.php");
@ -14,8 +17,7 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
update_items(); update_items();
killme(); killme();

View file

@ -2045,13 +2045,6 @@ function undo_post_tagging($s) {
return $s; return $s;
} }
function fix_mce_lf($s) {
$s = str_replace("\r\n","\n",$s);
// $s = str_replace("\n\n","\n",$s);
return $s;
}
function protect_sprintf($s) { function protect_sprintf($s) {
return(str_replace('%','%%',$s)); return(str_replace('%','%%',$s));
} }
@ -2073,17 +2066,19 @@ function is_a_date_arg($s) {
/** /**
* remove intentation from a text * remove intentation from a text
*/ */
function deindent($text, $chr="[\t ]", $count=NULL) { function deindent($text, $chr = "[\t ]", $count = NULL) {
$text = fix_mce_lf($text);
$lines = explode("\n", $text); $lines = explode("\n", $text);
if (is_null($count)) { if (is_null($count)) {
$m = array(); $m = array();
$k=0; while($k<count($lines) && strlen($lines[$k])==0) $k++; $k = 0;
preg_match("|^".$chr."*|", $lines[$k], $m); while ($k < count($lines) && strlen($lines[$k]) == 0) {
$k++;
}
preg_match("|^" . $chr . "*|", $lines[$k], $m);
$count = strlen($m[0]); $count = strlen($m[0]);
} }
for ($k=0; $k<count($lines); $k++){ for ($k=0; $k < count($lines); $k++) {
$lines[$k] = preg_replace("|^".$chr."{".$count."}|", "", $lines[$k]); $lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
} }
return implode("\n", $lines); return implode("\n", $lines);

View file

@ -1,4 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
require_once("include/threads.php"); require_once("include/threads.php");
@ -14,8 +17,7 @@ if(is_null($db)) {
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
} }
load_config('config'); Config::load();
load_config('system');
update_threads(); update_threads();
update_threads_mention(); update_threads_mention();

View file

@ -1,5 +1,7 @@
<?php <?php
use \Friendica\Core\Config;
require_once("boot.php"); require_once("boot.php");
function update_gcontact_run(&$argv, &$argc){ function update_gcontact_run(&$argv, &$argc){
@ -19,8 +21,7 @@ function update_gcontact_run(&$argv, &$argc){
require_once('include/Scrape.php'); require_once('include/Scrape.php');
require_once("include/socgraph.php"); require_once("include/socgraph.php");
load_config('config'); Config::load();
load_config('system');
$a->set_baseurl(get_config('system','url')); $a->set_baseurl(get_config('system','url'));

View file

@ -13,6 +13,8 @@
* *
*/ */
use \Friendica\Core\Config;
require_once('boot.php'); require_once('boot.php');
require_once('object/BaseObject.php'); require_once('object/BaseObject.php');
@ -54,8 +56,7 @@ if(!$install) {
* Load configs from db. Overwrite configs from .htconfig.php * Load configs from db. Overwrite configs from .htconfig.php
*/ */
load_config('config'); Config::load();
load_config('system');
if ($a->max_processes_reached() OR $a->maxload_reached()) { if ($a->max_processes_reached() OR $a->maxload_reached()) {
header($_SERVER["SERVER_PROTOCOL"].' 503 Service Temporarily Unavailable'); header($_SERVER["SERVER_PROTOCOL"].' 503 Service Temporarily Unavailable');

117
js/acl.js
View file

@ -1,12 +1,12 @@
function ACL(backend_url, preset, automention, is_mobile){ function ACL(backend_url, preset, automention, is_mobile){
this.url = backend_url; this.url = backend_url;
this.automention = automention; this.automention = automention;
this.is_mobile = is_mobile; this.is_mobile = is_mobile;
this.kp_timer = null; this.kp_timer = null;
if (preset==undefined) preset = []; if (preset==undefined) preset = [];
this.allow_cid = (preset[0] || []); this.allow_cid = (preset[0] || []);
this.allow_gid = (preset[1] || []); this.allow_gid = (preset[1] || []);
@ -19,74 +19,69 @@ function ACL(backend_url, preset, automention, is_mobile){
} else { } else {
this.nw = 4; this.nw = 4;
} }
this.list_content = $("#acl-list-content"); this.list_content = $("#acl-list-content");
this.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html()); this.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html());
this.showall = $("#acl-showall"); this.showall = $("#acl-showall");
if (preset.length==0) this.showall.addClass("selected"); if (preset.length==0) this.showall.addClass("selected");
/*events*/ /*events*/
this.showall.click(this.on_showall.bind(this)); this.showall.click(this.on_showall.bind(this));
$(document).on("click", ".acl-button-show", this.on_button_show.bind(this)); $(document).on("click", ".acl-button-show", this.on_button_show.bind(this));
$(document).on("click", ".acl-button-hide", this.on_button_hide.bind(this)); $(document).on("click", ".acl-button-hide", this.on_button_hide.bind(this));
$("#acl-search").keypress(this.on_search.bind(this)); $("#acl-search").keypress(this.on_search.bind(this));
$("#acl-wrapper").parents("form").submit(this.on_submit.bind(this)); $("#acl-wrapper").parents("form").submit(this.on_submit.bind(this));
/* add/remove mentions */ /* add/remove mentions */
this.element = $("#profile-jot-text"); this.element = $("#profile-jot-text");
this.htmlelm = this.element.get()[0]; this.htmlelm = this.element.get()[0];
/* startup! */ /* startup! */
this.get(0,100); this.get(0,100);
} }
ACL.prototype.remove_mention = function(id) { ACL.prototype.remove_mention = function(id) {
if (!this.automention) return; if (!this.automention) {
var nick = this.data[id].nick; return;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
start = this.element.val().indexOf(searchText);
if ( start<0) return;
end = start+searchText.length;
this.element.setSelection(start,end).replaceSelectedText('').collapseSelection(false);
} else {
start = tinyMCE.activeEditor.getContent({format : 'raw'}).search( searchText );
if ( start<0 ) return;
txt = tinyMCE.activeEditor.getContent();
newtxt = txt.replace(searchText, '');
tinyMCE.activeEditor.setContent(newtxt);
} }
var nick = this.data[id].nick;
var searchText = "@" + nick + "+" + id + " ";
var start = this.element.val().indexOf(searchText);
if (start < 0) {
return;
}
var end = start + searchText.length;
this.element.setSelection(start, end).replaceSelectedText('').collapseSelection(false);
} }
ACL.prototype.add_mention = function(id) { ACL.prototype.add_mention = function(id) {
if (!this.automention) return; if (!this.automention) {
var nick = this.data[id].nick; return;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
if ( this.element.val().indexOf( searchText) >= 0 ) return;
this.element.val( searchText + this.element.val() );
} else {
if ( tinyMCE.activeEditor.getContent({format : 'raw'}).search(searchText) >= 0 ) return;
tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'dummy', {}, searchText);
} }
var nick = this.data[id].nick;
var searchText = "@" + nick + "+" + id + " ";
if (this.element.val().indexOf( searchText) >= 0 ) {
return;
}
this.element.val(searchText + this.element.val());
} }
ACL.prototype.on_submit = function(){ ACL.prototype.on_submit = function(){
aclfileds = $("#acl-fields").html(""); var aclfields = $("#acl-fields").html("");
$(this.allow_gid).each(function(i,v){ $(this.allow_gid).each(function(i,v){
aclfileds.append("<input type='hidden' name='group_allow[]' value='"+v+"'>"); aclfields.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
}); });
$(this.allow_cid).each(function(i,v){ $(this.allow_cid).each(function(i,v){
aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>"); aclfields.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
}); });
$(this.deny_gid).each(function(i,v){ $(this.deny_gid).each(function(i,v){
aclfileds.append("<input type='hidden' name='group_deny[]' value='"+v+"'>"); aclfields.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
}); });
$(this.deny_cid).each(function(i,v){ $(this.deny_cid).each(function(i,v){
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>"); aclfields.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
}); });
} }
ACL.prototype.search = function(){ ACL.prototype.search = function(){
@ -103,19 +98,19 @@ ACL.prototype.on_search = function(event){
ACL.prototype.on_showall = function(event){ ACL.prototype.on_showall = function(event){
event.preventDefault() event.preventDefault()
event.stopPropagation(); event.stopPropagation();
if (this.showall.hasClass("selected")){ if (this.showall.hasClass("selected")){
return false; return false;
} }
this.showall.addClass("selected"); this.showall.addClass("selected");
this.allow_cid = []; this.allow_cid = [];
this.allow_gid = []; this.allow_gid = [];
this.deny_cid = []; this.deny_cid = [];
this.deny_gid = []; this.deny_gid = [];
this.update_view(); this.update_view();
return false; return false;
} }
@ -123,7 +118,7 @@ ACL.prototype.on_button_show = function(event){
event.preventDefault() event.preventDefault()
event.stopImmediatePropagation() event.stopImmediatePropagation()
event.stopPropagation(); event.stopPropagation();
this.set_allow($(event.target).parent().attr('id')); this.set_allow($(event.target).parent().attr('id'));
return false; return false;
@ -141,7 +136,7 @@ ACL.prototype.on_button_hide = function(event){
ACL.prototype.set_allow = function(itemid){ ACL.prototype.set_allow = function(itemid){
type = itemid[0]; type = itemid[0];
id = parseInt(itemid.substr(1)); id = parseInt(itemid.substr(1));
switch(type){ switch(type){
case "g": case "g":
if (this.allow_gid.indexOf(id)<0){ if (this.allow_gid.indexOf(id)<0){
@ -159,7 +154,7 @@ ACL.prototype.set_allow = function(itemid){
this.allow_cid.remove(id); this.allow_cid.remove(id);
if (this.data[id].forum=="1") this.remove_mention(id); if (this.data[id].forum=="1") this.remove_mention(id);
} }
if (this.deny_cid.indexOf(id)>=0) this.deny_cid.remove(id); if (this.deny_cid.indexOf(id)>=0) this.deny_cid.remove(id);
break; break;
} }
this.update_view(); this.update_view();
@ -168,7 +163,7 @@ ACL.prototype.set_allow = function(itemid){
ACL.prototype.set_deny = function(itemid){ ACL.prototype.set_deny = function(itemid){
type = itemid[0]; type = itemid[0];
id = parseInt(itemid.substr(1)); id = parseInt(itemid.substr(1));
switch(type){ switch(type){
case "g": case "g":
if (this.deny_gid.indexOf(id)<0){ if (this.deny_gid.indexOf(id)<0){
@ -202,31 +197,31 @@ ACL.prototype.update_view = function(){
/* jot acl */ /* jot acl */
$('#jot-perms-icon').removeClass('lock').addClass('unlock'); $('#jot-perms-icon').removeClass('lock').addClass('unlock');
$('#jot-public').show(); $('#jot-public').show();
$('.profile-jot-net input').attr('disabled', false); $('.profile-jot-net input').attr('disabled', false);
if(typeof editor != 'undefined' && editor != false) { if(typeof editor != 'undefined' && editor != false) {
$('#profile-jot-desc').html(ispublic); $('#profile-jot-desc').html(ispublic);
} }
} else { } else {
this.showall.removeClass("selected"); this.showall.removeClass("selected");
/* jot acl */ /* jot acl */
$('#jot-perms-icon').removeClass('unlock').addClass('lock'); $('#jot-perms-icon').removeClass('unlock').addClass('lock');
$('#jot-public').hide(); $('#jot-public').hide();
$('.profile-jot-net input').attr('disabled', 'disabled'); $('.profile-jot-net input').attr('disabled', 'disabled');
$('#profile-jot-desc').html('&nbsp;'); $('#profile-jot-desc').html('&nbsp;');
} }
$("#acl-list-content .acl-list-item").each(function(){ $("#acl-list-content .acl-list-item").each(function(){
$(this).removeClass("groupshow grouphide"); $(this).removeClass("groupshow grouphide");
}); });
$("#acl-list-content .acl-list-item").each(function(index, element){ $("#acl-list-content .acl-list-item").each(function(index, element){
itemid = $(element).attr('id'); itemid = $(element).attr('id');
type = itemid[0]; type = itemid[0];
id = parseInt(itemid.substr(1)); id = parseInt(itemid.substr(1));
btshow = $(element).children(".acl-button-show").removeClass("selected"); btshow = $(element).children(".acl-button-show").removeClass("selected");
bthide = $(element).children(".acl-button-hide").removeClass("selected"); bthide = $(element).children(".acl-button-hide").removeClass("selected");
switch(type){ switch(type){
case "g": case "g":
var uclass = ""; var uclass = "";
@ -240,7 +235,7 @@ ACL.prototype.update_view = function(){
bthide.addClass("selected"); bthide.addClass("selected");
uclass="grouphide"; uclass="grouphide";
} }
$(this.group_uids[id]).each(function(i,v) { $(this.group_uids[id]).each(function(i,v) {
if(uclass == "grouphide") if(uclass == "grouphide")
$("#c"+v).removeClass("groupshow"); $("#c"+v).removeClass("groupshow");
@ -253,7 +248,7 @@ ACL.prototype.update_view = function(){
$("#c"+v).addClass(uclass); $("#c"+v).addClass(uclass);
} }
}); });
break; break;
case "c": case "c":
if (this.allow_cid.indexOf(id)>=0){ if (this.allow_cid.indexOf(id)>=0){
@ -263,11 +258,11 @@ ACL.prototype.update_view = function(){
if (this.deny_cid.indexOf(id)>=0){ if (this.deny_cid.indexOf(id)>=0){
btshow.removeClass("selected"); btshow.removeClass("selected");
bthide.addClass("selected"); bthide.addClass("selected");
} }
} }
}.bind(this)); }.bind(this));
} }
@ -277,7 +272,7 @@ ACL.prototype.get = function(start,count, search){
count:count, count:count,
search:search, search:search,
} }
$.ajax({ $.ajax({
type:'POST', type:'POST',
url: this.url, url: this.url,
@ -295,7 +290,7 @@ ACL.prototype.populate = function(data){
html = "<div class='acl-list-item {4} {5} type{2}' title='{6}' id='{2}{3}'>"+this.item_tpl+"</div>"; html = "<div class='acl-list-item {4} {5} type{2}' title='{6}' id='{2}{3}'>"+this.item_tpl+"</div>";
html = html.format(item.photo, item.name, item.type, item.id, (item.forum=='1'?'forum':''), item.network, item.link); html = html.format(item.photo, item.name, item.type, item.id, (item.forum=='1'?'forum':''), item.network, item.link);
if (item.uids!=undefined) this.group_uids[item.id] = item.uids; if (item.uids!=undefined) this.group_uids[item.id] = item.uids;
this.list_content.append(html); this.list_content.append(html);
this.data[item.id] = item; this.data[item.id] = item;
}.bind(this)); }.bind(this));
@ -303,7 +298,7 @@ ACL.prototype.populate = function(data){
// Add src attribute for images with a data-src attribute // Add src attribute for images with a data-src attribute
$(el).attr('src', $(el).data("src")); $(el).attr('src', $(el).data("src"));
}); });
this.update_view(); this.update_view();
} }

View file

@ -2,10 +2,10 @@
* @brief Friendica people autocomplete * @brief Friendica people autocomplete
* *
* require jQuery, jquery.textcomplete * require jQuery, jquery.textcomplete
* *
* for further documentation look at: * for further documentation look at:
* http://yuku-t.com/jquery-textcomplete/ * http://yuku-t.com/jquery-textcomplete/
* *
* https://github.com/yuku-t/jquery-textcomplete/blob/master/doc/how_to_use.md * https://github.com/yuku-t/jquery-textcomplete/blob/master/doc/how_to_use.md
*/ */
@ -91,7 +91,7 @@ function editor_replace(item) {
// 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way. // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
// 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id). // 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
if(id.length > 16) if(id.length > 16)
id = item.id.substring(0,16); id = item.id.substring(0,16);
return '$1$2' + item.nick.replace(' ', '') + '+' + id + ' '; return '$1$2' + item.nick.replace(' ', '') + '+' + id + ' ';
@ -347,61 +347,38 @@ function string2bb(element) {
})( jQuery ); })( jQuery );
/** /**
* Friendica people autocomplete legacy * Friendica people autocomplete legacy code
* code which is needed for tinymce
* *
* require jQuery, jquery.textareas * require jQuery, jquery.textareas
*/ */
function ACPopup(elm, backend_url){
function ACPopup(elm,backend_url){ this.idsel = -1;
this.idsel=-1;
this.element = elm; this.element = elm;
this.searchText=""; this.searchText = '';
this.ready=true; this.ready = true;
this.kp_timer = false; this.kp_timer = false;
this.url = backend_url; this.url = backend_url;
this.conversation_id = null; this.conversation_id = null;
var conv_id = this.element.id.match(/\d+$/); var conv_id = this.element.id.match(/\d+$/);
if (conv_id) this.conversation_id = conv_id[0]; if (conv_id) {
console.log("ACPopup elm id",this.element.id,"conversation",this.conversation_id); this.conversation_id = conv_id[0];
var w = 530;
var h = 130;
if(tinyMCE.activeEditor == null) {
style = $(elm).offset();
w = $(elm).width();
h = $(elm).height();
}
else {
// I can't find an "official" way to get the element who get all
// this fraking thing that is tinyMCE.
// This code will broke again at some point...
var container = $(tinyMCE.activeEditor.getContainer()).find("table");
style = $(container).offset();
w = $(container).width();
h = $(container).height();
} }
style.top=style.top+h; var w = $(elm).width();
var h = $(elm).height();
var style = $(elm).offset();
style.top = style.top + h;
style.width = w; style.width = w;
style.position = 'absolute'; style.position = 'absolute';
/* style['max-height'] = '150px';
style.border = '1px solid red';
style.background = '#cccccc';
style.overflow = 'auto';
style['z-index'] = '100000';
*/
style.display = 'none'; style.display = 'none';
this.cont = $("<div class='acpopup-mce'></div>"); this.cont = $('<div class="acpopup-mce"></div>');
this.cont.css(style); this.cont.css(style);
$("body").append(this.cont); $('body').append(this.cont);
} }
ACPopup.prototype.close = function(){ ACPopup.prototype.close = function(){
$(this.cont).remove(); $(this.cont).remove();
@ -449,48 +426,42 @@ ACPopup.prototype._search = function(){
} }
ACPopup.prototype.add = function(label, value){ ACPopup.prototype.add = function(label, value){
var that=this; var that = this;
var elm = $("<div class='acpopupitem' title='"+value+"'>"+label+"</div>"); var elm = $('<div class="acpopupitem" title="' + value + '">' + label + '</div>');
elm.click(function(e){ elm.click(function(e){
t = $(this).attr('title').replace(new RegExp(' \- .*'),''); t = $(this).attr('title').replace(new RegExp(' \- .*'), '');
if(typeof(that.element.container) === "undefined") { el = $(that.element);
el=$(that.element); sel = el.getSelection();
sel = el.getSelection(); sel.start = sel.start - that.searchText.length;
sel.start = sel.start- that.searchText.length; el.setSelection(sel.start, sel.end).replaceSelectedText(t + ' ').collapseSelection(false);
el.setSelection(sel.start,sel.end).replaceSelectedText(t+' ').collapseSelection(false); that.close();
that.close();
}
else {
txt = tinyMCE.activeEditor.getContent();
// alert(that.searchText + ':' + t);
newtxt = txt.replace('@' + that.searchText,'@' + t +' ');
tinyMCE.activeEditor.setContent(newtxt);
tinyMCE.activeEditor.focus();
that.close();
}
}); });
$(this.cont).append(elm); $(this.cont).append(elm);
} }
ACPopup.prototype.onkey = function(event){ ACPopup.prototype.onkey = function(event){
if (event.keyCode == '13') { if (event.keyCode == '13') {
if(this.idsel>-1) { if(this.idsel > -1) {
this.cont.children()[this.idsel].click(); this.cont.children()[this.idsel].click();
event.preventDefault(); event.preventDefault();
} } else {
else
this.close(); this.close();
}
} }
if (event.keyCode == '38') { //cursor up if (event.keyCode == '38') { //cursor up
cmax = this.cont.children().size()-1; var cmax = this.cont.children().size() - 1;
this.idsel--; this.idsel--;
if (this.idsel<0) this.idsel=cmax; if (this.idsel < 0) {
this.idsel = cmax;
}
event.preventDefault(); event.preventDefault();
} }
if (event.keyCode == '40' || event.keyCode == '9') { //cursor down if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
cmax = this.cont.children().size()-1; var cmax = this.cont.children().size() - 1;
this.idsel++; this.idsel++;
if (this.idsel>cmax) this.idsel=0; if (this.idsel > cmax) {
this.idsel = 0;
}
event.preventDefault(); event.preventDefault();
} }

View file

@ -122,9 +122,6 @@
input.val(val); input.val(val);
}); });
/* setup field_richtext */
setupFieldRichtext();
/* popup menus */ /* popup menus */
function close_last_popup_menu() { function close_last_popup_menu() {
if(last_popup_menu) { if(last_popup_menu) {
@ -659,7 +656,6 @@
function preview_post() { function preview_post() {
$("#jot-preview").val("1"); $("#jot-preview").val("1");
$("#jot-preview-content").show(); $("#jot-preview-content").show();
tinyMCE.triggerSave();
$.post( $.post(
"item", "item",
$("#profile-jot-form").serialize(), $("#profile-jot-form").serialize(),
@ -771,59 +767,6 @@ function notifyMarkAll() {
}); });
} }
// code from http://www.tinymce.com/wiki.php/How-to_implement_a_custom_file_browser
function fcFileBrowser (field_name, url, type, win) {
/* TODO: If you work with sessions in PHP and your client doesn't accept cookies you might need to carry
the session name and session ID in the request string (can look like this: "?PHPSESSID=88p0n70s9dsknra96qhuk6etm5").
These lines of code extract the necessary parameters and add them back to the filebrowser URL again. */
var cmsURL = baseurl+"/fbrowser/"+type+"/";
tinyMCE.activeEditor.windowManager.open({
file : cmsURL,
title : 'File Browser',
width : 420, // Your dimensions may differ - toy around with them!
height : 400,
resizable : "yes",
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}
function setupFieldRichtext(){
tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
editor_selector: "fieldRichtext",
plugins : "bbcode,paste, inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
theme_advanced_blockformats : "blockquote,code",
theme_advanced_resizing : true,
paste_text_sticky : true,
entity_encoding : "raw",
add_unload_trigger : false,
remove_linebreaks : false,
//force_p_newlines : false,
//force_br_newlines : true,
forced_root_block : 'div',
convert_urls: false,
content_css: baseurl+"/view/custom_tinymce.css",
theme_advanced_path : false,
file_browser_callback : "fcFileBrowser",
});
}
/** /**
* sprintf in javascript * sprintf in javascript
* "{0} and {1}".format('zero','uno'); * "{0} and {1}".format('zero','uno');

View file

@ -1,8 +0,0 @@
In order to make TinyMCE work smoothly with Friendica, the files in this directory are those few files we've changed in TinyMCE. We will attempt to keep them current, but if you decide to upgrade tinymce, it is best to save current copies of the files in question from the active tinymce tree and replace them or merge them after upgrade.
Except for some simple theming, the primary changes are the advanced theme icon set, which we changed the "html" icon to "[]" to represent BBcode, and major changes have been made to the bbcode plugin.
in TinyMCE 3.5b2 it appears that we are getting double linefeeds. Code has been put in place in mod/item.php and mod/message.php to reduce the duplicates.

View file

@ -1,268 +0,0 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
/* Macgirvin Aug-2010 changed from punbb to dfrn dialect */
(function() {
tinymce.create('tinymce.plugins.BBCodePlugin', {
init : function(ed, url) {
var t = this, dialect = ed.getParam('bbcode_dialect', 'dfrn').toLowerCase();
ed.onBeforeSetContent.add(function(ed, o) {
o.content = t['_' + dialect + '_bbcode2html'](o.content);
});
ed.onPostProcess.add(function(ed, o) {
if (o.set)
o.content = t['_' + dialect + '_bbcode2html'](o.content);
if (o.get)
o.content = t['_' + dialect + '_html2bbcode'](o.content);
});
},
getInfo : function() {
return {
longname : 'BBCode Plugin',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
},
// Private methods
// HTML -> BBCode in DFRN dialect
_dfrn_html2bbcode : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
s = s.replace(re,str);
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
/* This doesn't seem to work well with
[code]line1
line2[/code]
commenting out for now
*/
/*
var o = new Array();
var x = s.split("[code]");
var i = 0;
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
s = o.join("[code]");
*/
};
/* oembed */
function _h2b_cb(match) {
/*
function s_h2b(data) {
match = data;
}
$.ajax({
type:"POST",
url: 'oembed/h2b',
data: {text: match},
async: false,
success: s_h2b,
dataType: 'html'
});
*/
var f, g, tof = [], tor = [];
var find_spanc = /<span [^>]*class *= *[\"'](?:[^\"']* )*oembed(?: [^\"']*)*[\"'][^>]*>(.*?(?:<span[^>]*>(.*?)<\/span *>)*.*?)<\/span *>/ig;
while (f = find_spanc.exec(match)) {
var find_a = /<a([^>]* rel=[\"']oembed[\"'][^>]*)>.*?<\/a *>/ig;
if (g = find_a.exec(f[1])) {
var find_href = /href=[\"']([^\"']*)[\"']/ig;
var m2 = find_href.exec(g[1]);
if (m2[1]) {
tof.push(f[0]);
tor.push("[EMBED]" + m2[1] + "[/EMBED]");
}
}
}
for (var i = 0; i < tof.length; i++) match = match.replace(tof[i], tor[i]);
return match;
}
if (s.indexOf('class="oembed')>=0){
//alert("request oembed html2bbcode");
s = _h2b_cb(s);
}
/* /oembed */
// example: <strong> to [b]
rep(/<a class=\"bookmark\" href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[bookmark=$1]$2[/bookmark]");
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/<span style=\"color:(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
rep(/<font>(.*?)<\/font>/gi,"$1");
rep(/<img.*?width=\"(.*?)\".*?height=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$1x$2]$3[/img]");
rep(/<img.*?height=\"(.*?)\".*?width=\"(.*?)\".*?src=\"(.*?)\".*?\/>/gi,"[img=$2x$1]$3[/img]");
rep(/<img.*?src=\"(.*?)\".*?height=\"(.*?)\".*?width=\"(.*?)\".*?\/>/gi,"[img=$3x$2]$1[/img]");
rep(/<img.*?src=\"(.*?)\".*?width=\"(.*?)\".*?height=\"(.*?)\".*?\/>/gi,"[img=$2x$3]$1[/img]");
rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
rep(/<ul class=\"listbullet\" style=\"list-style-type\: circle\;\">(.*?)<\/ul>/gi,"[list]$1[/list]");
rep(/<ul class=\"listnone\" style=\"list-style-type\: none\;\">(.*?)<\/ul>/gi,"[list=]$1[/list]");
rep(/<ul class=\"listdecimal\" style=\"list-style-type\: decimal\;\">(.*?)<\/ul>/gi,"[list=1]$1[/list]");
rep(/<ul class=\"listlowerroman\" style=\"list-style-type\: lower-roman\;\">(.*?)<\/ul>/gi,"[list=i]$1[/list]");
rep(/<ul class=\"listupperroman\" style=\"list-style-type\: upper-roman\;\">(.*?)<\/ul>/gi,"[list=I]$1[/list]");
rep(/<ul class=\"listloweralpha\" style=\"list-style-type\: lower-alpha\;\">(.*?)<\/ul>/gi,"[list=a]$1[/list]");
rep(/<ul class=\"listupperalpha\" style=\"list-style-type\: upper-alpha\;\">(.*?)<\/ul>/gi,"[list=A]$1[/list]");
rep(/<li>(.*?)<\/li>/gi,'[li]$1[/li]');
rep(/<code>(.*?)<\/code>/gi,"[code]$1[/code]");
rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]");
rep(/<\/(em|i)>/gi,"[/i]");
rep(/<(em|i)>/gi,"[i]");
rep(/<\/u>/gi,"[/u]");
rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
rep(/<u>/gi,"[u]");
rep(/<blockquote[^>]*>/gi,"[quote]");
rep(/<\/blockquote>/gi,"[/quote]");
rep(/<hr \/>/gi,"[hr]");
rep(/<br (.*?)\/>/gi,"\n");
rep(/<br\/>/gi,"\n");
rep(/<br>/gi,"\n");
rep(/<p>/gi,"");
rep(/<\/p>/gi,"\n");
rep(/&nbsp;/gi," ");
rep(/&quot;/gi,"\"");
rep(/&lt;/gi,"<");
rep(/&gt;/gi,">");
rep(/&amp;/gi,"&");
return s;
},
// BBCode -> HTML from DFRN dialect
_dfrn_bbcode2html : function(s) {
s = tinymce.trim(s);
function rep(re, str) {
//modify code to keep stuff intact within [code][/code] blocks
//Waitman Gobble NO WARRANTY
var o = new Array();
var x = s.split("[code]");
var i = 0;
var si = "";
si = x.shift();
si = si.replace(re,str);
o.push(si);
for (i = 0; i < x.length; i++) {
var no = new Array();
var j = x.shift();
var g = j.split("[/code]");
no.push(g.shift());
si = g.shift();
si = si.replace(re,str);
no.push(si);
o.push(no.join("[/code]"));
}
s = o.join("[code]");
};
// example: [b] to <strong>
rep(/\n/gi,"<br />");
rep(/\[b\]/gi,"<strong>");
rep(/\[\/b\]/gi,"</strong>");
rep(/\[i\]/gi,"<em>");
rep(/\[\/i\]/gi,"</em>");
rep(/\[u\]/gi,"<u>");
rep(/\[\/u\]/gi,"</u>");
rep(/\[hr\]/gi,"<hr />");
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"<a class=\"bookmark\" href=\"$1\">$2</a>");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
rep(/\[list\](.*?)\[\/list\]/gi, '<ul class="listbullet" style="list-style-type: circle;">$1</ul>');
rep(/\[list=\](.*?)\[\/list\]/gi, '<ul class="listnone" style="list-style-type: none;">$1</ul>');
rep(/\[list=1\](.*?)\[\/list\]/gi, '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>');
rep(/\[list=i\](.*?)\[\/list\]/gi,'<ul class="listlowerroman" style="list-style-type: lower-roman;">$1</ul>');
rep(/\[list=I\](.*?)\[\/list\]/gi, '<ul class="listupperroman" style="list-style-type: upper-roman;">$1</ul>');
rep(/\[list=a\](.*?)\[\/list\]/gi, '<ul class="listloweralpha" style="list-style-type: lower-alpha;">$1</ul>');
rep(/\[list=A\](.*?)\[\/list\]/gi, '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$1</ul>');
rep(/\[li\](.*?)\[\/li\]/gi, '<li>$1</li>');
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");
rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");
rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");
/* oembed */
function _b2h_cb(match, url) {
url = bin2hex(url);
function s_b2h(data) {
match = data;
}
$.ajax({
url: 'oembed/b2h?url=' + url,
async: false,
success: s_b2h,
dataType: 'html'
});
return match;
}
s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
/* /oembed */
return s;
}
});
// Register plugin
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,117 +0,0 @@
/* Generic */
body {
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
scrollbar-3dlight-color:#F0F0EE;
scrollbar-arrow-color:#676662;
scrollbar-base-color:#F0F0EE;
scrollbar-darkshadow-color:#DDDDDD;
scrollbar-face-color:#E0E0DD;
scrollbar-highlight-color:#F0F0EE;
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
background:#F0F0EE;
padding:0;
margin:8px 8px 0 8px;
}
html {background:#F0F0EE;}
td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
textarea {resize:none;outline:none;}
a:link, a:visited {color:black;}
a:hover {color:#2B6FB6;}
.nowrap {white-space: nowrap}
/* Forms */
fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
legend {color:#2B6FB6; font-weight:bold;}
label.msg {display:none;}
label.invalid {color:#EE0000; display:inline;}
input.invalid {border:1px solid #EE0000;}
input {background:#FFF; border:1px solid #CCC;}
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
input, select, textarea {border:1px solid #808080;}
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
.input_noborder {border:0;}
/* Buttons */
#insert, #cancel, input.button, .updateButton {
border:0; margin:0; padding:0;
font-weight:bold;
width:94px; height:26px;
background:url(img/buttons.png) 0 -26px;
cursor:pointer;
padding-bottom:2px;
float:left;
}
#insert {background:url(img/buttons.png) 0 -52px}
#cancel {background:url(img/buttons.png) 0 0; float:right}
/* Browse */
a.pickcolor, a.browse {text-decoration:none}
a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
.mceOldBoxModel a.browse span {width:22px; height:20px;}
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
a.pickcolor:hover span {background-color:#B2BBD0;}
a.pickcolor:hover span.disabled {}
/* Charmap */
table.charmap {border:1px solid #AAA; text-align:center}
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
#charmap a {display:block; color:#000; text-decoration:none; border:0}
#charmap a:hover {background:#CCC;color:#2B6FB6}
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
/* Source */
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
.mceActionPanel {margin-top:5px;}
/* Tabs classes */
.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
.tabs ul {margin:0; padding:0; list-style:none;}
.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */
.column {float:left;}
.properties {width:100%;}
.properties .column1 {}
.properties .column2 {text-align:left;}
/* Titles */
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
h3 {font-size:14px;}
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
/* Dialog specific */
#link .panel_wrapper, #link div.current {height:125px;}
#image .panel_wrapper, #image div.current {height:200px;}
#plugintable thead {font-weight:bold; background:#DDD;}
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
#plugintable {width:96%; margin-top:10px;}
#pluginscontainer {height:290px; overflow:auto;}
#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
#colorpicker #light div {overflow:hidden;}
#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
#colorpicker .panel_wrapper div.current {height:175px;}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
#colorpicker #colornamecontainer {margin-top:5px;}
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}

View file

@ -1,213 +0,0 @@
/* Reset */
.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
.defaultSkin table td {vertical-align:middle}
/* Containers */
.defaultSkin table {direction:ltr; background:#FFF}
.defaultSkin iframe {display:block; background:#FFF}
.defaultSkin .mceToolbar {height:26px}
.defaultSkin .mceLeft {text-align:left}
.defaultSkin .mceRight {text-align:right}
/* External */
.defaultSkin .mceExternalToolbar {position:absolute; border:2px solid #CCC; border-bottom:0; display:none;}
.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
/* Layout */
.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}
.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top}
.defaultSkin .mceIframeContainer { /*border-top:1px solid #CCC; border-bottom:1px solid #CCC */ border: none;}
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
.defaultSkin .mceStatusbar div {float:left; margin:2px}
.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
.defaultSkin table.mceToolbar {margin-left:3px}
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
.defaultSkin td.mceCenter {text-align:center;}
.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}
.defaultSkin td.mceRight table {margin:0 0 0 auto;}
/* Button */
.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:10px}
.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
.defaultSkin .mceButtonLabeled {width:auto}
.defaultSkin .mceButtonLabeled span.mceIcon {float:left}
.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}
/* Separator */
.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
/* ListBox */
.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}
.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}
.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}
.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}
.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}
.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
/* SplitButton */
.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
.defaultSkin .mceSplitButton span.mceOpen {display:none}
.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}
.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}
.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}
/* ColorSplitButton */
.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
.defaultSkin .mceColorSplitMenu td {padding:2px}
.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}
.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
/* Menu */
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
.defaultSkin .mceNoIcons span.mceIcon {width:0;}
.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
.defaultSkin .mceMenu table {background:#FFF}
.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
.defaultSkin .mceMenu td {height:20px}
.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}
.defaultSkin .mceMenu pre.mceText {font-family:Monospace}
.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
.defaultSkin .mceMenuItemDisabled .mceText {color:#888}
.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}
.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
.defaultSkin .mceMenu span.mceMenuLine {display:none}
.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
/* Progress,Resize */
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
/* Formats */
.defaultSkin .mce_formatPreview a {font-size:10px}
.defaultSkin .mce_p span.mceText {}
.defaultSkin .mce_address span.mceText {font-style:italic}
.defaultSkin .mce_pre span.mceText {font-family:monospace}
.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
/* Theme */
.defaultSkin span.mce_bold {background-position:0 0}
.defaultSkin span.mce_italic {background-position:-60px 0}
.defaultSkin span.mce_underline {background-position:-140px 0}
.defaultSkin span.mce_strikethrough {background-position:-120px 0}
.defaultSkin span.mce_undo {background-position:-160px 0}
.defaultSkin span.mce_redo {background-position:-100px 0}
.defaultSkin span.mce_cleanup {background-position:-40px 0}
.defaultSkin span.mce_bullist {background-position:-20px 0}
.defaultSkin span.mce_numlist {background-position:-80px 0}
.defaultSkin span.mce_justifyleft {background-position:-460px 0}
.defaultSkin span.mce_justifyright {background-position:-480px 0}
.defaultSkin span.mce_justifycenter {background-position:-420px 0}
.defaultSkin span.mce_justifyfull {background-position:-440px 0}
.defaultSkin span.mce_anchor {background-position:-200px 0}
.defaultSkin span.mce_indent {background-position:-400px 0}
.defaultSkin span.mce_outdent {background-position:-540px 0}
.defaultSkin span.mce_link {background-position:-500px 0}
.defaultSkin span.mce_unlink {background-position:-640px 0}
.defaultSkin span.mce_sub {background-position:-600px 0}
.defaultSkin span.mce_sup {background-position:-620px 0}
.defaultSkin span.mce_removeformat {background-position:-580px 0}
.defaultSkin span.mce_newdocument {background-position:-520px 0}
.defaultSkin span.mce_image {background-position:-380px 0}
.defaultSkin span.mce_help {background-position:-340px 0}
.defaultSkin span.mce_code {background-position:-260px 0}
.defaultSkin span.mce_hr {background-position:-360px 0}
.defaultSkin span.mce_visualaid {background-position:-660px 0}
.defaultSkin span.mce_charmap {background-position:-240px 0}
.defaultSkin span.mce_paste {background-position:-560px 0}
.defaultSkin span.mce_copy {background-position:-700px 0}
.defaultSkin span.mce_cut {background-position:-680px 0}
.defaultSkin span.mce_blockquote {background-position:-220px 0}
.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}
.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}
.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}
.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}
/* Plugins */
.defaultSkin span.mce_advhr {background-position:-0px -20px}
.defaultSkin span.mce_ltr {background-position:-20px -20px}
.defaultSkin span.mce_rtl {background-position:-40px -20px}
.defaultSkin span.mce_emotions {background-position:-60px -20px}
.defaultSkin span.mce_fullpage {background-position:-80px -20px}
.defaultSkin span.mce_fullscreen {background-position:-100px -20px}
.defaultSkin span.mce_iespell {background-position:-120px -20px}
.defaultSkin span.mce_insertdate {background-position:-140px -20px}
.defaultSkin span.mce_inserttime {background-position:-160px -20px}
.defaultSkin span.mce_absolute {background-position:-180px -20px}
.defaultSkin span.mce_backward {background-position:-200px -20px}
.defaultSkin span.mce_forward {background-position:-220px -20px}
.defaultSkin span.mce_insert_layer {background-position:-240px -20px}
.defaultSkin span.mce_insertlayer {background-position:-260px -20px}
.defaultSkin span.mce_movebackward {background-position:-280px -20px}
.defaultSkin span.mce_moveforward {background-position:-300px -20px}
.defaultSkin span.mce_media {background-position:-320px -20px}
.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}
.defaultSkin span.mce_pastetext {background-position:-360px -20px}
.defaultSkin span.mce_pasteword {background-position:-380px -20px}
.defaultSkin span.mce_selectall {background-position:-400px -20px}
.defaultSkin span.mce_preview {background-position:-420px -20px}
.defaultSkin span.mce_print {background-position:-440px -20px}
.defaultSkin span.mce_cancel {background-position:-460px -20px}
.defaultSkin span.mce_save {background-position:-480px -20px}
.defaultSkin span.mce_replace {background-position:-500px -20px}
.defaultSkin span.mce_search {background-position:-520px -20px}
.defaultSkin span.mce_styleprops {background-position:-560px -20px}
.defaultSkin span.mce_table {background-position:-580px -20px}
.defaultSkin span.mce_cell_props {background-position:-600px -20px}
.defaultSkin span.mce_delete_table {background-position:-620px -20px}
.defaultSkin span.mce_delete_col {background-position:-640px -20px}
.defaultSkin span.mce_delete_row {background-position:-660px -20px}
.defaultSkin span.mce_col_after {background-position:-680px -20px}
.defaultSkin span.mce_col_before {background-position:-700px -20px}
.defaultSkin span.mce_row_after {background-position:-720px -20px}
.defaultSkin span.mce_row_before {background-position:-740px -20px}
.defaultSkin span.mce_merge_cells {background-position:-760px -20px}
.defaultSkin span.mce_table_props {background-position:-980px -20px}
.defaultSkin span.mce_row_props {background-position:-780px -20px}
.defaultSkin span.mce_split_cells {background-position:-800px -20px}
.defaultSkin span.mce_template {background-position:-820px -20px}
.defaultSkin span.mce_visualchars {background-position:-840px -20px}
.defaultSkin span.mce_abbr {background-position:-860px -20px}
.defaultSkin span.mce_acronym {background-position:-880px -20px}
.defaultSkin span.mce_attribs {background-position:-900px -20px}
.defaultSkin span.mce_cite {background-position:-920px -20px}
.defaultSkin span.mce_del {background-position:-940px -20px}
.defaultSkin span.mce_ins {background-position:-960px -20px}
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
.defaultSkin span.mce_spellchecker {background-position:-540px -20px}

View file

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,477 +0,0 @@
Version 3.5.8 (2012-11-20)
Fixed bug where html5 data attributes where stripped from contents.
Fixed bug where toolbar was annouced multiple times with JAWS on Firefox.
Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode.
Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty.
Fixed bug with auto detection logic for youtube urls in the media plugin.
Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery.
Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks.
Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element.
Fixed bug where toggling of blockquotes when using br enter mode would produce an exception.
Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level.
Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8.
Version 3.5.7 (2012-09-20)
Changed table row properties dialog to not update multiple rows when row type is header or footer.
Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of --
Changing toolbars to have a toolbar role for FF keyboard navigation works correctly.
Fixed bug where applying formatting to an empty block element would produce redundant spans.
Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return.
Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors.
Fixed bug where some white space would be removed after inline elements before block elements.
Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents.
Fixed bug where noscript elements would loose it's contents on older IE versions.
Fixed bug where backspace inside empty blockquote wouldn't delete it properly.
Fixed bug where custom elements with . in their names wouldn't work properly.
Fixed bug where the custom_elements option didn't properly setup the block elements schema structure.
Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements.
Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it.
Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents.
Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s.
Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used.
Fixed issue with missing autofocus attribute on input element when using the HTML5 schema.
Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI.
Version 3.5.6 (2012-07-26)
Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents.
Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position.
Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected.
Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio.
Fixed so force_p_newlines option works again since some users want mixed mode paragraphs.
Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor.
Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko.
Version 3.5.5 (2012-07-19)
Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko.
Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas.
Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO.
Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO.
Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell.
Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false.
Fixed bug where scrollbars aren't visible in fullscreen when window is resized.
Fixed bug with updating the border size using the advimage dialog on IE 9.
Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element.
Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE.
Fixed bug where autolink plugin would produce an exception for specific html see bug #5365
Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format.
Version 3.5.4.1 (2012-06-24)
Fixed issue with Shift+A selecting all contents on Chrome.
Version 3.5.4 (2012-06-21)
Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge.
Added image resizing for WebKit browsers by faking the whole resize behavior.
Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly.
Fixed bug where media plugin wouldn't use placeholder size for the object/video elements.
Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded.
Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents.
Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values.
Version 3.5.3 (2012-06-19)
Added missing wbr element to HTML5 schema.
Added new mceToggleFormat command. Enabled you to toggle a specific format on/off.
Fixed bug where undo/redo state didn't update correctly after executing an execCommand call.
Fixed bug where the editor would get auto focused on IE running in quirks mode.
Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block.
Fixed bug where backspace would navigate back when selecting control types on IE.
Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI.
Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed.
Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers.
Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block.
Fixed bug where it wasn't possible to block events using the handle_event_callback option.
Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly.
Fixed bug where keyboard navigation didn't work correctly on split buttons.
Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in.
Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete.
Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE.
Fixed so paragraphs gets created if you press enter inside a form element.
Version 3.5.2 (2012-05-31)
Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats.
Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors.
Changed the default theme to be advanced instead of simple since most users uses the advanced theme.
Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified.
Changed the theme_advanced_toolbar_align default value to "left".
Changed the theme_advanced_toolbar_location default value to "top".
Changed the theme_advanced_statusbar_location default value to "bottom".
Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible.
Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic.
Fixed bug where the border attribute was missing in the HTML5 schema.
Fixed bug where the legacyoutput plugin would use inline styles for font color.
Fixed bug where editing of anchor names wouldn't produce an undo level.
Fixed bug where the table plugin would delete the last empty block element in the editor.
Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row.
Fixed bug with pressing enter in IE while having a select list focused would produce a JS error.
Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu.
Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog.
Version 3.5.1.1 (2012-05-25)
Fixed bug with control creation where plugin specific controls didn't work as expected.
Version 3.5.1 (2012-05-25)
Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney.
Added support for overriding the theme rendering logic by using a custom function.
Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode.
Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty.
Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string.
Fixed bug where named anchors wouldn't work properly when schema was set to HTML5.
Fixed bug where HTML5 datalist options wasn't correctly parsed or indented.
Fixed bug where linking would add anchors around block elements when the HTML5 schema was used.
Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com.
Optimized initialization and reduced rendering flicker by hiding the target element while initializing.
Version 3.5.0.1 (2012-05-10)
Fixed bug where selection normalization logic would break the selections of parent elements using the element path.
Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation.
Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter.
Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div.
Version 3.5 (2012-05-03)
Fixed menu rendering issue if the document was in rtl mode.
Fixed bug where the hide function would throw an error about a missing variable.
Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic.
Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time.
Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents.
Fixed bug where whitespace would be removed before/after invalid_elements when they where removed.
Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors.
Fixed bug where IE 8 would produce an error when using the contextmenu plugin.
Fixed bug where delete/backspace could remove contents of noneditable elements.
Fixed so background color in style preview gets computed from body element if the current style element is transparent.
Version 3.5b3 (2012-03-29)
Added cancel button to colour picker dialog.
Added figure and figcaption to the html5 visualblocks plugin.
Added default alignment options for the figure element.
Fixed bug where empty inline elements within block elements would sometimes produce a br child element.
Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson.
Fixed bug where enter inside an editable element inside an non editable element would split the element.
Fixed bug where cut/copy/paste of noneditable elements didn't work.
Fixed bug where backspace would sometimes produce font elements on WebKit.
Fixed bug where WebKit would produce spans out of various inline elements when using backspace.
Fixed bug where IE9 wouldn't properly update image styles when images where resized.
Fixed bug where drag/drop of noneditable elements didn't work correctly.
Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz.
Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path.
Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block.
Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko.
Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default.
Fixed bug where the tabfocus plugin would tab to iframes these are now ignored.
Fixed bug where format drop down list wouldn't show the currently active format for a parent element.
Fixed bug where paste of plain text in IE 9 would remove the new line characters from text.
Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions.
Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places.
Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error.
Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling.
Fixed so options like content_css accepts and array as well as a comma separated string as input.
Restructured the internal logic to make it more separate from Editor.js.
Updated the Sizzle engine to the latest version.
Version 3.5b2 (2012-03-15)
Rewrote the enter key logic to normalize browser behavior.
Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option.
Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node.
Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls.
Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection.
Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string.
Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default.
Version 3.5b1 (2012-03-08)
Added new event class that is faster and enables support for faking events.
Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema.
Added new schema option and support for the HTML5 schema.
Added new visualblocks plugin that shows html5 blocks with visual borders.
Added new types and selector options to make it easier to create editor instances with different configs.
Added new preview of formatting options in various listboxes.
Added new preview_styles option that enables control over what gets previewed.
Fixed bug where content css would be loaded twice into iframe.
Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed.
Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined.
Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting.
Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing.
Version 3.4.9 (2012-02-23)
Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete.
Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents.
Fixed bug where pressing enter on end of list item with a heading would create a new item with heading.
Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled.
Fixed bug in Gecko where undo wasn't added when focus was lost.
Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line.
Fixed bug where right-click on formatted text in IE selected the entire line.
Fixed bug where text ending with space could not be unformatted in IE.
Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used.
Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts.
Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config.
Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser.
Fixed bug where content css files where loaded twice into the iframe.
Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse.
Version 3.4.8 (2012-02-02)
Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text.
Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked.
Fixed bug where wrong text align buttons are active when multiple block elements are selected.
Fixed bug where selected link not showing in target field of link dialog in some selection cases.
Use settings for remove_trailing_br so this can be turned off instead of hard coding the value.
Fixed bug in IE where the media plugin displayed null text when some values aren't filled in.
Added API method 'onSetAttrib' that fires when the attribute value on a node changes.
Fix font size dropdown value not being updated when text already has a font size in the advanced template.
Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times.
Fixed bug where caret cannot be placed after table if table is at end of document in IE.
Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur.
Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly.
Fixed bug where a stranded bullet point would get created in WebKit.
Fixed bug where selecting text in a blockquote and pressing backspace toggles the style.
Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property.
Fix white space in between spans from being deleted.
Fixed bug where scrollbars where visible in the character map dialog on Gecko.
Fixed issue with missing translation for one of the emoticons.
Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev.
Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout.
Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace.
Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber.
Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu.
Version 3.4.7 (2011-11-03)
Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office.
Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text.
Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row.
Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10.
Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph.
Fix new list items in IE8 not displayed on a new line when list contains nested list items.
Clear formatting in table cell breaks the cell.
Made media type list localisable.
Fix out of memory error when using prototype in media dialog.
Fixed bug where could not add a space in the middle of a th cell.
Fixed bug where adding a bullet between two existing bullets adds an extra one
Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in.
Fixed bug where pressing enter on an empty list item does not outdent properly in FF
Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell
Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox.
Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph.
Fixed bug where deleting part of the link text can cause a link with no destination to be saved.
Fixed bug where css style border widths wasn't handled correctly in table dialog.
Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop.
Fixed bug where scripts with custom script types wasn't properly passed though the editor.
Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled.
Made emoticons dialog use the keyboard naviation.
Added navigation instructions to the symbols dialog.
Added ability to set default values for the media plugin.
Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties.
Fixed bug where the symbols dialog was not accessible.
Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility.
Fixed bug where the advanced color picker wasn't working properly on FF 7.
Fixed issue where the advanced color picker was producing uppercase hex codes.
Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements.
Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit.
Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes.
Version 3.4.6 (2011-09-29)
Fixed bug where list items were being created for empty divs.
Added support in Media plugin for audio media using the embed tag
Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read.
Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers)
Fixed bug where classid attribute was not being checked from embed objects.
Fixed bug in jsrobot tests with intermittently failing.
Fixed bug where anchors wasn't updated properly if you edited them using IE 8.
Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor.
Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them.
Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin.
Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin.
Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin.
Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko.
Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly.
Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers.
Version 3.4.5 (2011-09-06)
Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes.
Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved.
Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats.
Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly.
Fixed bug in WebKit where console messages would be logged when deleting an empty document.
Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list
Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements.
Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases.
Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM.
Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized.
Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control.
Fixed bug where adjacent links would get merged on IE due to bugs in their link command.
Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe.
Fixed bug where floated images in WebKit wouldn't get properly linked.
Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode.
Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P.
Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit.
Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit.
Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7.
Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit.
Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents.
Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text.
Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled.
Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin.
Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped.
Version 3.4.4 (2011-08-04)
Added new html5 audio support. Patch contributed by Ronald M. Clifford.
Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin.
Fixed selection to match visual selection before applying formatting changes.
Fixed browser specific bugs in lists for WebKit and IE.
Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel.
Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser.
Fixed bug where formatting change would be lost after pressing enter.
Fixed bug in WebKit where deleting across blocks would add extra styles.
Fixed bug where moving cursor vertically in tables in WebKit wasn't working.
Fixed bug in IE where deleting would cause error in console.
Fixed bug where the formatter was not applying formats across list elements.
Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed.
Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden.
Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko.
Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements.
Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event.
Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them.
Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog.
Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location.
Version 3.4.3.2 (2011-06-30)
Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit.
Fixed bugs in tests in firefox5 and WebKit.
Fixed bug where selection of table cells would produce an exception on Gecko.
Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden.
Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup.
Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection.
Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes.
Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document.
Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them.
Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed.
Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element.
Fixed performance issue with the noneditable plugin where it would enable/disable controls to often.
Version 3.4.3.1 (2011-06-16)
Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin.
Fixed bug where custom buttons were not being rendered correctly when in high contrast mode.
Added support for iOS 5 that now supporting contentEditable in it's latest beta.
Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output.
Fixed bug where custom_elements option wasn't working properly on IE browsers.
Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements.
Fixed bug where attributes with </> wasn't properly encoded as XML entities.
Version 3.4.3 (2011-06-09)
Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location.
Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly.
Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8.
Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs.
Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied.
Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page.
Fixed bug where applying a heading style to a list item would cascade style to children list items.
Fixed bug where Editor loses focus when backspacing and changing styles in WebKit.
Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided.
Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari.
Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk.
Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded.
Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ).
Added possibility to change properties of all table cells in a column.
Added external_image_list option to get images list from user-defined variable or function.
Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome.
Fixed bug where table size inputs were to small for values with size units.
Fixed bug where table cell/row size input values were not validated.
Fixed bug where menu item line-height would be set to wrong value by external styles.
Fixed bug where hasUndo() would return wrong answer.
Fixed bug where page title would be set to undefined by fullpage plugin.
Fixed bug where HTML5 video properties were not updated in embedded media settings.
Fixed bug where HTML comment on the first line would cause an error.
Fixed bug where spellchecker menu was positioned incorrectly on IE.
Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list.
Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped.
Fixed bug where numeric entities with leading zeros would produce incorrect decoding.
Fixed bug where hexadecimal entities wasn't properly decoded.
Fixed bug where bookmarks wasn't properly stored/restored on undo/redo.
Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents.
Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements.
Fixed so contentEditable is used for the body of the editor if it's supported.
Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null.
Fixed performance issue with mceInsertCommand and inserting very simple contents.
Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic.
Fixed performance issue with table plugin where it checked for selected cells to often.
Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers.
Fixed bug where Gecko would remove single paragraphs if there where contents before/after it.
Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin.
Version 3.4.2 (2011-04-07)
Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text.
Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz.
Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers.
Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser.
Fixed bug where blocks containing a single anchor element would be treated as empty.
Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed.
Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed.
Fixed bug where image border color/style values were overwritten by advimage plugin.
Fixed bug where setting border in advimage plugin would throw error in IE.
Fixed bug where empty anchors list in link settings wasn't hidden.
Fixed bug where xhtmlextras popups were missing localized popup-size parameters.
Fixed bug where the context menu wouldn't select images on WebKit browsers.
Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior.
Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control.
Fixed bug where contextmenu wasn't disabled on noneditable elements.
Fixed bug where getStyle function would trigger error when called on element without style property.
Fixed bug where editor fail to load if Javascript Compressor was used.
Fixed bug where list-style-type=lower-greek would produce errors in IE<8.
Fixed bug where spellchecker plugin would produce errors on IE6-7.
Fixed bug where theme_advanced_containers configuration option causes error.
Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value.
Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size.
Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog.
Version 3.4.1 (2011-03-24)
Added significantly improved list handling via the new 'lists' plugin.
Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default.
Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color.
Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour.
Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled.
Fixed bug where selection locations on undo/redo didn't work correctly on specific contents.
Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe.
Fixed bug where some ascii numeric entities wasn't properly decoded.
Fixed bug where some non western language codes wasn't properly decoded/encoded.
Fixed bug where undo levels wasn't created when deleting contents on IE.
Fixed bug where the initial undo levels bookmark wasn't updated correctly.
Fixed bug where search/replace wouldn't be scoped to editor instances on IE8.
Fixed bug where IE9 would produce two br elements after block elements when pasting.
Fixed bug where IE would place the caret at an incorrect position after a paste operation.
Fixed bug where a paste operation using the keyboard would add an extra undo level.
Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted.
Fixed bug where the table plugin couldn't correctly handle invalid table structures.
Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin.
Fixed bug where toggle states on some of the list boxes didn't update correctly.
Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10.
Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin.
Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid.
Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme.
Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome.
Fixed bug with references to non-existing images in css of fullpage plugin.
Fixed bug where item could be unselected in spellchecker's language selector.
Fixed bug where some mispelled words could be not highlighted using spellchecker plugin.
Fixed bug where spellchecking would merge some words on IE.
Fixed bug where spellchecker context menu was not always positioned correctly.
Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled.
Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents.
Fixed bug where selecting the whole table would enable table tools for cells and rows.
Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin.
Fixed bug where setting text color in fullpage plugin doesn't work.
Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly.
Fixed bug where black spade suit character was not included in special character selector.
Fixed bug where setting invalid values for table cell size would throw an error in IE.
Fixed bug where spellchecking would remove whitespace characters from PRE block in IE.
Fixed bug where HR was inserted inside P elements instead of splitting them.
Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes.
Fixed bug where bullet lists weren't always detected correctly.
Fixed bug where deleting some paragraphs on IE would cause an exception.
Fixed bug where the json encoder logic wouldn't properly encode \ characters.
Fixed bug where the onChange event would be fired when the editor was first initialized.
Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class.
Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences.
Fixed issue where styles were not included when using the full page plugin.
Fixed issue where drag/drop operations wasn't properly added to the undo levels.
Fixed issue where colors wasn't correctly applied to elements with underline decoration.
Fixed issue where deleting some paragraphs on IE would cause an exception.
Version 3.4 (2011-03-10)
Added accessibility example with various accessibility options contributed by Ephox.
Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin.
Fixed bug where the image.htm had some strange td artifacts probably due to auto merging.
Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method.
Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent.
Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode.
Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode.
Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode.
Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox.
Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme.
Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x.
Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right.
Fixed bug where the formatter would align images when the selection range was collapsed.
Fixed bug where the image button would be active when the selection range was collapsed.
Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic.
Fixed bug where the table cell/row dialogs would produce empty attributes.
Fixed bug where the tfoot wouldn't be added to the top of the table.
Fixed bug where the formatter would merge siblings with white space between them.
Fixed bug where pasting headers and paragraphs would produce an extra paragraph.
Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color.
Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting.
Fixed bug where multiple BR elements at end of block elements where removed.
Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages.
Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode.
Fixed bug where the search/replace plugin wouldn't work correctly on IE 9.
Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox.
Fixed so the values entered in the color picker are forced to hex values.
Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade.
Removed obsolete calls in various plugins to the mceBeginUndoLevel command.

View file

@ -1,101 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
// using false to ensure that the default browser settings are used for best Accessibility
// ACCESSIBILITY SETTINGS
content_css : false,
// Use browser preferred colors for dialogs.
browser_preferred_colors : true,
detect_highcontrast : true,
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<div>
<h3>Full featured example, with Accessibility settings enabled</h3>
<p>
This page has got the TinyMCE set up to work with configurations related to accessiblity enabled.
In particular
<ul>
<li>the <strong>content_css</strong> is set to false, to ensure that all default browser styles are used, </li>
<li>the <strong>browser_preferred_colors</strong> dialog option is used to ensure that default css is used for dialogs, </li>
<li>and the <strong>detect_highcontrast</strong> option has been set to ensure that highcontrast mode in Windows browsers
is detected and the toolbars are displayed in a high contrast mode.</li>
</ul>
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
</div>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

View file

@ -1,105 +0,0 @@
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.example1 {
font-weight: bold;
font-size: 14px
}
.example2 {
font-weight: bold;
font-size: 12px;
color: #FF0000
}
.tablerow1 {
background-color: #BBBBBB;
}
thead {
background-color: #FFBBBB;
}
tfoot {
background-color: #BBBBFF;
}
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}
/* Basic formats */
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
.underline {
text-decoration: underline;
}
/* Global align classes */
.left {
text-align: inherit;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
.full {
text-align: justify
}
/* Image and table specific aligns */
img.left, table.left {
float: left;
text-align: inherit;
}
img.center, table.center {
margin-left: auto;
margin-right: auto;
text-align: inherit;
}
img.center {
display: block;
}
img.right, table.right {
float: right;
text-align: inherit;
}

View file

@ -1,53 +0,0 @@
body {
background-color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
scrollbar-3dlight-color: #F0F0EE;
scrollbar-arrow-color: #676662;
scrollbar-base-color: #F0F0EE;
scrollbar-darkshadow-color: #DDDDDD;
scrollbar-face-color: #E0E0DD;
scrollbar-highlight-color: #F0F0EE;
scrollbar-shadow-color: #F0F0EE;
scrollbar-track-color: #F5F5F5;
}
p {margin:0; padding:0;}
td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
pre {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.example1 {
font-weight: bold;
font-size: 14px
}
.example2 {
font-weight: bold;
font-size: 12px;
color: #FF0000
}
.tablerow1 {
background-color: #BBBBBB;
}
thead {
background-color: #FFBBBB;
}
tfoot {
background-color: #BBBBFF;
}
th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
}

View file

@ -1,111 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Custom formats example</title>
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
formats : {
alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'},
aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'},
alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'},
alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'},
bold : {inline : 'span', 'classes' : 'bold'},
italic : {inline : 'span', 'classes' : 'italic'},
underline : {inline : 'span', 'classes' : 'underline', exact : true},
strikethrough : {inline : 'del'}
},
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<div>
<h3>Custom formats example</h3>
<p>
This example shows you how to override the default formats for bold, italic, underline, strikethough and alignment to use classes instead of inline styles.
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
<a href="javascript:;" onmousedown="tinyMCE.get('elm1').execCommand('Bold');">[Bold]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').getContent());">[Get contents]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent());">[Get selected HTML]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>
<a href="javascript:;" onmousedown="alert(tinyMCE.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
<a href="javascript:;" onmousedown="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

View file

@ -1,101 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body role="application">
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<div>
<h3>Full featured example</h3>
<p>
This page shows all available buttons and plugins that are included in the TinyMCE core package.
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<div>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
</div>
<!-- Some integration calls -->
<a href="javascript:;" onclick="tinyMCE.get('elm1').show();return false;">[Show]</a>
<a href="javascript:;" onclick="tinyMCE.get('elm1').hide();return false;">[Hide]</a>
<a href="javascript:;" onclick="tinyMCE.get('elm1').execCommand('Bold');return false;">[Bold]</a>
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').getContent());return false;">[Get contents]</a>
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent());return false;">[Get selected HTML]</a>
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));return false;">[Get selected text]</a>
<a href="javascript:;" onclick="alert(tinyMCE.get('elm1').selection.getNode().nodeName);return false;">[Get selected element]</a>
<a href="javascript:;" onclick="tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');return false;">[Insert HTML]</a>
<a href="javascript:;" onclick="tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');return false;">[Replace selection]</a>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

View file

@ -1,10 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>TinyMCE examples</title>
</head>
<frameset cols="180,80%">
<frame src="menu.html" name="menu" />
<frame src="full.html" name="main" />
</frameset>
</html>

View file

@ -1,9 +0,0 @@
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There images will be displayed as a dropdown in all image dialogs if the "external_link_image_url"
// option is defined in TinyMCE init.
var tinyMCEImageList = new Array(
// Name, URL
["Logo 1", "media/logo.jpg"],
["Logo 2 Over", "media/logo_over.jpg"]
);

View file

@ -1,10 +0,0 @@
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There links will be displayed as a dropdown in all link dialogs if the "external_link_list_url"
// option is defined in TinyMCE init.
var tinyMCELinkList = new Array(
// Name, URL
["Moxiecode", "http://www.moxiecode.com"],
["Freshmeat", "http://www.freshmeat.com"],
["Sourceforge", "http://www.sourceforge.com"]
);

View file

@ -1,14 +0,0 @@
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There flash movies will be displayed as a dropdown in all media dialog if the "media_external_list_url"
// option is defined in TinyMCE init.
var tinyMCEMediaList = [
// Name, URL
["Some Flash", "media/sample.swf"],
["Some Quicktime", "media/sample.mov"],
["Some AVI", "media/sample.avi"],
["Some RealMedia", "media/sample.rm"],
["Some Shockwave", "media/sample.dcr"],
["Some Video", "media/sample.mp4"],
["Some FLV", "media/sample.flv"]
];

View file

@ -1,9 +0,0 @@
// This list may be created by a server logic page PHP/ASP/ASPX/JSP in some backend system.
// There templates will be displayed as a dropdown in all media dialog if the "template_external_list_url"
// option is defined in TinyMCE init.
var tinyMCETemplateList = [
// Name, URL, Description
["Simple snippet", "templates/snippet1.htm", "Simple HTML snippet."],
["Layout", "templates/layout1.htm", "HTML Layout."]
];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -1 +0,0 @@
http://streaming.uga.edu/samples/ayp_lan.rm

View file

@ -1,18 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Menu</title>
<style>
a {display:block;}
</style>
</head>
<body>
<h3>Examples</h3>
<a href="full.html" target="main">Full featured</a>
<a href="simple.html" target="main">Simple theme</a>
<a href="skins.html" target="main">Skin support</a>
<a href="word.html" target="main">Word processor</a>
<a href="custom_formats.html" target="main">Custom formats</a>
<a href="accessibility.html" target="main">Accessibility Options</a>
</body>
</html>

View file

@ -1,47 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Simple theme example</title>
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<h3>Simple theme example</h3>
<p>
This page shows you the simple theme and it's core functionality you can extend it by changing the code use the advanced theme if you need to configure/add more buttons etc.
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

View file

@ -1,216 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Skin support example</title>
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
// Default skin
tinyMCE.init({
// General options
mode : "exact",
elements : "elm1",
theme : "advanced",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
// O2k7 skin
tinyMCE.init({
// General options
mode : "exact",
elements : "elm2",
theme : "advanced",
skin : "o2k7",
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
// O2k7 skin (silver)
tinyMCE.init({
// General options
mode : "exact",
elements : "elm3",
theme : "advanced",
skin : "o2k7",
skin_variant : "silver",
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
// O2k7 skin (silver)
tinyMCE.init({
// General options
mode : "exact",
elements : "elm4",
theme : "advanced",
skin : "o2k7",
skin_variant : "black",
plugins : "lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/content.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<h3>Skin support example</h3>
<p>
This page displays the two skins that TinyMCE comes with. You can make your own by creating a CSS file in themes/advanced/skins/<yout skin>/ui.css
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
<br />
<textarea id="elm2" name="elm2" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
<br />
<textarea id="elm3" name="elm3" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
<br />
<textarea id="elm4" name="elm4" rows="15" cols="80" style="width: 80%">
&lt;p&gt;
This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
&lt;/p&gt;
</textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

View file

@ -1,15 +0,0 @@
<table border="1">
<thead>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</thead>
<tbody>
<tr>
<td>Username: {$username}</td>
<td>Staffid: {$staffid}</td>
</tr>
</tbody>
</table>

View file

@ -1 +0,0 @@
This is just some <strong>code</strong>.

View file

@ -1,72 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Word processor example</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
skin : "o2k7",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example word content CSS (should be your site CSS) this one removes paragraph margins
content_css : "css/word.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
<h3>Word processor example</h3>
<p>
This page shows you how to configure TinyMCE to work more like common word processors.
There are more examples on how to use TinyMCE in the <a href="http://tinymce.moxiecode.com/examples/">Wiki</a>.
</p>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
&lt;p&gt;This is the first paragraph.&lt;/p&gt;
&lt;p&gt;This is the second paragraph.&lt;/p&gt;
&lt;p&gt;This is the third paragraph.&lt;/p&gt;
</textarea>
<br />
<input type="submit" name="save" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View file

@ -1,5 +0,0 @@
input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
.panel_wrapper div.current {height:80px;}
#width {width:50px; vertical-align:middle;}
#width2 {width:50px; vertical-align:middle;}
#size {width:100px;}

View file

@ -1 +0,0 @@
(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();

View file

@ -1,57 +0,0 @@
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
init : function(ed, url) {
// Register commands
ed.addCommand('mceAdvancedHr', function() {
ed.windowManager.open({
file : url + '/rule.htm',
width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
inline : 1
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('advhr', {
title : 'advhr.advhr_desc',
cmd : 'mceAdvancedHr'
});
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('advhr', n.nodeName == 'HR');
});
ed.onClick.add(function(ed, e) {
e = e.target;
if (e.nodeName === 'HR')
ed.selection.select(e);
});
},
getInfo : function() {
return {
longname : 'Advanced HR',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
})();

View file

@ -1,43 +0,0 @@
var AdvHRDialog = {
init : function(ed) {
var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
w = dom.getAttrib(n, 'width');
f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
},
update : function() {
var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
h = '<hr';
if (f.size.value) {
h += ' size="' + f.size.value + '"';
st += ' height:' + f.size.value + 'px;';
}
if (f.width.value) {
h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"';
st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';';
}
if (f.noshade.checked) {
h += ' noshade="noshade"';
st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;';
}
if (ed.settings.inline_styles)
h += ' style="' + tinymce.trim(st) + '"';
h += ' />';
ed.execCommand("mceInsertContent", false, h);
tinyMCEPopup.close();
}
};
tinyMCEPopup.requireLangPack();
tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);

View file

@ -1 +0,0 @@
tinyMCE.addI18n('en.advhr_dlg',{size:"Height",noshade:"No Shadow",width:"Width",normal:"Normal",widthunits:"Units"});

Some files were not shown because too many files have changed in this diff Show more