update code to use info() instead of notice() when appropriate (non-error message)
add info-message class style in themes
if($a->argc > 1 && $a->argv[1] === 'remove') {
del_pconfig(local_user(),'facebook','post');
- notice( t('Facebook disabled') . EOL);
+ info( t('Facebook disabled') . EOL);
}
if($a->argc > 1 && $a->argv[1] === 'friends') {
fb_get_friends(local_user());
- notice( t('Updating contacts') . EOL);
+ info( t('Updating contacts') . EOL);
}
// to post a tweet for every new __public__ posting to the wall
set_pconfig(local_user(),'statusnet','post',intval($_POST['statusnet-enable']));
set_pconfig(local_user(),'statusnet','post_by_default',intval($_POST['statusnet-default']));
- notice( t('StatusNet settings updated.') . EOL);
+ info( t('StatusNet settings updated.') . EOL);
}}}}
}
function statusnet_settings(&$a,&$s) {
if($a->interactive)
$_SESSION['sysmsg'] .= $s;
}}
+if(! function_exists('info')) {
+function info($s) {
+ $a = get_app();
+ if($a->interactive)
+ $_SESSION['sysmsg_info'] .= $s;
+}}
+
// wrapper around config to limit the text length of an incoming message
if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email']))
return true;
return false;
-}}
\ No newline at end of file
+}}
// process logout request
nuke_session();
- notice( t('Logged out.') . EOL);
+ info( t('Logged out.') . EOL);
goaway($a->get_baseurl());
}
if($a->user['login_date'] === '0000-00-00 00:00:00') {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
- notice( t("Welcome ") . $a->user['username'] . EOL);
- notice( t('Please upload a profile photo.') . EOL);
+ info( t("Welcome ") . $a->user['username'] . EOL);
+ info( t('Please upload a profile photo.') . EOL);
}
else
- notice( t("Welcome back ") . $a->user['username'] . EOL);
+ info( t("Welcome back ") . $a->user['username'] . EOL);
if(strlen($a->user['timezone'])) {
date_default_timezone_set($a->user['timezone']);
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = '';
+if(! x($_SESSION,'sysmsg_info'))
+ $_SESSION['sysmsg_info'] = '';
+
/*
* check_config() is responsible for running update scripts. These automatically
* update the DB schema whenever we push a new one out. It also checks to see if
if(x($_SESSION,'sysmsg')) {
$a->page['content'] = "<div id=\"sysmsg\" class=\"error-message\">{$_SESSION['sysmsg']}</div>\r\n"
. ((x($a->page,'content')) ? $a->page['content'] : '');
+ $_SESSION['sysmsg']="";
unset($_SESSION['sysmsg']);
}
+if(x($_SESSION,'sysmsg_info')) {
+ $a->page['content'] = "<div id=\"sysmsg_info\" class=\"info-message\">{$_SESSION['sysmsg_info']}</div>\r\n"
+ . ((x($a->page,'content')) ? $a->page['content'] : '');
+ $_SESSION['sysmsg_info']="";
+ unset($_SESSION['sysmsg_info']);
+}
+
call_hooks('page_end', $a->page['content']);
intval(local_user())
);
if($r)
- notice( t('Contact updated.') . EOL);
+ info( t('Contact updated.') . EOL);
else
notice( t('Failed to update contact record.') . EOL);
return;
);
if($r) {
//notice( t('Contact has been ') . (($blocked) ? t('blocked') : t('unblocked')) . EOL );
- notice( (($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL );
+ info( (($blocked) ? t('Contact has been blocked') : t('Contact has been unblocked')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
return; // NOTREACHED
intval(local_user())
);
if($r) {
- notice( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL );
+ info( (($readonly) ? t('Contact has been ignored') : t('Contact has been unignored')) . EOL );
}
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
return; // NOTREACHED
contact_remove($contact_id);
- notice( t('Contact has been removed.') . EOL );
+ info( t('Contact has been removed.') . EOL );
goaway($a->get_baseurl() . '/contacts');
return; // NOTREACHED
}
}
$o .= paginate($a);
return $o;
-}
\ No newline at end of file
+}
);
if($r)
- notice( t('Contact settings applied.') . EOL);
+ info( t('Contact settings applied.') . EOL);
else
notice( t('Contact update failed.') . EOL);
return $o;
-}
\ No newline at end of file
+}
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
$_SESSION['visitor_visiting'] = $r[0]['uid'];
- notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
+ info( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
// Visitors get 1 day session.
$session_id = session_id();
$expire = time() + 86400;
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
$_SESSION['visitor_visiting'] = $r[0]['uid'];
- notice( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
+ info( sprintf(t('%s welcomes %s'), $r[0]['username'] , $r[0]['name']) . EOL);
// Visitors get 1 day session.
$session_id = session_id();
$expire = time() + 86400;
}
if($r) {
- notice( t("Introduction complete.") . EOL);
+ info( t("Introduction complete.") . EOL);
}
/**
// This notice will only be seen by the requestor if the requestor and requestee are on the same server.
if(! $failed)
- notice( t('Your introduction has been sent.') . EOL );
+ info( t('Your introduction has been sent.') . EOL );
// "Homecoming" - send the requestor back to their site to record the introduction.
if(x($_GET,'dfrn_url')) {
if(! local_user()) {
- notice( t("Please login to confirm introduction.") . EOL );
+ info( t("Please login to confirm introduction.") . EOL );
/* setup the return URL to come back to this page if they use openid */
}
return; // Somebody is fishing.
-}}
\ No newline at end of file
+}}
}
else
- notice( t("No entries \x28some entries may be hidden\x29.") . EOL);
+ info( t("No entries \x28some entries may be hidden\x29.") . EOL);
return $o;
-}
\ No newline at end of file
+}
$name = notags(trim($_POST['groupname']));
$r = group_add(local_user(),$name);
if($r) {
- notice( t('Group created.') . EOL );
+ info( t('Group created.') . EOL );
$r = group_byname(local_user(),$name);
if($r)
goaway($a->get_baseurl() . '/group/' . $r);
intval($group['id'])
);
if($r)
- notice( t('Group name changed.') . EOL );
+ info( t('Group name changed.') . EOL );
}
$a->page['aside'] = group_side();
if(count($r))
$result = group_rmv(local_user(),$r[0]['name']);
if($result)
- notice( t('Group removed.') . EOL);
+ info( t('Group removed.') . EOL);
else
notice( t('Unable to remove group.') . EOL);
}
}
}
- notice( t('Connected to database.') . EOL);
+ info( t('Connected to database.') . EOL);
$tpl = get_intltext_template('htconfig.tpl');
$txt = replace_macros($tpl,array(
}
}
- notice( t('Welcome to Friendika.') . EOL);
+ info( t('Welcome to Friendika.') . EOL);
check_funcs();
}
}
return $errors;
-}
\ No newline at end of file
+}
$pubmail_enable = ((x($_POST,'pubmail_enable') && intval($_POST['pubmail_enable']) && (! $private)) ? 1 : 0);
if(! strlen($body)) {
- notice( t('Empty post discarded.') . EOL );
+ info( t('Empty post discarded.') . EOL );
if(x($_POST,'return'))
goaway($a->get_baseurl() . "/" . $_POST['return'] );
killme();
intval($uid)
);
if($r)
- notice( t('Password reset request issued. Check your email.') . EOL);
+ info( t('Password reset request issued. Check your email.') . EOL);
$email_tpl = get_intltext_template("lostpass_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$baseurl' => $a->get_baseurl()
));
- notice("Your password has been reset." . EOL);
+ info("Your password has been reset." . EOL);
return $o;
}
-}
\ No newline at end of file
+}
$_SESSION['page_flags'] = $r[0]['page-flags'];
$_SESSION['my_url'] = $a->get_baseurl() . '/profile/' . $r[0]['nickname'];
- notice( sprintf( t("Welcome back %s") , $r[0]['username']) . EOL);
+ info( sprintf( t("Welcome back %s") , $r[0]['username']) . EOL);
$a->user = $r[0];
if(strlen($a->user['timezone'])) {
return $o;
-}
\ No newline at end of file
+}
$o .= '<div id="profile-match-wrapper-end"></div>';
}
else {
- notice( t('No matches') . EOL);
+ info( t('No matches') . EOL);
}
}
$o .= paginate($a);
return $o;
-}
\ No newline at end of file
+}
if($post_id) {
proc_run('php',"include/notifier.php","mail","$post_id");
- notice( t('Message sent.') . EOL );
+ info( t('Message sent.') . EOL );
}
else {
notice( t('Message could not be sent.') . EOL );
intval(local_user())
);
if($r) {
- notice( t('Message deleted.') . EOL );
+ info( t('Message deleted.') . EOL );
}
goaway($a->get_baseurl() . '/message' );
}
intval(local_user())
);
if($r)
- notice( t('Conversation removed.') . EOL );
+ info( t('Conversation removed.') . EOL );
}
goaway($a->get_baseurl() . '/message' );
}
intval($a->pager['itemspage'])
);
if(! count($r)) {
- notice( t('No messages.') . EOL);
+ info( t('No messages.') . EOL);
return $o;
}
return $o;
}
-}
\ No newline at end of file
+}
if(! $update) {
if(group) {
if(($t = group_public_members($group)) && (! get_pconfig(local_user(),'system','nowarn_insecure'))) {
- $plural_form = sprintf( tt('%d member', '%d members', $t), $t);
- notice( sprintf( t('Warning: This group contains %s from an insecure network.'), $plural_form ) . EOL);
+ notice( sprintf( tt('Warning: This group contains %s member from an insecure network.',
+ 'Warning: This group contains %s members from an insecure network.',
+ $t), $t ) . EOL);
notice( t('Private messages to this group are at risk of public disclosure.') . EOL);
}
}
}
else {
$contact_str = ' 0 ';
- notice( t('Group is empty'));
+ info( t('Group is empty'));
}
$sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) ";
}
}
else
- notice( t('No notifications.') . EOL);
+ info( t('No notifications.') . EOL);
if ($a->config['register_policy'] == REGISTER_APPROVE &&
$a->config['admin_email'] === $a->user['email']){
$o .= "</ul>";
}
else
- notice( t('No registrations.') . EOL);
+ info( t('No registrations.') . EOL);
}
}
if(($a->argc > 1) && $a->argv[1] === 'done') {
- notice( t('Post successful.') . EOL);
+ info( t('Post successful.') . EOL);
return;
}
if($a->user['login_date'] === '0000-00-00 00:00:00') {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
- notice( t("Welcome ") . $a->user['username'] . EOL);
- notice( t('Please upload a profile photo.') . EOL);
+ info( t("Welcome ") . $a->user['username'] . EOL);
+ info( t('Please upload a profile photo.') . EOL);
}
else
- notice( t("Welcome back ") . $a->user['username'] . EOL);
+ info( t("Welcome back ") . $a->user['username'] . EOL);
if(strlen($a->user['timezone'])) {
notice( t('Login failed.') . EOL);
goaway($a->get_baseurl());
// NOTREACHED
-}
\ No newline at end of file
+}
$r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 );
if($r)
- notice( t('Image uploaded successfully.') . EOL );
+ info( t('Image uploaded successfully.') . EOL );
else
notice( t('Image upload failed.') . EOL );
);
if($r)
- notice( t('Profile updated.') . EOL);
+ info( t('Profile updated.') . EOL);
if($namechanged && $is_default) {
intval(local_user())
);
if($r)
- notice( t('Profile deleted.') . EOL);
+ info( t('Profile deleted.') . EOL);
goaway($a->get_baseurl() . '/profiles');
return; // NOTREACHED
dbesc($name)
);
- notice( t('New profile created.') . EOL);
+ info( t('New profile created.') . EOL);
if(count($r3) == 1)
goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl() . '/profiles');
intval(local_user()),
dbesc($name)
);
- notice( t('New profile created.') . EOL);
+ info( t('New profile created.') . EOL);
if(count($r3) == 1)
goaway($a->get_baseurl() . '/profiles/' . $r3[0]['id']);
goaway($a->get_baseurl() . '/profiles');
return $o;
}
-}
\ No newline at end of file
+}
if($res) {
- notice( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
+ info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
goaway($a->get_baseurl());
}
else {
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
if($res) {
- notice( t('Your registration is pending approval by the site owner.') . EOL ) ;
+ info( t('Your registration is pending approval by the site owner.') . EOL ) ;
goaway($a->get_baseurl());
}
$_SESSION['return_url'] = $a->cmd;
if(! local_user()) {
- notice( t('Please login.') . EOL);
+ info( t('Please login.') . EOL);
$o .= '<br /><br />' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;
}
. 'Content-transfer-encoding: 8bit' );
if($res) {
- notice( t('Account approved.') . EOL );
+ info( t('Account approved.') . EOL );
return;
}
}
-}
\ No newline at end of file
+}
$a->set_pager_total($r[0]['total']);
if(! $r[0]['total']) {
- notice( t('No results.') . EOL);
+ info( t('No results.') . EOL);
return $o;
}
intval(local_user())
);
if($r)
- notice( t('Password changed.') . EOL);
+ info( t('Password changed.') . EOL);
else
notice( t('Password update failed. Please try again.') . EOL);
}
intval(local_user())
);
if($r)
- notice( t('Settings updated.') . EOL);
+ info( t('Settings updated.') . EOL);
$r = q("UPDATE `profile`
SET `publish` = %d, `net-publish` = %d
? true : false);
if($invisible)
- notice( t('Profile is <strong>not published</strong>.') . EOL );
+ info( t('Profile is <strong>not published</strong>.') . EOL );
$theme_selector = '<select name="theme" id="theme-select" >';
'$imap_replyto' => $mail_replyto,
'$lbl_imap7' => t('Send public posts to all email contacts:'),
'$pubmail_checked' => (($mail_pubmail) ? ' checked="checked" ' : ''),
- '$mail_disabled' => (($mail_disabled) ? '<div class="error-message">' . t('Email access is disabled on this site.') . '</div>' : ''),
+ '$mail_disabled' => (($mail_disabled) ? '<div class="info-message">' . t('Email access is disabled on this site.') . '</div>' : ''),
'$imap_disabled' => $imap_disabled
));
intval(local_user())
);
- notice( t('Tag removed') . EOL );
+ info( t('Tag removed') . EOL );
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
// NOTREACHED
return $o;
-}
\ No newline at end of file
+}
intval($a->pager['itemspage'])
);
if(! count($r)) {
- notice( t('No contacts.') . EOL );
+ info( t('No contacts.') . EOL );
return $o;
}
$o .= paginate($a);
return $o;
-}
\ No newline at end of file
+}
<div id="settings-nick-wrapper" >
-<p id="settings-nickname-desc">
-<div class="error-message">$desc <strong>'$nickname@$basepath'</strong>$subdir</div>
-</p>
+<div id="settings-nickname-desc" class="info-message">$desc <strong>'$nickname@$basepath'</strong>$subdir</div>
</div>
<div id="settings-nick-end" ></div>
#home-update { background-position: -90px 0px; }
/** sysmsg **/
+#sysmsg_info{
+ position:fixed;
+ bottom: 0px; right:20%;
+ -moz-box-shadow: 0px 0px 5px #888;
+ -webkit-box-shadow: 0px 0px 5px #888;
+ box-shadow: 0px 0px 5px #888;
+ padding: 10px;
+ background-color: #fcaf3e; border:2px solid #f8911b;
+ border-bottom:0px;
+ padding-bottom: 50px;
+ z-index: 1000;
+}
#sysmsg {
position:fixed;
bottom: 0px; right:10%;
padding-bottom: 50px;
z-index: 1000;
}
+#sysmsg_info br,
#sysmsg br {
display:block;
margin:2px 0px;
border-top: 1px solid #ccccce;
}
+
+
/**
* aside
**/
padding: 10px;
}
+.info-message {
+ color: #204a87;
+ font-size: 1.1em;
+ border: 1px solid #3465a4;
+ background-color: #d7e3f1;
+ padding: 10px;
+}
+
nav #banner {
display: block;
background-color: #FFEEEE;
padding: 10px;
}
+.info-message {
+ color: #204a87;
+ font-size: 1.1em;
+ border: 1px solid #3465a4;
+ background-color: #d7e3f1;
+ padding: 10px;
+}
+
.nav-link {
float: right;