1 | <?php |
||
12 | class Application extends CompressableExternalModule |
||
|
|||
13 | { |
||
14 | const EVENT_IS_CMS = 'samsonsms.is.cms'; |
||
15 | |||
16 | /** @var string Module identifier */ |
||
17 | public $id = 'cms'; |
||
18 | |||
19 | public $baseUrl = 'cms'; |
||
20 | |||
21 | /** @var bool Flag that currently we are woring in SamsonCMS */ |
||
22 | protected $isCMS = false; |
||
23 | |||
24 | public function init(array $params = array()) |
||
55 | |||
56 | /** |
||
57 | * If module is dependent from current module through composer.json. |
||
58 | * |
||
59 | * @param $module Module for checking |
||
60 | * @return bool True if module dependent |
||
61 | */ |
||
62 | protected function isModuleDependent($module) |
||
66 | |||
67 | public function isCMS() |
||
71 | |||
72 | public function activeModuleHandler($module) |
||
85 | |||
86 | /** |
||
87 | * Callback for adding SamsonCMS related modules prefix to routes. |
||
88 | * |
||
89 | * @param $module |
||
90 | * @param $prefix |
||
91 | */ |
||
92 | public function updateCMSPrefix($module, &$prefix) |
||
98 | |||
99 | public function buildUrl(&$urlObj, &$httpHost, &$urlParams) |
||
105 | |||
106 | public function parseUrl(&$urlObj, &$urlArgs) |
||
112 | |||
113 | /** |
||
114 | * Check if passed module is related to SamsonCMS. |
||
115 | * Also method stores data to flag variable. |
||
116 | * |
||
117 | * @param $module |
||
118 | * |
||
119 | * @return bool True if module related to SamsonCMS |
||
120 | */ |
||
121 | public function ifModuleRelated($module) |
||
126 | |||
127 | public function __base() |
||
137 | |||
138 | public function oldMainRenderer(&$html) |
||
148 | |||
149 | /** |
||
150 | * @deprecated All application should draw menu block via events |
||
151 | */ |
||
152 | public function oldMenuRenderer(&$html, &$subMenu) |
||
153 | { |
||
154 | // Iterate loaded samson\cms\application |
||
155 | foreach (\samsoncms\Application::loaded() as $app) { |
||
156 | // Show only visible apps |
||
157 | if ($app->hide == false) { |
||
158 | // Render application menu item |
||
159 | $html .= m('template') |
||
160 | ->view('menu/item') |
||
161 | ->active(url()->module == $app->id() ? 'active' : '') |
||
162 | ->app($app) |
||
163 | ->icon($app->icon) |
||
164 | ->name(isset($app->name{0}) ? $app->name : '') |
||
165 | ->output(); |
||
166 | } |
||
167 | } |
||
168 | $subMenu = ''; |
||
169 | // Find current SamsonCMS application |
||
170 | if (\samsoncms\Application::find(url()->module, $app/*@var $app App*/)) { |
||
171 | // If module has sub_menu view - render it |
||
172 | if ($app->findView('sub_menu')) { |
||
173 | // Get url params |
||
174 | $url = $_SERVER['REQUEST_URI']; |
||
175 | // Explode url by symbols '/' |
||
176 | $url = explode('/', $url); |
||
177 | // If isset url with params search and param page equal 0 |
||
178 | if (isset($url[4]) && $url[3] == '0') { |
||
179 | // Default value for search field |
||
180 | $paramSearch = ''; |
||
181 | // Default value for search field |
||
182 | $paramSearch = urldecode($url[4]); |
||
183 | // Set params search |
||
184 | $app->search($paramSearch); |
||
185 | } |
||
186 | |||
187 | $subMenu .= $app->view('sub_menu')->set(t($app->name, true), 'appName')->output(); |
||
188 | } |
||
189 | } |
||
190 | } |
||
191 | |||
192 | /** |
||
193 | * @deprecated |
||
194 | * @return string Page title |
||
195 | */ |
||
196 | public function oldGetTitle() |
||
204 | } |
||
205 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.