Commit 2adb9032 authored by Clément Damiens's avatar Clément Damiens
Browse files

first working / no double loading menu / app contr in ctk and others

parent 27bac8eb
......@@ -584,7 +584,7 @@ class CommunecterController extends Controller
"app" => array(
"welcome" => array('href' => "/ph/co2/app/welcome", "public" => true),
"view" => array('href' => "/ph/co2/app/view", "public" => true),
"home" => array('href' => "/ph/co2/app/home", "public" => true),
"home" => array('href' => "/ph/co2/app/home", "public" => true),
"index" => array('href' => "/ph/co2/app/index", "public" => true),
"web" => array('href' => "/ph/co2/app/web", "public" => true),
"websearch" => array('href' => "/ph/co2/app/websearch", "public" => true),
......
......@@ -22,6 +22,8 @@ class AppController extends CommunecterController {
'savereferencement' => 'citizenToolKit.controllers.app.SaveReferencementAction',
'mediacrawler' => 'citizenToolKit.controllers.app.MediaCrawlerAction',
'superadmin' => 'citizenToolKit.controllers.app.SuperAdminAction',
'home' => 'citizenToolKit.controllers.app.HomeAction',
'page' => 'citizenToolKit.controllers.app.PageAction',
//'sendmailformcontact' => 'citizenToolKit.controllers.app.SendMailFormContactAction',
'checkurlexists' => 'citizenToolKit.controllers.app.CheckUrlExistsAction',
);
......@@ -32,10 +34,8 @@ class AppController extends CommunecterController {
$CO2DomainName = isset( Yii::app()->params["CO2DomainName"]) ?
Yii::app()->params["CO2DomainName"] : "CO2";
//Yii::app()->theme = "CO2";
Yii::app()->session["theme"] = "CO2";
// $params = CO2::getThemeParams();
$hash = (@Yii::app()->session["userId"]) ? Yii::app()->session['paramsConfig']["pages"]["#app.index"]["redirect"]["logged"] : Yii::app()->session['paramsConfig']["pages"]["#app.index"]["redirect"]["unlogged"];
$params = array("type" => @$type );
......@@ -264,13 +264,13 @@ class AppController extends CommunecterController {
//echo "Hello there "; echo Yii::app()->createUrl("/interop/co/index"); exit;
$this->redirect( Yii::app()->createUrl("/interop") );
}
public function actionHome(){
/*public function actionHome(){
CO2Stat::incNbLoad("co2-home");
if( !@Yii::app()->session["userId"] )
$this->redirect( Yii::app()->createUrl($controller->module->id) );
echo $this->renderPartial("home", array(), true);
}
public function actionPage($type, $id, $view=null, $mode=null, $dir=null, $key=null, $folder=null){
}*/
/*public function actionPage($type, $id, $view=null, $mode=null, $dir=null, $key=null, $folder=null){
CO2Stat::incNbLoad("co2-page");
if( $type == Person::COLLECTION || $type == Event::COLLECTION ||
......@@ -356,7 +356,7 @@ class AppController extends CommunecterController {
else{
echo $this->renderPartial("page", $params, true);
}
}
}*/
public function actionInteroperability(){
CO2Stat::incNbLoad("co2-interoberability");
......
......@@ -46,11 +46,11 @@
//le param USEHEADER de params.json sert à afficher ou non le header,
//donc normalement pas besoin de faire de IF ici
$this->renderPartial($layoutPath.'header',
/* $this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => "myhome",
"dontShowMenu"=>true,
"useFilter"=>false) );
"useFilter"=>false) ); */
?>
<style type="text/css">
.social-main-container{
......
<?php
$cssAnsScriptFilesModule = array(
'/js/default/search.js',
// $cssAnsScriptFilesModule = array(
// '/js/default/search.js',
//'/js/default/live.js',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
//);
//HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
$page = "live";
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
//header + menu
$this->renderPartial($layoutPath.'header',
/* $this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"type" => @$type,
"page" => $page,
"dontShowMenu"=>true,
//"explain"=> "Live public : retrouvez tous les messages publics selon vos lieux favoris")
));
));*/
$page = "live";
//$randImg = 1;
$filliaireCategories = CO2::getContextList("filliaireCategories");
//$filliaireCategories = CO2::getContextList("filliaireCategories");
?>
......@@ -92,7 +92,7 @@ $filliaireCategories = CO2::getContextList("filliaireCategories");
searchObject.initType="news";
var titlePage = "<?php echo @Yii::app()->session['paramsConfig']["pages"]["#".$page]["subdomainName"]; ?>";
var filliaireCategories = <?php echo json_encode( $filliaireCategories ) ?>;
//var filliaireCategories = <?php ?>;
var liveParams =<?php echo json_encode(@Yii::app()->session['paramsConfig']["pages"]["#".$page]); ?>;
//var loadContent = '<?php echo @$_GET["content"]; ?>';
var appParamsKey=(location.hash.indexOf("?") >= 0) ? location.hash.split("?")[0] : location.hash;
......
<?php
//$this->renderPartial("co2.views.news.newsAssets");
HtmlHelper::registerCssAndScriptsFiles( array('/css/default/directory.css') , Yii::app()->theme->baseUrl. '/assets');
//$cssAnsScriptFilesModule = array('');
//HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
//header + menu
$onepageKey = @Yii::app()->session['paramsConfig']["onepageKey"];
//var_dump($this->module->id); exit;
//Rest::json(array("view" => $view, "onepageKey" => $onepageKey)); exit ;
if( $this->module->id != "network" &&
/*( $type!=Product::COLLECTION ||
($element["creator"]==Yii::app()->session["userId"] && $view != "show") )*/
/* if( $this->module->id != "network" &&
!empty($onepageKey) &&
!in_array($view, $onepageKey) ){
//le param USEHEADER de params.json sert à afficher ou non le header,
......@@ -24,16 +15,14 @@
"page" => "page",
"dontShowMenu"=>true,
"useFilter"=>false) );
}
}*/
?>
<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
<div class="" id="onepage">
<?php
if($type == Person::COLLECTION || $type == Event::COLLECTION ||
$type == Project::COLLECTION || $type == Organization::COLLECTION ||
$type == Place::COLLECTION){
if(in_array($type,[Person::COLLECTION,Event::COLLECTION,Project::COLLECTION,Organization::COLLECTION,Place::COLLECTION])){
$params = array("element"=>$element ,
"id" => @$id,
"type" => @$type,
......@@ -49,13 +38,8 @@
if(@$members) $params["members"] = $members;
if(@$invitedMe) $params["invitedMe"] = $invitedMe;
//Rest::json(array("view" => $view, "onepageKey" => $onepageKey)); exit ;
if(Yii::app()->params["CO2DomainName"] == "terla")
$this->renderPartial('co2.views.element.terla.index', $params );
else if(!empty($view) && !empty($onepageKey) && in_array($view, $onepageKey)) {
if(isset($view) && !empty($view) && !empty($onepageKey) && in_array($view, $onepageKey))
$this->renderPartial("co2.views.element.onepage", $params);
}
else
$this->renderPartial('co2.views.element.profilSocial', $params );
}
......@@ -73,7 +57,7 @@
$this->renderPartial('news.views.co.standalone', $params );
}
if($type == Product::COLLECTION){
/*if($type == Product::COLLECTION){
$params = array("element"=>$element ,
"page" => "page",
"type" => $type,
......@@ -100,7 +84,7 @@
$this->renderPartial('co2.views.element.terla.dashboard', $params );
else
$this->renderPartial('co2.views.element.standalone', $params );
}
}*/
if($type == Survey::COLLECTION){
$params = array("survey"=>$element ,
"page" => "page",
......@@ -125,7 +109,7 @@
}
if($type == Ressource::COLLECTION){
/*if($type == Ressource::COLLECTION){
$params = array("element"=>$element ,
"page" => "page",
"type" => $type,
......@@ -137,7 +121,7 @@
$this->renderPartial('ressources.views.co.standalone', $params );
}
}*/
if($type == Poi::COLLECTION){
$params = array("element"=>$element ,
......
......@@ -47,11 +47,11 @@
if(@Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"])
$directoryParams=Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"];
//header + menu
$this->renderPartial($layoutPath.'header',
/*$this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => $page,
"type" => @$type)
);
);*/
?>
......
......@@ -61,8 +61,8 @@
if(@Yii::app()->params["front"]) $front = Yii::app()->params["front"];
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
$me = isset(Yii::app()->session['userId']) ? Person::getById(Yii::app()->session['userId']) : null;
$this->renderPartial( $layoutPath.'modals.'.Yii::app()->params["CO2DomainName"].'.mainMenu', array("me"=>$me) );
//$me = isset(Yii::app()->session['userId']) ? Person::getById(Yii::app()->session['userId']) : null;
//$this->renderPartial( $layoutPath.'modals.'.Yii::app()->params["CO2DomainName"].'.mainMenu', array("me"=>$me) );
?>
<style>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment