Beispiel #1
0
 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 )	);
 }
Beispiel #2
0
 protected function view_reset_password()
 {
     $form = new control\form('USERS_RESET_PASSWORD');
     //create textbox for enter email or username
     $email = new control\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 control\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());
 }