Changeset 256
- Timestamp:
- 04/10/08 00:29:05 (9 months ago)
- Files:
-
- trunk/Framework/Module/Domains.php (modified) (9 diffs)
- trunk/Framework/Module/Domains/Templates/Default/addDomain.tpl (modified) (1 diff)
- trunk/Framework/Module/Domains/Templates/Default/domainConfirmDelete.tpl (modified) (1 diff)
- trunk/Framework/Module/Domains/Templates/Default/domainMenu.tpl (modified) (1 diff)
- trunk/Framework/Module/Domains/Templates/Default/listDomains.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Framework/Module/Domains.php
r246 r256 5 5 * Framework_Module_Domains 6 6 * 7 * This module is for viewing and editing vpopmail domains 8 * 9 * @uses ToasterAdmin_Auth_System 10 * @package ToasterAdmin 11 * @author Bill Shupp <hostmaster@shupp.org> 12 * @copyright 2007 Bill Shupp 13 * @license GPL 2.0 {@link http://www.gnu.org/licenses/gpl.txt} 14 * @link http://trac.merchbox.com/trac/toasteradmin 7 * PHP Version 5.1.0+ 8 * 9 * @uses ToasterAdmin_Auth_System 10 * @category Mail 11 * @package ToasterAdmin 12 * @subpackage Module 13 * @author Bill Shupp <hostmaster@shupp.org> 14 * @copyright 2007-2008 Bill Shupp 15 * @license GPL 2.0 {@link http://www.gnu.org/licenses/gpl.txt} 16 * @link http://trac.merchbox.com/trac/toasteradmin 15 17 */ 16 18 … … 21 23 * This module is for viewing and editing vpopmail domains 22 24 * 23 * @uses ToasterAdmin_Auth_System 24 * @package ToasterAdmin 25 * @author Bill Shupp <hostmaster@shupp.org> 26 * @copyright 2007 Bill Shupp 27 * @license GPL 2.0 {@link http://www.gnu.org/licenses/gpl.txt} 28 * @link http://trac.merchbox.com/trac/toasteradmin 25 * @uses ToasterAdmin_Auth_System 26 * @category Mail 27 * @package ToasterAdmin 28 * @subpackage Module 29 * @author Bill Shupp <hostmaster@shupp.org> 30 * @copyright 2007-2008 Bill Shupp 31 * @license GPL 2.0 {@link http://www.gnu.org/licenses/gpl.txt} 32 * @link http://trac.merchbox.com/trac/toasteradmin 29 33 */ 30 34 class Framework_Module_Domains extends ToasterAdmin_Auth_System … … 36 40 * Run listDomains() 37 41 * 38 * @access public39 * @return mixed42 * @access public 43 * @return mixed 40 44 */ 41 45 public function __default() … … 59 63 60 64 // Build domain list 61 $domainArray = $this->user->listDomains($this->data['currentPage'],$this->data['limit']); 62 $domains = array(); 63 $count = 0; 64 while (list($key,$val) = each($domainArray)) { 65 $domains[$count]['name'] = $key; 66 $domains[$count]['limits_url'] = htmlspecialchars('./?module=Main&class=Limits&domain=' . $key); 67 $domains[$count]['menu_url'] = htmlspecialchars('./?module=Domains&class=Menu&domain=' . $key); 68 $domains[$count]['delete_url'] = htmlspecialchars('./?module=Domains&event=delDomain&domain=' . $key); 69 $count++; 70 } 71 $this->setData('domains', $domains); 72 $this->setData('add_domain_url', htmlspecialchars("./?module=Domains&event=addDomain")); 73 74 // Language 75 $this->setData('LANG_Add_Domain', _('Add Domain')); 76 $this->setData('LANG_Domains_Page', _('Domains: Page')); 77 $this->setData('LANG_of', _('of')); 78 $this->setData('LANG_edit_domain', _('edit domain')); 79 $this->setData('LANG_delete_domain', _('delete domain')); 80 65 $list = $this->user->listDomains($this->data['currentPage'], 66 $this->data['limit']); 67 $a = array(); 68 $c = 0; 69 foreach ($list as $key => $val) { 70 $lus = './?module=Main&class=Limits&domain=' . $key; 71 $mus = './?module=Domains&class=Menu&domain=' . $key; 72 $dus = './?module=Domains&event=delDomain&domain=' . $key; 73 74 $a[$c]['name'] = $key; 75 $a[$c]['limits_url'] = htmlspecialchars($lus); 76 $a[$c]['menu_url'] = htmlspecialchars($mus); 77 $a[$c]['delete_url'] = htmlspecialchars($dus); 78 $c++; 79 } 80 $this->setData('domains', $a); 81 $this->setData('add_domain_url', 82 htmlspecialchars("./?module=Domains&event=addDomain")); 81 83 $this->tplFile = 'listDomains.tpl'; 82 84 return; … … 116 118 // Add domain 117 119 try { 118 $result = $this->user->addDomain($form->getElementValue('domain'), $form->getElementValue('password')); 120 $result = $this->user->addDomain($form->getElementValue('domain'), 121 $form->getElementValue('password')); 119 122 } catch (Net_Vpopmaild_Exception $e) { 120 123 $this->setData('message', _("Error: ") . $e->getMessage()); 121 124 return $this->addDomain(); 122 125 } 123 header('Location: ./?module=Domains&class=Menu&success&domain=' . $form->getElementValue('domain')); 126 header('Location: ./?module=Domains&class=Menu&success&domain=' 127 . $form->getElementValue('domain')); 124 128 return; 125 129 } … … 128 132 * addDomainForm 129 133 * 130 * create add domain form 131 * 132 * @access private 133 * @return void 134 */ 135 private function addDomainForm() 136 { 137 $form = new HTML_QuickForm('formLogin', 'post', './?module=Domains&event=addDomainNow'); 134 * Create add domain form. 135 * 136 * @access protected 137 * @return object HTML_QuickForm object 138 */ 139 protected function addDomainForm() 140 { 141 $form = new HTML_QuickForm('formLogin', 'post', 142 './?module=Domains&event=addDomainNow'); 138 143 139 144 $form->addElement('text', 'domain', _('Domain')); … … 141 146 $form->addElement('submit', 'submit', _('Add Domain')); 142 147 143 $form->addRule('domain', _('Please a domain name'), 'required', null, 'client'); 144 $form->addRule('password', _('Please enter a postmaster password'), 'required', null, 'client'); 148 $form->addRule('domain', _('Please a domain name'), 149 'required', null, 'client'); 150 $form->addRule('password', _('Please enter a postmaster password'), 151 'required', null, 'client'); 145 152 $form->applyFilter('__ALL__', 'trim'); 146 153 … … 163 170 } 164 171 165 $this->setData('LANG_Are_you_sure_you_want_to_delete_this_domain', _("Are you sure you want to delete this domain?")); 166 $this->setData('LANG_cancel', _("cancel")); 167 $this->setData('LANG_delete', _("delete")); 168 169 $this->setData('delete_url', htmlspecialchars("./?module=Domains&event=delDomainNow&domain=" . $this->domain)); 170 $this->setData('cancel_url', htmlspecialchars("./?module=Domains&event=cancelDelDomain")); 172 $dus = "./?module=Domains&event=delDomainNow&domain=" . $this->domain; 173 $cus = "./?module=Domains&event=cancelDelDomain"; 174 $this->setData('delete_url', htmlspecialchars($dus)); 175 $this->setData('cancel_url', htmlspecialchars($cus)); 171 176 $this->tplFile = 'domainConfirmDelete.tpl'; 172 177 … … 207 212 * @return void 208 213 */ 209 public function cancelDelDomain() { 214 public function cancelDelDomain() 215 { 210 216 $this->setData('message', _("Domain deletion canceled")); 211 217 return $this->listDomains(); 212 218 } 213 219 220 /** 221 * _renderForm 222 * 223 * Render Add Domain form 224 * 225 * @param object $form HTML_QuickForm object 226 * 227 * @access private 228 * @return void 229 */ 214 230 private function _renderForm($form) 215 231 { 216 232 $this->tplFile = 'addDomain.tpl'; 217 233 $this->setData('addDomainForm', $form->toHtml()); 218 $this->setData('LANG_Main_Menu', _('Main Menu'));219 $this->setData('LANG_List_Domains', _('List Domains'));220 234 } 221 235 trunk/Framework/Module/Domains/Templates/Default/addDomain.tpl
r228 r256 8 8 {$addDomainForm} 9 9 <br /> 10 <a href="./?module=Domains">{ $LANG_List_Domains}</a> | <a href="./?module=Main">{$LANG_Main_Menu}</a>10 <a href="./?module=Domains">{t}List Domains{/t}</a> | <a href="./?module=Main">{t}Main Menu{/t}</a> 11 11 </div> 12 12 <div class="boxbottom"></div> trunk/Framework/Module/Domains/Templates/Default/domainConfirmDelete.tpl
r74 r256 1 1 <div class="boxtop"></div> 2 2 <div class="box"> 3 { $LANG_Are_you_sure_you_want_to_delete_this_domain}3 {t}Are you sure you want to delete this domain?{/t} 4 4 <br /><br /> 5 5 {$domain} 6 6 <br /><br /> 7 <a href="{$cancel_url}">{ $LANG_cancel}</a>   |   <a href="{$delete_url}">{$LANG_delete}</a>7 <a href="{$cancel_url}">{t}cancel{/t}</a>   |   <a href="{$delete_url}">{t}delete{/t}</a> 8 8 </div> 9 9 <div class="boxbottom"></div> trunk/Framework/Module/Domains/Templates/Default/domainMenu.tpl
r227 r256 11 11 <tr><td class="border"> 12 12 <ul> 13 <li><a href="{$list_accounts_url}">{ $LANG_Email_Accounts}</a></li>14 <li><a href="{$list_forwards_url}">{ $LANG_Forwards}</a></li>15 <li><a href="{$list_responders_url}">{ $LANG_Auto_Responders}</a></li>16 <!-- <li><a href="{$list_lists_url}">{ $LANG_Mailing_Lists}</a></li> -->13 <li><a href="{$list_accounts_url}">{t}Email Accounts{/t}</a></li> 14 <li><a href="{$list_forwards_url}">{t}Forwards{/t}</a></li> 15 <li><a href="{$list_responders_url}">{t}Auto Responders{/t}</a></li> 16 <!-- <li><a href="{$list_lists_url}">{t}Mailing Lists{/t}</a></li> --> 17 17 </ul> 18 18 </td> 19 19 </tr> 20 20 </table> 21 {if $isSysAdmin}<a href="./?module=Domains">{ $LANG_Domain_List}</a>{/if}21 {if $isSysAdmin}<a href="./?module=Domains">{t}Domain List{/t}</a>{/if} 22 22 </div> 23 23 <div class="boxbottom"></div> trunk/Framework/Module/Domains/Templates/Default/listDomains.tpl
r246 r256 2 2 <div class="boxtop"></div> 3 3 <div class="box"> 4 <strong><a href="{$add_domain_url}">{ $LANG_Add_Domain}</a></strong>4 <strong><a href="{$add_domain_url}">{t}Add Domain{/t}</a></strong> 5 5 </div> 6 6 <div class="boxbottom"></div> … … 9 9 <div class="boxtopDomains"> 10 10 <div class="boxtopDomainscontent"> 11 <h1>{ $LANG_Domains_Page} {$currentPage} {$LANG_of} {$totalPages}</h1>11 <h1>{t}Domains: Page{/t} {$currentPage} {t}of{/t} {$totalPages}</h1> 12 12 {framework_pager start=$start limit=$limit total=$total} 13 13 </div>
