page.php 6.63 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">
Raphael's avatar
Raphael committed
24
		<?php 
25
            if(in_array($type,[Person::COLLECTION,Event::COLLECTION,Project::COLLECTION,Organization::COLLECTION,Place::COLLECTION])){
Kgneo's avatar
Kgneo committed
26
    			$params = array("element"=>$element , 
Tibor Katelbach's avatar
Tibor Katelbach committed
27 28
                                "id" => @$id,
                                "type" => @$type,
Kgneo's avatar
Kgneo committed
29 30 31 32 33 34 35 36 37 38 39 40
    							"page" => "page",
    							"edit"=>$edit,
    							"openEdition" => $openEdition,
    							"linksBtn" => $linksBtn,
    							"isLinked" => $isLinked,
    							"controller" => $controller,
    							"countStrongLinks" => $countStrongLinks,
    							"countInvitations" => $countInvitations,
    							"countries" => $countries );

                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;
41 42
// <<<<<<< HEAD
//                 //Rest::json(array("view" => $view, "onepageKey" => $onepageKey)); exit ;
Raph El's avatar
Raph El committed
43 44

                
45 46 47 48 49 50 51 52 53
//                 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']) ) {
//                     echo $this->renderPartial(Yii::app()->session['costum']['htmlConstruct']['element']['url'],$params);
//                 } else if(Yii::app()->params["CO2DomainName"] == "terla")
//                     $this->renderPartial('co2.views.element.terla.index', $params );
//                 else if(!empty($view) && !empty($onepageKey) && in_array($view, $onepageKey)) {
// =======
Raph El's avatar
Raph El committed
54 55 56 57 58
                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']) ) {
                    echo $this->renderPartial(Yii::app()->session['costum']['htmlConstruct']['element']['url'],$params);
59 60
                } else if(isset($view) && !empty($view) && !empty($onepageKey) && in_array($view, $onepageKey))     
// >>>>>>> master
Tibor Katelbach's avatar
Tibor Katelbach committed
61
                    $this->renderPartial("co2.views.element.onepage", $params);
Kgneo's avatar
Kgneo committed
62
                else 
Tibor Katelbach's avatar
Tibor Katelbach committed
63
                    $this->renderPartial('co2.views.element.profilSocial', $params ); 
Kgneo's avatar
Kgneo committed
64 65 66 67 68 69 70 71 72 73 74 75
            }

            if($type == News::COLLECTION){
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );

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

Clément Damiens's avatar
 
Clément Damiens committed
76
                $this->renderPartial('news.views.co.standalone', $params ); 
Kgneo's avatar
Kgneo committed
77 78
            }

79
            /*if($type == Product::COLLECTION){
80 81 82 83 84 85 86 87 88
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );

                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;
                if(($element["creator"]==Yii::app()->session["userId"] || @Yii::app()->session["superAdmin"]) && $view != "show")
Tibor Katelbach's avatar
Tibor Katelbach committed
89
                    $this->renderPartial('co2.views.element.terla.dashboard', $params );
90
                else
Tibor Katelbach's avatar
Tibor Katelbach committed
91
                    $this->renderPartial('co2.views.element.standalone', $params ); 
92 93 94 95 96 97 98
            }
            if($type == Service::COLLECTION){
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );
Kgneo's avatar
up  
Kgneo committed
99

100 101 102
                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;
                if($element["creator"]==Yii::app()->session["userId"] && $view != "show")
Tibor Katelbach's avatar
Tibor Katelbach committed
103
                    $this->renderPartial('co2.views.element.terla.dashboard', $params );
104
                else
Tibor Katelbach's avatar
Tibor Katelbach committed
105
                    $this->renderPartial('co2.views.element.standalone', $params ); 
106
            }*/
Kgneo's avatar
up  
Kgneo committed
107 108 109 110 111 112 113
            if($type == Survey::COLLECTION){
                $params = array("survey"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );

Tibor Katelbach's avatar
Tibor Katelbach committed
114
                $this->renderPartial('co2.views.survey.entryStandalone', $params ); 
Kgneo's avatar
up  
Kgneo committed
115
            }
Kgneo's avatar
Kgneo committed
116

Kgneo's avatar
Kgneo committed
117
            if($type == Classified::COLLECTION){
Kgneo's avatar
Kgneo committed
118 119 120 121 122 123
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );

Kgneo's avatar
Kgneo committed
124 125 126
                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;

Clément Damiens's avatar
 
Clément Damiens committed
127
                $this->renderPartial('eco.views.co.standalone', $params ); 
Kgneo's avatar
Kgneo committed
128 129 130 131 132 133 134 135 136
                
            }

            if($type == Poi::COLLECTION){
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );
Tibor Katelbach's avatar
Tibor Katelbach committed
137
                $this->renderPartial('co2.views.poi.standalone', $params ); 
Kgneo's avatar
Kgneo committed
138
            }
Raphael's avatar
Raphael committed
139 140
		?>
	</div>
Kgneo's avatar
Kgneo committed
141 142 143 144 145
</div>
<script type="text/javascript" >

var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
146
var view = "<?php echo @$view; ?>";
Kgneo's avatar
Kgneo committed
147 148 149
var indexStepGS = 20;


Kgneo's avatar
Kgneo committed
150
</script>