public function run($type = null, $id = null) { if (!$type || !$id) { cmsCore::error404(); } switch ($type) { case 'city': $this->model->delete('geo_cities', $id); $this->cms_cache->clean('geo.cities'); break; case 'region': $this->model->filterEqual('region_id', $id); $this->model->deleteFiltered('geo_cities'); $this->model->delete('geo_regions', $id); $this->cms_cache->clean('geo.cities'); $this->cms_cache->clean('geo.regions'); break; case 'country': $this->model->filterEqual('country_id', $id); $this->model->deleteFiltered('geo_cities'); $this->model->filterEqual('country_id', $id); $this->model->deleteFiltered('geo_regions'); $this->model->delete('geo_countries', $id); $this->cms_cache->clean('geo.cities'); $this->cms_cache->clean('geo.regions'); $this->cms_cache->clean('geo.countries'); break; default: cmsCore::error404(); } cmsUser::addSessionMessage(string_lang('LANG_GEO_SUCCESS_DELETE_' . $type), 'success'); $this->redirectBack(); }
public function getControllerInfo($controller_name) { return $this->getItemByField('controllers', 'name', $controller_name, function ($item) { $item['options'] = cmsModel::yamlToArray($item['options']); $item['title'] = string_lang($item['name'] . '_CONTROLLER', $item['title']); return $item; }); }
public function run($controller_name) { if (!$controller_name) { cmsCore::error404(); } $controller_info = $this->model->getControllerInfo($controller_name); if (!$controller_info) { // если компонент имеет несколько контроллеров и один из них использует опции другого $controller_info = cmsEventsManager::hook("admin_{$controller_name}_controller_info", false); if (!$controller_info) { cmsCore::error404(); } } cmsCore::loadControllerLanguage($controller_info['name']); $controller_title = string_lang($controller_info['name'] . '_CONTROLLER', $controller_info['title']); if (!$controller_info['is_backend']) { return $this->cms_template->render('controllers_edit', array('is_backend' => false, 'ctype' => false, 'controller_name' => $controller_info['name'], 'controller_title' => $controller_title)); } // // Загружаем бакенд выбранного контроллера // $backend_context = $this->request->isAjax() ? cmsRequest::CTX_AJAX : cmsRequest::CTX_INTERNAL; $backend_request = new cmsRequest($this->request->getData(), $backend_context); $backend_controller = $this->loadControllerBackend($controller_info['name'], $backend_request); // Определяем текущий экшен бакенда $action_name = sizeof($this->params) > 1 ? $this->params[1] : 'index'; // // Удаляем из массива параметров название контроллера и экшен // if (sizeof($this->params) <= 2) { $params = array(); } else { $params = $this->params; unset($params[0]); unset($params[1]); } // Если запрос пришел по AJAX, то выполняем экшен бакенда сразу же // иначе он будет выполнен позже, в шаблоне, чтобы тулбары и pathwey бакенда // вывелись позже, чем админки if ($this->request->isAjax()) { $backend_controller->runAction($action_name, $params); $this->halt(); } // Подключаем CSS бакенда если он есть $css_file = $this->cms_template->getStylesFileName($controller_info['name'], 'backend'); if ($css_file) { $this->cms_template->addCSS($css_file); } $this->cms_template->setMenuItems('backend', $backend_controller->getBackendMenu()); return $this->cms_template->render('controllers_edit', array('is_backend' => true, 'ctype' => cmsCore::getModel('content')->getContentTypeByName($backend_controller->maintained_ctype ? $backend_controller->maintained_ctype : $controller_name), 'controller_name' => $controller_info['name'], 'controller_title' => $controller_title, 'params' => $params, 'action_name' => $action_name, 'backend_controller' => $backend_controller)); }
<?php html($photo['camera']); ?> </a> <?php } ?> <?php if ($photo['exif']) { ?> <div class="exif_info"> <?php foreach ($photo['exif'] as $name => $value) { ?> <span title="<?php echo string_lang('lang_exif_' . $name); ?> "><?php html($value); ?> </span> <?php } ?> </div> <?php } ?> </div> <?php }
echo LANG_SESS_IP; ?> </th> <th class="actions"></th> </tr> <?php if ($sessions) { ?> <?php foreach ($sessions as $session) { ?> <tr> <td> <?php echo string_lang('LANG_SESS_' . $session['access_type']['type']); ?> </td> <td> <?php echo string_date_age_max($session['date_log'], true); ?> </td> <td> <a target="_blank" href="https://apps.db.ripe.net/search/query.html?searchtext=<?php echo $session['ip']; ?> #resultsAnchor"> <?php echo $session['ip']; ?>
?> </li> <?php if (!$manifest['depends_results']['package']) { $depends_pass = false; } ?> <?php } ?> <?php if (isset($manifest['depends']['dependent_type'])) { ?> <li> <?php echo sprintf(LANG_CP_PACKAGE_DEPENDENT_TYPE, string_lang('LANG_CP_PACKAGE_DEPENDENT_' . $manifest['depends']['dependent_type']), $manifest['depends']['dependent_url'], $manifest['depends']['dependent_title']); ?> : <?php echo html_bool_span($manifest['depends_results']['dependent_type'] ? LANG_CP_INSTALLED : LANG_CP_NOT_INSTALLED, $manifest['depends_results']['dependent_type']); ?> </li> <?php if (!$manifest['depends_results']['dependent_type']) { $depends_pass = false; } ?> <?php } ?> <?php