| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
class SH4_Conf_Html_Admin_View_Email |
| 3 |
{ |
| 4 |
protected $ui = NULL; |
| 5 |
protected $settings = NULL; |
| 6 |
|
| 7 |
public function __construct( |
| 8 |
HC3_Hooks $hooks, |
| 9 |
|
| 10 |
HC3_Ui $ui, |
| 11 |
HC3_Ui_Layout1 $layout, |
| 12 |
|
| 13 |
HC3_Settings $settings |
| 14 |
) |
| 15 |
{ |
| 16 |
$this->ui = $ui; |
| 17 |
$this->layout = $layout; |
| 18 |
|
| 19 |
$this->settings = $hooks->wrap($settings); |
| 20 |
$this->self = $hooks->wrap($this); |
| 21 |
} |
| 22 |
|
| 23 |
public function render() |
| 24 |
{ |
| 25 |
$pnames = array( 'email_from', 'email_fromname', 'email_html' ); |
| 26 |
foreach( $pnames as $pname ){ |
| 27 |
$values[$pname] = $this->settings->get($pname); |
| 28 |
} |
| 29 |
|
| 30 |
$inputs = array(); |
| 31 |
|
| 32 |
$inputs[] = $this->ui->makeInputText( 'email_from', '__Send Email From Address__', $values['email_from'] ); |
| 33 |
$inputs[] = $this->ui->makeInputText( 'email_fromname', '__Send Email From Name__', $values['email_fromname'] ); |
| 34 |
|
| 35 |
$formatOptions = array( |
| 36 |
'1' => 'HTML', |
| 37 |
'0' => '__Plain Text__', |
| 38 |
); |
| 39 |
$inputs[] = $this->ui->makeInputRadioSet( 'email_html', '__Email Format__', $formatOptions, $values['email_html'] ); |
| 40 |
|
| 41 |
$inputs = $this->ui->makeList( $inputs ); |
| 42 |
|
| 43 |
$out = $this->ui->makeForm( |
| 44 |
'admin/conf/email', |
| 45 |
$this->ui->makeList( |
| 46 |
array( $inputs, $this->ui->makeInputSubmit( '__Save__')->tag('primary') ) |
| 47 |
) |
| 48 |
); |
| 49 |
|
| 50 |
$this->layout |
| 51 |
->setContent( $out ) |
| 52 |
->setBreadcrumb( $this->self->breadcrumb() ) |
| 53 |
->setHeader( $this->self->header() ) |
| 54 |
// ->setMenu( $this->self->menu() ) |
| 55 |
; |
| 56 |
|
| 57 |
$out = $this->layout->render(); |
| 58 |
return $out; |
| 59 |
} |
| 60 |
|
| 61 |
public function header() |
| 62 |
{ |
| 63 |
$out = '__Email__'; |
| 64 |
return $out; |
| 65 |
} |
| 66 |
|
| 67 |
public function breadcrumb() |
| 68 |
{ |
| 69 |
$return = array(); |
| 70 |
$return['admin'] = array( 'admin', '__Administration__' ); |
| 71 |
return $return; |
| 72 |
} |
| 73 |
} |