From 4023001a68b3d85891ab744eb77e7b22a9dd8e3f Mon Sep 17 00:00:00 2001 From: jimmacfx Date: Fri, 25 Nov 2005 22:16:10 +0000 Subject: import original 0.11 git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@2 4fa712ea-3c06-0410-9261-c11b4c06c003 --- www/inc/www.class.inc.php | 210 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 www/inc/www.class.inc.php (limited to 'www/inc/www.class.inc.php') diff --git a/www/inc/www.class.inc.php b/www/inc/www.class.inc.php new file mode 100644 index 0000000..6fa319e --- /dev/null +++ b/www/inc/www.class.inc.php @@ -0,0 +1,210 @@ +bgcolor = $bgcolor; + $this->link = $link; + $this->vlink = $vlink; + $this->alink = $alink; + $this->hover = $hover; + $this->font = $font; + $this->fontsize = $fontsize; + $this->textcol = $textcol; + } + + //// + // !vykpise HTML hlavicku dokumentu + // Ten CSS style jeste neni moc dodelanej + function header($title) { + global $gallery_dir,$root, $snimek, $galerie, $ThisScript, $themes; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo " $title\n"; + # mozilla style links + if ($snimek && $galerie) { + #Top + echo " \n"; + #First + #Prev + $predchozi = $snimek - 1; + $dalsi = $snimek + 1; + if ($snimek > 1) { + echo " \n"; + echo " \n"; + } + #Next + if (is_file("$gallery_dir/$galerie/lq/img-$dalsi.jpg")) { + echo " \n"; + } + #Last + $adr = opendir("$gallery_dir/$galerie/thumbs/"); + $i = -2; + while ($file = readdir($adr)) { + $i++; + } + if ($i!=$snimek) { + echo " \n"; + } + } + + /* check the theme in a cookie */ + $theme = $_COOKIE["theme"]; + if (!$theme) { //we didn't set the cookie yet + if (browserCheck()=="ie6+" || browserCheck()=="ie4+") { + $theme = "ie"; //IE crashes on other themes + } else { + $theme = "default"; + } + } + foreach ($themes as $skin => $url) { + echo "\n"; + } + + require("javascript.inc.php"); + echo "\n\n"; + echo "\n"; + } + + //// + // !zavre html stranku + function footer() { + echo "\n"; + echo "\n"; + } + + //// + // !vypise chybovou hlasku + // $title - nadpis a title HTML stranky + // $message - vlastni chybova hlaska + function error($title, $message) { + $this->header($title); + echo "

$title

\n"; + echo $message; + $this->footer(); + exit; //vysere se na vsechno + } + + + + //// + // !zacatek fomrulare + function form_start($action, $method, $upload) { + echo "
\n"; + echo "\n"; + } + + //// + // !konec formulare + function form_end() { + echo "
\n"; + echo "
\n"; + } + + //// + // !vykresli polozku formulare + // umi text, password, submit, file, hidden, textarea, select + // u textarea je default pocet radku... + function input($type, $name, $value, $popis, $default) { + if ($type!="hidden") { + echo "\n"; + echo "$popis\n"; + echo ""; + } + switch ($type) { + case "checkbox": + echo ""; + break; + case "password": + case "text": + echo ""; + break; + case "file": + echo ""; + break; + case "hidden": + echo "\n"; + break; + case "textarea": + echo ""; + break; + case "select": + echo ""; + break; + case "submit": + echo ""; + break; + } + if ($type!="hidden") { + echo "\n"; + echo "\n"; + } + } + + +} + +# return dirs sorted +class SortDir { + var $items; + + function SortDir($directory) { + $handle=opendir($directory); + while ($file = readdir($handle)) { + if ($file != "." && $file != "..") { + $this->items[]=$file; + } + } + closedir($handle); + natsort($this->items); + } + + function Read() { + $getback= (pos($this->items)); + next($this->items); + return $getback; + } +} + +?> -- cgit v1.2.3