Merge branch 'master' of ssh://gitolite@asdynamics.com:50005/projects/fdn2.git

This commit is contained in:
Lorenzo Giacomelli
2016-03-31 16:51:22 +02:00
7 changed files with 47 additions and 29 deletions
-2
View File
@@ -6,8 +6,6 @@ Creation Date: 27/gen/2016
class AnalyticsHelper {
private static $COOKIE_NAME = "FDN_STAT_NUM";
//TODO: Switch this value to +1 year in production environment
// private static $COOKIE_TIME = "+5 minutes";
private static $COOKIE_TIME = "+1 year";
/**
+5 -3
View File
@@ -40,6 +40,7 @@ class NotiziaModel extends HasMediaModel{
const CATEGORY_SALUTE = 11;
const CATEGORY_ANNUNCI = 12;
const CATEGORY_FISCOELAVORO = 13;
const CATEGORY_RUBRICHE = 14;
public static $NOTIZIE_CATEGORY = array(
self::CATEGORY_POLITICA=>array("label"=>"Politica","mainMenu"=>true,"hidden"=>false,"pages"=>array("list"=>"politica.php")),
@@ -50,11 +51,12 @@ class NotiziaModel extends HasMediaModel{
self::CATEGORY_ANIMALI=>array("label"=>"Mondo Animale","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"animali.php")),
self::CATEGORY_VIAGGI=>array("label"=>"Viaggi","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"viaggi.php")),
self::CATEGORY_RISTORANTI=>array("label"=>"Food&Drink","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"ristoranti.php")),
self::CATEGORY_MESTIERI=>array("label"=>"Professioni e Mestieri","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"mestieri.php")),
self::CATEGORY_MESTIERI=>array("label"=>"Professioni e Mestieri","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"mestieri.php")),
self::CATEGORY_CASA=>array("label"=>"Casa","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"casa.php")),
self::CATEGORY_SALUTE=>array("label"=>"Salute","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"salute.php")),
self::CATEGORY_SALUTE=>array("label"=>"Salute","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"salute.php")),
self::CATEGORY_ANNUNCI=>array("label"=>"Annunci","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"annunci.php")),
self::CATEGORY_FISCOELAVORO=>array("label"=>"Fisco e Lavoro","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"fiscoelavoro.php"))
self::CATEGORY_FISCOELAVORO=>array("label"=>"Fisco e Lavoro","mainMenu"=>false, "hidden"=>true,"pages"=>array("list"=>"fiscoelavoro.php")),
self::CATEGORY_RUBRICHE=>array("label"=>"Rubriche","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"rubriche.php"))
);
public static function getCollectionName(){
+1 -1
View File
@@ -21,7 +21,7 @@ try{
throw new CoreException("Trying to add a media to an invalid model with id '".$notiziaId. "'");
}
else{
$mediaTypeSaved = PostHandler::get("mediaType");
$mediaTypeSaved = intval(PostHandler::get("mediaType"));
if(array_key_exists("action", $_POST) && strcmp(PostHandler::get("action"), "save")==0){
$notizia = GlobalVariables::get("dao")->getFirst("NotiziaModel",array("id"=>$notiziaId));
-3
View File
@@ -88,9 +88,6 @@ try{
}
}
}
else{
echo "post nullo";
}
}catch(GUIException $ex){
$error = $ex->getMessage();
}catch (Exception $exec){
+17 -9
View File
@@ -207,14 +207,14 @@ GUIHandler::generateHtmlHeaders(array("additionalHeaders"=>$additionalHeaders));
</script>
<?php
$i=0;
foreach($medias as $mediaImage){?>
<div class="carosImage mediaContent">
<span class="helper"></span>
<div style="display:inline-block;" onclick="javascript:loadImage('<?php echo $i;?>')"><?php $mediaImage->renderMedia(array("size"=>MediaRenderer::SIZE_MINI,"clickable"=>true));?></div>
</div>
<?php if($mediaImage->mediaType == MediaModel::TYPE_IMAGE){
foreach($medias as $mediaImage){
if($mediaImage->mediaType == MediaModel::TYPE_IMAGE){
$imageArray = getimagesize($mediaImage->getRenderer()->getImageLink(array("size"=>MediaRenderer::SIZE_BIG)));
?>
?>
<div class="carosImage mediaContent">
<span class="helper"></span>
<div style="display:inline-block;" onclick="javascript:loadImage('<?php echo $i;?>')"><?php $mediaImage->renderMedia(array("size"=>MediaRenderer::SIZE_MINI,"clickable"=>true));?></div>
</div>
<script type="text/javascript">
var ele ={
src: '<?php echo GUIHandler::getBaseUrl()."getImage.php?id=".$mediaImage->id."&size=".MediaRenderer::SIZE_BIG;?>',
@@ -223,9 +223,17 @@ GUIHandler::generateHtmlHeaders(array("additionalHeaders"=>$additionalHeaders));
}
items.push(ele);
</script>
<?php
<?php
$i++;
}
}
else {
?>
<div class="carosImage mediaContent">
<span class="helper"></span>
<div style="display:inline-block;" ><?php $mediaImage->renderMedia(array("size"=>MediaRenderer::SIZE_MINI,"clickable"=>true));?></div>
</div>
<?php
}
}
?>
</div>
+10 -8
View File
@@ -10,15 +10,17 @@ if (array_key_exists("id",$_GET)) {
$pdfModel = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$_GET['id']));
$id = $_GET["id"];
if (!is_null($pdfModel)){
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".pdf";
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".pdf";
if (!SFSManager::fileExists($exposedFilePath)){
SystemController::shellExec("ln",'-s "'.$localFilePath.'" "'.$exposedFilePath.'"');
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension;
if (SFSManager::fileExists($localFilePath)){
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension;
if (!SFSManager::fileExists($exposedFilePath)){
SystemController::shellExec("ln",'-nFs "'.$localFilePath.'" "'.$exposedFilePath.'"');
}
header('X-Sendfile: '.$exposedFilePath.'');
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"');
}
header('X-Sendfile: '.$exposedFilePath.'');
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"');
}
}
+14 -3
View File
@@ -1,8 +1,12 @@
@CHARSET "UTF-8";
body{min-width:1000px;}
body:before{content: ""; float:left; width:15%; min-width: 180px; height:100vh; min-height:600px;}
body > div {overflow:hidden;}
.hidden{display:none;}
#admin_menu{position:fixed; left:0; top:0; bottom:0; width:300px; background-color:#393939; display:inline-block;}
#admin_menu{position:fixed; left:0; top:0; bottom:0; width:15%; min-width:180px; background-color:#393939; display:inline-block;}
#admin_menu ul{list-style: none; width:100%; border:0; margin:0; padding:0; display:block; overflow:hidden;}
#admin_menu ul li{width:100%; height:50px; display:inline-block;}
@@ -12,8 +16,11 @@
#admin_menu ul ul li a{padding-left:25px; }
#admin_menu ul ul{height:0px;}
.admin_head{margin-left:300px; text-align:center;}
.admin_head + div{margin-left:300px; padding: 20px; position:relative;min-height:50px;}
.admin_head + div{padding: 20px; position:relative;min-height:50px;}
table.dataTable th{text-align:left; }
@@ -27,6 +34,10 @@ table.dataTable tr.even td{background-color:rgba(126, 151, 214, 0.4); }
.deletionConfirm a {text-decoration: none;color: #36F;font-weight: bold;margin-right: 5px;padding: 5px;display: inline-block;}
.deletionConfirm a:hover{background-color: #FFABAB;}
.mediaContent{overflow:hidden;}
.mediaContent *{max-height:100%;max-width:100%;}
.mediaContent > a{height:100%; width:100%;display:inline-block;}
/*
_ _ ____
| | ___ __ _(_)_ __ | _ \ __ _ __ _ ___
@@ -92,7 +103,7 @@ div.notiziaStat >div > div {text-align:center;}
*/
.mediaElement.mainElement{background-color:yellow;}
.mediaElement{display:inline-block; padding:15px;}
.mediaElement{display:inline-block; padding:15px; max-width:160px;}
.mediaElement.selected {opacity:0.4;background-color:orange;}
/*