Ejemplo n.º 1
0
 /**
  * Получение записи по псевдониму
  * @param $alias
  */
 private function showItemByAlias($alias)
 {
     // Получение номера страницы
     $page_num = $this->getPageNum();
     if ((int) Text::get_get('ajaxAutoload') == 1) {
         $page_num = (int) Text::get_get('page');
     }
     $album = $this->object->getRowByField('gallery', 'alias', $alias);
     $page_title = $album['head_title'] != '' ? $album['head_title'] : $album['name'];
     $this->setPageTitle($page_title);
     $this->setH1($album['name']);
     $this->setMetaDescription($album['meta_description']);
     $this->setMetaKeywords($album['meta_keywords']);
     $images = $this->object->getRows('gallery_photos', 'group_id', $album['id'], '', '', $page_num);
     $this->page_info['link'] = str_replace('.html', '/', $this->getUrl()) . $album['alias'] . '.html';
     $this->smarty->assign('page', $this->page_info);
     $this->smarty->assign('album', $album);
     $this->smarty->assign('images', $images);
     $this->smarty->assign('pagination', $this->object->getPagination($page_num));
     $this->smarty->assign('current_link', $this->getUrl());
     if ((int) Text::get_get('ajaxAutoload') == 1) {
         $result = $this->smarty->fetch(DOC . 'templates/site/matches/images_list.tpl');
         echo $result;
         exit;
     }
 }
