Processes window events and handles user interactions.
84 {
86
90
91 switch ($id) {
93 $bearsamppWinbinder->setText(
96 );
97 $bearsamppWinbinder->setEnabled($this->wbBtnSave[
WinBinder::CTRL_OBJ], empty($aliasName) ?
false : true);
98 break;
101 if ($aliasDest && is_dir($aliasDest)) {
103 $bearsamppWinbinder->setText(
106 );
107 }
108 break;
110 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_SAVE + 1);
111 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
112
113 if (!ctype_alnum($aliasName)) {
114 $bearsamppWinbinder->messageBoxError(
117 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
118 break;
119 }
120
121 if ($aliasName != $this->initName && is_file(
$bearsamppRoot->getAliasPath() .
'/' . $aliasName .
'.conf')) {
122 $bearsamppWinbinder->messageBoxError(
125 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
126 break;
127 }
128 if (file_put_contents(
$bearsamppRoot->getAliasPath() .
'/' . $aliasName .
'.conf',
$bearsamppBins->getApache()->getAliasContent($aliasName, $aliasDest)) !==
false) {
129 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
130
132 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
133
134 $bearsamppWinbinder->messageBoxInfo(
137 $bearsamppWinbinder->destroyWindow($window);
138 } else {
140 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
141 }
142 break;
144 $bearsamppWinbinder->setProgressBarMax($this->wbProgressBar, self::GAUGE_DELETE + 1);
145
147 $confirm = $bearsamppWinbinder->messageBoxYesNo(
149 $boxTitle);
150
151 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
152
153 if ($confirm) {
154 if (@unlink(
$bearsamppRoot->getAliasPath() .
'/' . $this->initName .
'.conf')) {
155 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
156
158 $bearsamppWinbinder->incrProgressBar($this->wbProgressBar);
159
160 $bearsamppWinbinder->messageBoxInfo(
162 $boxTitle);
163 $bearsamppWinbinder->destroyWindow($window);
164 } else {
165 $bearsamppWinbinder->messageBoxError(
167 $boxTitle);
168 $bearsamppWinbinder->resetProgressBar($this->wbProgressBar);
169 }
170 }
171 break;
172 case IDCLOSE:
174 $bearsamppWinbinder->destroyWindow($window);
175 break;
176 }
177 }
const ALIAS_NOT_VALID_ALPHA
const ALIAS_ALREADY_EXISTS
const ALIAS_CREATED_ERROR