model/*Handler.php and various other files

- rename $this->return to $this->result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1534 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent f38b10cd61
commit bb7a3ff04d

@ -81,7 +81,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && $active == '') {
header ("Location: " . $formconf['listview']);
exit;
} else {
$values = $handler->return;
$values = $handler->result;
$values[$id_field] = $edit;
}
}

@ -115,15 +115,15 @@ class AliasHandler extends PFAHandler {
$retval = parent::init($id);
# hide 'goto_mailbox' for non-mailbox aliases
# parent::init called view() before, so we can rely on having $this->return filled
# (only validate_new_id() is called from parent::init and could in theory change $this->return)
if ($this->new || $this->return['is_mailbox'] == 0) {
# parent::init called view() before, so we can rely on having $this->result filled
# (only validate_new_id() is called from parent::init and could in theory change $this->result)
if ($this->new || $this->result['is_mailbox'] == 0) {
$this->struct['goto_mailbox']['editable'] = 0;
$this->struct['goto_mailbox']['display_in_form'] = 0;
$this->struct['goto_mailbox']['display_in_list'] = 0;
}
if ( !$this->new && $this->return['is_mailbox'] && $this->admin_username != ''&& !authentication_has_role('global-admin') ) {
if ( !$this->new && $this->result['is_mailbox'] && $this->admin_username != ''&& !authentication_has_role('global-admin') ) {
# domain admins are not allowed to change mailbox alias $CONF['alias_control_admin'] = NO
# TODO: apply the same restriction to superadmins?
if (!Config::bool('alias_control_admin')) {
@ -369,7 +369,7 @@ class AliasHandler extends PFAHandler {
return false;
}
if ($this->return['is_mailbox']) {
if ($this->result['is_mailbox']) {
$this->errormsg[] = 'This alias belongs to a mailbox and can\'t be deleted.'; # TODO: make translatable
return false;
}

@ -32,8 +32,8 @@ class AliasdomainHandler extends PFAHandler {
$used_targets = array();
foreach ($this->allowed_domains as $dom) {
if (isset($this->return[$dom]) ) { # already used as alias_domain
$used_targets[$this->return[$dom]['target_domain']] = $this->return[$dom]['target_domain'];
if (isset($this->result[$dom]) ) { # already used as alias_domain
$used_targets[$this->result[$dom]['target_domain']] = $this->result[$dom]['target_domain'];
} else { # might be available
$this->struct['alias_domain']['options'][$dom] = $dom;
$this->struct['target_domain']['options'][$dom] = $dom;

@ -55,7 +55,7 @@ class MailboxHandler extends PFAHandler {
if ($this->new) {
$currentquota = 0;
} else {
$currentquota = $this->return['quotabytes']; # parent::init called ->view()
$currentquota = $this->result['quotabytes']; # parent::init called ->view()
}
$this->updateMaxquota($domain, $currentquota);

@ -493,13 +493,13 @@ abstract class PFAHandler {
* get the values of an item
* @param boolean (optional) - if false, $this->errormsg[] will not be filled in case of errors
* @return bool - true if item was found
* The data is stored in $this->return (as associative array of column => value)
* The data is stored in $this->result (as associative array of column => value)
* error messages (if any) are stored in $this->errormsg
*/
public function view($errors=true) {
$result = $this->read_from_db(array($this->id_field => $this->id) );
if (count($result) == 1) {
$this->return = $result[$this->id];
$this->result = $result[$this->id];
return true;
}
@ -514,12 +514,12 @@ abstract class PFAHandler {
* @param integer limit - maximum number of rows to return
* @param integer offset - number of first row to return
* @return bool - true if at least one item was found
* The data is stored in $this->return (as array of rows, each row is an associative array of column => value)
* The data is stored in $this->result (as array of rows, each row is an associative array of column => value)
*/
public function getList($condition, $limit=-1, $offset=-1) {
$result = $this->read_from_db($condition, $limit, $offset);
if (count($result) >= 1) {
$this->return = $result;
$this->result = $result;
return true;
}
@ -570,7 +570,7 @@ abstract class PFAHandler {
* @return return value of previously called method
*/
public function result() {
return $this->return;
return $this->result;
}

@ -174,7 +174,7 @@ class ViewTask extends Shell {
if ( ! $handler->view() ) {
$this->error("Error: Not Found", "The requested alias was not found!");
} else {
$result = $handler->return;
$result = $handler->result;
$this->out(sprintf("Entries for: %s\n", $address));
$this->out("Goto: \t");

@ -306,7 +306,7 @@ class ViewTask extends Shell {
}
# TODO: offer alternative output formats (based on parameter)
# TODO: whitespace fix - 8 lines below
$result = $handler->return;
$result = $handler->result;
$this->out(sprintf("Entries for: %s\n", $address));
$this->out("");
$this->out(sprintf("+%'-25s+%'-15s+%'-10s+%'-20s+%'-8s+%'-8s+%'-6s+",'','','','','','',''));

Loading…
Cancel
Save