Ejemplo n.º 2
0
        exit;
    }
} else {
    //  проверяем содержит ли страница компонент
    $component = components($page['text'], $page, $page['link'], $page_num);
    $page['text'] = $component['content'];
}
//	Получение информации о странице.
if (!is_array($page) or empty($page)) {
    //	Страница не найдена. Попытка ввода url вручную или поломались ключи у дерева (врятли).
    require_once DOC . 'error404.php';
    exit;
}
// получение родительской страницы
$parents = $pages->enumPath('pages', $page['id']);
$parent = $page;
for ($i = 0; $i < count($parents); $i++) {
    if ($parents[$i]['tree_level'] == 1) {
        $parent = $parents[$i];
    }
}
/*		Шаблон страницы.	*/
$tpl = !isset($page['template']) || empty($page['template']) ? 'index' : is_file(System_Settings::getSmarty_template() . $page['template'] . '.tpl') ? $page['template'] : 'index2';
// Выгрузка в AJAX JSON
if ((int) Text::get_get('AjaxShowPage') == 1) {
    $pages->getJsonWrap($page);
}
// Выгрузка переменных в шаблон
$smarty->assign(array('page' => $page, 'parent' => $parent, 'breadcrumbs' => $bread_crumbs, 'page_title' => $pages->getPageTitle($page['head_title'])));
// Шаблон для вывода статических страниц
self::setTpl($tpl);
Ejemplo n.º 3
0
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
if (Text::get_get('do') == 'ajaxUploadFile') {
    $file = Files::loadFiles();
    echo $file['name'];
    exit;
}
if (Text::get_get('do') == 'ajaxDeleteFile') {
    $file = Text::get_get('file');
    if (file_exists(DOC . 'userfiles/' . $file)) {
        unlink(DOC . 'userfiles/' . $file);
    }
    exit;
}
$e = array('all' => false);
if (Text::get_post('do') == 'send_order') {
    $id = (int) Text::get_post('id');
    // Получение иформации формы
    $form = $object->getFormInfo($id);
    // Получение полей формы
    $form_rows = $object->getFormFields($id);
    $ext = array('do', 'send', 'id', 'ajax');
    $values = array();
    foreach ($_POST as $key => $value) {
        if (!in_array($key, $ext)) {
            if (!is_array($value)) {
Ejemplo n.º 4
0
Archivo: index.php Proyecto: klimjr/cms
     echo json_encode($data);
     exit;
 }
 // Получение данных о пользователе
 $rights = array();
 // Настройки сайта, передаваемые в модули
 $conf = array('langs' => $_langs, 'deflang' => $default_lang, 'curlang' => $current_lang, 'tpl' => $__template, 'aStrings' => $aStrings, 'final_path' => $final_path, 'limit' => $options['table_limit']);
 $router = new System_Router($smarty, array(), $conf, $rights, $__lang);
 if ((int) Text::get_get('localization') == 1) {
     echo json_encode($router::getLocalize());
     exit;
 }
 // Получение шаблона с формой
 if (Text::get_get('do') == 'get_form') {
     $form = Text::get_get('form');
     $user_id = (int) Text::get_get('user_id');
     $user_id = $user_id > 0 ? $user_id : isset($_SESSION['siteuser']['id']) ? $_SESSION['siteuser']['id'] : 0;
     $tpl = $oSettings::getSmarty_template() . 'forms/' . $form . '_form.tpl';
     $data = '';
     if (file_exists($tpl)) {
         $__lang = $router::getLocalize();
         $smarty->assign('__lang', $__lang);
         $smarty->assign('user_id', $user_id);
         $content = $smarty->fetch($tpl);
         $data = array('head' => isset($__lang['add_' . $form]) ? $__lang['add_' . $form] : '', 'content' => $content, 'success' => isset($__lang['add_' . $form . '_success']) ? $__lang['add_' . $form . '_success'] : '', 'error' => isset($__lang['add_' . $form . '_error']) ? $__lang['add_' . $form . '_error'] : '');
         echo json_encode($data);
     }
     exit;
 }
 // Определение мобильного устройства
 require_once DOC . 'system/php-to-detect-mobile-phones.php';
Ejemplo n.º 5
0
Archivo: login.php Proyecto: klimjr/cms
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
if (isset($_SESSION['user'])) {
    header('Location: /admin/');
    exit;
}
$auth_loginname_str = Text::get_post('auth_loginname_str');
$auth_password_str = md5(Text::get_post('auth_password_str'));
$msg = '';
if (!empty($auth_loginname_str)) {
    $query = 'CALL `get_user_info`(:user_login, :user_pass)';
    $params = array(':user_login' => $auth_loginname_str, ':user_pass' => $auth_password_str);
    $result = PdoWrap::selectRow($query, $params);
    if (!empty($result)) {
        $return = '/admin/';
        if (Text::get_get('return') != '') {
            $return = urldecode(Text::get_get('return'));
        }
        $_SESSION['user'] = $result;
        location($return);
    } else {
        $msg = 'В доступе отказано';
    }
}
$smarty->assign('msg', $msg);
Ejemplo n.º 6
0
<?php

/**
 * Изменение активности модуля.
 * @author Alexey O Klimov (izra.ru)
 * @update 12.01.2011
 */
//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
/**
 * Проверка прав доступа на просмотр для текущего действия.
 */
if (!isset($rights[$action]['delete']) || (int) $rights[$action]['delete'] == 0) {
    $access_denied = true;
} else {
    //	Идентификатор записи.
    $id = (int) Text::get_get('id');
    //	Тип активности (активно/неактивно).
    $active = (int) Text::get_get('active');
    $query = 'CALL modules_change_active(:active, :table_id)';
    $params = array(':active' => $active, ':table_id' => $id);
    PdoWrap::execute($query, $params);
    // Переадресация.
    location($__return);
}
Ejemplo n.º 7
0
Archivo: list.php Proyecto: klimjr/cms
// Поле для сортировки
$sort = Text::get_get('s');
// Тип сортировки
$sort_type = Text::get_get('st');
if ($sort_type == '') {
    $sort_type = 'ASC';
}
// Установка группововй таблицы
if (isset($group_table) && $group_table != '' && ($object_list->getBase() instanceof TreeTableGroup || $object_list->getBase() instanceof SimpleTableGroup)) {
    $base->setTableGroupName($group_table);
    $group_data = $object_list->getRow($group_table, $group_id);
    $bread_crumbs[] = array('link' => '/admin/?lang=' . $current_lang . '&action=' . $action . '&do=' . $table . '_list&group_id=' . $group_id, 'name' => $group_data['name']);
    $object_list->setBreadCrumbs($bread_crumbs);
}
if (isset($_GET['search'])) {
    $data = $object_list->searchAllTables($table, Text::get_get('search'), $parent, $page_num, $sort, $sort_type);
} else {
    $data = $object_list->getAdminList($table, $parent, $page_num, $sort, $sort_type);
}
$smarty->assign('count_rows', $object_list->getCount());
// определение постраничной навигации
$pagination = $object_list->getPagination($page_num);
// Обработка данных
$data = $object_list->getAdminListData($table, $data);
// Получение заголовков таблицы
$table_head = $object_list->getTableColumns($table);
//  Получение информации о родителях для хлебных крошек
$breadcrumbs = $object_list->getAdminBreadCrumbs($table, $parent, $action);
//	Массив детей
if ($sort != '') {
    $sort_type = $sort_type == 'ASC' ? 'DESC' : 'ASC';
Ejemplo n.º 8
0
<?php

/**
 * Изменение позиции для раздела.
 * @author Alexey O Klimov
 * @update 25.08.2010
 */
//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
if (!isset($rights[$action]['delete']) || (int) $rights[$action]['delete'] == 0) {
    $access_denied = true;
} else {
    /**
     * Удаление.
     */
    //	Идентификатор раздела.
    $id = (int) Text::get_get('id');
    // Удаление страницы
    $pages->deleteRow($action, $id);
    clearCacheFiles($smarty, 0, 'pages', $id);
    //	Переадресация.
    location($__return);
}
Ejemplo n.º 9
0
 /**
  *	Обязательная функция для компонента.
  *
  */
 public function start()
 {
     $this->setObject();
     // Определение полей формы
     $this->form = isset($this->params['form']) && (int) $this->params['form'] > 0 ? $this->params['form'] : "";
     $success = (int) Text::get_get('success');
     // Получение иформации формы
     $form = $this->__getFormInfo($this->form);
     // Получение полей формы
     $form_rows = $this->__getFormFields($this->form);
     if (Text::get_get('do') == 'ajaxUploadFile') {
         $file = load_file('Filedata', 'userfiles/', 1);
         echo $file['name'];
         exit;
     }
     if (Text::get_get('do') == 'ajaxDeleteFile') {
         $file = Text::get_get('file');
         if (file_exists(DOC . 'userfiles/' . $file)) {
             unlink(DOC . 'userfiles/' . $file);
         }
         exit;
     }
     $e = array('all' => false);
     if (Text::get_post('do') == 'send_order') {
         $ext = array('do', 'send');
         $values = array();
         foreach ($_POST as $key => $value) {
             if (!in_array($key, $ext)) {
                 if (!is_array($value)) {
                     $values[$key] = htmlspecialchars(stripcslashes(Text::get_post($key)));
                 } else {
                     $values[$key] = Text::get_post($key);
                 }
             }
         }
         foreach ($values as $k => $v) {
             for ($i = 0; $i < count($form_rows); $i++) {
                 if ($k == $form_rows[$i]['alias']) {
                     $form_rows[$i]['default'] = $v;
                     if ($form_rows[$i]['check'] == 1) {
                         if ($k == 'email') {
                             if (Text::check_mail($v) === false) {
                                 $e['all'] = $e[$k] = true;
                             }
                         } else {
                             if (empty($v)) {
                                 $e['all'] = $e[$k] = true;
                             }
                         }
                     }
                 }
             }
         }
         // Обработка изображений
         $files = array();
         if (isset($values['file'])) {
             foreach ($values['file'] as $v) {
                 $files[] = array('name' => $v, 'orig' => $v);
             }
         } else {
             foreach ($_FILES as $key => $value) {
                 if ($value['error'] == 0) {
                     $files[$key] = load_file($key);
                 }
             }
         }
         if ($e['all'] === false) {
             ob_start();
             $this->smarty->assign('data', $values);
             $this->smarty->assign('form_rows', $form_rows);
             $this->smarty->assign('options', getSiteOptions());
             $this->smarty->assign('site_url', 'http://' . $_SERVER['SERVER_NAME'] . '/');
             $this->smarty->display($this->doc . 'mail.tpl');
             $mail_body = ob_get_contents();
             ob_clean();
             $test = sendMail($form['email'], $form['subj'], $mail_body, '', $files);
             //sendMail($form['email'], $form['subj'], $mail_body, $files);
             if ($form['admin'] == 1) {
                 $v = array($form_rows, $values, $files);
                 $val = serialize($v);
                 $query = 'CALL form_orders_insert(:field_name, :field_value)';
                 $params = array(':field_name' => $form['name'], ':field_value' => $mail_body);
                 PdoWrap::execute($query, $params);
             }
             header("Location: " . $_SERVER['REQUEST_URI'] . (preg_match('/\\?/', $_SERVER['REQUEST_URI']) ? '&' : '?') . 'success=1');
             exit;
         }
     }
     $this->smarty->assign('e', $e);
     $this->smarty->assign('form', $form);
     $this->smarty->assign('form_rows', $form_rows);
     $this->smarty->assign('success', $success);
     return;
 }
Ejemplo n.º 10
0
<?php

/**
 * Created by PhpStorm.
 * User: klim
 * Date: 06.10.14
 * Time: 21:52
 */
$item_id = (int) Text::get_get('item_id');
$table = Text::get_get('table');
$size = Text::get_get('size');
Files::setImageSize($size);
$file = Files::loadFiles();
if ($file['Filedata']['error'] == 0) {
    // Получение объекта кооректного класса для текущейт таблицы
    $base = checkTableType($table);
    $file_insert = new SimpleModule($base, $__lang);
    $file_insert->setUid($_SESSION['user']['id']);
    $data = array('item_id' => $item_id, 'name' => $file['Filedata']['orig_name'], 'image' => $file['Filedata']['name'], 'position' => 0, 'active' => '1');
    $result = $file_insert->setRow($table, $data);
    $smarty->assign('__lang', $__lang);
    $smarty->assign('image', Files::getImageLink($file['Filedata']['name']));
    $smarty->assign('image_id', $result);
    $smarty->assign('position', 1);
    $smarty->assign('active', '1');
    echo $smarty->fetch(DOC . 'templates/.admin/matches/admin_catalog_image_block.tpl');
} else {
    echo 'Error - ' . $file['Filedata']['error'];
}
exit;
Ejemplo n.º 11
0
 /**
  * Получение нескольких позиций каталога по идентификаторам
  * @param array $ids
  * @return array
  */
 public function getSeveralItemsByIds(array $ids)
 {
     $data = array();
     if (is_array($ids) && !empty($ids)) {
         $ids = array_filter($ids, function ($el) {
             return !empty($el);
         });
         $query = 'CALL get_catalog_items(:parent_ids, :item_ids, :price_from, :price_to, :sq_from, :sq_to, :insight_field, :sort, :sort_type, :table_limit, :page_num)';
         $params = array(':parent_ids' => '', ':item_ids' => implode(',', $ids), ':price_from' => (int) Text::get_get('price_from'), ':price_to' => (int) Text::get_get('price_to'), ':sq_from' => (int) Text::get_get('sq_from'), ':sq_to' => (int) Text::get_get('sq_to'), ':insight_field' => 2, ':sort' => 'name', ':sort_type' => 'ASC', ':table_limit' => 999, ':page_num' => 1);
         $data = PdoWrap::select($query, $params);
         Files::setImageSize('220x220');
         $count_data = count($data);
         for ($i = 0; $i < $count_data; $i++) {
             if ($data[$i]['image'] != '') {
                 $data[$i]['image_link'] = Files::getImageLink($data[$i]['image']);
             }
         }
     }
     return $data;
 }
Ejemplo n.º 12
0
 * Проверка прав доступа на просмотр для текущего действия.
 */
if (!isset($rights[$action]['edit']) || (int) $rights[$action]['edit'] == 0) {
    $access_denied = true;
} else {
    if (Text::get_get('ac_field') == 1) {
        $word = Text::get_get('term');
        $data = $object->findItem($word);
        echo json_encode($data);
        exit;
    }
    $table = 'catalog_complect';
    $do = 'catalog_comlect_relation_list';
    // Удаление
    $delete_handler = 'catalog_complect_set_delete';
    $id = (int) Text::get_get('group_id');
    $complect_info = $object->getRow('catalog_complect', $id);
    // Добавление связей
    if (Text::get_post('do') == 'add_relation') {
        $item_id2 = (int) Text::get_post('relation1');
        $item_id1 = (int) $id;
        // Если добавленный элемент является "radio" удаляем элементы "radio" из той же группы
        // Получение информации о добавляемом элементе
        $item_info = $object->getRow('catalog_features', $item_id2);
        if ($item_info['type'] == 5) {
            // Получение связанных элементов
            $data = $object->getRelationList(PREF . 'catalog_complect_values', PREF . 'catalog_features', 'complect_id', 'feature_id', $id);
            for ($i = 0; $i < count($data); $i++) {
                if ($item_info['catalog_features_group'] == $data[$i]['catalog_features_group']) {
                    // Удаление записи из таблицы
                    $object->deleteRelations(PREF . 'catalog_complect_values', 'complect_id', 'feature_id', $item_id1, $data[$i]['id']);
Ejemplo n.º 13
0
Archivo: edit.php Proyecto: klimjr/cms
<?php

/**
 * Добавление/редактирование раздела.
 * @author Alexey O Klimov
 * @update 25.08.2010
 */
//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
$table = Text::get_get('table');
if (Text::get_post('do') == 'save') {
    $options->setTableOptions($table);
    location($__return . '#options_table');
    exit;
}
$data = $options->getTableOptions($table);
// Выгрузка переменных в шаблон
$smarty->assign(array('table' => $table, 'data' => $data['data'], 'table_options' => $data['table_options']));
Ejemplo n.º 14
0
if ($sort != '') {
    $sort_type = $sort_type == 0 ? 'ASC' : 'DESC';
}
// Идентификатор родителя
$parent = (int) Text::get_get('parent');
$parent = $parent > 0 ? $parent : 0;
$groups_list = array();
// Установка группововй таблицы
if (isset($group_table) && $group_table != '' && ($object->getBase() instanceof TreeTableGroup || $object->getBase() instanceof SimpleTableGroup)) {
    $base->setTableGroupName($group_table);
    $groups_list = $object->getAllRows($group_table, 'tree_left', 'ASC');
}
$count_rows = 0;
if (Text::get_get('search') != '') {
    $query = 'CALL search_catalog_items(:sort, :sort_type, :table_limit, :page_num, :search_query)';
    $params = array(':sort' => 'name', ':sort_type' => 'ASC', ':table_limit' => 9999, ':page_num' => $page_num, ':search_query' => Text::get_get('search'));
    $data = PdoWrap::select($query, $params);
} else {
    $data = $object->getAdminList($table, $parent, $page_num, $sort, $sort_type);
    $count_rows = $object->getCount();
}
// определение постраничной навигации
$pagination = $object->getPagination($page_num);
// Обработка данных
$data = $object->getAdminListData($table, $data);
// Получение заголовков таблицы
$table_head = $object->getTableColumns($table);
//  Получение информации о родителях для хлебных крошек
$breadcrumbs = $object->getAdminBreadCrumbs($table, $parent, $action);
$smarty->assign('table_head', $table_head);
$smarty->assign('table', $table);
Ejemplo n.º 15
0
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
$page_num = 1;
if ((int) Text::get_get('page') > 1) {
    $page_num = (int) Text::get_get('page');
}
// Для показа статических страниц нужно разобрать URL
$module_aString = self::getModuleAString();
// Установка пользователя
$gallery->setUid($_SESSION['siteuser']['id']);
// Получение корневой страницы модуля
if (empty($module_aString)) {
    // Получение списка групп новостей
    // Устанавливаем таблицу для групп
    $gallery->setTable(PREF . 'gallery_groups');
    $groups = $gallery->getGroups($page_num);
    // устанавливаем таблицу для новостей
    $gallery->setTable(PREF . 'gallery');
    // Массив новостей
    $data = array();
    for ($i = 0; $i < count($groups); $i++) {
        $tmp = $gallery->getAnonsList($groups[$i]['id'], $page_num);
        $data = array_merge($tmp, $data);
    }
    $data = array_values($data);
    for ($i = 0; $i < count($data); $i++) {
Ejemplo n.º 16
0
/**
 * Получение корректной ссылки для сайта
 * @param $param
 */
function smarty_function_getLink($param)
{
    global $current_lang, $default_lang;
    $link = $current_lang == $default_lang ? '/' : '/' . $current_lang . '/';
    if (isset($param['link'])) {
        $link .= preg_replace('/^\\//', '', $param['link']);
        if (count($param) > 1) {
            $link = preg_replace('/\\.html$/', '/', $link);
        }
    }
    if (is_array($param) && !empty($param)) {
        foreach ($param as $key => $value) {
            if ($key != 'html' && $key != 'page_num' && $key != 'sort' && $key != 'sort_type' && $key != 'link' && $key != 'add_to_cart' && $key != 'product_set') {
                $link .= $value . '/';
            }
        }
    }
    if (isset($param['html']) && (int) $param['html'] == 1) {
        $link = substr($link, 0, -1) . '.html';
    } else {
        if (isset($param['page_num']) && (int) $param['page_num'] > 1) {
            $link = preg_replace('/\\.html$/', '/', $link);
            $link .= 'page-' . $param['page_num'] . '/';
        }
        if (isset($param['sort']) && $param['sort'] != '') {
            $sort_type = isset($param['sort_type']) ? $param['sort_type'] : 0;
            if ($param['sort'] == Text::get_get('sort')) {
                $sort_type = (int) Text::get_get('sort_type') == 0 ? 1 : 0;
            } elseif (!isset($_GET['sort']) && $param['sort'] == 'date_add') {
                $sort_type = $param['sort_type'] == 0 ? 1 : 0;
            }
            $link .= '?sort=' . $param['sort'] . '&sort_type=' . $sort_type;
        }
        if (isset($param['add_to_cart']) && (int) $param['add_to_cart'] > 0) {
            $link .= 'catalog/?add_to_cart=' . $param['add_to_cart'];
            if (isset($param['product_set'])) {
                $link .= '&product_set=1';
            }
        }
    }
    echo $link;
}
Ejemplo n.º 17
0
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
/**
 * Проверка прав доступа на просмотр для текущего действия.
 */
if (!isset($rights[$action]['delete']) || (int) $rights[$action]['delete'] == 0) {
    $access_denied = true;
} else {
    $item_id1 = (int) Text::get_get('relation1');
    $item_id2 = (int) Text::get_get('relation2');
    // Удаление записи из таблицы
    $object->deleteRelations(PREF . 'catalog_set', 'item_id1', 'item_id2', $item_id1, $item_id2);
    location($__return);
}
Ejemplo n.º 18
0
<?php

/**
 * Изменение позиции модуля.
 * @author Alexey O Klimov
 * @update 09.09.2010
 */
//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
/**
 * Проверка прав доступа на просмотр для текущего действия.
 */
if (!isset($rights[$action]['edit']) || (int) $rights[$action]['edit'] == 0) {
    $access_denied = true;
} else {
    //	Идентификатор записи.
    $id = (int) Text::get_get('id');
    //	Тип (уменьшение/увеличение) позиции.
    $type = (int) Text::get_get('type');
    $query = 'CALL change_table_positions(:id, :type, :table_name)';
    $params = array(':id' => $id, ':type' => $type, ':table_name' => PREF . $action);
    PdoWrap::execute($query, $params);
    // Переадресация.
    location($__return);
}
Ejemplo n.º 19
0
Archivo: list.php Proyecto: klimjr/cms
$sort = Text::get_get('s');
// Тип сортировки
$sort_type = Text::get_get('st');
// Изменение активности элемента
if (Text::get_get('do') == 'active') {
    $id = (int) Text::get_get('id');
    $pages->changeActive($action, $id);
    location($__return);
    exit;
}
// Групповые операции
$pages->groupActions($action, $__return);
// Получение информации о основной странице для текущего языка
$index = $pages->getRootPage();
// Идентификатор родителя
$parent = (int) Text::get_get('parent');
$parent = $parent > 0 ? $parent : $index['id'];
$data = $pages->getAdminList($action, $parent, $page_num, $sort, $sort_type);
$sort_type = $sort_type == 'ASC' ? 'DESC' : 'ASC';
// Добавляем информацию на главную страницу
if ($index['id'] == $parent) {
    $data = array_merge(array($index), $data);
}
// определение постраничной навигации
$pagination = $pages->getPagination($page_num);
// Получение заголовков таблицы
$table_head = $pages->getTableColumns($action);
// Обработка данных
$data = $pages->getAdminListData($action, $data);
//  Получение информации о родителях для хлебных крошек
$breadcrumbs = $pages->getAdminBreadCrumbs($action, $parent);
Ejemplo n.º 20
0
<?php

//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
// Получение номера страницы
$page_num = self::getPageNum();
// Для показа статических страниц нужно разобрать URL
$module_aString = self::getModuleAString();
// Получение корневой страницы модуля
if (empty($module_aString)) {
    $tpl = 'search';
    //	Поисковый запрос.
    $search_query = Text::get_get('query');
    $search_query = Text::triming($search_query);
    $data = $search->search_data($search_query);
    // Выгрузка переменных в шаблон
    $smarty->assign(array('search_data' => $data, 'search_query' => $search_query));
} else {
    // Для данного модуля вложенность не пердусмотрена
    require_once DOC . '/error404.php';
}
Ejemplo n.º 21
0
    $id = (int) Text::get_get('id');
    $type = (int) Text::get_get('type');
    $cell = Text::get_get('do');
    $forms->changeRowType($id, $type, $cell);
    location($__return);
    exit;
}
// текущая таблица
$forms->setTable(PREF . $action);
// Получение текущей страницы. По умолчанию страница 1
$page = (int) Text::get_get('page');
$page = $page > 0 ? $page : 1;
// Поле для сортировки
$sort = Text::get_get('s');
// Тип сортировки
$sort_type = (int) Text::get_get('st');
//	Массив детей
if ($sort != '') {
    $sort_type = $sort_type == 0 ? 1 : 0;
}
$data = $forms->getAdminList($page, $sort, $sort_type);
// Обработка данных
$data = $forms->getAdminListData($data);
// Получение заголовков таблицы
$table_head = $forms->getTableColumns();
$smarty->assign('table_head', $table_head);
$smarty->assign('data', $data);
// Вывод в шаблон полей для сортировки
$smarty->assign('s', $sort);
$smarty->assign('st', $sort_type);
// Вывод в шаблон данных о постраничной навигации
Ejemplo n.º 22
0
<?php

/**
 * Created by PhpStorm.
 * User: alexeyklimov
 * Date: 26.05.14
 * Time: 18:11
 */
$id = (int) Text::get_get('id');
$prev_id = (int) Text::get_get('prev_id');
changePositions($_SESSION['table'], $id, $prev_id);
Ejemplo n.º 23
0
Archivo: index.php Proyecto: klimjr/cms
             // вывод информации о меню раздела
             if ($tmp[$i]['folder'] == $action) {
                 $smarty->assign('sub_menu', $sub_menu);
             }
         }
     }
 }
 //	Действие по-умолчанию.
 $do = 'list';
 //	Проверка существования действия.
 if (Text::get_get('do') != '' && is_file(DOC . 'admin/~' . $action . '/' . Text::get_get('do') . '.php')) {
     $do = Text::get_get('do');
 } elseif (Text::get_get('do') != '' && is_file(DOC . 'modules' . '/' . $action . '/admin/' . Text::get_get('do') . '.php')) {
     $do = Text::get_get('do');
 } elseif (Text::get_get('do') != '') {
     $do = Text::get_get('do');
 }
 $__help = '';
 if ($action != 'ajax') {
     //	Подключение файлов локализации.
     if (is_file(DOC . 'admin/~' . $action . '/langs/' . $current_lang . '.lang.php')) {
         require DOC . 'admin/~' . $action . '/langs/' . $current_lang . '.lang.php';
     } elseif (is_file(DOC . 'modules/' . $action . '/langs/' . $current_lang . '.lang.php')) {
         require DOC . 'modules/' . $action . '/langs/' . $current_lang . '.lang.php';
     }
     for ($i = 0; $i < count($top_menu); $i++) {
         if ($top_menu[$i]['url'] == $action) {
             $top_menu[$i]['name'] = $__lang[$action]['name'];
             $top_menu[$i]['title'] = $__lang[$action]['title'];
         }
     }
Ejemplo n.º 24
0
     $parent = (int) Text::get_post('parent');
     $id = $user->addComment($text, $user_id, $profile_id, $parent, PROFILE);
     echo $id;
     exit;
     break;
 case 'getWallMessage':
     $id = (int) Text::get_get('id');
     $result = $user->getMessage($id);
     $result['text'] = Text::stsl($result['text']);
     echo json_encode($result);
     exit;
     break;
 case 'showlist':
     // Определение шаблона
     $tpl = 'profile_publics';
     $type = Text::get_get('type') == 'all' ? Text::get_get('type') : (int) Text::get_get('type');
     if ($type === 'all') {
         $where = ' AND `p`.`user_add` = ' . $profile['id'];
     } else {
         //Получение всех постов данного пользователя
         $where = ' AND `p`.`type` = ' . $type . ' AND `p`.`user_add` = ' . $profile['id'];
     }
     $posts = $public->getList($where, array('date_add' => 'DESC'), 9);
     // Получение списка изображений для галерей
     for ($i = 0; $i < count($posts['pos']); $i++) {
         if ($posts['pos'][$i]['type'] == 1) {
             $posts['pos'][$i]['gallery'] = $public->getImages($posts['pos'][$i]['id'], 4);
         } elseif ($posts['pos'][$i]['type'] == 2) {
             $posts['pos'][$i]['video'] = $public->getVideo($posts['pos'][$i]['id'], 1, 460);
         } elseif ($posts['pos'][$i]['type'] == 3) {
             $posts['pos'][$i]['music'] = $public->getAudio($posts['pos'][$i]['id'], 1);
Ejemplo n.º 25
0
 * @author Alexey O Klimov
 * @update 11.01.2011
 */
//	Запрет на обращение к файлу.
if (realpath($_SERVER['SCRIPT_FILENAME']) == realpath(__FILE__)) {
    header('Location: /');
    exit;
}
/**
 * Проверка прав доступа на просмотр для текущего действия.
 */
if (!isset($rights[$action]['delete']) || (int) $rights[$action]['delete'] == 0) {
    $access_denied = true;
} else {
    //	Тип активности (активно/неактивно).
    $folder = Text::get_get('folder');
    $query = 'CALL get_table_row_count(:table_name, :select_row, :select_value)';
    $params = array(':table_name' => PREF . 'modules', ':select_row' => 'folder', ':select_value' => $folder);
    $count = PdoWrap::selectRow($query, $params);
    //	Проверка существования записи.
    if ($count['count'] == 0) {
        $query = 'CALL get_max_position(:table_name, :table_column)';
        $params = array(':table_name' => PREF . 'modules', ':table_column' => 'position');
        $tmp = PdoWrap::selectRow($query, $params);
        $query = 'CALL modules_insert(:folder_field, :active_field, :position_field)';
        $params = array(':folder_field' => $folder, ':active_field' => 1, ':position_field' => $tmp['max'] + 1);
        //	Добавление записи в таблицу.
        PdoWrap::execute($query, $params);
    }
    /*
    // Подключение модуля
Ejemplo n.º 26
0
                exit;
            }
            // Получение данных каталога
            $data = $object->getItems($group['id'], $sort, $sort_type, System_Settings::getLimit(), $page_num);
            // Получение хлебных крошек
            //            $bread_crumbs = $object->getFrontEndBreadCrumbs($table);
            $bread_crumbs = $object->getFrontEndBreadCrumbs('catalog_groups', $group['id']);
            if (isset($group['show_children']) && $group['show_children'] == 1) {
                // Вывод для группы немецкие кухни
                $children_groups = $object->getGroupChildren('catalog_groups', $group['id']);
            }
            $parent = $group;
        }
    }
} else {
    // переопределяем данные
    $page['h1'] = $page['h1'] . ' ' . $object->getLocalization(end($module_aString));
    $group_id = 0;
    $data = array();
    // Получение хлебных крошек
    $bread_crumbs = $object->getFrontEndBreadCrumbs($table);
    $bread_crumbs[] = array('link' => '', 'name' => $page['h1']);
}
if ((int) Text::get_get('getAjaxCatalogList') == 1) {
    $smarty->assign(array('data' => $data, '__lang' => $object->getLocalization(), 'pagination' => $object->getPagination($page_num)));
    $result = $smarty->fetch(DOC . 'templates/site/matches/catalog_items_list.tpl');
    echo $result;
    exit;
}
// Выгрузка переменных в шаблон
$smarty->assign(array('data' => $data, 'group_id' => $group_id, 'filters_vars' => $object->getFiltersVars(), 'current_producer' => $object->getCurrentProducer(), 'current_collection' => $object->getCurrentCollection(), 'breadcrumbs' => $bread_crumbs, 'page_title' => $object->getPageTitle($page['head_title']), 'show_text' => $show_text, 'sort' => $sort, 'sort_type' => $sort_type, 'limit' => $limit, 'tags' => $object->getFiltersVars(), 'pagination' => $object->getPagination($page_num), 'children_groups' => $children_groups, 'parent' => $parent));