Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 28th May 2013, 09:00
remy74 remy74 is offline
Junior Member
 
Join Date: May 2013
Posts: 16
Thanks: 9
Thanked 6 Times in 4 Posts
Default

Quote:
Originally Posted by till View Post
There is no api function availbale for that. The places were we use such conversions (e.g. web statistics) it is hard coded. Its a good idea to add it as a filter in the next version.
For testing, I'm trying to add this :
Code:
function filterField($field_name, $field_value, $filters, $filter_event) {

                        global $app;
                        $returnval = $field_value;

                        //* Loop trough all filters
                        foreach($filters as $filter) {
                                if($filter['event'] == $filter_event) {
                                        switch ($filter['type']) {
                                                case 'TOLOWER':
                                                        $returnval = strtolower($returnval);
                                                break;
                                                case 'TOUPPER':
                                                        $returnval = strtoupper($returnval);
                                                break;
                                                case 'IDNTOASCII':
                                                        $returnval = $app->functions->idn_encode($returnval);
                                                break;
                                                case 'IDNTOUTF8':
                                                        $returnval = $app->functions->idn_decode($returnval);
                                                break;
                                                case 'FORMATED_BYTES':
                                                        $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
                                                        $returnval= @round($value/pow(1024, ($i = floor(log($returnval, 1024)))), 2).' '.$unit[$i];
                                                //   In the next try, will implement this on the functions class ..   
                                               // $returnval = $app->functions->convertSize($returnval);
                                                break;          
                                                default:
                                                        $this->errorMessage .= "Unknown Filter: ".$filter['type'];
                                                break;

                                        }
                                }
                        }
            return $returnval;
        }
on the tform.inc files ..
And on the tfrom file module :
Code:
'filters'   => array( 0 => array( 'event' => 'SHOW',
                                              'type' => 'FORMATED_BYTES')
											  ),
but no lucky, not working.. Is we forget something else ?

Last edited by remy74; 28th May 2013 at 10:03.
Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freeradius and Mysql uvstudios HOWTO-Related Questions 4 19th February 2014 12:11
Proftpd + MySQL virtual users, can't connect geekman HOWTO-Related Questions 28 27th September 2010 18:03
FreeRadius + MySQL working, but I don't know how to customise SQL queries awe Installation/Configuration 4 4th April 2010 23:28
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
Webmin docs missing namit Server Operation 11 5th January 2006 09:51


All times are GMT +2. The time now is 00:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.