Browse Source

- Merge the Contact map and the posts map

- Little CSS fix in the chat
pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
e3e3fdf51e
  1. 6
      app/widgets/Chat/chat.css
  2. 5
      app/widgets/ContactInfo/ContactInfo.php
  3. 5
      app/widgets/Wall/Wall.php
  4. 17
      app/widgets/WidgetCommon/WidgetCommon.php
  5. BIN
      themes/movim/img/marker-icon.png

6
app/widgets/Chat/chat.css

@ -32,9 +32,10 @@
#chats .chat .tab.alert .name {
display: relative;
padding-right: 2.5em;
}
#chats .chat .tab.alert .name:after {
#chats .chat .tab.alert .name:before {
content: "";
width: 2em;
height: 2em;
@ -46,7 +47,8 @@
float: right;
background-color: #D92727;
margin-left: 0.5em;
margin-right: -0.5em;
margin-right: -2.5em;
z-index: 3;
}
#chats .chat .tab:hover {

5
app/widgets/ContactInfo/ContactInfo.php

@ -88,7 +88,8 @@ class ContactInfo extends WidgetCommon
$html .= prepareDate(strtotime($c->delay)).'<br />';
}
if($c->loclatitude != '' && $c->loclongitude != ''
/*
if($c->loclatitude != '' && $c->loclongitude != ''
|| $c->getPlace() != '') {
$html .= '
@ -113,7 +114,7 @@ class ContactInfo extends WidgetCommon
}
*/
// Client informations

5
app/widgets/Wall/Wall.php

@ -60,6 +60,9 @@ class Wall extends WidgetCommon
$pd = new \modl\PostnDAO();
$pl = $pd->getNode($from, 'urn:xmpp:microblog:0', $start+1, 10);
$cd = new \modl\ContactDAO();
$c = $cd->getRosterItem($from);
// We ask for the HTML of all the posts
$htmlmessages = $this->preparePosts($pl);
@ -70,7 +73,7 @@ class Wall extends WidgetCommon
if(count($pl) > 0 && $htmlmessages != false) {
if($start == -1) {
$html .= $this->printMap($pl);
$html .= $this->printMap($pl, $c);
$html .= '
<div class="posthead spacetop">

17
app/widgets/WidgetCommon/WidgetCommon.php

@ -237,7 +237,7 @@ class WidgetCommon extends WidgetBase {
}
protected function printMap($posts) {
protected function printMap($posts, $c = null) {
$html = '<div style="height: 13em;" id="postsmap"></div>';
$javascript = '
@ -270,6 +270,21 @@ class WidgetCommon extends WidgetBase {
}
}
if(isset($c) && $c->loclatitude != '' && $c->loclongitude != '') {
$posfound = true;
$javascript .= '
var red = L.icon({
iconUrl: "'.BASE_URI.'/themes/movim/img/marker-icon.png",
iconSize: [25,41], // size of the icon
shadowSize: [50, 64], // size of the shadow
iconAnchor: [13, 41]
});
var marker = L.marker(['.$c->loclatitude.' ,'.$c->loclongitude.'], {icon: red}).addTo(postsmap);
';
$bound .= '['.$c->loclatitude.','.$c->loclongitude.'],';
}
$javascript .= '
postsmap.fitBounds(['.$bound.']);
</script>';

BIN
themes/movim/img/marker-icon.png

After

Width: 25  |  Height: 41  |  Size: 1.8 KiB

Loading…
Cancel
Save