Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
FileSystemContentSource.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  * Class for loading content from File System Content Renderer
11  *
12  * @property string $folder
13  */
15 {
16  /**
17  * @var string folder which contained File System Content Renderer content
18  */
19  public $contentFolder;
20 
21 
22  /**
23  * Return array of attributes which will be requested from API
24  *
25  * @return array array of attributes
26  */
27  public function getRequestedAttributes()
28  {
29  if ($this->usePersonalisation) {
30  return $this->personalisationFields;
31  } else {
32  return array();
33  }
34  }
35 
36  /**
37  * Component initial function
38  *
39  * @return void
40  */
41  public function init()
42  {
43 
44  }
45 
46  /**
47  * Get content absolute path.
48  *
49  * @param string $path content path
50  *
51  * @return bool|\Content|mixed local file location
52  */
53  public function getContent($path)
54  {
55  $contentFile = $this->contentFile($path);
56  if ($this->fileAccessible($contentFile, $this->contentFolder)) {
57  $content = new Content($this, $path);
58  return $content;
59  }
60 
61  return false;
62  }
63 
64  public function getStartPage($folderPath, $locale)
65  {
66  return false;
67  }
68  /**
69  * Get content file location
70  *
71  * @param string $path content path
72  *
73  * @return string
74  */
75  public function contentFile($path)
76  {
77  return $this->contentFolder . $path;
78  }
79 }