Merge remote-tracking branch 'fabrix/newui'

This commit is contained in:
Fabio Comuni 2011-09-27 08:57:16 +02:00
commit 939449602a
140 changed files with 2783 additions and 356 deletions

169
boot.php
View file

@ -5,6 +5,7 @@ require_once('include/network.php');
require_once('include/plugin.php');
require_once('include/text.php');
require_once("include/pgettext.php");
require_once('include/nav.php');
define ( 'FRIENDIKA_VERSION', '2.3.1116' );
@ -248,7 +249,7 @@ class App {
public $timezone;
public $interactive = true;
public $plugins;
public $apps;
public $apps = Array();
public $identities;
private $scheme;
@ -723,14 +724,16 @@ function remote_user() {
if(! function_exists('notice')) {
function notice($s) {
$a = get_app();
if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array();
if($a->interactive)
$_SESSION['sysmsg'] .= $s;
$_SESSION['sysmsg'][] = $s;
}}
if(! function_exists('info')) {
function info($s) {
$a = get_app();
if(! x($_SESSION,'sysmsg_info')) $_SESSION['sysmsg_info'] = array();
if($a->interactive)
$_SESSION['sysmsg_info'] .= $s;
$_SESSION['sysmsg_info'][] = $s;
}}
@ -812,8 +815,8 @@ function profile_load(&$a, $nickname, $profile = 0) {
$a->page['aside'] .= profile_sidebar($a->profile, $block);
if(! $block)
$a->page['aside'] .= contact_block();
/*if(! $block)
$a->page['aside'] .= contact_block();*/
return;
}}
@ -841,132 +844,107 @@ function profile_sidebar($profile, $block = 0) {
$a = get_app();
$o = '';
$location = '';
$location = false;
$address = false;
$pdesc = true;
if((! is_array($profile)) && (! count($profile)))
return $o;
call_hooks('profile_sidebar_enter', $profile);
$fullname = '<div class="fn">' . $profile['name'] . '</div>';
$pdesc = '<div class="title">' . $profile['pdesc'] . '</div>';
$tabs = '';
$photo = '<div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="' . $profile['photo'] . '" alt="' . $profile['name'] . '" /></div>';
// don't show connect link to yourself
$connect = (($profile['uid'] != local_user()) ? '<li><a id="dfrn-request-link" href="dfrn_request/' . $profile['nickname'] . '">' . t('Connect') . '</a></li>' : '');
$connect = (($profile['uid'] != local_user()) ? t('Connect') : False);
// don't show connect link to authenticated visitors either
if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
$connect = '';
$connect = False;
// show edit profile to yourself
if ($profile['uid'] == local_user()) {
$profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => t('Create New Profile'),
'entries' => array(),
);
if(count($r)) {
foreach($r as $rr) {
$profile['menu']['entries'][] = array(
'photo' => $rr['thumb'],
'id' => $rr['id'],
'alt' => t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'),
);
}
}
}
if((x($profile,'address') == 1)
|| (x($profile,'locality') == 1)
|| (x($profile,'region') == 1)
|| (x($profile,'postal-code') == 1)
|| (x($profile,'country-name') == 1))
$address = true;
$location = t('Location:');
if($address) {
$location .= '<div class="location"><span class="location-label">' . t('Location:') . '</span> <div class="adr">';
$location .= ((x($profile,'address') == 1) ? '<div class="street-address">' . $profile['address'] . '</div>' : '');
$location .= (((x($profile,'locality') == 1) || (x($profile,'region') == 1) || (x($profile,'postal-code') == 1))
? '<span class="city-state-zip"><span class="locality">' . $profile['locality'] . '</span>'
. ((x($profile['locality']) == 1) ? t(', ') : '')
. '<span class="region">' . $profile['region'] . '</span>'
. ' <span class="postal-code">' . $profile['postal-code'] . '</span></span>' : '');
$location .= ((x($profile,'country-name') == 1) ? ' <span class="country-name">' . $profile['country-name'] . '</span>' : '');
$location .= '</div></div><div class="profile-clear"></div>';
}
$gender = ((x($profile,'gender') == 1) ? t('Gender:') : False);
$gender = ((x($profile,'gender') == 1) ? '<div class="mf"><span class="gender-label">' . t('Gender:') . '</span> <span class="x-gender">' . $profile['gender'] . '</span></div><div class="profile-clear"></div>' : '');
$marital = ((x($profile,'marital') == 1) ? t('Status:') : False);
$pubkey = ((x($profile,'pubkey') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
$marital = ((x($profile,'marital') == 1) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $profile['marital'] . '</span></div><div class="profile-clear"></div>' : '');
$homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
$homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False);
if(($profile['hidewall'] || $block) && (! local_user()) && (! remote_user())) {
$location = $pdesc = $connect = $gender = $marital = $homepage = '';
$location = $pdesc = $connect = $gender = $marital = $homepage = False;
}
$podloc = $a->get_baseurl();
$searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' );
$nickname = $profile['nickname'];
$photo300 = $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg';
$photo100 = $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg';
$photo50 = $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg';
$diaspora = array(
'podloc' => $a->get_baseurl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname ' => $profile['nickname'],
'fullname' => $profile['name'],
'photo300' => $a->get_baseurl() . '/photo/custom/300/' . $profile['uid'] . '.jpg',
'photo100' => $a->get_baseurl() . '/photo/custom/100/' . $profile['uid'] . '.jpg',
'photo50' => $a->get_baseurl() . '/photo/custom/50/' . $profile['uid'] . '.jpg',
);
$diaspora_vcard = <<< EOT
if (!$block){
$contact_block = contact_block();
}
<div style="display:none;">
<dl class='entity_nickname'>
<dt>Nickname</dt>
<dd>
<a class="nickname url uid" href="$podloc/" rel="me">$nickname</a>
</dd>
</dl>
<dl class='entity_fn'>
<dt>Full name</dt>
<dd>
<span class='fn'>$fullname</span>
</dd>
</dl>
<dl class="entity_url">
<dt>URL</dt>
<dd>
<a class="url" href="$podloc/" id="pod_location" rel="me">$podloc/</a>
</dd>
</dl>
<dl class="entity_photo">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="300px" width="300px" src="$photo300">
</dd>
</dl>
<dl class="entity_photo_medium">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="100px" width="100px" src="$photo100">
</dd>
</dl>
<dl class="entity_photo_small">
<dt>Photo</dt>
<dd>
<img class="photo avatar" height="50px" width="50px" src="$photo50">
</dd>
</dl>
<dl class="entity_searchable">
<dt>Searchable</dt>
<dd>
<span class="searchable">$searchable</span>
</dd>
</dl>
</div>
EOT;
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array(
'$fullname' => template_escape($fullname),
'$pdesc' => template_escape($pdesc),
'$tabs' => $tabs,
'$photo' => $photo,
'$profile' => $profile,
'$connect' => $connect,
'$location' => template_escape($location),
'$gender' => $gender,
'$pubkey' => $pubkey,
'$marital' => template_escape($marital),
'$homepage' => template_escape($homepage),
'$diaspora' => $diaspora_vcard
'$pdesc' => $pdesc,
'$marital' => $marital,
'$homepage' => $homepage,
'$diaspora' => $diaspora,
'$contact_block' => $contact_block,
));
@ -1174,3 +1152,4 @@ function load_contact_links($uid) {
$a->contacts = $ret;
return;
}}

