Beispiel #1
0
/**
 * Получение ссылки для изображения
 * @param $param
 */
function smarty_function_getImageLink($param)
{
    $image = getParam($param, 'image', '');
    $size = getParam($param, 'size', '');
    $form = getParam($param, 'form', '');
    $name = getParam($param, 'name', '');
    if ($size == '') {
        echo '/userfiles/original/' . $image;
    } else {
        Files::setImageSize($size);
        echo Files::getImageLink($image, $name);
    }
}
Beispiel #2
0
 /**
  * Получение связей
  * @param string $table
  * @param string $relation_table
  * @param string $col1
  * @param string $col2
  * @param int $value
  * @return array
  */
 public function getRelationList($table, $relation_table, $col1, $col2, $value)
 {
     $data = parent::getRelationList($table, $relation_table, $col1, $col2, $value);
     // Получение изображений для позиций
     Files::setImageSize('100x100');
     for ($i = 0; $i < count($data); $i++) {
         $tmp = $this->__getImages($data[$i]['id'], 1);
         $data[$i]['image_link'] = Files::getImageLink($tmp['image']);
         $group = $this->getRow('catalog_groups', $data[$i]['group_id']);
         $data[$i]['link'] = $group['link'] . $data[$i]['alias'] . ".html";
     }
     return $data;
 }
Beispiel #3
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;
Beispiel #4
0
    $object->setLimit($limit);
}
if (isset($_GET['show'])) {
    $limit = Text::get_get('show');
    if ($limit != 'all' && $limit > 0) {
        $object->setLimit($limit);
        setcookie('limit', $limit, time() + 150000000);
    } else {
        setcookie('limit', 0, time() + 150000000);
    }
}
if ($skip == 0) {
    // Получение корневой страницы модуля
    if (empty($module_aString)) {
        // Устанавливаем размеры для изображений
        Files::setImageSize('220x220');
        // Данные для автоподгрузки
        if (isset($_GET['ajaxAutoload']) && (int) $_GET['ajaxAutoload'] == 1) {
            $page_num = Text::get_get('page');
            $data = $object->getItems('', 2, $sort, $sort_type, $object->getLimit(), $page_num);
            $smarty->assign(array('data' => $data, '__lang' => $object->getLocalization()));
            $result = $smarty->fetch(DOC . 'templates/site/matches/catalog_items_list.tpl');
            echo $result;
            exit;
        }
        // Получение данных каталога
        $data = $object->getItems($parent['id'], $sort, $sort_type, System_Settings::getLimit(), $page_num);
        $bread_crumbs = $object->getFrontEndBreadCrumbs('catalog_groups');
        $bread_crumbs[] = array('link' => '', 'name' => $page['name']);
        $page_tmp_link = explode('/', $page['link']);
        $page_tmp_link = array_merge($page_tmp_link, self::getModuleAString());