Редакция 538 | Редакция 540 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 538 | Редакция 539 | ||
---|---|---|---|
Строка 727... | Строка 727... | ||
727 | 727 | ||
728 | return $result; |
728 | return $result; |
729 | }
|
729 | }
|
730 | 730 | ||
731 | /**
|
731 | /**
|
- | 732 | * Показывает список подписей
|
|
- | 733 | *
|
|
- | 734 | * @author Alexander Wolf
|
|
- | 735 | * @category Core
|
|
- | 736 | *
|
|
- | 737 | * @param string $name
|
|
- | 738 | * @param string $actor
|
|
- | 739 | * @return string
|
|
- | 740 | */
|
|
- | 741 | public function showSignsList($name, $actor) { |
|
- | 742 | $query = "SELECT * FROM ".$this->prefix."signs"; |
|
- | 743 | $rq =& $this->db->query($query); |
|
- | 744 | $show = "<ul>\n"; |
|
- | 745 | while ($rq->fetchInto($element)) { |
|
- | 746 | $show .= "<li>[<a href='".$actor."?mode=".$name."&action=edit&uuid=".$element["sign_id"]."'>править</a>][<a href='".$actor."?mode=".$name."&action=delete&uuid=".$element["sign_id"]."'>удалить</a>] ".$this->secure->checkStr($element["sname"],1)."</li>\n"; |
|
- | 747 | }
|
|
- | 748 | $show .= "</ul>"; |
|
- | 749 | ||
- | 750 | return $show; |
|
- | 751 | }
|
|
- | 752 | ||
- | 753 | /**
|
|
- | 754 | * Вывод формы редактирования/добавления подписей
|
|
- | 755 | *
|
|
- | 756 | * @author Alexander Wolf
|
|
- | 757 | * @category Core
|
|
- | 758 | *
|
|
- | 759 | * @param integer $sectionID
|
|
- | 760 | * @param string $info
|
|
- | 761 | * @return string
|
|
- | 762 | */
|
|
- | 763 | public function showSignsForm($signID = 0, $info = "") { |
|
- | 764 | $sSignID = $this->secure->checkInt($signID); |
|
- | 765 | $sInfo = $this->secure->checkStr($info, 1); |
|
- | 766 | if ($sInfo == "") { |
|
- | 767 | $sInfo = "Подписи"; |
|
- | 768 | }
|
|
- | 769 | if ($sSignID != 0) { |
|
- | 770 | // Режим редактирования
|
|
- | 771 | $query = "SELECT * FROM ".$this->prefix."signs WHERE sign_id='".$sSignID."'"; |
|
- | 772 | $rq =& $this->db->query($query); |
|
- | 773 | $rq->fetchInto($element); |
|
- | 774 | }
|
|
- | 775 | ||
- | 776 | $show = "<fieldset><legend>".$sInfo."</legend>\n"; |
|
- | 777 | $show .= "<div class='inputbox'><label for='sname'>Название подписи:</label> <input type='text' name='sname' id='sname' value='".$this->secure->checkStr($element["sname"],1)."'></div>\n"; |
|
- | 778 | $show .= "<div class='inputbox'><label for='sinfo'>Описание подписи:</label> <input type='text' name='sinfo' id='sinfo' value='".$this->secure->checkStr($element["sinfo"],1)."'></div>\n"; |
|
- | 779 | $show .= "<div class='inputbox'><input type='submit' value=' Отправить данные '></div>\n</fieldset>\n"; |
|
- | 780 | ||
- | 781 | return $show; |
|
- | 782 | }
|
|
- | 783 | ||
- | 784 | /**
|
|
- | 785 | * Обновление информации о секции
|
|
- | 786 | *
|
|
- | 787 | * @author Alexander Wolf
|
|
- | 788 | * @category Core
|
|
- | 789 | *
|
|
- | 790 | * @param integer $sectionID
|
|
- | 791 | * @param string $sname
|
|
- | 792 | * @param string $sinfo
|
|
- | 793 | * @return array
|
|
- | 794 | */
|
|
- | 795 | public function updateSign($signID, $sname, $sinfo = "") { |
|
- | 796 | $result = array(); |
|
- | 797 | $sSignID = $this->secure->checkInt($signID); |
|
- | 798 | $sSName = $this->secure->checkStr($sname,1); |
|
- | 799 | $sSInfo = $this->secure->checkStr($sinfo,1); |
|
- | 800 | ||
- | 801 | $query = "UPDATE ".$this->prefix."signs SET sname='".$sSName."', sinfo='".$sSInfo."' WHERE sign_id='".$sSignID."'"; |
|
- | 802 | $rq =& $this->db->query($query); |
|
- | 803 | if (PEAR::isError($this->db)) { |
|
- | 804 | $result["ERR"] = 1; |
|
- | 805 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 806 | } else { |
|
- | 807 | $result["ERR"] = 0; |
|
- | 808 | }
|
|
- | 809 | ||
- | 810 | return $result; |
|
- | 811 | }
|
|
- | 812 | ||
- | 813 | /**
|
|
- | 814 | * Удаление информации о подписи
|
|
- | 815 | *
|
|
- | 816 | * @author Alexander Wolf
|
|
- | 817 | * @category Core
|
|
- | 818 | *
|
|
- | 819 | * @param integer $sectionID
|
|
- | 820 | * @return array
|
|
- | 821 | */
|
|
- | 822 | public function dropSection($signID) { |
|
- | 823 | $result = array(); |
|
- | 824 | $sSignID = $this->secure->checkInt($signID); |
|
- | 825 | ||
- | 826 | // Удаление подписи
|
|
- | 827 | $query = "DELETE FROM ".$this->prefix."signs WHERE sign_id='".$sSignID."'"; |
|
- | 828 | $rq =& $this->db->query($query); |
|
- | 829 | if (PEAR::isError($this->db)) { |
|
- | 830 | $result["ERR"] = 1; |
|
- | 831 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 832 | } else { |
|
- | 833 | $result["ERR"] = 0; |
|
- | 834 | }
|
|
- | 835 | ||
- | 836 | return $result; |
|
- | 837 | }
|
|
- | 838 | ||
- | 839 | /**
|
|
- | 840 | * Добавление новой секции
|
|
- | 841 | *
|
|
- | 842 | * @author Alexander Wolf
|
|
- | 843 | * @category Core
|
|
- | 844 | *
|
|
- | 845 | * @param string $sname
|
|
- | 846 | * @param string $sinfo
|
|
- | 847 | * @return array
|
|
- | 848 | */
|
|
- | 849 | public function addSection($sname, $sinfo = "") { |
|
- | 850 | $result = array(); |
|
- | 851 | $sSName = $this->secure->checkStr($sname,1); |
|
- | 852 | $sSInfo = $this->secure->checkStr($sinfo,1); |
|
- | 853 | ||
- | 854 | $query = "INSERT INTO ".$this->prefix."section SET secname='".$sSName."', sectinfo='".$sSInfo."'"; |
|
- | 855 | $rq =& $this->db->query($query); |
|
- | 856 | if (PEAR::isError($this->db)) { |
|
- | 857 | $result["ERR"] = 1; |
|
- | 858 | $result["ERRINFO"] = $this->db->getMessage(); |
|
- | 859 | } else { |
|
- | 860 | $result["ERR"] = 0; |
|
- | 861 | }
|
|
- | 862 | ||
- | 863 | return $result; |
|
- | 864 | }
|
|
- | 865 | /**
|
|
732 | * Проверка пароля (из формы авторизации)
|
866 | * Проверка пароля (из формы авторизации)
|
733 | *
|
867 | *
|
734 | * @author Alexander Wolf
|
868 | * @author Alexander Wolf
|
735 | * @category Core
|
869 | * @category Core
|
736 | *
|
870 | *
|
Строка 907... | Строка 1041... | ||
907 | $path = $url["path"]; |
1041 | $path = $url["path"]; |
908 | 1042 | ||
909 | return 0; |
1043 | return 0; |
910 | }
|
1044 | }
|
911 | 1045 | ||
- | 1046 | /**
|
|
- | 1047 | * Выгрузка картинок логотипов дистрибутивов
|
|
- | 1048 | *
|
|
- | 1049 | * @author Alexander Wolf
|
|
- | 1050 | * @category Core
|
|
- | 1051 | *
|
|
- | 1052 | * @param string $path
|
|
- | 1053 | * @param string $dist
|
|
- | 1054 | * @param array $datafile
|
|
- | 1055 | * @return integer
|
|
- | 1056 | */
|
|
912 | public function uploadPicture($path, $dist, $datafile) { |
1057 | public function uploadPicture($path, $dist, $datafile) { |
913 | $folder = $path.$dist."-orig.png"; |
1058 | $folder = $path.$dist."-orig.png"; |
914 | $folderN = $path.$dist.".png"; |
1059 | $folderN = $path.$dist.".png"; |
915 | $folderEM = $path.$dist."-em.png"; |
1060 | $folderEM = $path.$dist."-em.png"; |
916 | 1061 |