page.php 5.42 KB
Newer Older
Kgneo's avatar
Kgneo committed
1
<?php 
Kgneo's avatar
Kgneo committed
2
    
Kgneo's avatar
Kgneo committed
3
    
Kgneo's avatar
Kgneo committed
4 5
    $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
    //header + menu
Clément Damiens's avatar
 
Clément Damiens committed
6
    $onepageKey = @Yii::app()->session['paramsConfig']["onepageKey"];
7 8
    
   /* if( $this->module->id != "network" && 
Raph El's avatar
Raph El committed
9 10 11 12 13 14 15 16 17
        !empty($onepageKey) &&
        !in_array($view, $onepageKey) ){
            //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', 
                            array(  "layoutPath"=>$layoutPath , 
                                    "page" => "page",
                                    "dontShowMenu"=>true,
                                    "useFilter"=>false) ); 
18
    }*/
Raph El's avatar
Raph El committed
19

Kgneo's avatar
Kgneo committed
20 21 22
?>

<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
Kgneo's avatar
Kgneo committed
23
	<div class="" id="onepage">
Raph El's avatar
Modif  
Raph El committed
24 25
		<?php
        //var_dump($type); exit;
26 27 28 29 30 31 32 33 34
            if( !empty(Yii::app()->session['costum']) && 
                        !empty(Yii::app()->session['costum']['htmlConstruct']) && 
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']) &&
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']['url'])&&
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']['url'][$type]) ) {
                    $params = array("element"=>$element , 
                                    "id" => @$id,
                                    "type" => @$type,
                                    "page" => "page",
Clément Damiens's avatar
 
Clément Damiens committed
35
                                    "canEdit"=>$canEdit,
36 37 38 39 40 41 42 43 44
                                    "openEdition" => $openEdition,
                                    "linksBtn" => $linksBtn,
                                    "isLinked" => $isLinked,
                                    "controller" => $controller,
                                    "countStrongLinks" => $countStrongLinks,
                                    "countInvitations" => $countInvitations,
                                    "countries" => $countries );
                        echo $this->renderPartial(Yii::app()->session['costum']['htmlConstruct']['element']['url'][$type],$params);
            } else if(in_array($type,[Person::COLLECTION,Event::COLLECTION,Project::COLLECTION,Organization::COLLECTION,Place::COLLECTION])){
Raph El's avatar
Modif  
Raph El committed
45 46 47 48
        			$params = array("element"=>$element , 
                                    "id" => @$id,
                                    "type" => @$type,
        							"page" => "page",
Clément Damiens's avatar
 
Clément Damiens committed
49 50
        							"canEdit"=>@$canEdit,
        							"openEdition" => @$openEdition,
Raph El's avatar
Modif  
Raph El committed
51 52 53 54 55 56 57 58 59
        							"linksBtn" => $linksBtn,
        							"isLinked" => $isLinked,
        							"controller" => $controller,
        							"countStrongLinks" => $countStrongLinks,
        							"countInvitations" => $countInvitations,
        							"countries" => $countries );

                    if(@$members) $params["members"] = $members;
                    if(@$invitedMe) $params["invitedMe"] = $invitedMe;
Clément Damiens's avatar
 
Clément Damiens committed
60
    
61
                    if(isset($view) && !empty($view) && !empty($onepageKey) && in_array($view, $onepageKey))
Raph El's avatar
Modif  
Raph El committed
62 63 64
                        $this->renderPartial("co2.views.element.onepage", $params);
                    else 
                        $this->renderPartial('co2.views.element.profilSocial', $params ); 
65
                } else if($type == News::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
66 67 68 69 70
                    $params = array("element"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );
Raph El's avatar
Raph El committed
71

Raph El's avatar
Modif  
Raph El committed
72 73 74 75 76
                    if(@$members) $params["members"] = $members;
                    if(@$invitedMe) $params["invitedMe"] = $invitedMe;

                    $this->renderPartial('news.views.co.standalone', $params ); 
                }
77
                else if($type == Survey::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
78 79 80 81 82 83 84
                    $params = array("survey"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );

                    $this->renderPartial('co2.views.survey.entryStandalone', $params ); 
85
                } else if($type == Classified::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
86 87 88 89 90 91 92 93 94 95 96
                    $params = array("element"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );

                    if(@$members) $params["members"] = $members;
                    if(@$invitedMe) $params["invitedMe"] = $invitedMe;

                    $this->renderPartial('eco.views.co.standalone', $params ); 
                    
97
                }else if($type == Poi::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
98 99 100 101 102 103
                        $params = array("element"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );
                        $this->renderPartial('co2.views.poi.standalone', $params ); 
Raph El's avatar
Raph El committed
104
                
Raph El's avatar
Modif  
Raph El committed
105
                }
Raphael's avatar
Raphael committed
106 107
		?>
	</div>
Kgneo's avatar
Kgneo committed
108 109 110 111 112
</div>
<script type="text/javascript" >

var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
113
var view = "<?php echo @$view; ?>";
Kgneo's avatar
Kgneo committed
114 115 116
var indexStepGS = 20;


Kgneo's avatar
Kgneo committed
117
</script>