From: Janusz Dobrowolski Date: Fri, 23 Jan 2015 21:19:46 +0000 (+0100) Subject: Cleanup: package info viewer moved to admin module. X-Git-Tag: v2.4.2~19^2~257 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=dd6cb45ea1904bd494d199dad893afc52a656ae4;p=fa-stable.git Cleanup: package info viewer moved to admin module. --- diff --git a/admin/view/view_package.php b/admin/view/view_package.php new file mode 100644 index 00000000..6d957720 --- /dev/null +++ b/admin/view/view_package.php @@ -0,0 +1,60 @@ +. +***********************************************************************/ +$page_security = 'SA_OPEN'; +$path_to_root = "../.."; +include_once($path_to_root . "/includes/session.inc"); +include_once($path_to_root . "/includes/packages.inc"); + +page(_($help_context = "Package Details"), true); + +include_once($path_to_root . "/includes/ui.inc"); + +if (!isset($_GET['id'])) +{ + /*Script was not passed the correct parameters */ + display_note(_("The script must be called with a valid package id to review the info for.")); + end_page(); +} + +$filter = array( + 'Version' => _('Available version'), + 'Type' => _('Package type'), + 'Name' => _('Package content'), + 'Description' => _('Description'), + 'Author' => _('Author'), + 'Homepage' => _('Home page'), + 'Maintenance' => _('Package maintainer'), + 'InstallPath' => _('Installation path'), + 'Depends' => _('Minimal software versions'), + 'RTLDir' => _('Right to left'), + 'Encoding' => _('Charset encoding') +); + +$pkg = get_package_info($_GET['id'], null, $filter); + +display_heading(sprintf(_("Content information for package '%s'"), $_GET['id'])); +br(); +start_table(TABLESTYLE2, "width=80%"); +$th = array(_("Property"), _("Value")); +table_header($th); + +foreach ($pkg as $field => $value) { + if ($value == '') + continue; + start_row(); + label_cells($field, nl2br(html_specials_encode(is_array($value) ? implode("\n", $value) :$value)), + "class='tableheader2'"); + end_row(); +} +end_table(1); + +end_page(true); diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index 8fee0ae0..daa161be 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -210,7 +210,7 @@ function get_package_view_str($pkg, $label="", $icon=false, $class='', $id='') $label = _("Info"); // $icon = ICON_GL; } - return viewer_link($label, "includes/ui/view_package.php?id=$pkg", $class, $id, $icon); + return viewer_link($label, "admin/view/view_package.php?id=$pkg", $class, $id, $icon); } diff --git a/includes/ui/view_package.php b/includes/ui/view_package.php deleted file mode 100644 index 6d957720..00000000 --- a/includes/ui/view_package.php +++ /dev/null @@ -1,60 +0,0 @@ -. -***********************************************************************/ -$page_security = 'SA_OPEN'; -$path_to_root = "../.."; -include_once($path_to_root . "/includes/session.inc"); -include_once($path_to_root . "/includes/packages.inc"); - -page(_($help_context = "Package Details"), true); - -include_once($path_to_root . "/includes/ui.inc"); - -if (!isset($_GET['id'])) -{ - /*Script was not passed the correct parameters */ - display_note(_("The script must be called with a valid package id to review the info for.")); - end_page(); -} - -$filter = array( - 'Version' => _('Available version'), - 'Type' => _('Package type'), - 'Name' => _('Package content'), - 'Description' => _('Description'), - 'Author' => _('Author'), - 'Homepage' => _('Home page'), - 'Maintenance' => _('Package maintainer'), - 'InstallPath' => _('Installation path'), - 'Depends' => _('Minimal software versions'), - 'RTLDir' => _('Right to left'), - 'Encoding' => _('Charset encoding') -); - -$pkg = get_package_info($_GET['id'], null, $filter); - -display_heading(sprintf(_("Content information for package '%s'"), $_GET['id'])); -br(); -start_table(TABLESTYLE2, "width=80%"); -$th = array(_("Property"), _("Value")); -table_header($th); - -foreach ($pkg as $field => $value) { - if ($value == '') - continue; - start_row(); - label_cells($field, nl2br(html_specials_encode(is_array($value) ? implode("\n", $value) :$value)), - "class='tableheader2'"); - end_row(); -} -end_table(1); - -end_page(true);