Source for file sys_view_createsite.php

Documentation is available at sys_view_createsite.php


1 <?php
2 /**
3 * @author Jan H. Andersen <jha@ipwsystems.dk>
4 * @author Martin R. Larsen <mrl@ipwsystems.dk>
5 * @copyright {@link http://www.ipwsystems.dk/ IPW Systems a.s}
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @package METAjour
8 * @subpackage view
9 * $Id: sys_view_createsite.php,v 1.2 2005/02/14 12:45:52 jan Exp $
10 */
11
12 require_once('basic_view.php');
13 require_once('basic_field.php');
14 require_once('install/createsite.inc.php');
15
16 class sys_view_createsite extends basic_view {
17
18 function loadLanguage() {
19 basic_view::loadLanguage();
20 }
21
22 function titleBar() {
23 return '<div class="metatitle">'.$this->shadowtext('Create new company / site').'</div>';
24 }
25
26 function viewStart() {
27 return '<div class="metawindow">';
28 }
29
30 function viewEnd() {
31 return '</div>';
32 }
33
34 function beforeForm() {
35 return '<div class="metabox">';
36 }
37
38 function afterForm() {
39 return '</div>';
40 }
41
42 function view() {
43 $result .= $this->viewStart();
44 $result .= $this->titleBar();
45 $result .= $this->beforeForm();
46
47 if ($this->data['step'] == '2') {
48 $failure = false;
49 if ($this->data['password'] != $this->data['passwordcheck']) {
50 $result .= "Passwords doesn't match<BR>";
51 $failure = true;
52 }
53 if ($this->data['viewer_path'] == '') {
54 $result .= "You have to enter the path to the documentroot<BR>";
55 $failure = true;
56 }
57
58 if ($this->data['viewer_url'] == '') {
59 $result .= "You have to enter the URL for the site<BR>";
60 $failure = true;
61 }
62
63 if ($this->data['name'] == '') {
64 $result .= "You have to enter a name for the site<BR>";
65 $failure = true;
66 }
67
68 if ($this->data['username'] == '') {
69 $result .= "You have to enter af name for the administrator account<BR>";
70 $failure = true;
71 }
72
73 if (!$failure) {
74 $site = createSite($this->data['username'], $this->data['password'], $this->data['viewer_path'], $this->data['viewer_url'], $this->data['name']);
75 $result .= "<strong>Site has been created with number: ".$site."<BR>";
76 $result .= "Place this number as the value of \$site in site.php<P>";
77 $result .= "Copy the files index.php, showpage.php and site.php to ".$viewer_path."<P>";
78 $result .= "Remember to edit the \$viewer_path, \$viewer_url and \$site variables in site.php</strong>";
79 }
80 }
81
82 if ($this->data['step'] != '2' || $failure) {
83 $result .= '<form name="metaform" method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" style="margin: 0px; padding: 0px;">';
84 $result .= '<input type="hidden" name="_DONTCONVERT_" value="1">';
85 $result .= '<input type="hidden" name="step" value="2">';
86 $result .= $this->returnMePost();
87 $result .= $this->makeField('Name of site','<input type="text" name="name" size=60 value="MyWebsite, Inc.">');
88 $result .= $this->makeField('Absolute path to documentroot','<input type="text" name="viewer_path" size=60>');
89 $result .= $this->makeField('URL to site','<input type="text" name="viewer_url" size=60>');
90 $result .= $this->makeField('Administrator name','<input type="text" name="username" value="administrator">');
91 $result .= $this->makeField('Administrator password','<input type="password" name="password">');
92 $result .= $this->makeField('Repeat password','<input type="password" name="passwordcheck">');
93
94 $result .= $this->returnviewpost($this->view);
95 $result .= '<div style="padding-bottom: 14px;">';
96 $result .= '<input id="submit1" name="submit1" type="submit" class="mformsubmit" value="Create">';
97 $result .= '</div>';
98 $result .= '</form>';
99 }
100 $result .= '<br><br><br>';
101 $result .= $this->afterForm();
102 $result .= $this->viewEnd();;
103 return $result;
104 }
105 }
106
107 ?>

Documentation generated on Thu, 9 Jun 2005 06:53:52 +0200 by phpDocumentor 1.2.3