page.php 5.06 KB
Newer Older
Kgneo's avatar
Kgneo committed
1
<?php 
Kgneo's avatar
Kgneo committed
2
	HtmlHelper::registerCssAndScriptsFiles( array('/css/default/directory.css') , Yii::app()->theme->baseUrl. '/assets');
Kgneo's avatar
Kgneo committed
3
	//$cssAnsScriptFilesModule = array('');
Kgneo's avatar
Kgneo committed
4
	//HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
Kgneo's avatar
Kgneo committed
5
    
Kgneo's avatar
Kgneo committed
6 7
    $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
    //header + menu
Raphael's avatar
Raphael committed
8 9 10

    if($this->module->id != "network")
        $this->renderPartial($layoutPath.'header', 
Kgneo's avatar
Kgneo committed
11
                        array(  "layoutPath"=>$layoutPath , 
Kgneo's avatar
Kgneo committed
12
                                "page" => "page") ); 
Kgneo's avatar
Kgneo committed
13 14 15 16
?>


<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
Kgneo's avatar
Kgneo committed
17
	<div class="padding-top-15">
Raphael's avatar
Raphael committed
18
		<?php 
Kgneo's avatar
Kgneo committed
19 20
        
            if($type == Person::COLLECTION  || $type == Event::COLLECTION || 
Kgneo's avatar
Kgneo committed
21
               $type == Project::COLLECTION || $type == Organization::COLLECTION){
Kgneo's avatar
Kgneo committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    			$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;

Kgneo's avatar
Kgneo committed
37 38
                //var_dump(@$_GET["web"]);exit;
                $page = isset($_GET["net"]) ? "onepage" : "profilSocial";
Kgneo's avatar
Kgneo committed
39 40

                $this->renderPartial('../element/'.$page, $params ); 
Kgneo's avatar
Kgneo committed
41 42 43 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
            }


            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 ); 
            }
Kgneo's avatar
up  
Kgneo committed
69 70 71 72 73 74 75 76 77 78

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

                $this->renderPartial('../survey/entryStandalone', $params ); 
            }
Kgneo's avatar
Kgneo committed
79 80 81 82 83 84 85 86 87 88

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

                $this->renderPartial('../poi/standalone', $params ); 
            }
Raphael's avatar
Raphael committed
89 90
		?>
	</div>
Kgneo's avatar
Kgneo committed
91 92 93 94 95 96 97
</div>


<script type="text/javascript" >

var type = "<?php echo $type; ?>";
var id = "<?php echo $id; ?>";
98
var view = "<?php echo @$view; ?>";
Kgneo's avatar
Kgneo committed
99 100
var indexStepGS = 20;

Kgneo's avatar
Kgneo committed
101 102
jQuery(document).ready(function() {
	
Kgneo's avatar
Kgneo committed
103 104
	initKInterface({"affixTop":0});
	$("#mainNav").addClass("affix");
Kgneo's avatar
up  
Kgneo committed
105
	initPageInterface();
Raphael's avatar
Raphael committed
106
    // var tpl = '<?php //echo @$_GET["tpl"] ? $_GET["tpl"] : "profilSocial"; ?>';
Kgneo's avatar
Kgneo committed
107 108 109
	// getAjax('#onepage' ,baseUrl+'/'+moduleId+"/element/detail/type/"+type+"/id/"+id+"/view/"+view+"?tpl="+tpl,function(){ 
	// 	initPageInterface();
	// },"html");
Kgneo's avatar
Kgneo committed
110 111
});

Kgneo's avatar
Kgneo committed
112 113 114 115 116 117 118 119 120

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
121
    $("#second-search-bar").keyup(function(e){ console.log("keyup #second-search-bar");
Kgneo's avatar
Kgneo committed
122 123 124 125 126 127
        $("#input-search-map").val($("#second-search-bar").val());
        if(e.keyCode == 13){
            startGlobalSearch(0, indexStepGS);
         }
    });
    
Kgneo's avatar
up  
Kgneo committed
128
    $("#input-search-map").keyup(function(e){ console.log("keyup #input-search-map");
Kgneo's avatar
Kgneo committed
129 130 131 132 133 134 135
        $("#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
136
        $("#second-search-bar").val($("#input-search-map").val());
Kgneo's avatar
Kgneo committed
137 138 139 140 141 142 143
        startGlobalSearch(0, indexStepGS);
    });

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

Kgneo's avatar
up  
Kgneo committed
144 145 146 147
    $(".tooltips").tooltip();
   
    $('.sub-menu-social').affix({
      offset: {
Kgneo's avatar
Kgneo committed
148
          top: 320
Kgneo's avatar
up  
Kgneo committed
149 150
      }
    });
Kgneo's avatar
Kgneo committed
151 152 153 154 155
    //$(".dropdown-result-global-search").hide();
    

}

Kgneo's avatar
Kgneo committed
156
</script>