BIN
images/connect-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

BIN
images/icons/10/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/feed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

BIN
images/icons/10/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
images/icons/10/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
images/icons/10/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

BIN
images/icons/10/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
images/icons/10/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
images/icons/10/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

BIN
images/icons/10/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/10/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
images/icons/16/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

BIN
images/icons/16/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/feed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

BIN
images/icons/16/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

BIN
images/icons/16/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

BIN
images/icons/16/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/16/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/16/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
images/icons/16/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/icons/16/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

BIN
images/icons/22/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
images/icons/22/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/22/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/icons/22/feed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/22/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/icons/22/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

BIN
images/icons/22/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
images/icons/22/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/icons/48/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
images/icons/48/feed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
images/icons/48/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/icons/48/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
images/icons/48/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
images/icons/48/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/icons/48/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
images/icons/48/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/icons/48/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/icons/48/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
images/icons/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
images/icons/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
images/icons/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
images/icons/feed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
images/icons/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/icons/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

BIN
images/icons/info.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/icons/lock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

14
images/icons/make.sh Normal file
View file

@ -0,0 +1,14 @@
sizes="10 16 22 48"
for s in $sizes
do
echo "=[ ${s}x${s} ]===="
[ -d $s ] || mkdir $s
for f in *.png
do
convert $f -resize ${s}x${s} $s/$f
echo -n "#"
done
echo
done
echo "Ok."

