@@ -18,24 +18,24 @@ |
||
18 | 18 | |
19 | 19 | class ConfigurationRouting implements CmsRouting |
20 | 20 | { |
21 | - /** |
|
22 | - * ConfigurationRouting constructor. |
|
23 | - * |
|
24 | - * @param Request $request |
|
25 | - * @param String $relativeCmsUri |
|
26 | - * @param CmsComponent $cmsComponent |
|
27 | - */ |
|
28 | - public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
29 | - { |
|
30 | - if ($relativeCmsUri == '/configuration') { |
|
31 | - $cmsComponent->subTemplate = 'configuration'; |
|
32 | - $cmsComponent->setParameter(CmsCOmponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
|
33 | - } |
|
21 | + /** |
|
22 | + * ConfigurationRouting constructor. |
|
23 | + * |
|
24 | + * @param Request $request |
|
25 | + * @param String $relativeCmsUri |
|
26 | + * @param CmsComponent $cmsComponent |
|
27 | + */ |
|
28 | + public function __construct($request, $relativeCmsUri, $cmsComponent) |
|
29 | + { |
|
30 | + if ($relativeCmsUri == '/configuration') { |
|
31 | + $cmsComponent->subTemplate = 'configuration'; |
|
32 | + $cmsComponent->setParameter(CmsCOmponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
|
33 | + } |
|
34 | 34 | |
35 | - new UsersRouting($request, $relativeCmsUri, $cmsComponent); |
|
36 | - new DocumentTypeRouting($request, $relativeCmsUri, $cmsComponent); |
|
37 | - new BricksRouting($request, $relativeCmsUri, $cmsComponent); |
|
38 | - new ImageSetRouting($request, $relativeCmsUri, $cmsComponent); |
|
39 | - new ApplicationComponentRouting($request, $relativeCmsUri, $cmsComponent); |
|
40 | - } |
|
35 | + new UsersRouting($request, $relativeCmsUri, $cmsComponent); |
|
36 | + new DocumentTypeRouting($request, $relativeCmsUri, $cmsComponent); |
|
37 | + new BricksRouting($request, $relativeCmsUri, $cmsComponent); |
|
38 | + new ImageSetRouting($request, $relativeCmsUri, $cmsComponent); |
|
39 | + new ApplicationComponentRouting($request, $relativeCmsUri, $cmsComponent); |
|
40 | + } |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -6,39 +6,39 @@ |
||
6 | 6 | use CloudControl\Cms\storage\Storage; |
7 | 7 | |
8 | 8 | /** |
9 | - * Interface Component |
|
10 | - * @package CloudControl\Cms\components |
|
11 | - */ |
|
12 | - interface Component |
|
13 | - { |
|
14 | - /** |
|
15 | - * Component constructor. |
|
16 | - * |
|
17 | - * @param $template |
|
18 | - * @param Request $request |
|
19 | - * @param $parameters |
|
20 | - * @param $matchedSitemapItem |
|
21 | - */ |
|
22 | - function __construct($template, Request $request, $parameters, $matchedSitemapItem); |
|
9 | + * Interface Component |
|
10 | + * @package CloudControl\Cms\components |
|
11 | + */ |
|
12 | + interface Component |
|
13 | + { |
|
14 | + /** |
|
15 | + * Component constructor. |
|
16 | + * |
|
17 | + * @param $template |
|
18 | + * @param Request $request |
|
19 | + * @param $parameters |
|
20 | + * @param $matchedSitemapItem |
|
21 | + */ |
|
22 | + function __construct($template, Request $request, $parameters, $matchedSitemapItem); |
|
23 | 23 | |
24 | - /** |
|
25 | - * @param Storage $storage |
|
26 | - */ |
|
27 | - function run(Storage $storage); |
|
24 | + /** |
|
25 | + * @param Storage $storage |
|
26 | + */ |
|
27 | + function run(Storage $storage); |
|
28 | 28 | |
29 | - /** |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - function render(); |
|
29 | + /** |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + function render(); |
|
33 | 33 | |
34 | - /** |
|
35 | - * @return mixed |
|
36 | - */ |
|
37 | - function get(); |
|
34 | + /** |
|
35 | + * @return mixed |
|
36 | + */ |
|
37 | + function get(); |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return \stdClass |
|
41 | - */ |
|
42 | - function getParameters(); |
|
43 | - } |
|
39 | + /** |
|
40 | + * @return \stdClass |
|
41 | + */ |
|
42 | + function getParameters(); |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -13,47 +13,47 @@ |
||
13 | 13 | */ |
14 | 14 | class Tokenizer |
15 | 15 | { |
16 | - protected $inputString; |
|
17 | - protected $tokenVector = array(); |
|
18 | - |
|
19 | - /** |
|
20 | - * Tokenizer constructor. |
|
21 | - * |
|
22 | - * @param string $string Should preferably be parsed wit \CloudControl\Cms\search\CharacterFilter |
|
23 | - * @see \CloudControl\Cms\search\CharacterFilter |
|
24 | - */ |
|
25 | - public function __construct($string) |
|
26 | - { |
|
27 | - $this->inputString = $string; |
|
28 | - $this->tokenize(); |
|
29 | - } |
|
30 | - |
|
31 | - protected function tokenize() |
|
32 | - { |
|
33 | - $tokens = explode(' ', $this->inputString); |
|
34 | - foreach ($tokens as $token) { |
|
35 | - $this->addTokenToVector($token); |
|
36 | - } |
|
37 | - } |
|
38 | - |
|
39 | - protected function addTokenToVector($token) |
|
40 | - { |
|
41 | - if (!empty($token)) { |
|
42 | - if (isset($this->tokenVector[$token])) { |
|
43 | - $this->tokenVector[$token] += 1; |
|
44 | - } else { |
|
45 | - $this->tokenVector[$token] = 1; |
|
46 | - } |
|
47 | - } |
|
48 | - } |
|
49 | - |
|
50 | - /** |
|
51 | - * @return array |
|
52 | - */ |
|
53 | - public function getTokenVector() |
|
54 | - { |
|
55 | - return $this->tokenVector; |
|
56 | - } |
|
16 | + protected $inputString; |
|
17 | + protected $tokenVector = array(); |
|
18 | + |
|
19 | + /** |
|
20 | + * Tokenizer constructor. |
|
21 | + * |
|
22 | + * @param string $string Should preferably be parsed wit \CloudControl\Cms\search\CharacterFilter |
|
23 | + * @see \CloudControl\Cms\search\CharacterFilter |
|
24 | + */ |
|
25 | + public function __construct($string) |
|
26 | + { |
|
27 | + $this->inputString = $string; |
|
28 | + $this->tokenize(); |
|
29 | + } |
|
30 | + |
|
31 | + protected function tokenize() |
|
32 | + { |
|
33 | + $tokens = explode(' ', $this->inputString); |
|
34 | + foreach ($tokens as $token) { |
|
35 | + $this->addTokenToVector($token); |
|
36 | + } |
|
37 | + } |
|
38 | + |
|
39 | + protected function addTokenToVector($token) |
|
40 | + { |
|
41 | + if (!empty($token)) { |
|
42 | + if (isset($this->tokenVector[$token])) { |
|
43 | + $this->tokenVector[$token] += 1; |
|
44 | + } else { |
|
45 | + $this->tokenVector[$token] = 1; |
|
46 | + } |
|
47 | + } |
|
48 | + } |
|
49 | + |
|
50 | + /** |
|
51 | + * @return array |
|
52 | + */ |
|
53 | + public function getTokenVector() |
|
54 | + { |
|
55 | + return $this->tokenVector; |
|
56 | + } |
|
57 | 57 | |
58 | 58 | |
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -11,15 +11,15 @@ |
||
11 | 11 | |
12 | 12 | interface Filter |
13 | 13 | { |
14 | - /** |
|
15 | - * Filter constructor. |
|
16 | - * |
|
17 | - * @param array $tokens |
|
18 | - */ |
|
19 | - public function __construct($tokens); |
|
14 | + /** |
|
15 | + * Filter constructor. |
|
16 | + * |
|
17 | + * @param array $tokens |
|
18 | + */ |
|
19 | + public function __construct($tokens); |
|
20 | 20 | |
21 | - /** |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function getFilterResults(); |
|
21 | + /** |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function getFilterResults(); |
|
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -10,5 +10,5 @@ |
||
10 | 10 | |
11 | 11 | class EnglishStopWords extends StopWordsFilter |
12 | 12 | { |
13 | - protected $stopWords = array('a', 'about', 'above', 'after', 'again', 'against', 'all', 'am', 'an', 'and', 'any', 'are', 'arent', 'as', 'at', 'be', 'because', 'been', 'before', 'being', 'below', 'between', 'both', 'but', 'by', 'cant', 'cannot', 'could', 'couldnt', 'did', 'didnt', 'do', 'does', 'doesnt', 'doing', 'dont', 'down', 'during', 'each', 'few', 'for', 'from', 'further', 'had', 'hadnt', 'has', 'hasnt', 'have', 'havent', 'having', 'he', 'hed', 'hell', 'hes', 'her', 'here', 'heres', 'hers', 'herself', 'him', 'himself', 'his', 'how', 'hows', 'i', 'id', 'ill', 'im', 'ive', 'if', 'in', 'into', 'is', 'isnt', 'it', 'its', 'its', 'itself', 'lets', 'me', 'more', 'most', 'mustnt', 'my', 'myself', 'no', 'nor', 'not', 'of', 'off', 'on', 'once', 'only', 'or', 'other', 'ought', 'our', 'ours ourselves', 'out', 'over', 'own', 'same', 'shant', 'she', 'shed', 'shell', 'shes', 'should', 'shouldnt', 'so', 'some', 'such', 'than', 'that', 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'there', 'theres', 'these', 'they', 'theyd', 'theyll', 'theyre', 'theyve', 'this', 'those', 'through', 'to', 'too', 'under', 'until', 'up', 'very', 'was', 'wasnt', 'we', 'wed', 'well', 'were', 'weve', 'were', 'werent', 'what', 'whats', 'when', 'whens', 'where', 'wheres', 'which', 'while', 'who', 'whos', 'whom', 'why', 'whys', 'with', 'wont', 'would', 'wouldnt', 'you', 'youd', 'youll', 'youre', 'youve', 'your', 'yours', 'yourself', 'yourselves'); |
|
13 | + protected $stopWords = array('a', 'about', 'above', 'after', 'again', 'against', 'all', 'am', 'an', 'and', 'any', 'are', 'arent', 'as', 'at', 'be', 'because', 'been', 'before', 'being', 'below', 'between', 'both', 'but', 'by', 'cant', 'cannot', 'could', 'couldnt', 'did', 'didnt', 'do', 'does', 'doesnt', 'doing', 'dont', 'down', 'during', 'each', 'few', 'for', 'from', 'further', 'had', 'hadnt', 'has', 'hasnt', 'have', 'havent', 'having', 'he', 'hed', 'hell', 'hes', 'her', 'here', 'heres', 'hers', 'herself', 'him', 'himself', 'his', 'how', 'hows', 'i', 'id', 'ill', 'im', 'ive', 'if', 'in', 'into', 'is', 'isnt', 'it', 'its', 'its', 'itself', 'lets', 'me', 'more', 'most', 'mustnt', 'my', 'myself', 'no', 'nor', 'not', 'of', 'off', 'on', 'once', 'only', 'or', 'other', 'ought', 'our', 'ours ourselves', 'out', 'over', 'own', 'same', 'shant', 'she', 'shed', 'shell', 'shes', 'should', 'shouldnt', 'so', 'some', 'such', 'than', 'that', 'thats', 'the', 'their', 'theirs', 'them', 'themselves', 'then', 'there', 'theres', 'these', 'they', 'theyd', 'theyll', 'theyre', 'theyve', 'this', 'those', 'through', 'to', 'too', 'under', 'until', 'up', 'very', 'was', 'wasnt', 'we', 'wed', 'well', 'were', 'weve', 'were', 'werent', 'what', 'whats', 'when', 'whens', 'where', 'wheres', 'which', 'while', 'who', 'whos', 'whom', 'why', 'whys', 'with', 'wont', 'would', 'wouldnt', 'you', 'youd', 'youll', 'youre', 'youve', 'your', 'yours', 'yourself', 'yourselves'); |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -13,43 +13,43 @@ |
||
13 | 13 | |
14 | 14 | class SearchResult |
15 | 15 | { |
16 | - /** |
|
17 | - * @var string |
|
18 | - */ |
|
19 | - public $documentPath; |
|
20 | - /** |
|
21 | - * @var array |
|
22 | - */ |
|
23 | - public $matchingTokens; |
|
24 | - /** |
|
25 | - * @var float |
|
26 | - */ |
|
27 | - public $score; |
|
28 | - |
|
29 | - protected $document; |
|
30 | - /** |
|
31 | - * @var Storage |
|
32 | - */ |
|
33 | - protected $storage; |
|
34 | - |
|
35 | - /** |
|
36 | - * @return Document |
|
37 | - */ |
|
38 | - public function getDocument() |
|
39 | - { |
|
40 | - if ($this->document instanceof Document) { |
|
41 | - return $this->document; |
|
42 | - } else { |
|
43 | - $this->document = $this->storage->getDocuments()->getDocumentBySlug(substr($this->documentPath, 1)); |
|
44 | - $this->document->dbHandle = $this->storage->getContentDbHandle(); |
|
45 | - $this->document->documentStorage = $this->storage->getRepository(); |
|
46 | - |
|
47 | - return $this->document; |
|
48 | - } |
|
49 | - } |
|
50 | - |
|
51 | - public function setStorage($storage) |
|
52 | - { |
|
53 | - $this->storage = $storage; |
|
54 | - } |
|
16 | + /** |
|
17 | + * @var string |
|
18 | + */ |
|
19 | + public $documentPath; |
|
20 | + /** |
|
21 | + * @var array |
|
22 | + */ |
|
23 | + public $matchingTokens; |
|
24 | + /** |
|
25 | + * @var float |
|
26 | + */ |
|
27 | + public $score; |
|
28 | + |
|
29 | + protected $document; |
|
30 | + /** |
|
31 | + * @var Storage |
|
32 | + */ |
|
33 | + protected $storage; |
|
34 | + |
|
35 | + /** |
|
36 | + * @return Document |
|
37 | + */ |
|
38 | + public function getDocument() |
|
39 | + { |
|
40 | + if ($this->document instanceof Document) { |
|
41 | + return $this->document; |
|
42 | + } else { |
|
43 | + $this->document = $this->storage->getDocuments()->getDocumentBySlug(substr($this->documentPath, 1)); |
|
44 | + $this->document->dbHandle = $this->storage->getContentDbHandle(); |
|
45 | + $this->document->documentStorage = $this->storage->getRepository(); |
|
46 | + |
|
47 | + return $this->document; |
|
48 | + } |
|
49 | + } |
|
50 | + |
|
51 | + public function setStorage($storage) |
|
52 | + { |
|
53 | + $this->storage = $storage; |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | class SearchSuggestion |
12 | 12 | { |
13 | - public $original; |
|
14 | - public $term; |
|
15 | - public $editDistance; |
|
13 | + public $original; |
|
14 | + public $term; |
|
15 | + public $editDistance; |
|
16 | 16 | } |
17 | 17 | \ No newline at end of file |
@@ -13,37 +13,37 @@ |
||
13 | 13 | |
14 | 14 | class UserFactory |
15 | 15 | { |
16 | - /** |
|
17 | - * Create user from POST values |
|
18 | - * |
|
19 | - * @param $postValues |
|
20 | - * |
|
21 | - * @return \stdClass |
|
22 | - * @throws \Exception |
|
23 | - */ |
|
24 | - public static function createUserFromPostValues($postValues) |
|
25 | - { |
|
26 | - if (isset($postValues['username'])) { |
|
27 | - $user = new \stdClass(); |
|
28 | - $user->username = $postValues['username']; |
|
29 | - $user->slug = StringUtil::slugify($postValues['username']); |
|
30 | - $user->rights = array(); |
|
31 | - if (isset($postValues['rights'])) { |
|
32 | - $user->rights = $postValues['rights']; |
|
33 | - } |
|
16 | + /** |
|
17 | + * Create user from POST values |
|
18 | + * |
|
19 | + * @param $postValues |
|
20 | + * |
|
21 | + * @return \stdClass |
|
22 | + * @throws \Exception |
|
23 | + */ |
|
24 | + public static function createUserFromPostValues($postValues) |
|
25 | + { |
|
26 | + if (isset($postValues['username'])) { |
|
27 | + $user = new \stdClass(); |
|
28 | + $user->username = $postValues['username']; |
|
29 | + $user->slug = StringUtil::slugify($postValues['username']); |
|
30 | + $user->rights = array(); |
|
31 | + if (isset($postValues['rights'])) { |
|
32 | + $user->rights = $postValues['rights']; |
|
33 | + } |
|
34 | 34 | |
35 | - if (isset($postValues['password']) && empty($postValues['password']) === false) { |
|
36 | - $crypt = new Crypt(); |
|
37 | - $user->password = $crypt->encrypt($postValues['password'], 16); |
|
38 | - $user->salt = $crypt->getLastSalt(); |
|
39 | - } else { |
|
40 | - $user->password = $postValues['passHash']; |
|
41 | - $user->salt = $postValues['salt']; |
|
42 | - } |
|
35 | + if (isset($postValues['password']) && empty($postValues['password']) === false) { |
|
36 | + $crypt = new Crypt(); |
|
37 | + $user->password = $crypt->encrypt($postValues['password'], 16); |
|
38 | + $user->salt = $crypt->getLastSalt(); |
|
39 | + } else { |
|
40 | + $user->password = $postValues['passHash']; |
|
41 | + $user->salt = $postValues['salt']; |
|
42 | + } |
|
43 | 43 | |
44 | - return $user; |
|
45 | - } else { |
|
46 | - throw new \Exception('Trying to create user with invalid data.'); |
|
47 | - } |
|
48 | - } |
|
44 | + return $user; |
|
45 | + } else { |
|
46 | + throw new \Exception('Trying to create user with invalid data.'); |
|
47 | + } |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -8,21 +8,21 @@ |
||
8 | 8 | |
9 | 9 | class ImageFactory |
10 | 10 | { |
11 | - /** |
|
12 | - * @param $postValues |
|
13 | - * @param $filename |
|
14 | - * @param $fileNames |
|
15 | - * |
|
16 | - * @return \stdClass |
|
17 | - */ |
|
18 | - public static function createImageFromPostValues($postValues, $filename, $fileNames) |
|
19 | - { |
|
20 | - $imageObject = new \stdClass(); |
|
21 | - $imageObject->file = $filename; |
|
22 | - $imageObject->type = $postValues['type']; |
|
23 | - $imageObject->size = $postValues['size']; |
|
24 | - $imageObject->set = $fileNames; |
|
11 | + /** |
|
12 | + * @param $postValues |
|
13 | + * @param $filename |
|
14 | + * @param $fileNames |
|
15 | + * |
|
16 | + * @return \stdClass |
|
17 | + */ |
|
18 | + public static function createImageFromPostValues($postValues, $filename, $fileNames) |
|
19 | + { |
|
20 | + $imageObject = new \stdClass(); |
|
21 | + $imageObject->file = $filename; |
|
22 | + $imageObject->type = $postValues['type']; |
|
23 | + $imageObject->size = $postValues['size']; |
|
24 | + $imageObject->set = $fileNames; |
|
25 | 25 | |
26 | - return $imageObject; |
|
27 | - } |
|
26 | + return $imageObject; |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | \ No newline at end of file |