本文整理汇总了PHP中site::next_flow_btn方法的典型用法代码示例。如果您正苦于以下问题:PHP site::next_flow_btn方法的具体用法?PHP site::next_flow_btn怎么用?PHP site::next_flow_btn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类site
的用法示例。
在下文中一共展示了site::next_flow_btn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* 添加新商户
*/
public function add()
{
/* 只允许root和管理员执行 */
if (!role::is_root()) {
role::check('manage_merchant');
$manager = Mymanager::instance($this->manager_id)->get();
if (!$manager['is_admin']) {
remind::set(Kohana::lang('o_manage.only_admin_do'), 'manage/manager');
}
}
$next_flow = site::next_flow(self::CURRENT_FLOW);
if ($_POST) {
//echo "<pre>";print_r($this->input->post());die();
$role_id = intval($this->input->post('role_id'));
$submit_target = intval($this->input->post('submit_target'));
//标签过滤
tool::filter_strip_tags($_POST);
$password1 = $this->input->post('password1');
$password2 = $this->input->post('password2');
$username = $this->input->post('username');
$email = $this->input->post('email');
$manager = Mymanager::instance()->get_by_username($username);
if ($manager['id']) {
remind::set(Kohana::lang('o_manage.name_has_exist'), 'manage/manager/add');
}
$manager = Mymanager::instance()->get_by_email($email);
if ($manager['id']) {
remind::set(Kohana::lang('o_manage.email_has_exist'), 'manage/manager/add');
}
//验证两次密码是否相同
if ($password1 != $password2) {
remind::set(Kohana::lang('o_manage.two_pwd_not_valid'), 'manage/manager/add');
} else {
$_POST['password'] = $password1;
}
$_POST['parent_id'] = $this->manager_id;
if (Mymanager::instance()->add($_POST)) {
//判断添加成功去向
switch ($submit_target) {
case 1:
remind::set(Kohana::lang('o_global.add_success'), 'manage/manager/add', 'success');
case 2:
remind::set(Kohana::lang('o_global.add_success_into') . $next_flow['name'], $next_flow['url'], 'success');
case 3:
default:
if ($role_id == 0) {
$id = Mymanager::instance()->get('id');
remind::set(Kohana::lang('o_global.add_success'), 'manage/manager/rule/' . $id, 'success');
}
remind::set(Kohana::lang('o_global.add_success'), 'manage/manager', 'success');
}
} else {
$error = Mysite::instance()->error();
remind::set(Kohana::lang('o_global.add_error') . $error, 'manage/manager/add');
}
}
$where = array();
$where['type'] = 0;
$where['active'] = 1;
//zhu add
//在添加商家帐号时候只能显示一级的用户级别
$where['level_depth'] = 1;
$roles = Myrole::instance()->roles($where);
$this->template->content = new View("manage/manager_add");
$this->template->content->roles = $roles;
//show next flow button
$this->template->content->next_flow_btn = site::next_flow_btn(self::CURRENT_FLOW);
}