BIN
images/icons/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/icons/notice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
images/icons/notify_off.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/icons/notify_on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
images/icons/star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
images/icons/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -268,6 +268,10 @@ function conversation(&$a, $items, $mode, $update) {
$blowhard = 0;
$blowhard_count = 0;
// array with html for each thread (parent+comments)
$treads = array();
$treadsid = -1;
foreach($items as $item) {
$comment = '';
@ -294,7 +298,7 @@ function conversation(&$a, $items, $mode, $update) {
$toplevelprivate = (($toplevelpost && $item['private']) ? true : false);
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
/*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) {
$blowhard_count ++;
if($blowhard_count == 3) {
$o .= '<div class="icollapse-wrapper fakelink" id="icollapse-wrapper-' . $item['parent']
@ -308,10 +312,13 @@ function conversation(&$a, $items, $mode, $update) {
if($blowhard_count >= 3)
$o .= '</div>';
$blowhard_count = 0;
}
}*/
$comments_seen = 0;
$comments_collapsed = false;
$treadsid++;
$treads[$treadsid] = "";
}
else {
// prevent private email from leaking into public conversation
@ -325,7 +332,7 @@ function conversation(&$a, $items, $mode, $update) {
if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) {
if(! $comments_collapsed) {
$o .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
$treads[$treadsid] .= '<div class="ccollapse-wrapper fakelink" id="ccollapse-wrapper-' . $item['parent']
. '" onclick="openClose(' . '\'ccollapse-' . $item['parent'] . '\'); $(\'#ccollapse-wrapper-' . $item['parent'] . '\').hide();" >'
. sprintf( t('See all %d comments'), $comments[$item['parent']]) . '</div>'
. '<div class="ccollapse" id="ccollapse-' . $item['parent'] . '" style="display: none;" >';
@ -333,15 +340,15 @@ function conversation(&$a, $items, $mode, $update) {
}
}
if(($comments[$item['parent']] > 2) && ($comments_seen == ($comments[$item['parent']] - 1))) {
$o .= '</div>';
$treads[$treadsid] .= '</div>';
}
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
$lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
: '<div class="wall-item-lock"></div>');
? t('Private Message')
: false);
// Top-level wall post not written by the wall owner (wall-to-wall)
@ -427,7 +434,21 @@ function conversation(&$a, $items, $mode, $update) {
$drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$select' => t('Select'), '$delete' => t('Delete')));
$star = (($profile_owner == local_user() && $toplevelpost) ? '<a href="#" id="starred-' . $item['id'] . '" onclick="dostar(' . $item['id'] . '); return false;" class="star-item icon ' . (($item['starred']) ? 'starred' : 'unstarred') . '" title="' . t('toggle star status') . '"></a>' : '');
$star = false;
if ($profile_owner == local_user() && $toplevelpost) {
$isstarred = (($item['starred']) ? "starred" : "unstarred");
$star = array(
'do' => t("add star"),
'undo' => t("remove star"),
'toggle' => t("toggle star status"),
'classdo' => (($item['starred']) ? "hidden" : ""),
'classundo' => (($item['starred']) ? "" : "hidden"),
'starred' => t('starred'),
);
}
$photo = $item['photo'];
@ -508,6 +529,7 @@ function conversation(&$a, $items, $mode, $update) {
'$owner_name' => template_escape($owner_name),
'$plink' => get_plink($item),
'$edpost' => $edpost,
'$isstarred' => $isstarred,
'$star' => $star,
'$drop' => $drop,
'$vote' => $likebuttons,
@ -521,7 +543,7 @@ function conversation(&$a, $items, $mode, $update) {
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
$o .= $arr['output'];
$treads[$treadsid] .= $arr['output'];
}
}
@ -530,10 +552,15 @@ function conversation(&$a, $items, $mode, $update) {
// if author collapsing is in force but didn't get closed, close it off now.
if($blowhard_count >= 3)
$o .= '</div>';
$treads[$treadsid] .= '</div>';
if($dropping)
$o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
$page_template = get_markup_template("conversation.tpl");
$o .= replace_macros($page_template, array(
'$treads' => $treads,
'$dropping' => $dropping,
));
//if($dropping)
// $o .= '<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();"><div id="item-delete-selected-icon" class="icon drophide" title="' . t('Delete Selected Items') . '" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div><div id="item-delete-selected-desc" >' . t('Delete Selected Items') . '</div></div><div id="item-delete-selected-end"></div>';
return $o;
}

View file

@ -37,11 +37,29 @@ function nav(&$a) {
* Display login or logout
*/
$nav['usermenu']=array();
$userinfo = null;
if(local_user()) {
$nav['logout'] = Array('logout',t('Logout'), "", t('End this session'));
// user menu
$nav['usermenu'][] = Array('profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
$nav['usermenu'][] = Array('profile/' . $a->user['nickname']. '?tab=profile', t('Profile'), "", t('Your profile page'));
$nav['usermenu'][] = Array('photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
$nav['usermenu'][] = Array('events/', t('Events'), "", t('Your events'));
$nav['usermenu'][] = Array('notes/', t('Personal notes'), "", t('Your personal photos'));
// user info
$r = q("SELECT micro FROM contact WHERE uid=%d AND self=1", intval($a->user['uid']));
$userinfo = array(
'icon' => (count($r) ? $r[0]['micro']: $a->get_baseurl()."/images/default-profile-mm.jpg"),
'name' => $a->user['username'],
);
}
else {
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''), t('Sign in'));
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
}
@ -63,7 +81,7 @@ function nav(&$a) {
if(! get_config('system','hide_help'))
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'));
if($a->apps)
if(count($a->apps)>0)
$nav['apps'] = array('apps', t('Apps'), "", t('Addon applications, utilities, games'));
$nav['search'] = array('search', t('Search'), "", t('Search site content'));
@ -137,8 +155,31 @@ function nav(&$a) {
'$sitelocation' => $sitelocation,
'$nav' => $nav,
'$banner' => $banner,
'$emptynotifications' => t('Nothing new here'),
'$userinfo' => $userinfo,
'$sel' => $a->nav_sel,
'$apps' => $a->apps,
));
call_hooks('page_header', $a->page['nav']);
}
/*
* Set a menu item in navbar as selected
*
*/
function nav_set_selected($item){
$a = get_app();
$a->nav_sel = array(
'community' => null,
'network' => null,
'home' => null,
'profiles' => null,
'notifications' => null,
'messages' => null,
'directyory' => null,
'settings' => null,
'contacts' => null,
);
$a->nav_sel[$item] = 'selected';
}

View file

@ -14,15 +14,18 @@
private function _preg_error(){
switch(preg_last_error()){
case PREG_INTERNAL_ERROR: die('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: die('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: die('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: die('PREG_BAD_UTF8_ERROR'); break;
case PREG_BAD_UTF8_OFFSET_ERROR: die('PREG_BAD_UTF8_OFFSET_ERROR'); break;
case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
}
echo "<hr><pre>";
debug_print_backtrace();
die();
}
private function _build_replace($r, $prefix){
@ -31,8 +34,6 @@
foreach ($r as $k => $v ) {
if (is_array($v))
$this->_build_replace($v, "$prefix$k.");
if (is_object($v))
$this->_build_replace($v->getKeys(), "$prefix$k.");
$this->search[] = $prefix . $k;
$this->replace[] = $v;
@ -159,29 +160,14 @@
return $s;
}
private function _get_lang(){
if ($this->lang!=null) return $this->lang;
$a = get_app();
$this->lang=array();
if(is_array($a->strings) && count($a->strings)) {
foreach ($a->strings as $k=>$v){
$k = preg_replace("/[^a-z0-9-]/", "", str_replace(" ","-", strtolower($k)));
$this->lang[$k] = $v;
}
}
return $this->lang;
}
public function replace($s, $r) {
if (!x($r,'$lang')){
$r['$lang'] = &$this->_get_lang();
}
$this->r = $r;
$this->search = array();
$this->replace = array();
$this->_build_replace($r, "");
#$s = str_replace(array("\n","\r"),array("§n§","§r§"),$s);
$s = $this->_build_nodes($s);
$s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);

View file

@ -538,23 +538,31 @@ function contact_block() {
$total = intval($r[0]['total']);
}
if(! $total) {
$o .= '<h4 class="contact-h4">' . t('No contacts') . '</h4>';
return $o;
}
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
if(count($r)) {
$o .= '<h4 class="contact-h4">' . sprintf( tt('%d Contact','%d Contacts', $total),$total) . '</h4><div id="contact-block">';
foreach($r as $rr) {
$o .= micropro($rr,true,'mpfriend');
}
$o .= '</div><div id="contact-block-end"></div>';
$o .= '<div id="viewcontacts"><a id="viewcontacts-link" href="viewcontacts/' . $a->profile['nickname'] . '">' . t('View Contacts') . '</a></div>';
$contacts = t('No contacts');
$micropro = Null;
} else {
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 ORDER BY RAND() LIMIT %d",
intval($a->profile['uid']),
intval($shown)
);
if(count($r)) {
$contacts = sprintf( tt('%d Contact','%d Contacts', $total),$total);
$micropro = Array();
foreach($r as $rr) {
$micropro[] = micropro($rr,true,'mpfriend');
}
}
}
$tpl = get_markup_template('contact_block.tpl');
$o = replace_macros($tpl, array(
'$contacts' => $contacts,
'$nickname' => $a->profile['nickname'],
'$viewcontacts' => t('View Contacts'),
'$micropro' => $micropro,
));
$arr = array('contacts' => $r, 'output' => $o);
call_hooks('contact_block_end', $arr);
@ -826,9 +834,14 @@ function feed_salmonlinks($nick) {
if(! function_exists('get_plink')) {
function get_plink($item) {
$a = get_app();
$plink = (((x($item,'plink')) && (! $item['private'])) ? '<div class="wall-item-links-wrapper"><a href="'
. $item['plink'] . '" title="' . t('link to source') . '" target="external-link" class="icon remote-link"></a></div>' : '');
return $plink;
if (x($item,'plink') && (! $item['private'])){
return array(
'href' => $item['plink'],
'title' => t('link to source'),
);
} else {
return false;
}
}}
if(! function_exists('unamp')) {

View file

@ -116,10 +116,10 @@ if(! x($_SESSION,'authenticated'))
header('X-Account-Management-Status: none');
if(! x($_SESSION,'sysmsg'))
$_SESSION['sysmsg'] = '';
$_SESSION['sysmsg'] = array();
if(! x($_SESSION,'sysmsg_info'))
$_SESSION['sysmsg_info'] = '';
$_SESSION['sysmsg_info'] = array();
/*
* check_config() is responsible for running update scripts. These automatically
@ -199,8 +199,8 @@ if(strlen($a->module)) {
if(! $a->module_loaded) {
// Stupid browser tried to pre-fetch our ACL img template. Don't log the event or return anything - just quietly exit.
if((x($_SERVER,'QUERY_STRING')) && strpos($_SERVER['QUERY_STRING'],'{0}') !== false) {
// Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
if((x($_SERVER,'QUERY_STRING')) && preg_match('/{[0-9]}/',$_SERVER['QUERY_STRING']) !== 0) {
killme();
}
@ -211,7 +211,10 @@ if(strlen($a->module)) {
logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG);
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
notice( t('Page not found.' ) . EOL);
$tpl = get_markup_template("404.tpl");
$a->page['content'] = replace_macros($tpl, array(
'$message' => t('Page not found.' )
));
}
}
@ -266,7 +269,7 @@ if(isset($homebase))
// now that we've been through the module content, see if the page reported
// a permission problem and if so, a 403 response would seem to be in order.
if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
if(stristr( implode("",$_SESSION['sysmsg']), t('Permission denied'))) {
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . t('Permission denied.'));
}
@ -276,7 +279,7 @@ if(stristr($_SESSION['sysmsg'], t('Permission denied'))) {
*
*/
if(x($_SESSION,'sysmsg')) {
/*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']="";
@ -287,7 +290,7 @@ if(x($_SESSION,'sysmsg_info')) {
. ((x($a->page,'content')) ? $a->page['content'] : '');
$_SESSION['sysmsg_info']="";
unset($_SESSION['sysmsg_info']);
}
}*/
@ -310,7 +313,6 @@ $a->page['content'] .= '<div id="pause"></div>';
*/
if($a->module != 'install') {
require_once('nav.php');
nav($a);
}

View file

View file

@ -34,6 +34,18 @@
msie = $.browser.msie ;
/* setup tooltips */
$("a,.tt").each(function(){
var e = $(this);
var pos="bottom";
if (e.hasClass("tttop")) pos="top";
if (e.hasClass("ttbottom")) pos="bottom";
if (e.hasClass("ttleft")) pos="left";
if (e.hasClass("ttright")) pos="right";
e.tipTip({defaultPosition: pos});
});
/* setup onoff widgets */
$(".onoff input").each(function(){
@ -56,33 +68,63 @@
/* setup field_richtext */
setupFieldRichtext();
/* load tinyMCE if needed and setup field_richtext */
/*if(typeof tinyMCE == "undefined") {
window.tinyMCEPreInit = {
suffix:"",
base: baseurl+"/library/tinymce/jscripts/tiny_mce/",
query:"",
};
$.getScript(baseurl +"/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js", setupFieldRichtext);
} else {
}*/
/* popup menus */
$('a[rel^=#]').click(function(e){
menu = $( $(this).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
$(this).parent().toggleClass("selected");
menu.toggle();
return false;
});
/* notifications template */
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_empty = unescape($("#nav-notifications-menu").html());
/* nav update event */
$('nav').bind('nav-update', function(e,data){;
var net = $(data).find('net').text();
if(net == 0) { net = ''; $('#net-update').hide() } else { $('#net-update').show() }
if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
$('#net-update').html(net);
var home = $(data).find('home').text();
if(home == 0) { home = ''; $('#home-update').hide() } else { $('#home-update').show() }
if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
$('#home-update').html(home);
var mail = $(data).find('mail').text();
if(mail == 0) { mail = ''; $('#mail-update').hide() } else { $('#mail-update').show() }
$('#mail-update').html(mail);
var intro = $(data).find('intro').text();
if(intro == 0) { intro = ''; $('#notify-update').hide() } else { $('#notify-update').show() }
$('#notify-update').html(intro);
var eNotif = $(data).find('notif')
notif = eNotif.attr('count');
if (notif>0){
$("#nav-notifications-linkmenu").addClass("on");
nnm = $("#nav-notifications-menu");
nnm.html("");
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
e = $(this);
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'));
nnm.append(html);
});
} else {
$("#nav-notifications-linkmenu").removeClass("on");
$("#nav-notifications-menu").html(notifications_empty);
}
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(notif);
var eSysmsg = $(data).find('sysmsgs');
eSysmsg.children("notice").each(function(){
text = $(this).text();
$.jGrowl(text, { sticky: true, theme: 'notice' });
});
eSysmsg.children("info").each(function(){
text = $(this).text();
$.jGrowl(text, { sticky: false, theme: 'info' });
});
});
@ -220,17 +262,22 @@
}
function dostar(ident) {
$('#like-rotator-' + ident.toString()).show();
$.get('starred/' + ident.toString(), function(data) {
ident = ident.toString();
$('#like-rotator-' + ident).show();
$.get('starred/' + ident, function(data) {
if(data.match(/1/)) {
$('#starred-' + ident.toString()).addClass('starred');
$('#starred-' + ident.toString()).removeClass('unstarred');
$('#starred-' + ident).addClass('starred');
$('#starred-' + ident).removeClass('unstarred');
$('#star-' + ident).addClass('hidden');
$('#unstar-' + ident).removeClass('hidden');
}
else {
$('#starred-' + ident.toString()).addClass('unstarred');
$('#starred-' + ident.toString()).removeClass('starred');
$('#starred-' + ident).addClass('unstarred');
$('#starred-' + ident).removeClass('starred');
$('#star-' + ident).removeClass('hidden');
$('#unstar-' + ident).addClass('hidden');
}
$('#like-rotator-' + ident.toString()).hide();
$('#like-rotator-' + ident).hide();
});
}

3
library/jgrowl/README Normal file
View file

@ -0,0 +1,3 @@
http://stanlemon.net/projects/jgrowl.html
jGrowl is free and open source, it's distributed under the MIT and GPL licenses

136
library/jgrowl/jquery.jgrowl.css Executable file
View file

@ -0,0 +1,136 @@
div.jGrowl {
z-index: 9999;
color: #fff;
font-size: 12px;
}
/** Special IE6 Style Positioning **/
div.ie6 {
position: absolute;
}
div.ie6.top-right {
right: auto;
bottom: auto;
left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.top-left {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.bottom-right {
left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.bottom-left {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
}
div.ie6.center {
left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
width: 100%;
}
/** Normal Style Positions **/
div.jGrowl {
position: absolute;
}
body > div.jGrowl {
position: fixed;
}
div.jGrowl.top-left {
left: 0px;
top: 0px;
}
div.jGrowl.top-right {
right: 0px;
top: 0px;
}
div.jGrowl.bottom-left {
left: 0px;
bottom: 0px;
}
div.jGrowl.bottom-right {
right: 0px;
bottom: 0px;
}
div.jGrowl.center {
top: 0px;
width: 50%;
left: 25%;
}
/** Cross Browser Styling **/
div.center div.jGrowl-notification, div.center div.jGrowl-closer {
margin-left: auto;
margin-right: auto;
}
div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer {
background-color: #000;
opacity: .85;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
zoom: 1;
width: 235px;
padding: 10px;
margin-top: 5px;
margin-bottom: 5px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 1em;
text-align: left;
display: none;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
div.jGrowl div.jGrowl-notification {
min-height: 40px;
}
div.jGrowl div.jGrowl-notification,
div.jGrowl div.jGrowl-closer {
margin: 10px;
}
div.jGrowl div.jGrowl-notification div.jGrowl-header {
font-weight: bold;
font-size: .85em;
}
div.jGrowl div.jGrowl-notification div.jGrowl-close {
z-index: 99;
float: right;
font-weight: bold;
font-size: 1em;
cursor: pointer;
}
div.jGrowl div.jGrowl-closer {
padding-top: 4px;
padding-bottom: 4px;
cursor: pointer;
font-size: .9em;
font-weight: bold;
text-align: center;
}
/** Hide jGrowl when printing **/
@media print {
div.jGrowl {
display: none;
}
}

View file

@ -0,0 +1,11 @@
(function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)
$('<div id="jGrowl"></div>').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);}
if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'&times;',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;}
this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification '+o.themeState+' ui-corner-all'+
((o.group!=undefined&&o.group!='')?' '+o.group:'')+'">'+'<div class="jGrowl-close">'+o.closeTemplate+'</div>'+'<div class="jGrowl-header">'+o.header+'</div>'+'<div class="jGrowl-message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);}
$(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0))
this.style.removeAttribute('filter');if($(this).data("jGrowl")!=null)
$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false)
$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){if($.isFunction(o.close)){if(o.close.apply(notification,[notification,message,o,self.element])!==false)
$(this).remove();}else{$(this).remove();}});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool))
this.render(this.notifications.shift());if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove();});}},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery);

