@@ -22,168 +22,168 @@ |
||
| 22 | 22 | class Pager |
| 23 | 23 | { |
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Total amount of entries |
|
| 27 | - * |
|
| 28 | - * @var integer |
|
| 29 | - */ |
|
| 30 | - protected $count; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * Current offset |
|
| 34 | - * |
|
| 35 | - * @var integer |
|
| 36 | - */ |
|
| 37 | - protected $offset; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Current page index |
|
| 41 | - * |
|
| 42 | - * @var integer |
|
| 43 | - */ |
|
| 44 | - protected $page; |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * Number of items per page |
|
| 48 | - * |
|
| 49 | - * @var integer |
|
| 50 | - */ |
|
| 51 | - protected $limit = 10; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Constructs a new Pager |
|
| 55 | - */ |
|
| 56 | - public function __construct() |
|
| 57 | - { |
|
| 58 | - $this->page = 1; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * Returns the total amount of entries |
|
| 63 | - * |
|
| 64 | - * @return int |
|
| 65 | - */ |
|
| 66 | - public function getCount() |
|
| 67 | - { |
|
| 68 | - return $this->count; |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - /** |
|
| 72 | - * Sets the total amount of entries |
|
| 73 | - * |
|
| 74 | - * @param int $count |
|
| 75 | - */ |
|
| 76 | - public function setCount($count) |
|
| 77 | - { |
|
| 78 | - $this->count = $count; |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * Returns the current page index |
|
| 83 | - * |
|
| 84 | - * @return int |
|
| 85 | - */ |
|
| 86 | - public function getPage() |
|
| 87 | - { |
|
| 88 | - return $this->page; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * Sets the current page index |
|
| 93 | - * |
|
| 94 | - * @param int $page |
|
| 95 | - */ |
|
| 96 | - public function setPage($page) |
|
| 97 | - { |
|
| 98 | - $this->page = $page; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * Returns the current limit index |
|
| 103 | - * |
|
| 104 | - * @return int |
|
| 105 | - */ |
|
| 106 | - public function getLimit() |
|
| 107 | - { |
|
| 108 | - return $this->limit; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Sets the current limit index |
|
| 113 | - * |
|
| 114 | - * @param int $limit |
|
| 115 | - */ |
|
| 116 | - public function setLimit($limit) |
|
| 117 | - { |
|
| 118 | - $this->limit = $limit; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * @return Array Items to display |
|
| 123 | - */ |
|
| 124 | - public function getDisplayItems() |
|
| 125 | - { |
|
| 126 | - $last = $this->getLastPage(); |
|
| 127 | - if ($last == 1) { |
|
| 128 | - return null; |
|
| 129 | - } |
|
| 130 | - $values = Array(); |
|
| 131 | - for ($i = 1; $i <= $last; $i++) { |
|
| 132 | - $values[] = Array('key' => $i, 'value' => $i); |
|
| 133 | - } |
|
| 134 | - return $values; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * @return int The last page index |
|
| 139 | - */ |
|
| 140 | - public function getLastPage() |
|
| 141 | - { |
|
| 142 | - $last = intval($this->count / $this->limit); |
|
| 143 | - if ($this->count % $this->limit > 0) { |
|
| 144 | - $last++; |
|
| 145 | - } |
|
| 146 | - return $last; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * @return int The previous page index. Minimum value is 1 |
|
| 151 | - */ |
|
| 152 | - public function getPreviousPage() |
|
| 153 | - { |
|
| 154 | - $prev = $this->page - 1; |
|
| 155 | - if ($prev < 1) { |
|
| 156 | - $prev = 1; |
|
| 157 | - } |
|
| 158 | - return $prev; |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - /** |
|
| 162 | - * @return int The next page index. Maximum valus is the last page |
|
| 163 | - */ |
|
| 164 | - public function getNextPage() |
|
| 165 | - { |
|
| 166 | - $next = $this->page + 1; |
|
| 167 | - $last = $this->getLastPage(); |
|
| 168 | - if ($next > $last) { |
|
| 169 | - $next = $last; |
|
| 170 | - } |
|
| 171 | - return $next; |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * @return int |
|
| 176 | - */ |
|
| 177 | - public function getOffset() |
|
| 178 | - { |
|
| 179 | - return $this->offset; |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * @param int $offset |
|
| 184 | - */ |
|
| 185 | - public function setOffset($offset) |
|
| 186 | - { |
|
| 187 | - $this->offset = $offset; |
|
| 188 | - } |
|
| 25 | + /** |
|
| 26 | + * Total amount of entries |
|
| 27 | + * |
|
| 28 | + * @var integer |
|
| 29 | + */ |
|
| 30 | + protected $count; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * Current offset |
|
| 34 | + * |
|
| 35 | + * @var integer |
|
| 36 | + */ |
|
| 37 | + protected $offset; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Current page index |
|
| 41 | + * |
|
| 42 | + * @var integer |
|
| 43 | + */ |
|
| 44 | + protected $page; |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * Number of items per page |
|
| 48 | + * |
|
| 49 | + * @var integer |
|
| 50 | + */ |
|
| 51 | + protected $limit = 10; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Constructs a new Pager |
|
| 55 | + */ |
|
| 56 | + public function __construct() |
|
| 57 | + { |
|
| 58 | + $this->page = 1; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * Returns the total amount of entries |
|
| 63 | + * |
|
| 64 | + * @return int |
|
| 65 | + */ |
|
| 66 | + public function getCount() |
|
| 67 | + { |
|
| 68 | + return $this->count; |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + /** |
|
| 72 | + * Sets the total amount of entries |
|
| 73 | + * |
|
| 74 | + * @param int $count |
|
| 75 | + */ |
|
| 76 | + public function setCount($count) |
|
| 77 | + { |
|
| 78 | + $this->count = $count; |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * Returns the current page index |
|
| 83 | + * |
|
| 84 | + * @return int |
|
| 85 | + */ |
|
| 86 | + public function getPage() |
|
| 87 | + { |
|
| 88 | + return $this->page; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * Sets the current page index |
|
| 93 | + * |
|
| 94 | + * @param int $page |
|
| 95 | + */ |
|
| 96 | + public function setPage($page) |
|
| 97 | + { |
|
| 98 | + $this->page = $page; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * Returns the current limit index |
|
| 103 | + * |
|
| 104 | + * @return int |
|
| 105 | + */ |
|
| 106 | + public function getLimit() |
|
| 107 | + { |
|
| 108 | + return $this->limit; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Sets the current limit index |
|
| 113 | + * |
|
| 114 | + * @param int $limit |
|
| 115 | + */ |
|
| 116 | + public function setLimit($limit) |
|
| 117 | + { |
|
| 118 | + $this->limit = $limit; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * @return Array Items to display |
|
| 123 | + */ |
|
| 124 | + public function getDisplayItems() |
|
| 125 | + { |
|
| 126 | + $last = $this->getLastPage(); |
|
| 127 | + if ($last == 1) { |
|
| 128 | + return null; |
|
| 129 | + } |
|
| 130 | + $values = Array(); |
|
| 131 | + for ($i = 1; $i <= $last; $i++) { |
|
| 132 | + $values[] = Array('key' => $i, 'value' => $i); |
|
| 133 | + } |
|
| 134 | + return $values; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @return int The last page index |
|
| 139 | + */ |
|
| 140 | + public function getLastPage() |
|
| 141 | + { |
|
| 142 | + $last = intval($this->count / $this->limit); |
|
| 143 | + if ($this->count % $this->limit > 0) { |
|
| 144 | + $last++; |
|
| 145 | + } |
|
| 146 | + return $last; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * @return int The previous page index. Minimum value is 1 |
|
| 151 | + */ |
|
| 152 | + public function getPreviousPage() |
|
| 153 | + { |
|
| 154 | + $prev = $this->page - 1; |
|
| 155 | + if ($prev < 1) { |
|
| 156 | + $prev = 1; |
|
| 157 | + } |
|
| 158 | + return $prev; |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + /** |
|
| 162 | + * @return int The next page index. Maximum valus is the last page |
|
| 163 | + */ |
|
| 164 | + public function getNextPage() |
|
| 165 | + { |
|
| 166 | + $next = $this->page + 1; |
|
| 167 | + $last = $this->getLastPage(); |
|
| 168 | + if ($next > $last) { |
|
| 169 | + $next = $last; |
|
| 170 | + } |
|
| 171 | + return $next; |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @return int |
|
| 176 | + */ |
|
| 177 | + public function getOffset() |
|
| 178 | + { |
|
| 179 | + return $this->offset; |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * @param int $offset |
|
| 184 | + */ |
|
| 185 | + public function setOffset($offset) |
|
| 186 | + { |
|
| 187 | + $this->offset = $offset; |
|
| 188 | + } |
|
| 189 | 189 | } |
@@ -22,8 +22,8 @@ |
||
| 22 | 22 | class LocalizationStatus extends Enumeration |
| 23 | 23 | { |
| 24 | 24 | |
| 25 | - const LOCALIZED = 'localized'; |
|
| 26 | - const NOT_YET_LOCALIZED = 'notYetLocalized'; |
|
| 27 | - const EMPTY_VALUE = 'emptyValue'; |
|
| 25 | + const LOCALIZED = 'localized'; |
|
| 26 | + const NOT_YET_LOCALIZED = 'notYetLocalized'; |
|
| 27 | + const EMPTY_VALUE = 'emptyValue'; |
|
| 28 | 28 | |
| 29 | 29 | } |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | class SavingBehavior extends Enumeration |
| 23 | 23 | { |
| 24 | 24 | |
| 25 | - const REMOVE = 'remove'; |
|
| 25 | + const REMOVE = 'remove'; |
|
| 26 | 26 | |
| 27 | - const APPEND = 'append'; |
|
| 27 | + const APPEND = 'append'; |
|
| 28 | 28 | |
| 29 | - const REPLACE = 'replace'; |
|
| 29 | + const REPLACE = 'replace'; |
|
| 30 | 30 | |
| 31 | 31 | } |
| 32 | 32 | \ No newline at end of file |
@@ -23,34 +23,34 @@ |
||
| 23 | 23 | class Date implements FormatterInterface, SingletonInterface |
| 24 | 24 | { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Format a date |
|
| 28 | - * |
|
| 29 | - * @param int $value |
|
| 30 | - * @return string |
|
| 31 | - * @throws \Exception |
|
| 32 | - */ |
|
| 33 | - public function format($value) |
|
| 34 | - { |
|
| 35 | - $result = ''; |
|
| 36 | - if ((int)$value > 0) { |
|
| 26 | + /** |
|
| 27 | + * Format a date |
|
| 28 | + * |
|
| 29 | + * @param int $value |
|
| 30 | + * @return string |
|
| 31 | + * @throws \Exception |
|
| 32 | + */ |
|
| 33 | + public function format($value) |
|
| 34 | + { |
|
| 35 | + $result = ''; |
|
| 36 | + if ((int)$value > 0) { |
|
| 37 | 37 | |
| 38 | - $timeStamp = '@' . $value; |
|
| 39 | - try { |
|
| 40 | - $date = new \DateTime($timeStamp); |
|
| 41 | - $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 42 | - } catch (\Exception $exception) { |
|
| 43 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 44 | - } |
|
| 38 | + $timeStamp = '@' . $value; |
|
| 39 | + try { |
|
| 40 | + $date = new \DateTime($timeStamp); |
|
| 41 | + $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 42 | + } catch (\Exception $exception) { |
|
| 43 | + throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
|
| 47 | - if (strpos($format, '%') !== false) { |
|
| 48 | - $result = strftime($format, $date->format('U')); |
|
| 49 | - } else { |
|
| 50 | - $result = $date->format($format); |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - return $result; |
|
| 54 | - } |
|
| 46 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
|
| 47 | + if (strpos($format, '%') !== false) { |
|
| 48 | + $result = strftime($format, $date->format('U')); |
|
| 49 | + } else { |
|
| 50 | + $result = $date->format($format); |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + return $result; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | 56 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | $result = ''; |
| 36 | 36 | if ((int)$value > 0) { |
| 37 | 37 | |
| 38 | - $timeStamp = '@' . $value; |
|
| 38 | + $timeStamp = '@'.$value; |
|
| 39 | 39 | try { |
| 40 | 40 | $date = new \DateTime($timeStamp); |
| 41 | 41 | $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
| 42 | 42 | } catch (\Exception $exception) { |
| 43 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 43 | + throw new \Exception('"'.$timeStamp.'" could not be parsed by \DateTime constructor: '.$exception->getMessage(), 1447153621); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] ?: 'Y-m-d'; |
@@ -23,35 +23,35 @@ |
||
| 23 | 23 | class Datetime implements FormatterInterface, SingletonInterface |
| 24 | 24 | { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Format a date |
|
| 28 | - * |
|
| 29 | - * @param int $value |
|
| 30 | - * @return string |
|
| 31 | - * @throws \Exception |
|
| 32 | - */ |
|
| 33 | - public function format($value) |
|
| 34 | - { |
|
| 35 | - $result = ''; |
|
| 36 | - if ($value > 0) { |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - $timeStamp = '@' . $value; |
|
| 40 | - try { |
|
| 41 | - $date = new \DateTime($timeStamp); |
|
| 42 | - $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 43 | - } catch (\Exception $exception) { |
|
| 44 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 48 | - if (strpos($format, '%') !== false) { |
|
| 49 | - $result = strftime($format, $date->format('U')); |
|
| 50 | - } else { |
|
| 51 | - $result = $date->format($format); |
|
| 52 | - } |
|
| 53 | - } |
|
| 54 | - return $result; |
|
| 55 | - } |
|
| 26 | + /** |
|
| 27 | + * Format a date |
|
| 28 | + * |
|
| 29 | + * @param int $value |
|
| 30 | + * @return string |
|
| 31 | + * @throws \Exception |
|
| 32 | + */ |
|
| 33 | + public function format($value) |
|
| 34 | + { |
|
| 35 | + $result = ''; |
|
| 36 | + if ($value > 0) { |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + $timeStamp = '@' . $value; |
|
| 40 | + try { |
|
| 41 | + $date = new \DateTime($timeStamp); |
|
| 42 | + $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
|
| 43 | + } catch (\Exception $exception) { |
|
| 44 | + throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 48 | + if (strpos($format, '%') !== false) { |
|
| 49 | + $result = strftime($format, $date->format('U')); |
|
| 50 | + } else { |
|
| 51 | + $result = $date->format($format); |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | + return $result; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |
@@ -36,15 +36,15 @@ |
||
| 36 | 36 | if ($value > 0) { |
| 37 | 37 | |
| 38 | 38 | |
| 39 | - $timeStamp = '@' . $value; |
|
| 39 | + $timeStamp = '@'.$value; |
|
| 40 | 40 | try { |
| 41 | 41 | $date = new \DateTime($timeStamp); |
| 42 | 42 | $date->setTimezone(new \DateTimeZone(date_default_timezone_get())); |
| 43 | 43 | } catch (\Exception $exception) { |
| 44 | - throw new \Exception('"' . $timeStamp . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1447153621); |
|
| 44 | + throw new \Exception('"'.$timeStamp.'" could not be parsed by \DateTime constructor: '.$exception->getMessage(), 1447153621); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 47 | + $format = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'].' '.$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; |
|
| 48 | 48 | if (strpos($format, '%') !== false) { |
| 49 | 49 | $result = strftime($format, $date->format('U')); |
| 50 | 50 | } else { |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | interface FormatterInterface |
| 21 | 21 | { |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Format a date |
|
| 25 | - * |
|
| 26 | - * @param string $value |
|
| 27 | - * @return string |
|
| 28 | - */ |
|
| 29 | - public function format($value); |
|
| 23 | + /** |
|
| 24 | + * Format a date |
|
| 25 | + * |
|
| 26 | + * @param string $value |
|
| 27 | + * @return string |
|
| 28 | + */ |
|
| 29 | + public function format($value); |
|
| 30 | 30 | |
| 31 | 31 | } |
@@ -23,18 +23,18 @@ |
||
| 23 | 23 | class IsLanguageApplicableViewHelper extends AbstractViewHelper |
| 24 | 24 | { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Returns whether the field in the context is localizable or not. |
|
| 28 | - * |
|
| 29 | - * @return string |
|
| 30 | - */ |
|
| 31 | - public function render() |
|
| 32 | - { |
|
| 33 | - $dataType = $this->templateVariableContainer->get('dataType'); |
|
| 34 | - $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
| 26 | + /** |
|
| 27 | + * Returns whether the field in the context is localizable or not. |
|
| 28 | + * |
|
| 29 | + * @return string |
|
| 30 | + */ |
|
| 31 | + public function render() |
|
| 32 | + { |
|
| 33 | + $dataType = $this->templateVariableContainer->get('dataType'); |
|
| 34 | + $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
| 35 | 35 | |
| 36 | - $isLanguageApplicable = Tca::table($dataType)->hasLanguageSupport() && Tca::table($dataType)->field($fieldName)->isLocalized(); |
|
| 37 | - return $isLanguageApplicable; |
|
| 38 | - } |
|
| 36 | + $isLanguageApplicable = Tca::table($dataType)->hasLanguageSupport() && Tca::table($dataType)->field($fieldName)->isLocalized(); |
|
| 37 | + return $isLanguageApplicable; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | 40 | } |
@@ -24,31 +24,31 @@ |
||
| 24 | 24 | class VisibilityOptionsViewHelper extends AbstractViewHelper |
| 25 | 25 | { |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Returns the options for the visibility field of a Selection. |
|
| 29 | - * |
|
| 30 | - * @return array |
|
| 31 | - */ |
|
| 32 | - public function render() |
|
| 33 | - { |
|
| 34 | - $options[Selection::VISIBILITY_PRIVATE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.private', 'vidi'); |
|
| 35 | - $options[Selection::VISIBILITY_EVERYONE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.everyone', 'vidi'); |
|
| 36 | - |
|
| 37 | - if ($this->getBackendUser()->isAdmin()) { |
|
| 38 | - $options[Selection::VISIBILITY_ADMIN_ONLY] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.admin_only', 'vidi'); |
|
| 39 | - } |
|
| 40 | - return $options; |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Returns an instance of the current Backend User. |
|
| 46 | - * |
|
| 47 | - * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication |
|
| 48 | - */ |
|
| 49 | - protected function getBackendUser() |
|
| 50 | - { |
|
| 51 | - return $GLOBALS['BE_USER']; |
|
| 52 | - } |
|
| 27 | + /** |
|
| 28 | + * Returns the options for the visibility field of a Selection. |
|
| 29 | + * |
|
| 30 | + * @return array |
|
| 31 | + */ |
|
| 32 | + public function render() |
|
| 33 | + { |
|
| 34 | + $options[Selection::VISIBILITY_PRIVATE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.private', 'vidi'); |
|
| 35 | + $options[Selection::VISIBILITY_EVERYONE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.everyone', 'vidi'); |
|
| 36 | + |
|
| 37 | + if ($this->getBackendUser()->isAdmin()) { |
|
| 38 | + $options[Selection::VISIBILITY_ADMIN_ONLY] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.admin_only', 'vidi'); |
|
| 39 | + } |
|
| 40 | + return $options; |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Returns an instance of the current Backend User. |
|
| 46 | + * |
|
| 47 | + * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication |
|
| 48 | + */ |
|
| 49 | + protected function getBackendUser() |
|
| 50 | + { |
|
| 51 | + return $GLOBALS['BE_USER']; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -27,28 +27,28 @@ |
||
| 27 | 27 | { |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Count a result set. |
|
| 32 | - * |
|
| 33 | - * @return int |
|
| 34 | - */ |
|
| 35 | - public function render() |
|
| 36 | - { |
|
| 37 | - if (!empty($this->arguments['dataType'])) { |
|
| 38 | - print 'Sorry to be so rude! There is something to change in the View Helper "v:find". Please replace attribute "dataType" by "type". This is a shorter syntax...'; |
|
| 39 | - exit(); |
|
| 40 | - } |
|
| 41 | - $dataType = $this->arguments['type']; |
|
| 42 | - $matches = $this->replacesAliases($this->arguments['matches']); |
|
| 43 | - $ignoreEnableFields = $this->arguments['ignoreEnableFields']; |
|
| 44 | - |
|
| 45 | - $matcher = $this->getMatcher($dataType, $matches); |
|
| 46 | - |
|
| 47 | - $contentRepository = ContentRepositoryFactory::getInstance($dataType); |
|
| 48 | - $contentRepository->setDefaultQuerySettings($this->getDefaultQuerySettings($ignoreEnableFields)); |
|
| 49 | - |
|
| 50 | - $numberOfObjects = ContentRepositoryFactory::getInstance($dataType)->countBy($matcher); |
|
| 51 | - return $numberOfObjects; |
|
| 52 | - } |
|
| 30 | + /** |
|
| 31 | + * Count a result set. |
|
| 32 | + * |
|
| 33 | + * @return int |
|
| 34 | + */ |
|
| 35 | + public function render() |
|
| 36 | + { |
|
| 37 | + if (!empty($this->arguments['dataType'])) { |
|
| 38 | + print 'Sorry to be so rude! There is something to change in the View Helper "v:find". Please replace attribute "dataType" by "type". This is a shorter syntax...'; |
|
| 39 | + exit(); |
|
| 40 | + } |
|
| 41 | + $dataType = $this->arguments['type']; |
|
| 42 | + $matches = $this->replacesAliases($this->arguments['matches']); |
|
| 43 | + $ignoreEnableFields = $this->arguments['ignoreEnableFields']; |
|
| 44 | + |
|
| 45 | + $matcher = $this->getMatcher($dataType, $matches); |
|
| 46 | + |
|
| 47 | + $contentRepository = ContentRepositoryFactory::getInstance($dataType); |
|
| 48 | + $contentRepository->setDefaultQuerySettings($this->getDefaultQuerySettings($ignoreEnableFields)); |
|
| 49 | + |
|
| 50 | + $numberOfObjects = ContentRepositoryFactory::getInstance($dataType)->countBy($matcher); |
|
| 51 | + return $numberOfObjects; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | 54 | } |