Exemplo n.º 1
0
 public function admin()
 {
     if ($this->is_back()) {
         if ($this->parent->get_type() == 'Base_Admin') {
             $this->parent->reset();
         } else {
             location(array());
         }
         return;
     }
     $form = $this->init_module(Libs_QuickForm::module_name(), 'Changing template');
     $themes = Base_Theme::list_themes();
     $form->addElement('header', 'install_module_header', __('Themes Administration'));
     $form->addElement('select', 'theme', __('Choose template'), $themes);
     $form->addElement('static', null, '', '<br /><br />');
     $form->addElement('header', 'upload_theme_header', __('Upload template'));
     $form->setDefaults(array('theme' => Variable::get('default_theme')));
     if ($form->validate()) {
         $form->process(array(&$this, 'submit_admin'));
     } else {
         $form->display();
         if (class_exists('ZipArchive')) {
             $this->pack_module(Utils_FileUpload::module_name(), array(array($this, 'upload_template'), __('Upload template')));
             //				Base_ActionBarCommon::add('edit',__('Manage templates'),$this->create_callback_href(array($this,'download_template')));
         }
     }
     Base_ActionBarCommon::add('back', __('Back'), $this->create_back_href());
     Base_ActionBarCommon::add('save', __('Save'), $form->get_submit_form_href());
 }