protected function view_themes($themes, $themes_info, $active_theme) { $form = new control\form("core_manage_themes"); $tab = new control\tabbar(); $table = new control\table(); foreach ($themes as $key => $theme) { $row = new control\row(); //add id to table for count rows $lbl_id = new control\label($key + 1); $row->add($lbl_id, 1, 1); //add theme name $lbl_theme_name = new control\label($themes_info[$key]['name']); $row->add($lbl_theme_name, 2); //add author of theme $lbl_author = new control\label($themes_info[$key]['author']); $row->add($lbl_author, 2); //add active theme button if ($theme != $active_theme) { $btn_active = new control\button(); $btn_active->configure('LABEL', _('Active this')); $btn_active->configure('TYPE', 'success'); $btn_active->configure('P_ONCLICK_PLUGIN', 'core'); $btn_active->configure('P_ONCLICK_FUNCTION', 'btn_change_theme'); $row->add($btn_active, 1); } $table->add_row($row); } //add headers to table $table->configure('HEADERS', array(_('ID'), _('Name'), _('Author'), _('Options'))); $table->configure('HEADERS_WIDTH', array(1, 2, 3, 4)); $form->add($table); $tab->add($form); return array(_('Appearance'), $tab->draw()); //Assign variables $this->raintpl->assign("label_themes", _('Themes')); $this->raintpl->assign("label_disable", _('Disable')); $this->raintpl->assign("label_enable", _('Enable')); $this->raintpl->assign("label_install", _('Install new theme')); $this->raintpl->assign("label_name", _('Name')); $this->raintpl->assign("label_screen", _('Splash screen')); $this->raintpl->assign("label_author", _('Author')); $this->raintpl->assign("label_options", _('Options')); $this->raintpl->assign("active_theme", $active_theme); $this->raintpl->assign("themes", $themes_info); $this->raintpl->assign("theme_count", max(array_keys($themes_info))); //draw and return back content //return array(_('Themes'),$this->raintpl->draw('core_appearance', true ) ); }
protected function view_register() { $form = new control\form('USERS_REGISTER'); $form->configure('LABEL', _('Register')); $username = new control\textbox(); $username->configure('NAME', 'txt_username'); $username->configure('LABEL', _('Username:'******'ADDON', _('*')); $username->configure('PLACE_HOLDER', _('Username')); $username->configure('HELP', _('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.')); $username->configure('SIZE', 4); $email = new control\textbox(); $email->configure('NAME', 'txt_email'); $email->configure('LABEL', _('Email:')); $email->configure('ADDON', _('*')); $email->configure('PLACE_HOLDER', _('Email')); $email->configure('HELP', _('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.')); $email->configure('SIZE', 6); $form->add_array(array($username, $email)); $password = new control\textbox(); $password->configure('NAME', 'txt_password'); $password->configure('LABEL', _('Password:'******'ADDON', _('*')); $password->configure('PLACE_HOLDER', _('Password')); $password->configure('PASSWORD', true); $password->configure('SIZE', 4); $repassword = new control\textbox(); $repassword->configure('NAME', 'txt_repassword'); $repassword->configure('LABEL', _('Confirm password :'******'ADDON', _('*')); $repassword->configure('PLACE_HOLDER', _('Password')); $repassword->configure('PASSWORD', true); $repassword->configure('SIZE', 4); $signup = new control\button(); $signup->configure('NAME', 'btn_signup'); $signup->configure('TYPE', 'primary'); $signup->configure('LABEL', _('Create new account')); $signup->configure('P_ONCLICK_PLUGIN', 'users'); $signup->configure('P_ONCLICK_FUNCTION', 'btn_signup_onclick'); $cancel = new control\button(); $cancel->configure('NAME', 'btn_cancel'); $cancel->configure('TYPE', 'warning'); $cancel->configure('LABEL', _('Cancel')); $cancel->configure('HREF', '?'); $row = new control\row(); $row->add($signup, 3); $row->add($cancel, 2); $form->add_array(array($password, $repassword)); $form->add_spc(); $form->add($row); return array(_('Sign up'), $form->draw()); }