Редакция 569 | Редакция 571 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 569 | Редакция 570 | ||
---|---|---|---|
Строка 919... | Строка 919... | ||
919 | 919 | ||
920 | return $show; |
920 | return $show; |
921 | }
|
921 | }
|
922 | 922 | ||
923 | /**
|
923 | /**
|
- | 924 | * Вывод списка схем репозиториев
|
|
- | 925 | *
|
|
- | 926 | * @author Alexander Wolf
|
|
- | 927 | * @category Core
|
|
- | 928 | *
|
|
- | 929 | * @param string $name
|
|
- | 930 | * @param string $actor
|
|
- | 931 | * @param string $format
|
|
- | 932 | * @return string
|
|
- | 933 | */
|
|
- | 934 | public function showSchemeList($name, $actor, $format = 'list') { |
|
- | 935 | switch($format) { |
|
- | 936 | case 'list': |
|
- | 937 | $query = "SELECT * FROM ".$this->prefix."repscheme"; |
|
- | 938 | $rq =& $this->db->query($query); |
|
- | 939 | $show = "<ul>\n"; |
|
- | 940 | while ($rq->fetchInto($element)) { |
|
- | 941 | $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["scheme_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["scheme_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["scheme"],1)."</li>\n"; |
|
- | 942 | }
|
|
- | 943 | $show .= "</ul>"; |
|
- | 944 | break; |
|
- | 945 | case 'innerhtml': |
|
- | 946 | $repID = $this->secure->checkInt($actor); |
|
- | 947 | $query = "SELECT * FROM ".$this->prefix."repscheme"; |
|
- | 948 | $rq =& $this->db->query($query); |
|
- | 949 | $show = "<select name='".$name."' id='".$name."'>\n"; |
|
- | 950 | while ($rq->fetchInto($element)) { |
|
- | 951 | if ($element["scheme_id"]==$repID) { |
|
- | 952 | $show .= "<option value='".$this->secure->checkInt($element["scheme_id"])."' selected>".$this->secure->checkStr($element["scheme"],1)."</option>\n"; |
|
- | 953 | } else { |
|
- | 954 | $show .= "<option value='".$this->secure->checkInt($element["scheme_id"])."'>".$this->secure->checkStr($element["scheme"],1)."</option>\n"; |
|
- | 955 | }
|
|
- | 956 | }
|
|
- | 957 | $show .= "</select>"; |
|
- | 958 | break; |
|
- | 959 | }
|
|
- | 960 | return $show; |
|
- | 961 | }
|
|
- | 962 | ||
- | 963 | /**
|
|
- | 964 | * Добавление новой схемы репозитория
|
|
- | 965 | *
|
|
- | 966 | * @author Alexander Wolf
|
|
- | 967 | * @category Core
|
|
- | 968 | *
|
|
- | 969 | * @param string $scheme
|
|
- | 970 | * @return array
|
|
- | 971 | */
|
|
- | 972 | public function addScheme($scheme) { |
|
- | 973 | $result = array(); |
|
- | 974 | $sScheme = $this->secure->checkStr($scheme,1); |
|
- | 975 | ||
- | 976 | $query = "INSERT INTO ".$this->prefix."repscheme SET scheme='".$sScheme."'"; |
|
- | 977 | $rq =& $this->db->query($query); |
|
- | 978 | if (PEAR::isError($this->db)) { |
|
- | 979 | $result["ERR"] = 1; |
|
- | 980 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 981 | } else { |
|
- | 982 | $result["ERR"] = 0; |
|
- | 983 | }
|
|
- | 984 | ||
- | 985 | return $result; |
|
- | 986 | }
|
|
- | 987 | ||
- | 988 | /**
|
|
- | 989 | * Удаление информации о схеме репозитория
|
|
- | 990 | *
|
|
- | 991 | * @author Alexander Wolf
|
|
- | 992 | * @category Core
|
|
- | 993 | *
|
|
- | 994 | * @param integer $schemeID
|
|
- | 995 | * @return array
|
|
- | 996 | */
|
|
- | 997 | public function dropScheme($schemeID) { |
|
- | 998 | $result = array(); |
|
- | 999 | $sSchemeID = $this->secure->checkInt($schemeID); |
|
- | 1000 | ||
- | 1001 | // Удаление схемы
|
|
- | 1002 | $query = "DELETE FROM ".$this->prefix."repscheme WHERE scheme_id='".$sSchemeID."'"; |
|
- | 1003 | $rq =& $this->db->query($query); |
|
- | 1004 | if (PEAR::isError($this->db)) { |
|
- | 1005 | $result["ERR"] = 1; |
|
- | 1006 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 1007 | } else { |
|
- | 1008 | $result["ERR"] = 0; |
|
- | 1009 | }
|
|
- | 1010 | ||
- | 1011 | return $result; |
|
- | 1012 | }
|
|
- | 1013 | ||
- | 1014 | /**
|
|
- | 1015 | * Обновление информации о схеме репозитория
|
|
- | 1016 | *
|
|
- | 1017 | * @author Alexander Wolf
|
|
- | 1018 | * @category Core
|
|
- | 1019 | *
|
|
- | 1020 | * @param integer $schemeID
|
|
- | 1021 | * @param string $info
|
|
- | 1022 | * @return array
|
|
- | 1023 | */
|
|
- | 1024 | public function updateScheme($schemeID, $info) { |
|
- | 1025 | $result = array(); |
|
- | 1026 | $sSchemeID = $this->secure->checkInt($schemeID); |
|
- | 1027 | $sScheme = $this->secure->checkStr($info,1); |
|
- | 1028 | ||
- | 1029 | $query = "UPDATE ".$this->prefix."repscheme SET scheme='".$sScheme."' WHERE scheme_id='".$sSchemeID."'"; |
|
- | 1030 | $rq =& $this->db->query($query); |
|
- | 1031 | if (PEAR::isError($this->db)) { |
|
- | 1032 | $result["ERR"] = 1; |
|
- | 1033 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 1034 | } else { |
|
- | 1035 | $result["ERR"] = 0; |
|
- | 1036 | }
|
|
- | 1037 | ||
- | 1038 | return $result; |
|
- | 1039 | }
|
|
- | 1040 | ||
- | 1041 | /**
|
|
- | 1042 | * Вывод формы редактирования/добавления схем репозиториев
|
|
- | 1043 | *
|
|
- | 1044 | * @author Alexander Wolf
|
|
- | 1045 | * @category Core
|
|
- | 1046 | *
|
|
- | 1047 | * @param integer $schemeID
|
|
- | 1048 | * @param string $info
|
|
- | 1049 | * @return string
|
|
- | 1050 | */
|
|
- | 1051 | public function showSchemeForm($schemeID = 0, $info = "") { |
|
- | 1052 | $sSchemeID = $this->secure->checkInt($schemeID); |
|
- | 1053 | $sInfo = $this->secure->checkStr($info, 1); |
|
- | 1054 | if ($sInfo == "") { |
|
- | 1055 | $sInfo = "Схема репозитория"; |
|
- | 1056 | }
|
|
- | 1057 | if ($sSchemeID != 0) { |
|
- | 1058 | // Режим редактирования
|
|
- | 1059 | $query = "SELECT * FROM ".$this->prefix."repscheme WHERE scheme_id='".$sSchemeID."'"; |
|
- | 1060 | $rq =& $this->db->query($query); |
|
- | 1061 | $rq->fetchInto($element); |
|
- | 1062 | }
|
|
- | 1063 | ||
- | 1064 | $show = "<fieldset><legend>".$sInfo."</legend>\n"; |
|
- | 1065 | $show .= "<div class='inputbox'><label for='scheme'>Схема репозитория:</label> <input type='text' name='scheme' id='scheme' value='".$this->showSchemeList("scheme", $element["scheme_id"],"innerhtml")."'></div>\n"; |
|
- | 1066 | $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n"; |
|
- | 1067 | ||
- | 1068 | return $show; |
|
- | 1069 | }
|
|
- | 1070 | ||
- | 1071 | /**
|
|
924 | * Показывает список подписей
|
1072 | * Показывает список подписей
|
925 | *
|
1073 | *
|
926 | * @author Alexander Wolf
|
1074 | * @author Alexander Wolf
|
927 | * @category Core
|
1075 | * @category Core
|
928 | *
|
1076 | *
|
Строка 1377... | Строка 1525... | ||
1377 | $show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n"; |
1525 | $show .= "<div class='inputbox'><label for='rhost'>Хост репозитория:</label> <input type='text' name='rhost' value='".$this->secure->checkStr($element["rhost"],1)."'></div>\n"; |
1378 | $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n"; |
1526 | $show .= "<div class='inputbox'><label for='rfolder'>Корневая папка:</label> <input type='text' name='rfolder' value='".$this->secure->checkStr($element["rfolder"],1)."'></div>\n"; |
1379 | $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n"; |
1527 | $show .= "<div class='inputbox'><label for='rtype'>Тип репозитория:</label> ".$this->showRepType($this->secure->checkInt($element["rtype_id"]), "rtype")."</div>\n"; |
1380 | $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> <div class='formwrapper'>".$this->showSectionsList("rsects",$sRepID,"innerhtml")."</div></div>\n"; |
1528 | $show .= "<div class='inputbox'><label for='rsects'>Секции репозитория:</label> <div class='formwrapper'>".$this->showSectionsList("rsects",$sRepID,"innerhtml")."</div></div>\n"; |
1381 | $show .= "<div class='inputbox'><label for='rarchs'>Архитектуры:</label> <div class='formwrapper'>".$this->showArchList("rarchs",$sRepID,"innerhtml")."</div></div>\n"; |
1529 | $show .= "<div class='inputbox'><label for='rarchs'>Архитектуры:</label> <div class='formwrapper'>".$this->showArchList("rarchs",$sRepID,"innerhtml")."</div></div>\n"; |
- | 1530 | $show .= "<div class='inputbox'><label for='rscheme'>Схема репозитория:</label> ".$this->showSchemeList("rscheme",$sRepID,"innerhtml")."</div>\n"; |
|
1382 | $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n"; |
1531 | $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div></fieldset>\n"; |
1383 | 1532 | ||
1384 | return $show; |
1533 | return $show; |
1385 | return $show; |
1534 | return $show; |
1386 | }
|
1535 | }
|