Ejemplo n.º 1
0
    print @file_get_contents($dir . '/' . $idName);
} elseif ($action == 'save_edit') {
    $dataf = convert_ch(stripcslashes(trim($_POST['data'])));
    print @file_put_contents($dir . '/' . $idName, $dataf);
} elseif ($action == 'convert') {
    $p = isset($_POST['p']) ? intval($_POST['p']) : false;
    $fileload = @file_get_contents($dir . '/' . $idName);
    if ($p) {
        $fileload = mb_convert_encoding($fileload, "Windows-1251", "UTF-8");
        @file_put_contents($dir . '/' . $idName, $fileload);
    } else {
        $fileload = mb_convert_encoding($fileload, "UTF-8", "Windows-1251");
        @file_put_contents($dir . '/' . $idName, $fileload);
    }
} elseif ($action == 'update') {
    $file = my_fileBuld($dir);
    $image = '';
    $back = backFolder($dir);
    if ($back) {
        $image .= '<li onclick="image.update(\'' . base64_encode($back) . '\')"><div><table><tr><td valign="center" class="position_r">';
        $image .= '<img src="lib/images/back.png" />';
        $image .= '</td></tr></table></div>../назад</li>';
    }
    foreach ($file['dir'] as $name) {
        $image .= bunlerFiles($name, array('folder' => true));
    }
    foreach ($file['file'] as $name) {
        $image .= bunlerFiles($name);
    }
    print $image;
}
Ejemplo n.º 2
0
<?php

header("Content-type: application/x-javascript");
define('ROOT_DIR', dirname(dirname(__FILE__)));
define('THIS_DIR', dirname(__FILE__));
define('CLASS_DIR', dirname(__FILE__));
include CLASS_DIR . '/function.php';
$is_logged = login_alt($_GET['login']);
if (file_exists(ROOT_DIR . '/cache/' . $is_logged . '/godat.js.data')) {
    print file_get_contents(ROOT_DIR . '/cache/' . $is_logged . '/godat.js.data');
} else {
    $read = my_fileBuld(ROOT_DIR . '/data/' . $is_logged . '/');
    if (count($read['dir']) > 0) {
        $bigArr = array();
        foreach ($read['dir'] as $name) {
            $readLib = my_fileBuld(ROOT_DIR . '/data/' . $is_logged . '/' . $name . '/');
            $json = array();
            foreach ($readLib['file'] as $nameLib) {
                $libold = array();
                $libold = @unserialize(file_get_contents(ROOT_DIR . '/data/' . $is_logged . '/' . $name . '/' . $nameLib));
                $nameLib = str_replace(".lib", '', $nameLib);
                $arrMenuCo = array();
                if (is_array($libold)) {
                    foreach ($libold as $id => $text) {
                        $libold[$id] = $text;
                        $arrMenuCo[] = array("iframe.reobj(" . $id . ")" => $libold[$id]);
                    }
                }
                $json[$nameLib] = $arrMenuCo;
            }
            $allMenuInit[$name] = $json;
Ejemplo n.º 3
0
                    <div class="left textPad" style="min-width: 100px; font-weight: bold">' . $name . '</div>
                    <div class="left grayColor textPad" style="min-width: 200px">' . $date . '</div>
                    <div class="left grayColor textPad">' . FSizeNumber($size) . '</div>
                    <div class="right">
                        <div class="grayBtn" style="margin-right: 10px" onclick="libraly.export_lib(\'' . $name . '\')">Экспорт</div>
                        <div class="grayBtn" style="margin-right: 10px" onclick="libraly.renameLib(\'' . $name . '\')">Изменить</div>
                        <div class="grayBtn" onclick="libraly.del(\'' . $name . '\')">Удалить</div>
                    </div>
                    <div class="clear"></div>
                </div>
            </li>';
        }
        print '<ul class="ul tableList projectList">' . $prj . '</ul>';
    }
} elseif ($action == 'sLcat') {
    $read = my_fileBuld(ROOT_DIR . '/data/' . $is_logged . '/' . $idName . '/');
    if (count($read['file']) > 0) {
        foreach ($read['file'] as $name) {
            $p++;
            $p = $p > 2 ? 1 : $p;
            $size = FSize(ROOT_DIR . '/data/' . $is_logged . '/' . $idName . '/' . $name);
            $date = showDate(ROOT_DIR . '/data/' . $is_logged . '/' . $idName . '/' . $name);
            $name = str_replace(".data", '', $name);
            $prj .= '<li class="li_prj_' . $name . ' p_' . $p . '">
                <div class="lineB">
                    <img src="lib/images/lib_ico.png" class="left" />
                    <div class="left textPad" style="min-width: 100px; font-weight: bold">' . $name . '</div>
                    <div class="left grayColor textPad" style="min-width: 200px">' . $date . '</div>
                    <div class="left grayColor textPad">' . $size . '</div>
                    <div class="right">
                        <div class="grayBtn" style="margin-right: 10px" onclick="libraly.editCat(\'' . $name . '\',\'' . $idName . '\')">Редактировать</div>
Ejemplo n.º 4
0
                                }
                                $compliteStyle .= "}\n";
                            }
                        }
                    }
                }
                $compliteStyle .= "</style>\n";
            }
            $compliteStyle = preg_replace("'<style[^>]*>\\s*<\\/style>'si", '', $compliteStyle);
            @mkdir(ROOT_DIR . '/userData/userData/' . $is_logged);
            @file_put_contents(ROOT_DIR . '/userData/userData/' . $is_logged . '/' . $filenames . '.html', $compliteStyle . $dataPost);
        }
    } else {
        show_info('info', 'Возникла ошибка получения данных.');
    }
} elseif ($action == 'allPrj') {
    $file = my_fileBuld($dirName);
    $allowed = array('prj');
    if (count($file['dir']) > 0) {
        foreach ($file['dir'] as $name) {
            $p++;
            $p = $p > 2 ? 1 : $p;
            $date = @date("F d Y", @filemtime($dirName . '/' . $name));
            $size = FSizeNumber(sizeFolder($dirName . '/' . $name));
            $prj .= '<li class="li_prj_' . $name . ' p_' . $p . '"><div class="lineB"><img src="lib/images/future_projects.png" class="left" /><div class="left textPad" style="min-width: 100px; font-weight: bold">' . $name . '</div><div class="left grayColor textPad" style="min-width: 110px">' . $date . '</div><div class="left grayColor textPad">' . $size . '</div><div class="right"><div class="grayBtn" style="margin-right: 10px" onclick="file.open(\'' . $name . '\')">Открыть</div><div class="grayBtn" onclick="file.del(\'' . $name . '\')">Удалить</div></div><div class="clear"></div></div></li>';
        }
        print '<ul class="ul tableList projectList">' . $prj . '</ul>';
    } else {
        print 'Вы еще не создали ни один проект.';
    }
}
Ejemplo n.º 5
0
function lastBuldLib()
{
    global $db, $is_logged;
    $read = my_fileBuld(ROOT_DIR . '/data/' . $is_logged . '/');
    foreach ($read['dir'] as $name) {
        $cat = my_fileBuld(ROOT_DIR . '/data/' . $is_logged . '/' . $name . '/');
        $li .= '<li class="blib_' . $name . ' blib_select"><span>' . substr($name, 0, 14) . '</span><b uplName="' . $name . '"></b></li>';
    }
    if (count($read['dir']) == 0) {
        $li .= '<li class="nolib" onclick="libraly.showLibraly()"><span>У вас нет не одной библиотеки</span></li>';
    }
    return $li;
}