[vhffs-dev] [1826] No more HTML::Template in object/search |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1826
Author: beuss
Date: 2011-05-28 22:30:12 +0200 (Sat, 28 May 2011)
Log Message:
-----------
No more HTML::Template in object/search
Modified Paths:
--------------
trunk/vhffs-panel/admin/object/search.pl
Modified: trunk/vhffs-panel/admin/object/search.pl
===================================================================
--- trunk/vhffs-panel/admin/object/search.pl 2011-05-28 20:30:04 UTC (rev 1825)
+++ trunk/vhffs-panel/admin/object/search.pl 2011-05-28 20:30:12 UTC (rev 1826)
@@ -29,10 +29,8 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-
use utf8;
use POSIX qw(locale_h);
-use HTML::Template;
use locale;
use Locale::gettext;
use CGI;
@@ -41,40 +39,11 @@
use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Stats;
-use Vhffs::Constants;
+use Vhffs::Panel::Admin;
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
+my $panel = new Vhffs::Panel::Admin();
-my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
-my $user = $panel->{'user'};
-my $cgi = $panel->{'cgi'};
-my $servername = $cgi->param("name");
-my $template;
-my $templatesdir = $vhffs->get_config->get_templatedir;
+$panel->render('admin/misc/search.tt', {
+ search_title => gettext('Object search')
+});
-if( $user->is_admin != 1 )
-{
-
- $template = new HTML::Template( filename => $templatesdir."/panel/misc/simplemsg.tmpl" );
- my $message = gettext( "You are not allowed to see it");
- $template->param( MESSAGE => $message );
-}
-else
-{
- $template = new HTML::Template( filename => $templatesdir."/panel/admin/object/search.tmpl" );
- $template->param( TITLE => gettext("Search an object (give object_id)") );
-}
-
-$panel->build( $template );
-$panel->display;
-