mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
GFix client publications
This commit is contained in:
@@ -205,11 +205,9 @@ class Query implements ControllerProviderInterface
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$json['results'] = $twig->render($template, array(
|
||||
'results' => $result,
|
||||
'GV_social_tools' => $registry->get('GV_social_tools'),
|
||||
'array_selected' => explode(';', $request->get('sel')),
|
||||
'highlight' => $search_engine->get_query(),
|
||||
'searchEngine' => $search_engine,
|
||||
'suggestions' => $prop
|
||||
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
/* @var $Core \Alchemy\Phrasea\Core */
|
||||
$Core = require_once __DIR__ . "/../../lib/bootstrap.php";
|
||||
require_once __DIR__ . "/../../lib/bootstrap.php";
|
||||
|
||||
$Core= \bootstrap::getCore();
|
||||
$appbox = appbox::get_instance($Core);
|
||||
$session = $appbox->get_session();
|
||||
$registry = $appbox->get_registry();
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
@@ -15,295 +14,177 @@
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
//$Core = \bootstrap::getCore();
|
||||
//$appbox = appbox::get_instance($Core);
|
||||
//$session = $appbox->get_session();
|
||||
//
|
||||
//$th_size = $user->getPrefs('images_size');
|
||||
//
|
||||
//$user = $Core->getAuthenticatedUser();
|
||||
//
|
||||
//$RN = array("\r\n", "\n", "\r");
|
||||
//
|
||||
//$conn = $appbox->get_connection();
|
||||
//
|
||||
//$sql = 'SELECT s.public, s.pub_restrict,c.sselcont_id, c.base_id, sb.*, c.record_id, s.ssel_id, s.name, s.descript, c.ord, ' .
|
||||
// 'DATE_FORMAT(s.pub_date,"' . _('phraseanet::technique::datetime') . '") AS pub_date, ' .
|
||||
// 'DATE_FORMAT(s.updater,"' . _('phraseanet::technique::date') . '") AS updater, ' .
|
||||
// 's.updater as dateC1, s.pub_date as dateC2,' .
|
||||
// ' n.id, u.usr_nom, u.usr_prenom, u.usr_login, u.usr_mail ' .
|
||||
// ', bu.mask_and ' .
|
||||
// ', bu.mask_xor ' .
|
||||
// 'FROM (sselcont c, ssel s, usr u, bas b, sbas sb) ' .
|
||||
// 'LEFT JOIN sselnew n ' .
|
||||
// 'ON (n.ssel_id = s.ssel_id AND n.usr_id = :usr_id) ' .
|
||||
// ' LEFT JOIN basusr bu ON (bu.base_id = b.base_id AND bu.usr_id = :usr_id_bis)' .
|
||||
// 'WHERE s.ssel_id = c.ssel_id AND s.public="1" ' .
|
||||
// 'AND (s.pub_restrict="0" ' .
|
||||
// 'OR (s.pub_restrict="1" AND c.base_id IN ' .
|
||||
// ' (SELECT base_id FROM basusr WHERE usr_id = :usr_id_sub AND actif = "1")))' .
|
||||
// ' AND u.usr_id = s.usr_id AND temporaryType=0 ' .
|
||||
// ' AND b.sbas_id = sb.sbas_id' .
|
||||
// ' AND b.base_id = c.base_id' .
|
||||
// ' ORDER BY s.pub_date DESC, c.ord ASC';
|
||||
//
|
||||
//$sqlMe = 'SELECT usr_login, usr_password FROM usr WHERE usr_id = :usr_id';
|
||||
//
|
||||
//$stmt = $conn->prepare($sqlMe);
|
||||
//$stmt->execute(array(':usr_id' => $session->get_usr_id()));
|
||||
//$rawMe = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
//$stmt->closeCursor();
|
||||
//
|
||||
//$info_usr = null;
|
||||
//
|
||||
//if ($rawMe)
|
||||
//{
|
||||
// $info_usr = $rawMe;
|
||||
//}
|
||||
//
|
||||
//$core = \bootstrap::getCore();
|
||||
//$twig = $core->getTwig();
|
||||
//
|
||||
//$stmt = $conn->prepare($sql);
|
||||
//$usr_id = $session->get_usr_id();
|
||||
//$stmt->execute(array(':usr_id' => $usr_id, ':usr_id_bis' => $usr_id, ':usr_id_sub' => $usr_id));
|
||||
//$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
//$stmt->closeCursor();
|
||||
//
|
||||
//$sselid = null;
|
||||
//$o = 0;
|
||||
//$out = '';
|
||||
//
|
||||
//$feed = '';
|
||||
//$feed .= '<div style="height:50px;" class="homePubTitleBox">' .
|
||||
// '<div style="float:left;width:350px;"><h1 style="font-size:20px;margin-top:15px;">' . _('publications:: dernieres publications') . '</h1></div>' .
|
||||
// '<div style="float:right;width:160px;text-align:right;cursor:pointer;" class="subscribe_my_rss">
|
||||
// <h1 style="font-size:17px;margin-top:19px;"> ' .
|
||||
// _('publications:: s\'abonner aux publications') . ' ' .
|
||||
// '<img style="border:none;" src="/skins/icons/rss16.png" />
|
||||
// </h1>' .
|
||||
// '</div></div>';
|
||||
//
|
||||
//foreach ($rs as $row)
|
||||
//{
|
||||
// if ($row['ssel_id'] != $sselid)
|
||||
// {
|
||||
// if ($sselid !== null)
|
||||
// {
|
||||
//
|
||||
//
|
||||
//
|
||||
// $item .= '<div style="width:100%;position:relative;float:left;" id="PUBLICONT' . $sselid . '">' . $out;
|
||||
// $item .= '</div>' .
|
||||
// '</div></div>';
|
||||
//
|
||||
// if ($itemIsOk)
|
||||
// $feed .= $item;
|
||||
// }
|
||||
//
|
||||
// $itemIsOk = false;
|
||||
//
|
||||
// $sselid = $row['ssel_id'];
|
||||
// $ord = $row['ord'];
|
||||
// $o = 0;
|
||||
// $out = '';
|
||||
// $neverSeen = '';
|
||||
// $publisher = $row['usr_prenom'] . ' ' . $row['usr_nom'];
|
||||
// if ($publisher == ' ')
|
||||
// $publisher = $row['usr_mail'];
|
||||
// if ($publisher == '')
|
||||
// $publisher = 'Unreferenced user';
|
||||
//
|
||||
// if ($row['id'] != '')
|
||||
// $neverSeen = _('publications:: publication non lue');
|
||||
//
|
||||
// $item = '';
|
||||
// $item .= '<div class="boxPubli">' .
|
||||
// '<div class="titlePubli">' .
|
||||
// '<h2 class="htitlePubli">' .
|
||||
// '<a class="homePubTitle" onclick="openCompare(\'' . $sselid . '\');">' . $row['name'] .
|
||||
// '</a> <span style="font-size:12px;color:red;">' . $neverSeen . '</span></h2>' .
|
||||
// '<span class="publiInfos">' .
|
||||
// ' ' . $row['pub_date'] .
|
||||
// ' ';
|
||||
//
|
||||
// if ($row['usr_mail'] != '')
|
||||
// $item .= '<a class="homePubLink" href="mailto:' . $row['usr_mail'] . '">';
|
||||
//
|
||||
// $item .= $publisher;
|
||||
//
|
||||
// if ($row['usr_mail'] != '')
|
||||
// $item .= '</a>';
|
||||
//
|
||||
// if ($row['dateC1'] != $row['dateC2'])
|
||||
// $item .= '<br/><span style="font-style:italic;">' . _('publications:: derniere mise a jour') . ' ' . $row['updater'] . '</span><br/><br/>';
|
||||
//
|
||||
// $item .= '</span></div><div class="descPubli"><div style="margin:10px 0 10px 20px;width:80%;">';
|
||||
//
|
||||
//
|
||||
// if (trim(str_replace($RN, '', $row['descript'])) != '')
|
||||
// {
|
||||
// $row['descript'] = str_replace($RN, '<br/>', $row['descript']);
|
||||
// $item .= '' . $row['descript'];
|
||||
// }
|
||||
// $item .= '</div>';
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// $ord = $row['ord'];
|
||||
// $statOk = true;
|
||||
// if ($row['public'] == 1 && $row['pub_restrict'] == 1)
|
||||
// {
|
||||
// $statOk = false;
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// $connsbas = connection::getPDOConnection($row['sbas_id']);
|
||||
//
|
||||
// $sql = 'SELECT record_id FROM record WHERE ((status ^ ' . $row['mask_xor'] . ') & ' . $row['mask_and'] . ')=0
|
||||
// AND record_id = :record_id';
|
||||
// $stmt = $connsbas->prepare($sql);
|
||||
// $stmt->execute(array(':record_id' => $row['record_id']));
|
||||
// $statOk = ($stmt->rowCount() > 0);
|
||||
// $stmt->closeCursor();
|
||||
// }
|
||||
// catch (Exception $e)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// $layoutmode = $user->getPrefs('view');
|
||||
//
|
||||
// if ($statOk)
|
||||
// {
|
||||
// $record = new record_adapter($row["sbas_id"], $row["record_id"]);
|
||||
// $sbas_id = phrasea::sbasFromBas($row['base_id']);
|
||||
//
|
||||
// $captionXML = $record->get_xml();
|
||||
//
|
||||
// $thumbnail = $record->get_thumbnail();
|
||||
//
|
||||
// $title = $record->get_title();
|
||||
// $exifinfos = $record->get_technical_infos();
|
||||
// $caption = $twig->render('common/caption.html', array('view' => 'internal_publi', 'record' => $record));
|
||||
//
|
||||
// $o++;
|
||||
// $itemIsOk = true;
|
||||
// $bottom = 0;
|
||||
// $right = 10;
|
||||
// $left = 0;
|
||||
// $top = 10;
|
||||
//
|
||||
//
|
||||
// if (trim($preview) != '')
|
||||
// $preview = "<div tooltipsrc='/prod/tooltip/preview/" . phrasea::sbasFromBas($row["base_id"]) . "/" . $row["record_id"] . "/' class=\"previewTips\"></div> ";
|
||||
//
|
||||
// $docType = $record->get_type();
|
||||
// $isVideo = ($docType == 'video');
|
||||
// $isAudio = ($docType == 'audio');
|
||||
// $isImage = ($docType == 'image');
|
||||
// $isDocument = ($docType == 'document');
|
||||
//
|
||||
// $duration = '';
|
||||
//
|
||||
// if (!$isVideo && !$isAudio)
|
||||
// $isImage = true;
|
||||
//
|
||||
// if ($isVideo)
|
||||
// {
|
||||
// $duration = $record->get_formated_duration();
|
||||
// if ($duration != '')
|
||||
// $duration = '<div class="duration">' . $duration . '</div>';
|
||||
// }
|
||||
// if ($isAudio)
|
||||
// {
|
||||
// $duration = $record->get_formated_duration();
|
||||
// if ($duration != '')
|
||||
// $duration = '<div class="duration">' . $duration . '</div>';
|
||||
// }
|
||||
//
|
||||
//
|
||||
// $ratio = $thumbnail->get_width() / $thumbnail->get_height();
|
||||
//
|
||||
// if ($ratio > 1)
|
||||
// {
|
||||
// $cw = min(((int) $th_size - 30), $thumbnail->get_width());
|
||||
// $ch = $cw / $ratio;
|
||||
// $pv = floor(($th_size - $ch) / 2);
|
||||
// $ph = floor(($th_size - $cw) / 2);
|
||||
// $imgStyle = 'xwidth:' . $cw . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $ch = min(((int) $th_size - 30), $thumbnail->get_height());
|
||||
// $cw = $ch * $ratio;
|
||||
//
|
||||
// $pv = floor(($th_size - $ch) / 2);
|
||||
// $ph = floor(($th_size - $cw) / 2);
|
||||
//
|
||||
// $imgStyle = 'xheight:' . $ch . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// $ident = $row["base_id"] . "_" . $row["record_id"];
|
||||
//
|
||||
//
|
||||
// $out .= "<div style='width:" . ($th_size + 30) . "px;' sbas=\"" . $row['sbas_id'] . "\" id='IMGT_" . $row['base_id'] . "_" . $row['record_id'] . "_PUB_" . $sselid . "' class='IMGT diapo' onclick=\"openPreview('BASK','" . $ord . "','" . $sselid . "');\">";
|
||||
//
|
||||
// $out .= '<div>';
|
||||
// $out .= "<div class=\"title\" style=\"height:40px;\">";
|
||||
//
|
||||
// $out .= $title; //$data['title'];
|
||||
//
|
||||
// $out .= "</div>\n";
|
||||
//
|
||||
// $out .= '</div>';
|
||||
//
|
||||
// $out .= "<table class=\"thumb w160px h160px\" style=\"xheight:" . (int) $th_size . "px;\" cellspacing='0' cellpadding='0' valign='middle'>\n<tr><td>";
|
||||
//
|
||||
// $out .= $duration . "<img title=\"" . str_replace('"', '"', $caption) . "\" class=\" captionTips\" src=\"" . $thumbnail->get_url() . "\" style=\"" . $imgStyle . "\" />";
|
||||
//
|
||||
// $out .= "</td></tr></table>";
|
||||
//
|
||||
// $out .= '<div style="height: 25px;position:relative;">';
|
||||
// $out .= '<table class="bottom">';
|
||||
// $out .= '<tr>';
|
||||
// $out .= '<td>';
|
||||
//
|
||||
// $out .= "</td>\n";
|
||||
//
|
||||
// $out .= "<td style='text-align:right;' valign='bottom' nowrap>\n";
|
||||
//
|
||||
// $out .= $preview;
|
||||
//
|
||||
// $out .= "</td>";
|
||||
// $out .= "</tr>";
|
||||
// $out .= "</table>";
|
||||
// $out .= "</div>";
|
||||
//
|
||||
//
|
||||
// $out .= "</div>";
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if (isset($item))
|
||||
//{
|
||||
// $item .= ' <br/><div style="width:100%;position:relative;float:left;" id="PUBLICONT' . $sselid . '">' . $out;
|
||||
// $item .= '</div>' .
|
||||
// '</div></div>';
|
||||
// if ($itemIsOk)
|
||||
// $feed .= $item;
|
||||
//}
|
||||
//
|
||||
//echo '<div>' . $feed . '</div>';
|
||||
//
|
||||
//$sql = 'DELETE FROM sselnew WHERE usr_id = :usr_id AND ssel_id IN (SELECT ssel_id FROM ssel WHERE public="1")';
|
||||
//$stmt = $conn->prepare($sql);
|
||||
//$stmt->execute(array(':usr_id' => $usr_id));
|
||||
//$stmt->closeCursor();
|
||||
$Core = \bootstrap::getCore();
|
||||
$appbox = appbox::get_instance($Core);
|
||||
|
||||
$user = $Core->getAuthenticatedUser();
|
||||
|
||||
$feeds = \Feed_Collection::load_all($appbox, $user);
|
||||
|
||||
|
||||
$th_size = $user->getPrefs('images_size');
|
||||
|
||||
$core = \bootstrap::getCore();
|
||||
$twig = $core->getTwig();
|
||||
?>
|
||||
<div style="height:50px;" class="homePubTitleBox">
|
||||
<div style="float:left;width:350px;"><h1 style="font-size:20px;margin-top:15px;">
|
||||
<h1><?php echo _('publications:: dernieres publications'); ?></h1>
|
||||
</div>
|
||||
<!-- <div style="float:right;width:160px;text-align:right;cursor:pointer;" class="subscribe_my_rss">
|
||||
<h1 style="font-size:17px;margin-top:19px;">
|
||||
<?php echo _('publications:: s\'abonner aux publications'); ?>
|
||||
<img style="border:none;" src="/skins/icons/rss16.png" />
|
||||
</h1>
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$feed = '';
|
||||
|
||||
foreach ($feeds->get_aggregate()->get_entries(0, 5)->get_entries() as $entry)
|
||||
{
|
||||
/* @var $entry \Feed_Entry_Adapter */
|
||||
|
||||
$feed .= '<div class="boxPubli">' .
|
||||
'<div class="titlePubli">' .
|
||||
'<h2 class="htitlePubli">' .
|
||||
'<a class="homePubTitle" onclick="openCompare(\'' . $entry->get_id() . '\');">'
|
||||
. $entry->get_title() .
|
||||
'</a> </h2>' .
|
||||
'<span class="publiInfos">' .
|
||||
' ' . \phraseadate::getPrettyString($entry->get_created_on()) .
|
||||
' ';
|
||||
|
||||
if ($entry->get_author_email())
|
||||
$feed .= '<a class="homePubLink" href="mailto:' . $entry->get_author_email() . '">';
|
||||
|
||||
$feed .= $entry->get_author_name();
|
||||
|
||||
if ($entry->get_author_email())
|
||||
$feed .= '</a>';
|
||||
|
||||
if ($entry->get_updated_on() > $entry->get_created_on())
|
||||
$feed .= '<br/><span style="font-style:italic;">' . _('publications:: derniere mise a jour')
|
||||
. ' ' . \phraseadate::getPrettyString($entry->get_updated_on()) . '</span><br/><br/>';
|
||||
|
||||
$feed .= '</span></div><div class="descPubli"><div style="margin:10px 0 10px 20px;width:80%;">';
|
||||
|
||||
|
||||
if (trim($entry->get_subtitle()) != '')
|
||||
{
|
||||
$feed .= '' . nl2br($entry->get_subtitle());
|
||||
}
|
||||
$feed .= '</div>';
|
||||
|
||||
$feed .= '<div style="width:100%;position:relative;float:left;" id="PUBLICONT' . $entry->get_id() . '">';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
foreach ($entry->get_content() as $Feed_item)
|
||||
{
|
||||
/* @var $Feed_item \Feed_Entry_Item */
|
||||
$record = $Feed_item->get_record();
|
||||
|
||||
$thumbnail = $record->get_thumbnail();
|
||||
|
||||
$title = $record->get_title();
|
||||
$caption = $twig->render(
|
||||
'common/caption.html', array('view' => 'internal_publi', 'record' => $record)
|
||||
);
|
||||
|
||||
$preview = "<div tooltipsrc='/prod/tooltip/preview/" . $record->get_sbas_id() . "/" . $record->get_record_id() . "/' class=\"previewTips\"></div> ";
|
||||
|
||||
$docType = $record->get_type();
|
||||
$isVideo = ($docType == 'video');
|
||||
$isAudio = ($docType == 'audio');
|
||||
$isImage = ($docType == 'image');
|
||||
|
||||
$duration = '';
|
||||
|
||||
if (!$isVideo && !$isAudio)
|
||||
$isImage = true;
|
||||
|
||||
if ($isVideo)
|
||||
{
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
$duration = '<div class="duration">' . $duration . '</div>';
|
||||
}
|
||||
if ($isAudio)
|
||||
{
|
||||
$duration = $record->get_formated_duration();
|
||||
if ($duration != '')
|
||||
$duration = '<div class="duration">' . $duration . '</div>';
|
||||
}
|
||||
|
||||
|
||||
$ratio = $thumbnail->get_width() / $thumbnail->get_height();
|
||||
|
||||
if ($ratio > 1)
|
||||
{
|
||||
$cw = min(((int) $th_size - 30), $thumbnail->get_width());
|
||||
$ch = $cw / $ratio;
|
||||
$pv = floor(($th_size - $ch) / 2);
|
||||
$ph = floor(($th_size - $cw) / 2);
|
||||
$imgStyle = 'width:' . $cw . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ch = min(((int) $th_size - 30), $thumbnail->get_height());
|
||||
$cw = $ch * $ratio;
|
||||
|
||||
$pv = floor(($th_size - $ch) / 2);
|
||||
$ph = floor(($th_size - $cw) / 2);
|
||||
|
||||
$imgStyle = 'height:' . $ch . 'px;xpadding:' . $pv . 'px ' . $ph . 'px;';
|
||||
}
|
||||
|
||||
$feed .= "<div style='width:" . ($th_size + 30) . "px;' sbas=\"" . $record->get_sbas_id() . "\"
|
||||
id='IMGT_" . $record->get_serialize_key() . "_PUB_" . $entry->get_id()
|
||||
. "' class='IMGT diapo'
|
||||
onclick=\"openPreview('FEED','" . $Feed_item->get_ord() . "','" . $entry->get_id() . "');\">";
|
||||
|
||||
$feed .= '<div>';
|
||||
$feed .= "<div class=\"title\" style=\"height:40px;\">";
|
||||
|
||||
$feed .= $title;
|
||||
|
||||
$feed .= "</div>\n";
|
||||
|
||||
$feed .= '</div>';
|
||||
|
||||
$feed .= "<table class=\"thumb w160px h160px\" style=\"xheight:" . (int) $th_size . "px;\" cellspacing='0' cellpadding='0' valign='middle'>\n<tr><td>";
|
||||
|
||||
$feed .= $duration . "<img title=\"" . str_replace('"', '"', $caption) . "\" class=\" captionTips\" src=\"" . $thumbnail->get_url() . "\" style=\"" . $imgStyle . "\" />";
|
||||
|
||||
$feed .= "</td></tr></table>";
|
||||
|
||||
$feed .= '<div style="height: 25px;position:relative;">';
|
||||
$feed .= '<table class="bottom">';
|
||||
$feed .= '<tr>';
|
||||
$feed .= '<td>';
|
||||
|
||||
$feed .= "</td>\n";
|
||||
|
||||
$feed .= "<td style='text-align:right;' valign='bottom' nowrap>\n";
|
||||
|
||||
$feed .= $preview;
|
||||
|
||||
$feed .= "</td>";
|
||||
$feed .= "</tr>";
|
||||
$feed .= "</table>";
|
||||
$feed .= "</div>";
|
||||
|
||||
|
||||
$feed .= "</div>";
|
||||
}
|
||||
$feed .= '</div>' .
|
||||
'</div></div>';
|
||||
}
|
||||
|
||||
echo '<div>' . $feed . '</div>';
|
||||
|
||||
|
@@ -218,10 +218,16 @@
|
||||
return this.datas;
|
||||
},
|
||||
empty : function(){
|
||||
var $this = this;
|
||||
this.datas = new Array();
|
||||
|
||||
jQuery(this.options.selector, this.$container).filter('.selected:visible').removeClass('selected');
|
||||
|
||||
if(typeof $this.options.selectStop === 'function')
|
||||
{
|
||||
$this.options.selectStop(jQuery.Event('selectStop'), $this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
length : function(){
|
||||
|
Reference in New Issue
Block a user