Binary file not shown.

30
library/tiptip/README Normal file
View file

@ -0,0 +1,30 @@
http://code.drewwilson.com/entry/tiptip-jquery-plugin
License
This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses.
ChangeLog
Version 1.3 (Mar. 23, 2010)
Added defaultPoistion option that enables you to set the default orientation TipTip should show up as.
Added attribute option that enables you to set the HTML attribute that TipTip should pull it's content from.
Added content option. This will be used as the content for the TipTip and will overwrite any content pulled form any HTML attribute.
Added activation option enables you to specify the jQuery method TipTip is activated with: hover, focus or click. Now you can use TipTip on forms and for validation!
Added keepAlive option that when set to true the TipTip will only fadeout when you hover over the actual TipTip and then hover off of it. Allowing for hyperlinks inside your TipTip content to be accessible.
Version 1.2 (Jan. 13, 2010)
Added HTML support with Tip Tip. You can now add HTML into the Title attribute (though this is not recommended if you want strictly valid code).
Tightened up spacing margins in JS.
Updated margins in CSS file.
Version 1.1 (Jan. 03, 2010)
Swapped dynamically added orientation CSS class names ('_left' & '_right') to make better sense.
Added in some tighter spacing for the tooltip in JS.
Version 1.0 (Jan. 02, 2010)
Initial release.

