File: screenshot.php

package info (click to toggle)
dvdisaster 0.72.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 20,088 kB
  • ctags: 6,526
  • sloc: ansic: 29,301; php: 3,324; sh: 370; xml: 296; makefile: 73; cs: 33
file content (191 lines) | stat: -rw-r--r-- 6,309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?php
#  dvdisaster homepage: Screen shot helper routines
#  Copyright (C) 2007-2012 Carsten Gnörlich
#
# UTF-8 trigger: äöüß 
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
#  or direct your browser at http://www.gnu.org.

$screen_shot_counter = 0;

#
# Screen shots for showing preferences windows
#

function begin_screen_shot($caption, $image)
{  global $screen_shot_counter;
   global $screen_shot_image;
   global $screen_shot_caption;
   global $screen_shot_expand;
   global $screen_shot_way;

   $screen_shot_expand=$_GET["expand"];
   $screen_shot_way=$_GET["way"];
   $screen_shot_counter++;
   $screen_shot_image = $image;
   $screen_shot_caption = $caption;

   echo "<!-- begin of screen shot -->\n";

   # Screen version (large image)

   if($screen_shot_counter == $screen_shot_expand)
   {  echo "<table class=\"screenshot\">\n";
      echo "  <tr><td>\n";
      echo "    <a name=\"snap$screen_shot_counter\"></a>\n";
   }

   # Thumbnail version

   else
   {  echo "<table>\n";
      echo "  <tr>\n";
      echo "    <td class=\"valignt\">\n";
   }
}

function end_screen_shot()
{  global $screen_shot_counter;
   global $screen_shot_image;
   global $screen_shot_caption;
   global $screen_shot_expand;
   global $screen_shot_way;
   global $script_file;
   global $trans_screen_shot;

   if($screen_shot_counter == $screen_shot_expand)
   {  echo "  </td></tr>\n";
      echo "  <tr><td align=\"center\">\n";
      if($screen_shot_way != "")
	   echo "    <a href=\"${script_file}?way=$screen_shot_way&#snap${screen_shot_counter}\">\n";
      else echo "    <a href=\"${script_file}#snap${screen_shot_counter}\">\n";
      echo "      <img src=\"images/$screen_shot_image\" alt=\"\" class=\"noborder\">\n";
      echo "    </a>\n";
      echo "  </td></tr>\n";
      echo "  <tr><td align=\"center\">$trans_screen_shot: $screen_shot_caption</td></tr>\n";
      echo "</table>";
      echo "<pre> </pre>\n";
   }
   else
   {  echo "    </td>\n";
      echo "    <td>\n";
      echo "      <a name=\"snap${screen_shot_counter}\"></a>\n";
      echo "      <table class=\"thumbnail\" width=\"160\">\n";
      echo "        <tr><td><span class=\"fs\">$screen_shot_caption</span></td></tr>\n";
      if($screen_shot_way != "")
	   echo "        <tr><td><a href=\"${script_file}?way=$screen_shot_way&expand=${screen_shot_counter}#snap${screen_shot_counter}\">";
      else echo "        <tr><td><a href=\"${script_file}?expand=${screen_shot_counter}#snap${screen_shot_counter}\">";
      echo "<img src=\"thumbnails/$screen_shot_image\" alt=\"\" class=\"noborder\"></a>";
      echo "</td></tr>\n";
      echo "      </table>\n";
      echo "    </td>\n";
      echo "  </tr>\n";
      echo "</table><p>\n";
   }

   echo "<!-- end of screen shot -->\n";
}


#
# Smaller screen shots for the howtos
#

function begin_howto_shot($caption, $image, $arrow)
{  global $screen_shot_counter;
   global $screen_shot_image;
   global $screen_shot_caption;
   global $screen_shot_expand;
   global $screen_shot_arrow;
   global $screen_shot_way;

   $screen_shot_expand=$_GET["expand"];
   $screen_shot_way=$_GET["way"];
   $screen_shot_counter++;
   $screen_shot_image = $image;
   $screen_shot_caption = $caption;
   $screen_shot_arrow = $arrow;

   echo "<!-- begin of screen shot -->\n";

   # Screen version (large image)

   if($screen_shot_counter == $screen_shot_expand)
   {  echo "<table class=\"screenshot\">\n";
      echo "  <tr><td>\n";
      echo "    <a name=\"snap$screen_shot_counter\"></a>\n";
   }

   # Thumbnail version

   else
   {  echo "<table>\n";
      echo "  <tr>\n";
      echo "    <td class=\"w200x\" align=\"center\">\n";
      echo "      <a name=\"snap${screen_shot_counter}\"></a>\n";
      if($screen_shot_way != "")
	   echo "      <a href=\"${script_file}?way=$screen_shot_way&expand=${screen_shot_counter}#snap${screen_shot_counter}\">";
      else echo "      <a href=\"${script_file}?expand=${screen_shot_counter}#snap${screen_shot_counter}\">";
      echo "       <img src=\"thumbnails/$image\" alt=\"\" class=\"noborder\">\n";
      if($screen_shot_arrow != "")
	 echo "       <br><img src=\"../images/$arrow\" alt=\"\" class=\"noborder\">\n";
      echo "      </a>\n";
      echo "    </td><td>&nbsp; &nbsp;</td>\n";
      echo "    <td class=\"valignt\">\n";
   }
}

function end_howto_shot()
{  global $screen_shot_counter;
   global $screen_shot_image;
   global $screen_shot_caption;
   global $screen_shot_expand;
   global $screen_shot_way;
   global $screen_shot_arrow;
   global $script_file;
   global $trans_screen_shot;

   if($screen_shot_counter == $screen_shot_expand)
   {  echo "  </td></tr>\n";
      echo "  <tr><td align=\"center\">\n";
      if($screen_shot_way != "")
	   echo "    <a href=\"${script_file}?way=$screen_shot_way&expand=0#snap${screen_shot_counter}\">\n";
      else echo "    <a href=\"${script_file}?expand=0#snap${screen_shot_counter}\">\n";
      echo "      <img src=\"images/$screen_shot_image\" alt=\"\" class=\"noborder\">\n";
      echo "    </a>\n";
      echo "  </td></tr>\n";
      echo "  <tr><td align=\"center\">$trans_screen_shot: $screen_shot_caption</td></tr>\n";
      echo "</table>";

      if($screen_shot_arrow != "")
      {  	 echo "<table>\n";
	 echo "  <tr>\n";
	 echo "    <td class=\"w200x\" align=\"center\">\n";
	 echo "      <img src=\"../images/$screen_shot_arrow\" alt=\"\" class=\"noborder\">\n";
	 echo "    </td>\n";
	 echo "  </tr>\n";
	 echo "</table>\n";
      }
   }
   else
   {  echo "    </td>\n";
      echo "  </tr>\n";
      echo "</table><p>\n";
   }

   echo "<!-- end of screen shot -->\n";
}
?>