page.php 6.78 KB
Newer Older
Kgneo's avatar
Kgneo committed
1
<?php 
Kgneo's avatar
Kgneo committed
2 3 4
    
    $this->renderPartial("../news/newsAssets");

Kgneo's avatar
Kgneo committed
5
	HtmlHelper::registerCssAndScriptsFiles( array('/css/default/directory.css') , Yii::app()->theme->baseUrl. '/assets');
Kgneo's avatar
Kgneo committed
6
	//$cssAnsScriptFilesModule = array('');
Kgneo's avatar
Kgneo committed
7
	//HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
Kgneo's avatar
Kgneo committed
8
    
Kgneo's avatar
Kgneo committed
9 10
    $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
    //header + menu
Raphael's avatar
Raphael committed
11

12
    if($this->module->id != "network" && $type!=Classified::COLLECTION && ($type!=Product::COLLECTION || ($element["creator"]==Yii::app()->session["userId"] && $view != "show")))
Raphael's avatar
Raphael committed
13
        $this->renderPartial($layoutPath.'header', 
Kgneo's avatar
Kgneo committed
14
                        array(  "layoutPath"=>$layoutPath , 
Kgneo's avatar
Kgneo committed
15
                                "page" => "page") ); 
Kgneo's avatar
Kgneo committed
16 17 18 19
?>


<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
Clément Damiens's avatar
 
Clément Damiens committed
20
	<div class="padding-top-15" id="onepage">
Raphael's avatar
Raphael committed
21
		<?php 
Kgneo's avatar
Kgneo committed
22 23
        
            if($type == Person::COLLECTION  || $type == Event::COLLECTION || 
24 25
               $type == Project::COLLECTION || $type == Organization::COLLECTION || 
               $type == Place::COLLECTION){
Kgneo's avatar
Kgneo committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39
    			$params = array("element"=>$element , 
    							"page" => "page",
    							"edit"=>$edit,
    							"openEdition" => $openEdition,
    							"linksBtn" => $linksBtn,
    							"type" => $type,
    							"isLinked" => $isLinked,
    							"controller" => $controller,
    							"countStrongLinks" => $countStrongLinks,
    							"countInvitations" => $countInvitations,
    							"countries" => $countries );

                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;
40 41 42 43
                if(Yii::app()->params["CO2DomainName"] == "terla")
                    $this->renderPartial('../element/terla/index', $params );
                else
                    $this->renderPartial('../element/profilSocial', $params ); 
Kgneo's avatar
Kgneo committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
            }

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

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

                $this->renderPartial('../news/standalone', $params ); 
            }

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

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

                $this->renderPartial('../classified/standalone', $params ); 
            }
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
            if($type == Product::COLLECTION){
                $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")
                    $this->renderPartial('../element/terla/dashboard', $params );
                else
                    $this->renderPartial('../element/standalone', $params ); 
            }
            if($type == Service::COLLECTION){
                $params = array("element"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );
Kgneo's avatar
up  
Kgneo committed
91

92 93 94 95 96 97 98
                if(@$members) $params["members"] = $members;
                if(@$invitedMe) $params["invitedMe"] = $invitedMe;
                if($element["creator"]==Yii::app()->session["userId"] && $view != "show")
                    $this->renderPartial('../element/terla/dashboard', $params );
                else
                    $this->renderPartial('../element/standalone', $params ); 
            }
Kgneo's avatar
up  
Kgneo committed
99 100 101 102 103 104 105 106 107
            if($type == Survey::COLLECTION){
                $params = array("survey"=>$element , 
                                "page" => "page",
                                "type" => $type,
                                "controller" => $controller,
                                );

                $this->renderPartial('../survey/entryStandalone', $params ); 
            }
Kgneo's avatar
Kgneo committed
108 109 110 111 112 113 114 115 116 117

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

                $this->renderPartial('../poi/standalone', $params ); 
            }
Raphael's avatar
Raphael committed
118 119
		?>
	</div>
Kgneo's avatar
Kgneo committed
120 121 122 123 124 125 126
</div>


<script type="text/javascript" >

var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
127
var view = "<?php echo @$view; ?>";
Kgneo's avatar
Kgneo committed
128 129
var indexStepGS = 20;

Kgneo's avatar
Kgneo committed
130
jQuery(document).ready(function() {
131
    
Kgneo's avatar
Kgneo committed
132
	initKInterface({"affixTop":0});
Kgneo's avatar
Kgneo committed
133
	$("#mainNav").addClass("affix");
Clément Damiens's avatar
Clément Damiens committed
134
	initPageInterface();
Raphael's avatar
Raphael committed
135
    // var tpl = '<?php //echo @$_GET["tpl"] ? $_GET["tpl"] : "profilSocial"; ?>';
Kgneo's avatar
Kgneo committed
136 137 138
	// getAjax('#onepage' ,baseUrl+'/'+moduleId+"/element/detail/type/"+type+"/id/"+id+"/view/"+view+"?tpl="+tpl,function(){ 
	// 	initPageInterface();
	// },"html");
Kgneo's avatar
Kgneo committed
139 140
});

Kgneo's avatar
Kgneo committed
141 142 143 144 145 146 147 148 149

function initPageInterface(){

	$("#second-search-bar").addClass("input-global-search");

    $("#main-btn-start-search, .menu-btn-start-search").click(function(){
        startGlobalSearch(0, indexStepGS);
    });

Kgneo's avatar
up  
Kgneo committed
150
    $("#second-search-bar").keyup(function(e){ console.log("keyup #second-search-bar");
Kgneo's avatar
Kgneo committed
151 152 153 154 155 156
        $("#input-search-map").val($("#second-search-bar").val());
        if(e.keyCode == 13){
            startGlobalSearch(0, indexStepGS);
         }
    });
    
Kgneo's avatar
up  
Kgneo committed
157
    $("#input-search-map").keyup(function(e){ console.log("keyup #input-search-map");
Kgneo's avatar
Kgneo committed
158 159 160 161 162 163 164
        $("#second-search-bar").val($("#input-search-map").val());
        if(e.keyCode == 13){
            startGlobalSearch(0, indexStepGS);
         }
    });

    $("#menu-map-btn-start-search").click(function(){
Kgneo's avatar
Kgneo committed
165
        $("#second-search-bar").val($("#input-search-map").val());
Kgneo's avatar
Kgneo committed
166 167 168 169 170 171 172
        startGlobalSearch(0, indexStepGS);
    });

    $(".social-main-container").mouseenter(function(){
    	$(".dropdown-result-global-search").hide();
    });

Kgneo's avatar
up  
Kgneo committed
173 174 175 176
    $(".tooltips").tooltip();
   
    $('.sub-menu-social').affix({
      offset: {
Kgneo's avatar
Kgneo committed
177
          top: 320
Kgneo's avatar
up  
Kgneo committed
178 179
      }
    });
Kgneo's avatar
Kgneo committed
180 181 182 183 184
    //$(".dropdown-result-global-search").hide();
    

}

Kgneo's avatar
Kgneo committed
185
</script>