View file

@ -0,0 +1,21 @@
/*
* TipTip
* Copyright 2010 Drew Wilson
* www.drewwilson.com
* code.drewwilson.com/entry/tiptip-jquery-plugin
*
* Version 1.3 - Updated: Mar. 23, 2010
*
* This Plug-In will create a custom tooltip to replace the default
* browser tooltip. It is extremely lightweight and very smart in
* that it detects the edges of the browser window and will make sure
* the tooltip stays within the current window size. As a result the
* tooltip will adjust itself to be displayed above, below, to the left
* or to the right depending on what is necessary to stay within the
* browser window. It is completely customizable as well via CSS.
*
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);

113
library/tiptip/tipTip.css Normal file
View file

@ -0,0 +1,113 @@
/* TipTip CSS - Version 1.2 */
#tiptip_holder {
display: none;
position: absolute;
top: 0;
left: 0;
z-index: 99999;
}
#tiptip_holder.tip_top {
padding-bottom: 5px;
}
#tiptip_holder.tip_bottom {
padding-top: 5px;
}
#tiptip_holder.tip_right {
padding-left: 5px;
}
#tiptip_holder.tip_left {
padding-right: 5px;
}
#tiptip_content {
font-size: 11px;
color: #fff;
text-shadow: 0 0 2px #000;
padding: 4px 8px;
border: 1px solid rgba(255,255,255,0.25);
background-color: rgb(25,25,25);
background-color: rgba(25,25,25,0.92);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(#000));
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
box-shadow: 0 0 3px #555;
-webkit-box-shadow: 0 0 3px #555;
-moz-box-shadow: 0 0 3px #555;
}
#tiptip_arrow, #tiptip_arrow_inner {
position: absolute;
border-color: transparent;
border-style: solid;
border-width: 6px;
height: 0;
width: 0;
}
#tiptip_holder.tip_top #tiptip_arrow {
border-top-color: #fff;
border-top-color: rgba(255,255,255,0.35);
}
#tiptip_holder.tip_bottom #tiptip_arrow {
border-bottom-color: #fff;
border-bottom-color: rgba(255,255,255,0.35);
}
#tiptip_holder.tip_right #tiptip_arrow {
border-right-color: #fff;
border-right-color: rgba(255,255,255,0.35);
}
#tiptip_holder.tip_left #tiptip_arrow {
border-left-color: #fff;
border-left-color: rgba(255,255,255,0.35);
}
#tiptip_holder.tip_top #tiptip_arrow_inner {
margin-top: -7px;
margin-left: -6px;
border-top-color: rgb(25,25,25);
border-top-color: rgba(25,25,25,0.92);
}
#tiptip_holder.tip_bottom #tiptip_arrow_inner {
margin-top: -5px;
margin-left: -6px;
border-bottom-color: rgb(25,25,25);
border-bottom-color: rgba(25,25,25,0.92);
}
#tiptip_holder.tip_right #tiptip_arrow_inner {
margin-top: -6px;
margin-left: -5px;
border-right-color: rgb(25,25,25);
border-right-color: rgba(25,25,25,0.92);
}
#tiptip_holder.tip_left #tiptip_arrow_inner {
margin-top: -6px;
margin-left: -7px;
border-left-color: rgb(25,25,25);
border-left-color: rgba(25,25,25,0.92);
}
/* Webkit Hacks */
@media screen and (-webkit-min-device-pixel-ratio:0) {
#tiptip_content {
padding: 4px 8px 5px 8px;
background-color: rgba(45,45,45,0.88);
}
#tiptip_holder.tip_bottom #tiptip_arrow_inner {
border-bottom-color: rgba(45,45,45,0.88);
}
#tiptip_holder.tip_top #tiptip_arrow_inner {
border-top-color: rgba(20,20,20,0.92);
}
}

