protected function module_register() { if ($this->module_is_logedin()) { header("Location:" . core\general::create_url(array('plugin', 'users', 'action', 'profile'))); } elseif ($this->settings['register'] == '0') { //new register was closed $msg = new msg(); return $msg->msg('Warrning!', 'Register new user was closed by Administrator.', 'danger'); } return $this->view_register(); }
protected function view_dashboard() { //Assign variables $this->raintpl->assign("BasicSettings", _('Basic Settings')); $this->raintpl->assign("RegionalandLanguages", _('Regional and Languages')); $this->raintpl->assign("Appearance", _('Appearance')); $this->raintpl->assign("Plugins", _('Plugins')); $this->raintpl->assign("Blocks", _('Blocks')); $this->raintpl->assign("Usersandpermissions", _('Users and permissions')); $this->raintpl->assign("url_regional", _('Author')); $this->raintpl->assign("url_appearance", core\general::create_url(array('service', '1', 'plugin', 'administrator', 'action', 'main', 'p', 'administrator', 'a', 'themes'))); $this->raintpl->assign("url_plugins", _('Author')); $this->raintpl->assign("url_blocks", _('Author')); $this->raintpl->assign("url_uap", _('Author')); $this->raintpl->assign("url_basic", _('Author')); //draw and return back content return array(_('Dashboard'), $this->raintpl->draw('core_dashboard', true)); }
public static function core_menu() { $menus = [[core\general::create_url(array('service', '1', 'plugin', 'administrator', 'action', 'main', 'p', 'administrator', 'a', 'dashboard')), _('Dashboard')], [\core\cls\core\general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'settings')), _('General Settings')], [\core\cls\core\general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'themes')), _('Appearance')], [\core\cls\core\general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'plugins')), _('Plugins')], [\core\cls\core\general::create_url(array('service', '1', 'plugin', 'core', 'action', 'main', 'p', 'core', 'a', 'settings')), _('Localize')]]; return $menus; }
public static function jump_page($url, $inner_url = true) { if (!$inner_url && $url != SiteDomain) { $url = SiteDomain . $url; } elseif ($url == SiteDomain) { $url = SiteDomain; } elseif (is_array($url)) { $url = core\general::create_url($url); } header("Location:{$url}"); /* Make sure that code below does not get executed when we redirect. */ exit; }
protected function view_profile_block($user, $admin) { $form = new control\form('USERS_PROFILE_BLOCK'); $row = new control\row(); $avatar = new control\image(); $avatar->configure('SRC', './plugins/system/users/images/def_avatar_64.png'); $avatar->configure('TYPE', 'img-thumbnail'); $avatar->configure('LABEL', _('Hello') . ' ' . $user->username); $row->add($avatar, 12); $row1 = new control\row(); $btn_logout = new control\button(); $btn_logout->configure('NAME', 'btn_logout'); $btn_logout->configure('LABEL', 'Sign Out!'); $btn_logout->configure('TYPE', 'info'); $btn_logout->configure('P_ONCLICK_PLUGIN', 'users'); $btn_logout->configure('P_ONCLICK_FUNCTION', 'btn_logout_onclick'); $row1->add($btn_logout, 6); if ($admin) { $btn_admin = new control\button(); $btn_admin->configure('NAME', 'JUMP_ADMIN'); $btn_admin->configure('LABEL', _('Admin panel')); $btn_admin->configure('HREF', core\general::create_url(array('service', '1', 'plugin', 'administrator', 'action', 'main', 'p', 'administrator', 'a', 'dashboard'))); $row1->add($btn_admin, 6); } $form->add_array(array($row, $row1)); return array(_('User Profile'), $form->draw()); }