From 3802625270c6f453c1eefd8b2a5c1608082d1def Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Fri, 18 May 2012 14:09:07 -0300 Subject: Include movable code to reorder list,save button, domtt title messages, also base64 decode option, description and custom text to checkbox fields. New options need xml config to be included on package xml files, so no changes to packages that do not use these functions. I've sucessfully testes with imspector-dev, dansguardian and varnish code. Related post on forum with screenshots and full code http://forum.pfsense.org/index.php/topic,49322.msg262903.html#msg262903 --- usr/local/www/pkg.php | 161 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 139 insertions(+), 22 deletions(-) (limited to 'usr') diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 0a119d9..f410a05 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -2,7 +2,7 @@ /* $Id$ */ /* pkg.php - Copyright (C) 2004-2010 Scott Ullrich + Copyright (C) 2004-2012 Scott Ullrich All rights reserved. Redistribution and use in source and binary forms, with or without @@ -45,6 +45,10 @@ function gentitle_pkg($pgname) { return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; } +function domTT_title($title_msg){ + print "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '{$title_msg}', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\""; +} + $xml = $_REQUEST['xml']; if($xml == "") { @@ -82,6 +86,26 @@ if($_REQUEST['display_maximum_rows']) $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config']; +if ($_GET['act'] == "update") { + if(is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != ""){ + #get current values + $current_values=$config['installedpackages'][$pkg['name']]['config']; + #get updated ids + $update_list=explode(",",$_GET['ids']); + #sort ids to know what to change + $sort_list=$update_list; + sort($sort_list); + #apply updates + foreach(explode(",",$_GET['ids']) as $key=> $value){ + $config['installedpackages'][$pkg['name']]['config'][$sort_list[$key]]=$current_values[$update_list[$key]]; + } + #save current config + write_config(); + #sync package + eval ("{$pkg['custom_php_resync_config_command']}"); + } +} + if ($_GET['act'] == "del") { // loop through our fieldnames and automatically setup the fieldnames // in the environment. ie: a fieldname of username with a value of @@ -184,10 +208,83 @@ if ($pkg['tabs'] <> "") { document.pkgform.submit(); } + + + + + + + +\n"; +echo "\t\n"; +echo "\t\n"; +echo "\t\n"; +?>
-- cgit v1.1
+ "") { // First find the sorting type field if it exists foreach($pkg['fields']['field'] as $field) { if($field['type'] == "sorting") { + $sortable="on"; if(isset($field['include_filtering_inputbox'])) $include_filtering_inputbox = true; if($display_maximum_rows < 1) @@ -257,7 +355,7 @@ if ($pkg['tabs'] <> "") { echo ""; echo ""; echo "\n"; + if($pkg['adddeleteeditpagefields']['movable']) + echo "\n"; + else + echo "\n"; if($pkg['adddeleteeditpagefields']['columnitem'] <> "") foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { if ($column['fieldname'] == "description") @@ -335,32 +439,37 @@ if ($pkg['tabs'] <> "") { - - +\n"; + // Handle pagination and display_maximum_rows if($display_maximum_rows) { if($pagination_counter == ($display_maximum_rows-1) or @@ -403,12 +512,20 @@ if ($pkg['tabs'] <> "") { + + + + +
Displaying page $page of $totalpagesRows per page:
- - - - - -
')">
+ +
+ > + ')">> + + + > + > +
- + + + +
>>