Commit 48916d26 authored by Kgneo's avatar Kgneo
Browse files

startup CO2

parent 51e9acdc
......@@ -607,6 +607,7 @@ function jsController(hash){
mylog.log("jsController",hash);
res = false;
$(".menuShortcuts").addClass("hide");
mylog.log("loadableUrls", loadableUrls);
$.each( loadableUrls, function(urlIndex,urlObj)
{
//mylog.log("replaceAndShow2",urlIndex);
......
<?php
/**
* ActionController.php
* Co2Controller.php
*
* @author: Sylvain Barbot <sylvain.barbot@gmail.com>
* Date: 7/29/15
* Time: 12:25 AM
* @author: Alpha Tango
* Date: 12/2016
*/
class Co2Controller extends CommunecterController {
......@@ -17,22 +16,136 @@ class Co2Controller extends CommunecterController {
public function actions()
{
return array(
'index' => 'citizenToolKit.controllers.co2.IndexAction',
'web' => 'citizenToolKit.controllers.co2.WebAction',
'websearch' => 'citizenToolKit.controllers.co2.WebSearchAction',
'live' => 'citizenToolKit.controllers.co2.LiveAction',
'media' => 'citizenToolKit.controllers.co2.MediaAction',
'referencement' => 'citizenToolKit.controllers.co2.ReferencementAction',
'index' => 'citizenToolKit.controllers.co2.IndexAction',
'websearch' => 'citizenToolKit.controllers.co2.WebSearchAction',
'live' => 'citizenToolKit.controllers.co2.LiveAction',
'savereferencement' => 'citizenToolKit.controllers.co2.SaveReferencementAction',
'freedom' => 'citizenToolKit.controllers.co2.FreedomAction',
'agenda' => 'citizenToolKit.controllers.co2.AgendaAction',
'mediacrawler' => 'citizenToolKit.controllers.co2.MediaCrawlerAction',
'page' => 'citizenToolKit.controllers.co2.PageAction',
'social' => 'citizenToolKit.controllers.co2.SocialAction',
'agenda' => 'citizenToolKit.controllers.co2.AgendaAction',
'power' => 'citizenToolKit.controllers.co2.PowerAction',
'superadmin' => 'citizenToolKit.controllers.co2.SuperAdminAction',
'info' => 'citizenToolKit.controllers.co2.InfoAction'
'mediacrawler' => 'citizenToolKit.controllers.co2.MediaCrawlerAction',
'superadmin' => 'citizenToolKit.controllers.co2.SuperAdminAction',
);
}
public function actionIndex(){
$CO2DomainName = isset( Yii::app()->params["CO2DomainName"]) ?
Yii::app()->params["CO2DomainName"] : "CO2";
Yii::app()->theme = "CO2";
Yii::app()->session["theme"] = "CO2";
$params = CO2::getThemeParams();
$hash = $params["pages"]["#co2.index"]["redirect"];
$params = array("type" => @$type );
if(!@$hash || @$hash=="") $hash="social";
echo $this->renderPartial($hash, $params, true);
}
public function actionWeb(){ //kgougle
CO2Stat::incNbLoad("co2-web");
//get my favorites web sites in my cookies
$cookiesFav = isset( Yii::app()->request->cookies['webFavorites'] ) && Yii::app()->request->cookies['webFavorites'] != "" ?
explode(",", Yii::app()->request->cookies['webFavorites']->value) : array();
//get information about each website
$myWebFavorites = array();
foreach ($cookiesFav as $key => $urlId) { //var_dump($web); exit;
$url = PHDB::findOne(Url::COLLECTION,array("_id"=>new MongoId($urlId)));
$myWebFavorites[] = $url;
}
$params = array("myWebFavorites"=>$myWebFavorites);
echo $this->renderPartial("web", $params, true);
}
public function actionReferencement(){ //kgougle
CO2Stat::incNbLoad("co2-referencement");
$cities = CO2::getCitiesNewCaledonia();
$params = array("subdomain" => "referencement",
"mainTitle" => "Référencer votre site Calédonien",
"placeholderMainSearch" => "",
"cities" => $cities);
echo $this->renderPartial("referencement", $params, true);
}
public function actionMedia(){ //kgougle
$indexMin = isset($_POST['indexMin']) ? $_POST['indexMin'] : 0;
$indexMax = isset($_POST['indexMax']) ? $_POST['indexMax'] : 10;
$indexStep = $indexMax - $indexMin;
$query = array('srcMedia' => array('$in' => array("NCI", "NC1", "CALEDOSPHERE", "NCTV")));
$medias = PHDB::findAndSortAndLimitAndIndex("media", $query, array("date"=>-1) , $indexStep, $indexMin);
$params = array("medias" => $medias );
CO2Stat::incNbLoad("co2-live");
if(@$_POST['renderPartial'] == true)
echo $this->renderPartial("liveStream", $params, true);
else
echo $this->renderPartial("media", $params, true);
}
public function actionSocial($type=null){
CO2Stat::incNbLoad("co2-social");
$params = array("type" => @$type );
echo $this->renderPartial("social", $params, true);
}
public function actionFreedom(){
CO2Stat::incNbLoad("co2-freedom");
$params = array("type" => @$type );
echo $this->renderPartial("freedom", $params, true);
}
public function actionAgenda(){
CO2Stat::incNbLoad("co2-agenda");
$params = array("type" => "events");
echo $this->renderPartial("social", $params, true);
}
public function actionPower(){
CO2Stat::incNbLoad("co2-power");
$params = array("type" => "vote");
echo $this->renderPartial("social", $params, true);
}
public function actionPage($type, $id){
CO2Stat::incNbLoad("co2-page");
$params = array("id" => @$id,
"type" => @$type,
"subdomain" => "page",
"mainTitle" => "Page perso",
"placeholderMainSearch" => "");
echo $this->renderPartial("page", $params, true);
}
public function actionInfo($p){
$CO2DomainName = isset(Yii::app()->params["CO2DomainName"]) ?
Yii::app()->params["CO2DomainName"] : "CO2";
$page = @$p ? $p : "apropos";
echo $this->renderPartial("info/" . $CO2DomainName . "/" . $page, array(), true);
}
}
\ No newline at end of file
{
"Technologie" :
["TV / Vidéo", "Informatique", "Tablettes", "Téléphonie", "Appareils photos", "Appareil audio"],
"Immobilier" :
["Maison", "Appartement", "Terrain", "Parking", "Bureaux"],
"Véhicules" :
[ "Voiture",
"SUV",
"4x4",
"Moto",
"Scooter",
"Bateau",
"Voiturette",
"Vélos",
"Équipement véhicule",
"Équipement 2 roues",
"Équipement bateau",
"Équipement vélo"
],
"Maison" :
[ "Electroménager",
"Mobilier",
"Équipement bébé",
"Animaux",
"Divers"
],
"Loisirs" :
[ "Sports",
"Instrument musique",
"Sonorisation",
"CD / DVD",
"Jouet",
"Jeux de société",
"Livres / BD",
"Collections",
"Bricolages",
"Jardinage",
"Art / Déco",
"Modélisme",
"Puériculture",
"Animaux",
"Divers"
],
"Mode" :
[ "Vêtements",
"Chaussures",
"Accessoires",
"Montres",
"Bijoux"
]
}
\ No newline at end of file
{
"all":
{"label":"Tout",
"key" : "all",
"icon" : "circle-o",
"section":1, "color":"default"},
"like":
{"label":"Coup de cœur",
"key" : "like",
"icon" : "heartbeat",
"section":2,
"color":"green"
},
"dislike":
{"label":"Coup de gueule",
"key" : "dislike",
"icon" : "thumbs-o-down",
"section":2,
"color":"red"
},
"lookingfor" :
{"label":"À la recherche",
"key" : "lookingfor",
"icon" : "eye",
"section":3,
"color":"yellow"
},
"job":
{"label":"Offre d'emplois",
"key" : "job",
"icon" : "briefcase",
"section":3,
"color":"yellow"
},
"forsale":
{"label":"À vendre",
"key" : "forsale",
"icon" : "money",
"section":4,
"color":"blue"
},
"location":
{"label":"À louer",
"key" : "location",
"icon" : "external-link",
"section":4,
"color":"blue"
},
"donation":
{"label":"À donner",
"key" : "donation",
"icon" : "gift",
"section":5,
"color":"blue"
},
"sharing":
{"label":"À partager",
"key" : "sharing",
"icon" : "exchange",
"section":5,
"color":"blue"
}
}
\ No newline at end of file
{
"title" : "CO2",
"pages" :
{
"#co2.index":
{"redirect":"social"},
"#co2.social":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "social",
"subdomainName" : "Recherche",
"icon" : "search",
"mainTitle" : "Moteur de recherche <span class='letter-red'>territorial</span>",
"placeholderMainSearch" : "Rechercher une page ..."
},
"#co2.freedom":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "freedom",
"subdomainName" : "annonces",
"icon" : "newspaper-o",
"mainTitle" : "Toutes vos annonces en direct",
"placeholderMainSearch" : "rechercher parmis les annonces ..."
},
"#co2.agenda":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "agenda",
"subdomainName" : "agenda",
"icon" : "calendar",
"mainTitle" : "L'agenda <span class='letter-red'>CO</span>mmun",
"placeholderMainSearch" : "rechercher un événement ..."
},
"#co2.power":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "power",
"subdomainName" : "power",
"icon" : "hand-rock-o",
"mainTitle" : "Un bien <span class='letter-red'>CO</span>mmun dédié à l'intelligence <span class='letter-red'>CO</span>llective",
"placeholderMainSearch" : "rechercher parmis les propositions ..."
},
"#co2.page.type":
{"inMenu" : false,
"useHeader" : false,
"subdomain" : "page.type",
"subdomainName" : "page",
"icon" : "",
"mainTitle" : "Le réseau social à effet de sert",
"placeholderMainSearch" : "rechercher parmis les membres du réseau ..."
},
"#co2.info":
{"inMenu" : false,
"useHeader" : false,
"subdomain" : "apropos",
"subdomainName" : "Info",
"icon" : "search",
"mainTitle" : "Le réseau social à effet de sert",
"placeholderMainSearch" : "rechercher parmis les membres du réseau ..."
}
}
}
{
"Technologie" :
["TV / Vidéo", "Informatique", "Tablettes", "Téléphonie", "Appareils photos", "Appareil audio"],
"Immobilier" :
["Maison", "Appartement", "Terrain", "Parking", "Bureaux"],
"Véhicules" :
[ "Voiture",
"SUV",
"4x4",
"Moto",
"Scooter",
"Bateau",
"Voiturette",
"Vélos",
"Équipement véhicule",
"Équipement 2 roues",
"Équipement bateau",
"Équipement vélo"
],
"Maison" :
[ "Electroménager",
"Mobilier",
"Équipement bébé",
"Animaux",
"Divers"
],
"Loisirs" :
[ "Sports",
"Instrument musique",
"Sonorisation",
"CD / DVD",
"Jouet",
"Jeux de société",
"Livres / BD",
"Collections",
"Bricolages",
"Jardinage",
"Art / Déco",
"Modélisme",
"Puériculture",
"Animaux",
"Divers"
],
"Mode" :
[ "Vêtements",
"Chaussures",
"Accessoires",
"Montres",
"Bijoux"
]
}
\ No newline at end of file
{
"all":
{"label":"Tout",
"key" : "all",
"icon" : "circle-o",
"section":1, "color":"default"},
"like":
{"label":"Coup de cœur",
"key" : "like",
"icon" : "heartbeat",
"section":2,
"color":"green"
},
"dislike":
{"label":"Coup de gueule",
"key" : "dislike",
"icon" : "thumbs-o-down",
"section":2,
"color":"red"
},
"lookingfor" :
{"label":"À la recherche",
"key" : "lookingfor",
"icon" : "eye",
"section":3,
"color":"yellow"
},
"job":
{"label":"Offre d'emplois",
"key" : "job",
"icon" : "briefcase",
"section":3,
"color":"yellow"
},
"forsale":
{"label":"À vendre",
"key" : "forsale",
"icon" : "money",
"section":4,
"color":"blue"
},
"location":
{"label":"À louer",
"key" : "location",
"icon" : "external-link",
"section":4,
"color":"blue"
},
"donation":
{"label":"À donner",
"key" : "donation",
"icon" : "gift",
"section":5,
"color":"blue"
},
"sharing":
{"label":"À partager",
"key" : "sharing",
"icon" : "exchange",
"section":5,
"color":"blue"
}
}
\ No newline at end of file
{
"title" : "kgougle",
"pages" :
{
"#co2.index":
{"redirect":"web"},
"#co2.web":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "web",
"subdomainName" : "web",
"icon" : "search",
"mainTitle" : "Le moteur de recherche des cagous",
"placeholderMainSearch" : "Que recherchez-vous ?"},
"#co2.referencement":
{"inMenu" : false,
"useHeader" : true,
"subdomain" : "referencement",
"subdomainName" : "referencement",
"icon" : "search",
"mainTitle" : "Référencer un site",
"placeholderMainSearch" : ""},
"#co2.media":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "media",
"subdomainName" : "media",
"icon" : "newspaper-o",
"mainTitle" : "Toute l'actu du pays, d'hier à aujourd'hui",
"placeholderMainSearch" : "rechercher dans l'actu ..."},
"#co2.social":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "social",
"subdomainName" : "social",
"icon" : "user-circle-o",
"mainTitle" : "Le réseau social des Nouzot",
"placeholderMainSearch" : "rechercher une page ..."},
"#co2.freedom":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "freedom",
"subdomainName" : "freedom",
"icon" : "comments",
"mainTitle" : "Toutes vos annonces en direct",
"placeholderMainSearch" : "rechercher parmis les annonces ..."},
"#co2.agenda":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "agenda",
"subdomainName" : "agenda",
"icon" : "calendar",
"mainTitle" : "L'agenda collaboratif des Calédoniens",
"placeholderMainSearch" : "rechercher un événement ..."},
"#co2.power":
{"inMenu" : true,
"useHeader" : true,
"subdomain" : "power",
"subdomainName" : "power",
"icon" : "hand-rock-o",
"mainTitle" : "L'espace collaboratif des Calédoniens.",
"placeholderMainSearch" : "rechercher parmis les propositions"},
"#co2.page.type":
{"inMenu" : false,
"useHeader" : false,
"subdomain" : "page.type",
"subdomainName" : "page",
"icon" : "",
"mainTitle" : "Le réseau social Calédonien",
"placeholderMainSearch" : "rechercher parmis les membres du réseau ..."},
"#co2.info":
{"inMenu" : false,
"useHeader" : false,
"subdomain" : "apropos",
"subdomainName" : "Info",
"icon" : "search",
"mainTitle" : "Le moteur de recherche des Cagous",