1 |
50586
|
argiro.kok
|
import {Injectable, Inject} from '@angular/core';
|
2 |
50169
|
argiro.kok
|
import {Http, Response} from '@angular/http';
|
3 |
|
|
import {Observable} from 'rxjs/Observable';
|
4 |
|
|
import 'rxjs/add/observable/of';
|
5 |
|
|
import 'rxjs/add/operator/do';
|
6 |
|
|
import 'rxjs/add/operator/share';
|
7 |
50586
|
argiro.kok
|
import{EnvProperties} from '../properties/env-properties';
|
8 |
50169
|
argiro.kok
|
|
9 |
|
|
@Injectable()
|
10 |
|
|
export class HelperService {
|
11 |
50586
|
argiro.kok
|
constructor(private http: Http) {}
|
12 |
50169
|
argiro.kok
|
|
13 |
51565
|
argiro.kok
|
getHelper (router: string, position: string, before: boolean, div: string, properties:EnvProperties,communityId:string ):any {
|
14 |
50728
|
konstantin
|
console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div);
|
15 |
|
|
|
16 |
|
|
let url = properties.adminToolsAPIURL;
|
17 |
|
|
if(div) {
|
18 |
51565
|
argiro.kok
|
url += '/divhelpcontent?active=true&community='+communityId+'&page='+router+'&div=' + div;
|
19 |
50728
|
konstantin
|
} else {
|
20 |
51565
|
argiro.kok
|
url += '/pagehelpcontent?active=true&community='+communityId+'&page='+router+'&position=' + position;
|
21 |
50728
|
konstantin
|
if(before) {
|
22 |
|
|
url += '&before='+before;
|
23 |
|
|
}
|
24 |
|
|
}
|
25 |
|
|
|
26 |
50586
|
argiro.kok
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
27 |
50169
|
argiro.kok
|
.map(res => <any> res.json());
|
28 |
|
|
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
}
|