Merge branch 'master' of ssh://gitolite@asdynamics.com:50005/projects/fdn2.git
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
post_max_size = 60M
|
||||
upload_max_filesize = 60M
|
||||
@@ -29,7 +29,7 @@ $currentSystem->apache->user = "var-www";
|
||||
$currentSystem->apache->group = "var-www";
|
||||
$currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html
|
||||
|
||||
$currentSystem->remoteLocationPath = "http://10.0.0.249/fdn2/";
|
||||
$currentSystem->remoteLocationPath = "http://localhost/fdn2/";
|
||||
|
||||
$backupSystem = new stdClass();
|
||||
$backupSystem->account = "40a911e14db8ad6faf0a0e7385e7c267";
|
||||
|
||||
@@ -8,11 +8,36 @@ class MediaLocalVideo extends MediaRenderer{
|
||||
}
|
||||
|
||||
public function asText(array $opt = array()){
|
||||
return $this->id;
|
||||
$size = MediaRendererInterface::SIZE_ORIGINAL;
|
||||
if(array_key_exists("size", $opt) && array_key_exists($opt["size"], self::$SIZES)){
|
||||
$size = self::$SIZES[$opt["size"]];
|
||||
}
|
||||
|
||||
return '<video width="'.$size["width"].'" height="'.$size["height"].'" controls >'.
|
||||
'<source src="'.$this->getVideoLink($size).'" type="video/'.$this->getExtension().'" >'.
|
||||
'</video>';
|
||||
}
|
||||
|
||||
public function render(array $opt = array()){
|
||||
echo $this->asText($opt);
|
||||
}
|
||||
|
||||
public function getPath(){
|
||||
$basepath = GlobalVariables::get("config")->paths->media;
|
||||
return $basepath."/".$this->id.".".$this->extension;
|
||||
}
|
||||
|
||||
public function getExtension(){
|
||||
$video = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$this->id));
|
||||
return $video->extension;
|
||||
}
|
||||
|
||||
public function getVideoLink($size){
|
||||
if(!array_key_exists($size, self::$SIZES)){
|
||||
$size = MediaRendererInterface::SIZE_ORIGINAL;
|
||||
}
|
||||
return GUIHandler::getBaseUrl().'getLocalVideo.php?id='.$this->id.'&size='.$size;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -55,10 +55,10 @@ try{
|
||||
$media = DaoMediaHandler::createNewTextBasedMedia($saveable);
|
||||
}
|
||||
else {
|
||||
$file = $_FILES['data']['tmp_name'];
|
||||
$info = pathinfo($_FILES['data']['name']);
|
||||
// $file = PostHandler::get("data");
|
||||
$media = DaoMediaHandler::createNewFileBasedMedia($saveable, $file,$info["extension"]);
|
||||
$file = $_FILES['data']['tmp_name'];
|
||||
$info = pathinfo($_FILES['data']['name']);
|
||||
$media = DaoMediaHandler::createNewFileBasedMedia($saveable, $file,$info["extension"]);
|
||||
// var_dump($media);
|
||||
}
|
||||
|
||||
if(!is_null($media)){
|
||||
@@ -67,7 +67,7 @@ try{
|
||||
GlobalVariables::get("dao")->save($notizia);
|
||||
}
|
||||
else{
|
||||
throw new Exception("Cannot save a null media in the news with id '".$notiziaId."'");
|
||||
throw new Exception("Cannot save a null media '".$media."' in the news with id '".$notiziaId."'");
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -78,7 +78,7 @@ try{
|
||||
}
|
||||
}
|
||||
|
||||
$formFile = '<span class="label">Selezionare un file</span><input type="hidden" name="MAX_FILE_SIZE" value="52428800" />
|
||||
$formFile = '<span class="label">Selezionare un file</span><input type="hidden" name="MAX_FILE_SIZE" value="62914560" />
|
||||
<input type="file" name="data"/>';
|
||||
|
||||
$formYoutube = '<span class="label">Link</span> <input type="text" name ="data"/>';
|
||||
@@ -89,7 +89,7 @@ try{
|
||||
$error = $ex->getMessage();
|
||||
}catch (Exception $exec){
|
||||
LoggingFacilityManager::getLogger("gui")->log(LoggingFacility::$LEVEL_ERROR, $exec->getMessage());
|
||||
$error = "Si è verificato un errore inaspettato durante l'esecuzione della pagina. Se l'errore persiste contattare il supporto tecnico.";
|
||||
$error = "Si è verificato un errore inaspettato durante l'esecuzione della pagina. Se l'errore persiste contattare il supporto tecnico.".$exec->getMessage();
|
||||
}
|
||||
|
||||
MenuGenerator::generateMenu();
|
||||
@@ -97,6 +97,8 @@ HTMLHelper::generateAdminHead();
|
||||
?>
|
||||
<div>
|
||||
<?php echo $error;?>
|
||||
<div class="errorShow" style="color:red;">
|
||||
</div>
|
||||
<div>
|
||||
<form enctype="multipart/form-data" id="loadFile" method="POST">
|
||||
<div style="margin:15px 5px;">
|
||||
@@ -154,5 +156,18 @@ HTMLHelper::generateAdminHead();
|
||||
$("form#loadFile").attr("action","homeMultimedia.php");
|
||||
$("form#loadFile").submit();
|
||||
});
|
||||
|
||||
$("input[name=data]").on("change",function(){
|
||||
var fileSize = this.files[0].size/1024/1024;
|
||||
if(fileSize > 60){
|
||||
$("#submit").hide();
|
||||
$(".errorShow").append("Dimesioni file non consentite. Max 60MB.")
|
||||
}
|
||||
else{
|
||||
$("#submit").show();
|
||||
$(".errorShow").html("");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -38,6 +38,7 @@ try{
|
||||
}
|
||||
|
||||
if (AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_EDITORE_SUPERVISOR)){
|
||||
|
||||
$postAnsa = PostHandler::get("ansa");
|
||||
if(!is_null($postAnsa)){
|
||||
if(strcmp($postAnsa, "true")==0){
|
||||
@@ -50,6 +51,12 @@ try{
|
||||
GlobalVariables::get("dao")->save($notizia);
|
||||
}
|
||||
$ansa = $notizia->isAnsa;
|
||||
|
||||
$delSondaggio = PostHandler::get("deleteSondaggio");
|
||||
if(!is_null($delSondaggio) && strcmp($delSondaggio, "true")==0){
|
||||
$notizia->sondaggio = null;
|
||||
GlobalVariables::get("dao")->save($notizia);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,6 +82,7 @@ try{
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($notizia);
|
||||
MenuGenerator::generateMenu();
|
||||
HTMLHelper::generateAdminHead();
|
||||
|
||||
@@ -167,20 +175,31 @@ try{
|
||||
<?php if (AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_COMMENTI_SUPERVISOR)){ ?>
|
||||
<li><a href="#" id="notiziaMenu_commenti">Visualizza Commenti</a></li>
|
||||
<?php }?>
|
||||
<?php if (AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_SONDAGGI)){ ?>
|
||||
<?php if(sizeof($notizia->sondaggio->votanti)==0){
|
||||
if($notizia->hasProperty("sondaggio") && !is_null($notizia->sondaggio)){?>
|
||||
<li><a href="#" id="notiziaMenu_addSondaggi">Modifica Sondaggio</a></li>
|
||||
<?php }else{?>
|
||||
<li><a href="#" id="notiziaMenu_addSondaggi">Crea Sondaggio</a></li>
|
||||
<?php }
|
||||
} ?>
|
||||
<?php }?>
|
||||
<?php
|
||||
if (AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_SONDAGGI)){
|
||||
if($notizia->hasProperty("sondaggio") && !is_null($notizia->sondaggio)){
|
||||
if(sizeof($notizia->sondaggio->votanti)==0){
|
||||
?>
|
||||
<li><a href="#" id="notiziaMenu_addSondaggi">Modifica Sondaggio</a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<li><a href="#" id="notiziaMenu_deleteSondaggi">Cancella Sondaggio</a></li>
|
||||
<?php
|
||||
}
|
||||
else{
|
||||
?>
|
||||
<li><a href="#" id="notiziaMenu_addSondaggi">Crea Sondaggio</a></li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li><a href="listNotizie.php" id="notiziaMenu_back">Torna alla lista notizie</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form id="notiziaForm" method="POST" action="">
|
||||
<input type="hidden" name="ansa" value="" />
|
||||
<input type="hidden" name="deleteSondaggio" value="" />
|
||||
<input type="hidden" name="id" value="<?php echo $notiziaId;?>" />
|
||||
</form>
|
||||
<?php if($notizia->hasProperty("sondaggio") && !is_null($notizia->sondaggio)){?>
|
||||
@@ -208,6 +227,13 @@ try{
|
||||
$("form#notiziaForm").submit();
|
||||
});
|
||||
|
||||
$("#notiziaMenu_deleteSondaggi").click(function(event){
|
||||
$("form#notiziaForm").attr("action","homeNotizie.php");
|
||||
|
||||
$("form#notiziaForm input[type=hidden][name=deleteSondaggio]").val("true");
|
||||
$("form#notiziaForm").submit();
|
||||
});
|
||||
|
||||
$("#notiziaMenu_ansa").click(function(event){
|
||||
$("form#notiziaForm").attr("action","homeNotizie.php");
|
||||
|
||||
|
||||
@@ -108,6 +108,12 @@ HTMLHelper::generateAdminHead();
|
||||
Le newsletter nella lista <i>Inviate</i> sono invece già lavorate o in fase di lavorazione e sono quindi solo visibili ma non modificabili.
|
||||
</p>
|
||||
<?php } ?>
|
||||
<h3>Contenuti Multimediali</h3>
|
||||
<p style="text-align:justify;">
|
||||
Caricare contenuti multimediali in proporzione 16:9.
|
||||
La dimensione minima deve essere 500x375.
|
||||
Non possono essere caricati file più grandi di <b>60MB</b>.
|
||||
</p>
|
||||
<?php if (AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_NEWSLETTER)){ ?>
|
||||
<h3>Statistiche</h3>
|
||||
<p style="text-align:justify;">
|
||||
|
||||
+9
-4
@@ -142,11 +142,16 @@ GUIHandler::generateHtmlHeaders(array("additionalMetadata"=>$additionalHeaders,"
|
||||
if(sizeof($medias)>0){
|
||||
$pos = array_search($media, $medias);
|
||||
}
|
||||
if($media->mediaType == MediaModel::TYPE_IMAGE){
|
||||
?>
|
||||
<div onclick="javascript:loadImage('<?php echo $pos;?>')">
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
<?php
|
||||
<div onclick="javascript:loadImage('<?php echo $pos;?>')">
|
||||
<?php $media->renderMedia(array("size"=>MediaRenderer::SIZE_BIG,"clickable"=>true));?>
|
||||
</div>
|
||||
|
||||
<?php }
|
||||
else {
|
||||
$media->renderMedia(array("size"=>MediaRenderer::SIZE_ORIGINAL,"clickable"=>false));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once(dirname(__FILE__)."/load.php");
|
||||
|
||||
// $sizes = array(
|
||||
// "large"=>array("width"=>800,"height"=>600),
|
||||
// "small"=>array("width"=>160,"height"=>120)
|
||||
// );
|
||||
|
||||
if (array_key_exists("id",$_GET)) {
|
||||
$video = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$_GET['id']));
|
||||
|
||||
if (!is_null($video)){
|
||||
$basepath = GlobalVariables::get("config")->paths->media;
|
||||
$videoPath= $basepath."/".$video->id.".".$video->extension;
|
||||
$lenght = filesize($videoPath);
|
||||
|
||||
header('Content-type: '.mime_content_type($videoPath));
|
||||
header('Content-Lenght: '.$lenght);
|
||||
readfile($videoPath);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -6,6 +6,7 @@ font-weight: normal;
|
||||
src: local('Bebas Neue'), url('BebasNeue.woff') format('woff');
|
||||
}
|
||||
|
||||
|
||||
a{text-decoration:none;}
|
||||
body{font-family:lato, arial;}
|
||||
|
||||
@@ -609,4 +610,15 @@ Password Recovery
|
||||
color:white;
|
||||
text-decoration:none;
|
||||
cursor:pointer;
|
||||
}
|
||||
/**
|
||||
DISABILITAZIONE TASTO DOWNLOAD DAL PLAYER VIDEO
|
||||
*/
|
||||
|
||||
video::-internal-media-controls-download-button {
|
||||
display:none;
|
||||
}
|
||||
|
||||
video::-webkit-media-controls-enclosure {
|
||||
overflow:hidden;
|
||||
}
|
||||
Reference in New Issue
Block a user