Example #1
0
        Configuration::updateValue('TM_MAIL_PASSWD', $smtp_passwd);
    }
    if ($smtp_encryption = Tools::P('TM_MAIL_SMTP_ENCRYPTION')) {
        Configuration::updateValue('TM_MAIL_SMTP_ENCRYPTION', $smtp_encryption);
    }
    if ($smtp_port = Tools::P('TM_MAIL_SMTP_PORT')) {
        Configuration::updateValue('TM_MAIL_SMTP_PORT', $smtp_port);
    }
    UIAdminAlerts::conf('配置已更新');
}
if (isset($errors)) {
    UIAdminAlerts::MError($errors);
}
/** 导航 */
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('title' => '系统设置', 'active' => true));
$breadcrumb->add(array('title' => '邮件设置', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'button', 'title' => '保存', 'id' => 'save-email-form', 'class' => 'btn-success', 'icon' => 'save'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
?>
<script language="javascript">
	$("#save-email-form").click(function(){
		$("#email-form").submit();
	})
</script>
<?php 
$form = new UIAdminEditForm('post', 'index.php?rule=email', 'form-horizontal', 'base-form');
$form->items = array('TM_MAIL_METHOD' => array('title' => '网站名称', 'type' => 'radio', 'value' => Configuration::get('TM_MAIL_METHOD'), 'items' => array('1' => '使用PHP默认函数发送邮件', '2' => '设置为SMTP发送邮件')), 'TM_MAIL_DOMAIN' => array('title' => 'SMTP域名', 'type' => 'text', 'value' => Configuration::get('TM_MAIL_DOMAIN')), 'TM_MAIL_SERVER' => array('title' => 'SMTP服务器', 'type' => 'text', 'value' => Configuration::get('TM_MAIL_SERVER')), 'TM_MAIL_USER' => array('title' => 'SMTP用户名', 'type' => 'text', 'value' => Configuration::get('TM_MAIL_USER')), 'TM_MAIL_PASSWD' => array('title' => 'SMTP密码', 'type' => 'password', 'value' => ''), 'TM_MAIL_SMTP_ENCRYPTION' => array('title' => 'SMTP加密方式', 'type' => 'radio', 'value' => Configuration::get('TM_MAIL_SMTP_ENCRYPTION'), 'items' => array('tls' => 'TLS', 'ssl' => 'SSL')), 'TM_MAIL_SMTP_PORT' => array('title' => 'SMTP端口', 'type' => 'text', 'value' => Configuration::get('TM_MAIL_SMTP_PORT')), 'saveEmail' => array('type' => 'hidden', 'value' => 'update'));
echo UIViewBlock::area(array('col' => 'col-md-12', 'title' => '编辑', 'body' => $form->draw()), 'panel');
Example #2
0
echo UIAdminDndTable::loadHead();
$table = new UIAdminDndTable('currency', 'Currency', 'id_currency');
$table->addAttribte('id', 'currency');
$table->header = array(array('sort' => false, 'isCheckAll' => 'itemsBox[]'), array('name' => 'id_currency', 'title' => 'ID', 'filter' => 'string'), array('name' => 'name', 'title' => '名称', 'filter' => 'string'), array('name' => 'conversion_rate', 'title' => '汇率', 'filter' => 'string'), array('name' => 'iso_code', 'title' => 'ISO代码', 'filter' => 'string'), array('name' => 'sign', 'title' => '货币符号', 'filter' => 'string'), array('name' => 'active', 'title' => '状态', 'filter' => 'bool'), array('name' => 'position', 'title' => '排序'), array('name' => 'add_date', 'title' => '添加时间'), array('sort' => false, 'title' => '操作', 'class' => 'text-right', 'isAction' => array('edit', 'delete')));
$filter = $table->initFilter();
$orderBy = isset($_GET['orderby']) ? Tools::G('orderby') : 'position';
$orderWay = isset($_GET['orderway']) ? Tools::G('orderway') : 'asc';
$limit = $cookie->getPost('pagination') ? $cookie->getPost('pagination') : '50';
$p = Tools::G('p') ? Tools::G('p') == 0 ? 1 : Tools::G('p') : 1;
$result = Currency::loadData($p, $limit, $orderBy, $orderWay, $filter);
/** 输出错误信息 */
if (isset($errors)) {
    UIAdminAlerts::MError($errors);
}
/** 导航 */
$breadcrumb = new UIAdminBreadcrumb();
$breadcrumb->home();
$breadcrumb->add(array('title' => '系统设置', 'active' => true));
$breadcrumb->add(array('title' => '基本设置', 'active' => true));
$bread = $breadcrumb->draw();
$btn_group = array(array('type' => 'a', 'title' => '新货币', 'href' => 'index.php?rule=currency_edit', 'class' => 'btn-success', 'icon' => 'plus'));
echo UIViewBlock::area(array('bread' => $bread, 'btn_groups' => $btn_group), 'breadcrumb');
/** 输出列表 */
echo UIViewBlock::area(array('title' => '货币', 'table' => $table, 'result' => $result, 'limit' => $limit), 'table');
$form = new UIAdminEditForm('post', 'index.php?rule=currency', 'form-horizontal', 'base-form');
$currencys = array();
foreach ($result['items'] as $currency) {
    $currencys[$currency['id_currency']] = $currency['name'];
}
$form->items = array('ID_CURRENCY_DEFAULT' => array('title' => '默认货币', 'type' => 'select', 'value' => Configuration::get('ID_CURRENCY_DEFAULT'), 'option' => $currencys), 'saveDefault' => array('type' => 'submit', 'class' => 'btn-success', 'icon' => 'save', 'title' => '保存'));
echo UIViewBlock::area(array('title' => '默认货币', 'body' => $form->draw()), 'panel');