public function test() { $form = new ctr_form('test'); $text = new ctr_textbox('textbox'); $text->configure('LABEL', 'Name'); $text->configure('ADDON', 'N'); $btn = new ctr_button('BTN'); $btn->configure('LABEL', 'Click me!'); $btn->configure('P_ONCLICK_PLUGIN', 'hello'); $btn->configure('P_ONCLICK_FUNCTION', 'btn_onclick'); $form->add_array(array($text, $btn)); return array('TITTLE', $form->draw()); }
protected function view_themes($themes, $themes_info, $active_theme) { $form = new ctr_form("core_manage_themes"); $tab = new ctr_tabbar(); $table = new ctr_table(); foreach ($themes as $key => $theme) { $row = new ctr_row(); //add id to table for count rows $lbl_id = new ctr_label($key + 1); $row->add($lbl_id, 1, 1); //add theme name $lbl_theme_name = new ctr_label($themes_info[$key]['name']); $row->add($lbl_theme_name, 2); //add author of theme $lbl_author = new ctr_label($themes_info[$key]['author']); $row->add($lbl_author, 2); //add active theme button if ($theme != $active_theme) { $btn_active = new ctr_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_reset_password() { $form = new ctr_form('USERS_RESET_PASSWORD'); //create textbox for enter email or username $email = new ctr_textbox(); $email->configure('NAME', 'txt_email'); $email->configure('LABEL', _('Username or e-mail address')); $email->configure('HELP', _('Enter your Alternate Email Address or username')); $email->configure('PLACE_HOLDER', _('Username or e-mail address')); $email->configure('ADDON', _('*')); $email->configure('SIZE', 8); $reset = new ctr_button(); $reset->configure('NAME', 'btn_reset'); $reset->configure('LABEL', _('Email new password')); $reset->configure('P_ONCLICK_PLUGIN', 'users'); $reset->configure('P_ONCLICK_FUNCTION', 'btn_reset_password_onclick'); $reset->configure('TYPE', 'primary'); $form->add_array(array($email, $reset)); return array(_('Request new password'), $form->draw()); }