Редакция 567 | Редакция 569 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 567 | Редакция 568 | ||
---|---|---|---|
Строка 640... | Строка 640... | ||
640 | }
|
640 | }
|
641 | 641 | ||
642 | return $show; |
642 | return $show; |
643 | }
|
643 | }
|
644 | 644 | ||
645 | - | ||
646 | /**
|
645 | /**
|
647 | * Вывод формы редактирования/добавления секций
|
646 | * Вывод формы редактирования/добавления секций
|
648 | *
|
647 | *
|
649 | * @author Alexander Wolf
|
648 | * @author Alexander Wolf
|
650 | * @category Core
|
649 | * @category Core
|
Строка 755... | Строка 754... | ||
755 | 754 | ||
756 | return $result; |
755 | return $result; |
757 | }
|
756 | }
|
758 | 757 | ||
759 | /**
|
758 | /**
|
- | 759 | * Вывод списка поддерживаемых архитектур
|
|
- | 760 | *
|
|
- | 761 | * @author Alexander Wolf
|
|
- | 762 | * @category Core
|
|
- | 763 | *
|
|
- | 764 | * @param string $name
|
|
- | 765 | * @param string $actor
|
|
- | 766 | * @param string $format
|
|
- | 767 | * @return string
|
|
- | 768 | */
|
|
- | 769 | public function showArchList($name, $actor, $format = 'list') { |
|
- | 770 | switch($format) { |
|
- | 771 | case 'list': |
|
- | 772 | $query = "SELECT * FROM ".$this->prefix."arch"; |
|
- | 773 | $rq =& $this->db->query($query); |
|
- | 774 | $show = "<ul>\n"; |
|
- | 775 | while ($rq->fetchInto($element)) { |
|
- | 776 | $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["arch_id"]."' class='edit'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["arch_id"]."' class='delete'>удалить</a>] ".$this->secure->checkStr($element["arch"],1)."</li>\n"; |
|
- | 777 | }
|
|
- | 778 | $show .= "</ul>"; |
|
- | 779 | break; |
|
- | 780 | case 'innerhtml': |
|
- | 781 | $show = ""; |
|
- | 782 | $repID = $this->secure->checkInt($actor); |
|
- | 783 | if ($archID==0) { |
|
- | 784 | $query = "SELECT * FROM ".$this->prefix."arch"; |
|
- | 785 | $rq =& $this->db->query($query); |
|
- | 786 | while ($rq->fetchInto($element)) { |
|
- | 787 | $show .= "<input type='checkbox' name='".$name."[]' value='".$element["arch_id"]."'> ".$this->secure->checkStr($element["arch"],1)." "; |
|
- | 788 | }
|
|
- | 789 | } else { |
|
- | 790 | $query = "SELECT * FROM ".$this->prefix."arch a JOIN ".$this->prefix."arch2rep r ON a.arch_id=r.arch_id WHERE r.rep_id='$repID'"; |
|
- | 791 | $rq =& $this->db->query($query); |
|
- | 792 | while ($rq->fetchInto($element)) { |
|
- | 793 | $show .= "<input type='checkbox' name='".$name."[]' value='".$element["arch_id"]."' checked> ".$this->secure->checkStr($element["arch"],1)." "; |
|
- | 794 | }
|
|
- | 795 | $query = "SELECT a.* FROM ".$this->prefix."arch a WHERE a.arch_id NOT IN (SELECT arch_id FROM ".$this->prefix."arch2rep WHERE rep_id='$repID')"; |
|
- | 796 | $rq =& $this->db->query($query); |
|
- | 797 | while ($rq->fetchInto($element)) { |
|
- | 798 | $show .= "<input type='checkbox' name='".$name."[]' value='".$element["arch_id"]."'> ".$this->secure->checkStr($element["arch"],1)." "; |
|
- | 799 | }
|
|
- | 800 | }
|
|
- | 801 | break; |
|
- | 802 | }
|
|
- | 803 | return $show; |
|
- | 804 | }
|
|
- | 805 | ||
- | 806 | /**
|
|
- | 807 | * Добавление новой архитектуры
|
|
- | 808 | *
|
|
- | 809 | * @author Alexander Wolf
|
|
- | 810 | * @category Core
|
|
- | 811 | *
|
|
- | 812 | * @param string $arch
|
|
- | 813 | * @return array
|
|
- | 814 | */
|
|
- | 815 | public function addArch($arch) { |
|
- | 816 | $result = array(); |
|
- | 817 | $sArch = $this->secure->checkStr($arch,1); |
|
- | 818 | ||
- | 819 | $query = "INSERT INTO ".$this->prefix."arch SET arch='".$sArch."'"; |
|
- | 820 | $rq =& $this->db->query($query); |
|
- | 821 | if (PEAR::isError($this->db)) { |
|
- | 822 | $result["ERR"] = 1; |
|
- | 823 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 824 | } else { |
|
- | 825 | $result["ERR"] = 0; |
|
- | 826 | }
|
|
- | 827 | ||
- | 828 | return $result; |
|
- | 829 | }
|
|
- | 830 | ||
- | 831 | /**
|
|
- | 832 | * Удаление информации об архитектуре
|
|
- | 833 | *
|
|
- | 834 | * @author Alexander Wolf
|
|
- | 835 | * @category Core
|
|
- | 836 | *
|
|
- | 837 | * @param integer $archID
|
|
- | 838 | * @return array
|
|
- | 839 | */
|
|
- | 840 | public function dropArch($archID) { |
|
- | 841 | $result = array(); |
|
- | 842 | $sArchID = $this->secure->checkInt($archID); |
|
- | 843 | ||
- | 844 | // Удаление архитектуры
|
|
- | 845 | $query = "DELETE FROM ".$this->prefix."arch WHERE arch_id='".$sArchID."'"; |
|
- | 846 | $rq =& $this->db->query($query); |
|
- | 847 | if (PEAR::isError($this->db)) { |
|
- | 848 | $result["ERR"] = 1; |
|
- | 849 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 850 | } else { |
|
- | 851 | $result["ERR"] = 0; |
|
- | 852 | }
|
|
- | 853 | ||
- | 854 | // Удаление архитектуры из списка репозиториев
|
|
- | 855 | $query = "DELETE FROM ".$this->prefix."arch2rep WHERE arch_id='".$sArchID."'"; |
|
- | 856 | $rq =& $this->db->query($query); |
|
- | 857 | if (PEAR::isError($this->db)) { |
|
- | 858 | $result["ERR"] = 1; |
|
- | 859 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 860 | } else { |
|
- | 861 | $result["ERR"] = 0; |
|
- | 862 | }
|
|
- | 863 | return $result; |
|
- | 864 | }
|
|
- | 865 | ||
- | 866 | /**
|
|
- | 867 | * Обновление информации об архитектуре
|
|
- | 868 | *
|
|
- | 869 | * @author Alexander Wolf
|
|
- | 870 | * @category Core
|
|
- | 871 | *
|
|
- | 872 | * @param integer $archID
|
|
- | 873 | * @param string $arch
|
|
- | 874 | * @return array
|
|
- | 875 | */
|
|
- | 876 | public function updateArch($archID, $arch) { |
|
- | 877 | $result = array(); |
|
- | 878 | $sArchID = $this->secure->checkInt($archID); |
|
- | 879 | $sArch = $this->secure->checkStr($arch,1); |
|
- | 880 | ||
- | 881 | $query = "UPDATE ".$this->prefix."arch SET arch='".$sArch."' WHERE arch_id='".$sArchID."'"; |
|
- | 882 | $rq =& $this->db->query($query); |
|
- | 883 | if (PEAR::isError($this->db)) { |
|
- | 884 | $result["ERR"] = 1; |
|
- | 885 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 886 | } else { |
|
- | 887 | $result["ERR"] = 0; |
|
- | 888 | }
|
|
- | 889 | ||
- | 890 | return $result; |
|
- | 891 | }
|
|
- | 892 | ||
- | 893 | /**
|
|
- | 894 | * Вывод формы редактирования/добавления архитектур
|
|
- | 895 | *
|
|
- | 896 | * @author Alexander Wolf
|
|
- | 897 | * @category Core
|
|
- | 898 | *
|
|
- | 899 | * @param integer $archID
|
|
- | 900 | * @param string $info
|
|
- | 901 | * @return string
|
|
- | 902 | */
|
|
- | 903 | public function showArchForm($archID = 0, $info = "") { |
|
- | 904 | $sArchID = $this->secure->checkInt($archID); |
|
- | 905 | $sInfo = $this->secure->checkStr($info, 1); |
|
- | 906 | if ($sInfo == "") { |
|
- | 907 | $sInfo = "Архитектура"; |
|
- | 908 | }
|
|
- | 909 | if ($sArchID != 0) { |
|
- | 910 | // Режим редактирования
|
|
- | 911 | $query = "SELECT * FROM ".$this->prefix."arch WHERE arch_id='".$sArchID."'"; |
|
- | 912 | $rq =& $this->db->query($query); |
|
- | 913 | $rq->fetchInto($element); |
|
- | 914 | }
|
|
- | 915 | ||
- | 916 | $show = "<fieldset><legend>".$sInfo."</legend>\n"; |
|
- | 917 | $show .= "<div class='inputbox'><label for='arch'>Архитектура:</label> <input type='text' name='arch' id='arch' value='".$this->secure->checkStr($element["arch"],1)."'></div>\n"; |
|
- | 918 | $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n"; |
|
- | 919 | ||
- | 920 | return $show; |
|
- | 921 | }
|
|
- | 922 | ||
- | 923 | /**
|
|
760 | * Показывает список подписей
|
924 | * Показывает список подписей
|
761 | *
|
925 | *
|
762 | * @author Alexander Wolf
|
926 | * @author Alexander Wolf
|
763 | * @category Core
|
927 | * @category Core
|
764 | *
|
928 | *
|