page.php 6.76 KB
Newer Older
Kgneo's avatar
Kgneo committed
1
<?php 
Kgneo's avatar
Kgneo committed
2
    
Clément Damiens's avatar
 
Clément Damiens committed
3 4 5 6 7 8
    $cssAnsScriptFilesTheme = array(
        '/plugins/showdown/showdown.min.js',
        '/plugins/to-markdown/to-markdown.js'
    );
    HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesTheme, Yii::app()->request->baseUrl);

Kgneo's avatar
Kgneo committed
9 10
    $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
    //header + menu
Clément Damiens's avatar
 
Clément Damiens committed
11
    $onepageKey = @Yii::app()->session['paramsConfig']["onepageKey"];
12 13
    
   /* if( $this->module->id != "network" && 
Raph El's avatar
Raph El committed
14 15 16 17 18 19 20 21 22
        !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) ); 
23
    }*/
Raph El's avatar
Raph El committed
24

Kgneo's avatar
Kgneo committed
25 26 27
?>

<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
Kgneo's avatar
Kgneo committed
28
	<div class="" id="onepage">
Raph El's avatar
Modif  
Raph El committed
29
		<?php
Raph El's avatar
Modif  
Raph El committed
30
        //var_dump(Yii::app()->session['costum']['htmlConstruct']['element']); exit;
31 32 33
            if( !empty(Yii::app()->session['costum']) && 
                        !empty(Yii::app()->session['costum']['htmlConstruct']) && 
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']) &&
Raph El's avatar
Raph El committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'])&&
                        !empty(Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'][$type]) ) {


                $tpl = Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'][$type] ;
                $url = ( !empty($tpl[$element["type"]]) ? $tpl[$element["type"]] : $tpl["default"] ) ;
                $params = array("element"=>$element , 
                                "id" => @$id,
                                "type" => @$type,
                                "page" => "page",
                                "canEdit"=>$canEdit,
                                "openEdition" => $openEdition,
                                "linksBtn" => $linksBtn,
                                "isLinked" => $isLinked,
                                "controller" => $controller,
Raph El's avatar
Raph El committed
49 50 51 52 53
                                "iconColor" => @$iconColor,
                                "typeItem" => $typeItem,
                                "typeItemHead" => $typeItemHead,
                                "categoryItem" => $categoryItem,
                                "icon" => @$icon,
Raph El's avatar
Raph El committed
54 55
                                "countStrongLinks" => $countStrongLinks,
                                "countInvitations" => $countInvitations,
Raph El's avatar
Raph El committed
56 57 58 59
                                "countries" => $countries,
                                "useBorderElement" => $useBorderElement,
                                "pageConfig" => $pageConfig,
                                "addConfig" => $addConfig );
Raph El's avatar
Raph El committed
60
                echo $this->renderPartial($url,$params);
Raph El's avatar
Raph El committed
61
            } else if( in_array($type,[Person::COLLECTION,Event::COLLECTION,Project::COLLECTION,Organization::COLLECTION,Place::COLLECTION]) ){
Raph El's avatar
Modif  
Raph El committed
62 63 64 65
        			$params = array("element"=>$element , 
                                    "id" => @$id,
                                    "type" => @$type,
        							"page" => "page",
Clément Damiens's avatar
 
Clément Damiens committed
66 67
        							"canEdit"=>@$canEdit,
        							"openEdition" => @$openEdition,
Raph El's avatar
Modif  
Raph El committed
68 69 70 71 72
        							"linksBtn" => $linksBtn,
        							"isLinked" => $isLinked,
        							"controller" => $controller,
        							"countStrongLinks" => $countStrongLinks,
        							"countInvitations" => $countInvitations,
Raph El's avatar
Raph El committed
73 74 75 76 77 78 79 80 81
        							"countries" => $countries,
                                    "typeItem" => $typeItem,
                                    "typeItemHead" => $typeItemHead,
                                    "categoryItem" => $categoryItem,
                                    "icon" => $icon,
                                    "iconColor" => $iconColor,
                                    "useBorderElement" => $useBorderElement,
                                    "pageConfig" => $pageConfig,
                                    "addConfig" => $addConfig );
Raph El's avatar
Modif  
Raph El committed
82 83 84

                    if(@$members) $params["members"] = $members;
                    if(@$invitedMe) $params["invitedMe"] = $invitedMe;
Clément Damiens's avatar
 
Clément Damiens committed
85
    
86
                    if(isset($view) && !empty($view) && !empty($onepageKey) && in_array($view, $onepageKey))
Raph El's avatar
Modif  
Raph El committed
87 88 89
                        $this->renderPartial("co2.views.element.onepage", $params);
                    else 
                        $this->renderPartial('co2.views.element.profilSocial', $params ); 
90
                } else if($type == News::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
91 92 93 94 95
                    $params = array("element"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );
Raph El's avatar
Raph El committed
96

Raph El's avatar
Modif  
Raph El committed
97 98 99 100 101
                    if(@$members) $params["members"] = $members;
                    if(@$invitedMe) $params["invitedMe"] = $invitedMe;

                    $this->renderPartial('news.views.co.standalone', $params ); 
                }
102
                else if($type == Survey::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
103 104 105 106 107 108 109
                    $params = array("survey"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );

                    $this->renderPartial('co2.views.survey.entryStandalone', $params ); 
110
                } else if($type == Classified::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
111 112 113 114 115 116 117 118 119 120 121
                    $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 ); 
                    
122
                }else if($type == Poi::COLLECTION){
Raph El's avatar
Modif  
Raph El committed
123 124 125 126 127 128
                        $params = array("element"=>$element , 
                                    "page" => "page",
                                    "type" => $type,
                                    "controller" => $controller,
                                    );
                        $this->renderPartial('co2.views.poi.standalone', $params ); 
Raph El's avatar
Raph El committed
129
                
Raph El's avatar
Modif  
Raph El committed
130
                }
Raphael's avatar
Raphael committed
131 132
		?>
	</div>
Kgneo's avatar
Kgneo committed
133 134 135 136 137
</div>
<script type="text/javascript" >

var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
138
var view = "<?php echo @$view; ?>";
Kgneo's avatar
Kgneo committed
139 140 141
var indexStepGS = 20;


Kgneo's avatar
Kgneo committed
142
</script>