Хранилища Subversion ant

Редакция

Редакция 588 | Редакция 590 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 588 Редакция 589
Строка 1363... Строка 1363...
1363
1363
1364
        return $show;
1364
        return $show;
1365
    }
1365
    }
1366
1366
1367
    /**
1367
    /**
-
 
1368
     * Вывод списка корневых папок
-
 
1369
     *
-
 
1370
     * @author Alexander Wolf
-
 
1371
     * @category Core
-
 
1372
     *
-
 
1373
     * @param string $name
-
 
1374
     * @param string $actor
-
 
1375
     * @param string $format
-
 
1376
     * @return string
-
 
1377
     */
-
 
1378
    public function showFoldersList($name, $actor, $format = 'list') {
-
 
1379
        switch($format) {
-
 
1380
            case 'list':
-
 
1381
                $query = "SELECT * FROM ".$this->prefix."repfolder";
-
 
1382
                $rq =& $this->db->query($query);
-
 
1383
                $show = "<ul>\n";
-
 
1384
                while ($rq->fetchInto($element)) {
-
 
1385
                    $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["rfolder_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["rfolder_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["rfolder"],1)."</li>\n";
-
 
1386
                }
-
 
1387
                $show .= "</ul>";
-
 
1388
                break;
-
 
1389
            case 'innerhtml':
-
 
1390
                $folderID = $this->secure->checkInt($actor);
-
 
1391
                $query = "SELECT * FROM ".$this->prefix."repfolder";
-
 
1392
                $rq =& $this->db->query($query);
-
 
1393
                $show = "<select name='".$name."' id='".$name."'>\n";
-
 
1394
                while ($rq->fetchInto($element)) {
-
 
1395
                    if ($element["rfolder_id"]==$folderID) {
-
 
1396
                        $show .= "<option value='".$this->secure->checkInt($element["rfolder_id"])."' selected>".$this->secure->checkStr($element["rfolder"],1)."</option>\n";
-
 
1397
                    } else {
-
 
1398
                        $show .= "<option value='".$this->secure->checkInt($element["rfolder_id"])."'>".$this->secure->checkStr($element["rfolder"],1)."</option>\n";
-
 
1399
                    }
-
 
1400
                }
-
 
1401
                $show .= "</select>";
-
 
1402
                break;
-
 
1403
        }
-
 
1404
        return $show;
-
 
1405
    }
-
 
1406
-
 
1407
    /**
-
 
1408
     * Добавление нового корневого каталога
-
 
1409
     *
-
 
1410
     * @author Alexander Wolf
-
 
1411
     * @category Core
-
 
1412
     *
-
 
1413
     * @param string $flder
-
 
1414
     * @return array
-
 
1415
     */
-
 
1416
    public function addFolder($folder) {
-
 
1417
        $result = array();
-
 
1418
        $sFolder = $this->secure->checkStr($folder);
-
 
1419
-
 
1420
        $query = "INSERT INTO ".$this->prefix."repfolder SET rfolder='".$sFolder."'";
-
 
1421
        $rq =& $this->db->query($query);
-
 
1422
        if (PEAR::isError($this->db)) {
-
 
1423
            $result["ERR"] = 1;
-
 
1424
            $result["ERRINFO"] = $this->db->getMessage();
-
 
1425
        } else {
-
 
1426
            $result["ERR"] = 0;
-
 
1427
        }
-
 
1428
-
 
1429
        return $result;
-
 
1430
    }
-
 
1431
-
 
1432
    /**
-
 
1433
     * Удаление информации о корневой папке
-
 
1434
     *
-
 
1435
     * @author Alexander Wolf
-
 
1436
     * @category Core
-
 
1437
     *
-
 
1438
     * @param integer $folderID
-
 
1439
     * @return array
-
 
1440
     */
-
 
1441
    public function dropFolder($folderID) {
-
 
1442
        $result = array();
-
 
1443
        $sFolderID    = $this->secure->checkInt($folderID);
-
 
1444
-
 
1445
        // Удаление корневой папки
-
 
1446
        $query = "DELETE FROM ".$this->prefix."repfolder WHERE rfolder_id='".$sFolderID."'";
-
 
1447
        $rq =& $this->db->query($query);
-
 
1448
        if (PEAR::isError($this->db)) {
-
 
1449
            $result["ERR"] = 1;
-
 
1450
            $result["ERRINFO"] = $this->db->getMessage();
-
 
1451
        } else {
-
 
1452
            $result["ERR"] = 0;
-
 
1453
        }
-
 
1454
-
 
1455
        return $result;
-
 
1456
    }
-
 
1457
-
 
1458
    /**
-
 
1459
     * Обновление информации о корневой папки
-
 
1460
     *
-
 
1461
     * @author Alexander Wolf
-
 
1462
     * @category Core
-
 
1463
     *
-
 
1464
     * @param integer $folderID
-
 
1465
     * @param string $info
-
 
1466
     * @return array
-
 
1467
     */
-
 
1468
    public function updateFolder($folderID, $info) {
-
 
1469
        $result = array();
-
 
1470
        $sFolderID    = $this->secure->checkInt($folderID);
-
 
1471
        $sFolder      = $this->secure->checkStr($info);
-
 
1472
-
 
1473
        $query = "UPDATE ".$this->prefix."repfolder SET rfolder='".$sFolder."' WHERE rfolder_id='".$sFolderID."'";
-
 
1474
        $rq =& $this->db->query($query);
-
 
1475
        if (PEAR::isError($this->db)) {
-
 
1476
            $result["ERR"] = 1;
-
 
1477
            $result["ERRINFO"] = $this->db->getMessage();
-
 
1478
        } else {
-
 
1479
            $result["ERR"] = 0;
-
 
1480
        }
-
 
1481
-
 
1482
        return $result;
-
 
1483
    }
-
 
1484
-
 
1485
    /**
-
 
1486
     * Вывод формы редактирования/добавления корневых папок
-
 
1487
     *
-
 
1488
     * @author Alexander Wolf
-
 
1489
     * @category Core
-
 
1490
     *
-
 
1491
     * @param integer $folderID
-
 
1492
     * @param string $info
-
 
1493
     * @return string
-
 
1494
     */
-
 
1495
    public function showFolderForm($folderID = 0, $info = "") {
-
 
1496
        $sFolderID = $this->secure->checkInt($folderID);
-
 
1497
        $sInfo = $this->secure->checkStr($info, 1);
-
 
1498
        if ($sInfo == "") {
-
 
1499
            $sInfo = "Корневая папка";
-
 
1500
        }
-
 
1501
        if ($sFolderID != 0) {
-
 
1502
            // Режим редактирования
-
 
1503
            $query = "SELECT * FROM ".$this->prefix."repfolder WHERE rfolder_id='".$sFolderID."'";
-
 
1504
            $rq =& $this->db->query($query);
-
 
1505
            $rq->fetchInto($element);
-
 
1506
        }
-
 
1507
-
 
1508
        $show  = "<fieldset><legend>".$sInfo."</legend>\n";
-
 
1509
        $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' id='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n";
-
 
1510
        $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n";
-
 
1511
-
 
1512
        return $show;
-
 
1513
    }
-
 
1514
-
 
1515
    /**
1368
     * Показывает список подписей
1516
     * Показывает список подписей
1369
     *
1517
     *
1370
     * @author Alexander Wolf
1518
     * @author Alexander Wolf
1371
     * @category Core
1519
     * @category Core
1372
     *
1520
     *