public $videoheight = 350;
public $force_max_items = 0;
public $theme_thread_allow = true;
- public $theme_richtext_editor = true;
public $theme_events_in_profile = true;
/**
* @return boolean
*/
function feature_enabled($uid, $feature) {
-
- if (($feature == 'richtext') AND !get_app()->theme_richtext_editor) {
- return false;
- }
-
$x = get_config('feature_lock', $feature);
if ($x === false) {
/**
* @brief check if feature is enabled or disabled by default
- *
+ *
* @param string $feature
* @return boolean
*/
/**
* @brief Get a list of all available features
- *
+ *
* The array includes the setting group, the setting name,
* explainations for the setting and if it's enabled or disabled
* by default
- *
+ *
* @param bool $filtered True removes any locked features
- *
+ *
* @return array
*/
function get_features($filtered = true) {
// Post composition
'composition' => array(
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('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')),
),
}
}
- // 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);
return $arr;
}
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) {
return(str_replace('%','%%',$s));
}
/**
* remove intentation from a text
*/
-function deindent($text, $chr="[\t ]", $count=NULL) {
- $text = fix_mce_lf($text);
+function deindent($text, $chr = "[\t ]", $count = NULL) {
$lines = explode("\n", $text);
if (is_null($count)) {
$m = array();
- $k=0; while($k<count($lines) && strlen($lines[$k])==0) $k++;
- preg_match("|^".$chr."*|", $lines[$k], $m);
+ $k = 0;
+ while ($k < count($lines) && strlen($lines[$k]) == 0) {
+ $k++;
+ }
+ preg_match("|^" . $chr . "*|", $lines[$k], $m);
$count = strlen($m[0]);
}
- for ($k=0; $k<count($lines); $k++){
- $lines[$k] = preg_replace("|^".$chr."{".$count."}|", "", $lines[$k]);
+ for ($k=0; $k < count($lines); $k++) {
+ $lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
}
return implode("\n", $lines);
$fetch_further_information = intval($_POST['fetch_further_information']);
- $ffi_keyword_blacklist = fix_mce_lf(escape_tags(trim($_POST['ffi_keyword_blacklist'])));
+ $ffi_keyword_blacklist = escape_tags(trim($_POST['ffi_keyword_blacklist']));
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
- $info = fix_mce_lf(escape_tags(trim($_POST['info'])));
+ $info = escape_tags(trim($_POST['info']));
$r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s',
`hidden` = %d, `notify_new_posts` = %d, `fetch_further_information` = %d,
$categories .= file_tag_list_to_file($filedas, 'file');
}
- // Work around doubled linefeeds in Tinymce 3.5b2
- // First figure out if it's a status post that would've been
- // created using tinymce. Otherwise leave it alone.
-
-/* $plaintext = (local_user() ? intval(get_pconfig(local_user(),'system','plaintext')) || !feature_enabled($profile_uid,'richtext') : 0);
- if((! $parent) && (! $api_source) && (! $plaintext)) {
- $body = fix_mce_lf($body);
- }*/
- $plaintext = (local_user() ? !feature_enabled($profile_uid,'richtext') : 0);
- if((! $parent) && (! $api_source) && (! $plaintext)) {
- $body = fix_mce_lf($body);
- }
-
-
// get contact info for poster
$author = null;
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 );
- // Work around doubled linefeeds in Tinymce 3.5b2
-
-/* $plaintext = intval(get_pconfig(local_user(),'system','plaintext') && !feature_enabled(local_user(),'richtext'));
- if(! $plaintext) {
- $body = fix_mce_lf($body);
- }*/
- $plaintext = intval(!feature_enabled(local_user(),'richtext'));
- if(! $plaintext) {
- $body = fix_mce_lf($body);
- }
-
$ret = send_message($recipient, $body, $subject, $replyto);
$norecip = false;
* @file mod/parse_url.php
* @brief The parse_url module
*
- * This module does parse an url for embedable content (audio, video, image files or link)
- * information and does format this information to BBCode or html (this depends
- * on the user settings - default is BBCode output).
- * If the user has enabled the richtext editor setting the output will be in html
- * (Note: This is not always possible and in some case not useful because
- * the richtext editor doesn't support all kind of html).
- * Otherwise the output will be constructed BBCode.
+ * This module does parse an url for embeddable content (audio, video, image files or link)
+ * information and does format this information to BBCode
*
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
*/
$text = null;
$str_tags = "";
- $textmode = false;
-
- if (local_user() && (!feature_enabled(local_user(), "richtext"))) {
- $textmode = true;
- }
-
- $br = (($textmode) ? "\n" : "<br />");
+ $br = "\n";
if (x($_GET,"binurl")) {
$url = trim(hex2bin($_GET["binurl"]));
}
}
- if ($textmode) {
- $template = "[bookmark=%s]%s[/bookmark]%s";
- } else {
- $template = "<a class=\"bookmark\" href=\"%s\" >%s</a>%s";
- }
+ $template = "[bookmark=%s]%s[/bookmark]%s";
$arr = array("url" => $url, "text" => "");
$title = str_replace(array("\r","\n"),array("",""),$title);
- if ($textmode) {
- $text = "[quote]" . trim($text) . "[/quote]" . $br;
- } else {
- $text = "<blockquote>" . htmlspecialchars(trim($text)) . "</blockquote><br />";
- $title = htmlspecialchars($title);
- }
+ $text = "[quote]" . trim($text) . "[/quote]" . $br;
$result = sprintf($template, $url, ($title) ? $title : $url, $text) . $str_tags;
// Format it as BBCode attachment
$info = add_page_info_data($siteinfo);
- if (!$textmode) {
- // Replace ' with ’ - not perfect - but the richtext editor has problems otherwise
- $info = str_replace(array("'"), array("’"), $info);
- }
-
echo $info;
killme();
$politic = notags(trim($_POST['politic']));
$religion = notags(trim($_POST['religion']));
- $likes = fix_mce_lf(escape_tags(trim($_POST['likes'])));
- $dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes'])));
-
- $about = fix_mce_lf(escape_tags(trim($_POST['about'])));
- $interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
- $contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
- $music = fix_mce_lf(escape_tags(trim($_POST['music'])));
- $book = fix_mce_lf(escape_tags(trim($_POST['book'])));
- $tv = fix_mce_lf(escape_tags(trim($_POST['tv'])));
- $film = fix_mce_lf(escape_tags(trim($_POST['film'])));
- $romance = fix_mce_lf(escape_tags(trim($_POST['romance'])));
- $work = fix_mce_lf(escape_tags(trim($_POST['work'])));
- $education = fix_mce_lf(escape_tags(trim($_POST['education'])));
+ $likes = escape_tags(trim($_POST['likes']));
+ $dislikes = escape_tags(trim($_POST['dislikes']));
+
+ $about = escape_tags(trim($_POST['about']));
+ $interest = escape_tags(trim($_POST['interest']));
+ $contact = escape_tags(trim($_POST['contact']));
+ $music = escape_tags(trim($_POST['music']));
+ $book = escape_tags(trim($_POST['book']));
+ $tv = escape_tags(trim($_POST['tv']));
+ $film = escape_tags(trim($_POST['film']));
+ $romance = escape_tags(trim($_POST['romance']));
+ $work = escape_tags(trim($_POST['work']));
+ $education = escape_tags(trim($_POST['education']));
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
/* mod Waitman Gobble NO WARRANTY */
-//if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post)
+ // if we get the signal then return the image url info in BBCODE
if ($_REQUEST['hush']!='yeah') {
- if(local_user() && (! feature_enabled(local_user(),'richtext') || x($_REQUEST['nomce'])) ) {
- echo "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
- }
- else {
- echo '<br /><br /><a href="' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."\" alt=\"$basename\" /></a><br /><br />";
- }
- }
- else {
+ echo "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n";
+ } else {
$m = '[url='.App::get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.App::get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]";
return($m);
}
return;
}
- // Work around doubled linefeeds in Tinymce 3.5b2
-
- $body = str_replace("\r\n","\n",$body);
- $body = str_replace("\n\n","\n",$body);
-
-
$ret = send_wallmessage($user, $body, $subject, $replyto);
switch($ret){
if(typeof window.AjaxUpload != "undefined") {
var uploader = new window.AjaxUpload(
window.imageUploadButton,
- { action: 'wall_upload/'+window.nickname+'?nomce=1',
+ { action: 'wall_upload/' + window.nickname,
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {
if($('#wall-file-upload').length) {
var file_uploader = new window.AjaxUpload(
'wall-file-upload',
- { action: 'wall_attach/'+window.nickname+'?nomce=1',
+ { action: 'wall_attach/' + window.nickname,
name: 'userfile',
onSubmit: function(file,ext) { $('#profile-rotator').show(); },
onComplete: function(file,response) {