/** * Проверка прав доступа на просмотр для текущего действия. */ if (!isset($rights[$action]['edit']) || (int) $rights[$action]['edit'] == 0) { $access_denied = true; } else { // полуаем название Таблицы $table = str_replace('_edit', '', $do); if (!isset($object) || !is_object($object)) { // Получение объекта кооректного класса для текущейт таблицы $base = checkTableType($table); $object = new SimpleModule($base, $__lang); $object->setBreadCrumbs($bread_crumbs); } if (isset($_SESSION['user']['id']) && (int) $_SESSION['user']['id'] > 0) { $object->setUid($_SESSION['user']['id']); } $module_do = str_replace($action . '_', '', $do); $do = 'edit'; // Идетификатор записи. $id = (int) Text::get_get('id'); // Идентификатор родителя $group_id = (int) Text::get_get('group_id'); if ($group_id > 0) { $object->setGroup($table, $group_id); } // Идентификатор родителя $parent = (int) Text::get_get('parent'); $parent = $parent > 0 ? $parent : $object->getRootId(); // Основная переменная $data = array();
<?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;