Хранилища Subversion ant

Редакция

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

Редакция 43 Редакция 45
Строка 25... Строка 25...
25
25
26
$query =& $db->query("SELECT * FROM settings WHERE opt LIKE 'version'");
26
$query =& $db->query("SELECT * FROM settings WHERE opt LIKE 'version'");
27
$query->fetchInto($antv, DB_FETCHMODE_ASSOC);
27
$query->fetchInto($antv, DB_FETCHMODE_ASSOC);
28
$antversion = $antv["optvalue"];
28
$antversion = $antv["optvalue"];
29
29
-
 
30
$scripts = "
-
 
31
(function($){
-
 
32
  // очищаем select
-
 
33
  $.fn.clearSelect = function() {
-
 
34
          return this.each(function(){
-
 
35
                  if(this.tagName=='SELECT') {
-
 
36
                      this.options.length = 0;
-
 
37
                      $(this).attr('disabled','disabled');
-
 
38
                  }
-
 
39
          });
-
 
40
  }
-
 
41
  // заполняем select
-
 
42
  $.fn.fillSelect = function(dataArray) {
-
 
43
          return this.clearSelect().each(function(){
-
 
44
                  if(this.tagName=='SELECT') {
-
 
45
                          var currentSelect = this;
-
 
46
                          $.each(dataArray,function(index,data){
-
 
47
                                  var option = new Option(data.text,data.value);
-
 
48
                                  if($.support.cssFloat) {
-
 
49
                                          currentSelect.add(option,null);
-
 
50
                                  } else {
-
 
51
                                          currentSelect.add(option);
-
 
52
                                  }
-
 
53
                          });
-
 
54
                  }
-
 
55
          });
-
 
56
  }
-
 
57
})(jQuery);
-
 
58
</script>
-
 
59
<script type='text/javascript'>
-
 
60
$(document).ready(function(){
-
 
61
  // выбор дистрибутива
-
 
62
  function adjustDistro(){
-
 
63
        var distroValue = $('#distro').val();
-
 
64
        var tmpSelect = $('#distver');
-
 
65
        if(distroValue.length == 0) {
-
 
66
                tmpSelect.attr('disabled','disabled');
-
 
67
                tmpSelect.clearSelect();
-
 
68
                adjustReps();
-
 
69
                $('#replist').css('display','none');
-
 
70
        } else {
-
 
71
                $.getJSON('m-process.php',{d:distroValue,status:1},function(data) { tmpSelect.fillSelect(data).attr('disabled',''); adjustReps(); });
-
 
72
                $('#replist').css('display','none');
-
 
73
        }
-
 
74
  };
-
 
75
  // Выбор версии дистрибутива
-
 
76
  function adjustReps(){
-
 
77
        var distroValue = $('#distro').val();
-
 
78
        var versionValue = $('#distver').val();
-
 
79
        if (distroValue != 0 && versionValue != 0) {
-
 
80
                $.get('m-process.php',{d:distroValue,v:versionValue,status:2},function(data){ $('#replist').css('display','block'); $('#replist').html(data); },'html');
-
 
81
        }
-
 
82
  }
30
83

31
$scripts  = '
-
 
32
        $(document).ready(function() {
84
  $('#distro').change(adjustDistro);
33
                var options = {
-
 
34
                        target:        "#modern",    
-
 
35
                        success:       showResponse
-
 
36
                };
-
 
37
                $("#distro").ajaxForm(options);
85
  $('#distver').change(adjustReps);
38
        });
-
 
39

86

40
        function showResponse(responseText, statusText)  {
-
 
41
                //$("#modern").replaceAll(responseText);
-
 
42
        }
87
});
43
';
88
";
44
89
45
$linux = "<p><input type='hidden' name='step' value='1' /></p>";
-
 
46
$query =& $db->query("SELECT * FROM distribution");
90
$query =& $db->query("SELECT * FROM distribution");
47
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
91
while ($query->fetchInto($data, DB_FETCHMODE_ASSOC)) {
48
        $linux .= "<p><input type='radio' name='d' value='".$data["dist_id"]."' />".stripslashes($data["distname"])."</p>\n";
92
        $linux .= "<option value='".$data["dist_id"]."'>".stripslashes($data["distname"])."</option>\n";
49
}
93
}
50
94
-
 
95
$modern .= "<h2>Генератор sources.list</h2>";
51
$modern  = "<div id='ant'><div id='modern'>";
96
$modern .= "<div class='border'>";
52
-
 
53
$modern .= "<h2>Выбор дистрибутива</h2>";
97
$modern .= "<label>Дистрибутив</label><br />";
54
$modern .= "<form action='./m-process.php' method='post' id='distro'>";
98
$modern .= "<select id='distro'>\n<option value=''>Выбрать дистрибутив</option>\n";
55
$modern .= $linux;
99
$modern .= $linux."</select>";
-
 
100
$modern .= "</div><div class='border'>";
56
$modern .= "<p><input type='submit' value=' Выбрать дистрибутив '></p>";
101
$modern .= "<label>Версия дистрибутива</label><br />";
-
 
102
$modern .= "<select id='distver' disabled='disabled'>\n";
57
$modern .= "</form>";
103
$modern .= "</select></div>";
58
-
 
59
$modern .= "</div></div>";
104
$modern .= "<pre id='replist'></pre></div>";
60
105
61
$smarty->assign('modern',$modern);
106
$smarty->assign('modern',$modern);
62
$smarty->assign('scripts',$scripts);
107
$smarty->assign('scripts',$scripts);
63
$smarty->assign('antversion',$antversion);
108
$smarty->assign('antversion',$antversion." &bull; <a href='./classic.php'>Классический интерфейс</a>");
64
109
65
$smarty->display('modern.tpl');
110
$smarty->display('modern.tpl');
66
111
67
?>
112
?>