View file

@ -540,7 +540,7 @@ function admin_page_plugins(&$a){
}
$admin_form="";
if (in_array($plugin, $a->plugins_admin)){
if (is_array($a->plugins_admin) && in_array($plugin, $a->plugins_admin)){
@require_once("addon/$plugin/$plugin.php");
$func = $plugin.'_plugin_admin';
$func($a, $admin_form);

View file

@ -1,15 +1,18 @@
<?php
function apps_content(&$a) {
$title = t('Applications');
$o .= '<h3>' . t('Applications') . '</h3>';
if($a->apps)
$o .= $a->apps;
else
if(count($a->apps)==0)
notice( t('No installed applications.') . EOL);
return $o;
$tpl = get_markup_template("apps.tpl");
return replace_macros($tpl, array(
'$title' => $title,
'$apps' => $a->apps,
));
}

View file

@ -25,7 +25,7 @@ function community_content(&$a, $update = 0) {
$o .= '<h3>' . t('Community') . '</h3>';
if(! $update) {
$o .= '<script> $(document).ready(function() { $(\'#nav-community-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected('community');
$o .= '<div id="live-community"></div>' . "\r\n";
$o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
}

View file

@ -117,7 +117,7 @@ function contacts_content(&$a) {
$sort_type = 0;
$o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected('contacts');
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;

View file

@ -22,7 +22,7 @@ function directory_content(&$a) {
}
$o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected('directory');
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);

View file

@ -17,6 +17,7 @@ function load_doc_file($s) {
function help_content(&$a) {
nav_set_selected('help');
global $lang;
@ -35,8 +36,10 @@ function help_content(&$a) {
if(! strlen($text)) {
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
notice( t('Page not found.' ) . EOL);
return;
$tpl = get_markup_template("404.tpl");
return replace_macros($tpl, array(
'$message' => t('Page not found.' )
));
}
return Markdown($text);

View file

@ -36,7 +36,7 @@ function message_post(&$a) {
function message_content(&$a) {
$o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-messages-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected('messages');
if(! local_user()) {
notice( t('Permission denied.') . EOL);

View file

@ -196,7 +196,7 @@ function network_content(&$a, $update = 0) {
}
}
$o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected('network');
$_SESSION['return_url'] = $a->cmd;

View file

@ -64,7 +64,7 @@ function notifications_content(&$a) {
}
$o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-notify-link\').addClass(\'nav-selected\'); });</script>';
nav_set_selected("notifications");
if(($a->argc > 1) && ($a->argv[1] == 'all'))
$sql_extra = '';

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