Show
Ignore:
Timestamp:
11/21/06 00:10:55 (7 years ago)
Author:
qldrob
Message:

Merged revisions 3051-3063,3065,3067-3071,3073-3077,3079-3085,3087-3094,3096,3098,3100,3102-3110,3112,3114-3117,3124-3130 via svnmerge from
https://svn.sourceforge.net/svnroot/amportal/freepbx/trunk

........

r3051 | qldrob | 2006-11-13 10:34:21 +1000 (Mon, 13 Nov 2006) | 2 lines


More #999 style warning avoidance fixes.

........

r3052 | qldrob | 2006-11-13 11:16:37 +1000 (Mon, 13 Nov 2006) | 2 lines


Apply #2572 to trunk. Somehow I managed to apply this to the wrong branch. Sorry.

........

r3067 | gregmac | 2006-11-15 05:15:40 +1000 (Wed, 15 Nov 2006) | 2 lines


Better handling of defaults in parse_amportal_conf(), handling of booleans

........

r3068 | gregmac | 2006-11-15 05:16:47 +1000 (Wed, 15 Nov 2006) | 2 lines


New amportal.conf directive USECATEGORIES to control if the menus are sorted by category or not

........

r3069 | gregmac | 2006-11-15 05:22:09 +1000 (Wed, 15 Nov 2006) | 2 lines


Added USECATEGORIES (from r3068)

........

r3082 | gregmac | 2006-11-17 11:44:45 +1000 (Fri, 17 Nov 2006) | 2 lines


Fixed division by zero bugfix

........

r3130 | p_lindheimer | 2006-11-21 12:28:41 +1000 (Tue, 21 Nov 2006) | 1 line


add setmusiconhold to extensions class

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.2

    • Property svnmerge-integrated changed from /freepbx/trunk:1-3050,3064,3066,3072,3078,3086,3095,3097,3099,3101,3111,3113,3118-3123 to /freepbx/trunk:1-3130
  • freepbx/branches/2.2/amp_conf/htdocs/admin/config.php

    r3129 r3144  
    138138      $name[$key] = $row['name']; 
    139139    } 
    140  
    141     array_multisort( 
    142       $category, SORT_ASC,  
    143       $sort, SORT_ASC, SORT_NUMERIC,  
    144       $name, SORT_ASC,  
    145       $fpbx_menu 
    146     ); 
     140     
     141    if ($amp_conf['USECATEGORIES']) { 
     142      array_multisort( 
     143        $category, SORT_ASC,  
     144        $sort, SORT_ASC, SORT_NUMERIC,  
     145        $name, SORT_ASC,  
     146        $fpbx_menu 
     147      ); 
     148    } else { 
     149      array_multisort( 
     150        $sort, SORT_ASC, SORT_NUMERIC,  
     151        $name, SORT_ASC,  
     152        $fpbx_menu 
     153      ); 
     154    } 
    147155     
    148156    // Printing menu 
     
    152160     
    153161    foreach ($fpbx_menu as $key => $row) { 
    154       if ($row['category'] != $prev_category) { 
     162      if ($amp_conf['USECATEGORIES'] && ($row['category'] != $prev_category)) { 
    155163        echo "\t\t<li>"._($row['category'])."</li>\n"; 
    156164        $prev_category = $row['category']; 
  • freepbx/branches/2.2/amp_conf/htdocs/admin/extensions.class.php

    r2926 r3144  
    840840} 
    841841 
     842class ext_setmusiconhold extends extension { 
     843  function output() { 
     844    return "SetMusicOnHold(".$this->data.")"; 
     845  } 
     846} 
     847 
    842848class ext_congestion extends extension { 
    843849  function output() { 
  • freepbx/branches/2.2/amp_conf/htdocs/admin/functions.inc.php

    r3131 r3144  
    2222 
    2323function parse_amportal_conf($filename) { 
     24  // defaults, if not specified in the file 
     25  $defaults = array( 
     26    'AMPDBENGINE' => 'mysql', 
     27    'AMPDBNAME' => 'asterisk', 
     28    'AMPENGINE' => 'asterisk', 
     29    'USECATEGORIES' => true, 
     30    ); 
     31  // boolean values, will be converted to true/false 
     32  // "yes", "true", 1 (case-insensitive) will be treated as true, everything else is false 
     33  $booleans = array('USECATEGORIES'); 
     34 
    2435  $file = file($filename); 
    2536  if (is_array($file)) { 
     
    3344  } 
    3445   
    35   if ( !isset($conf["AMPDBENGINE"]) || ($conf["AMPDBENGINE"] == "")) { 
    36   $conf["AMPDBENGINE"] = "mysql"; 
    37   } 
    38    
    39   if ( !isset($conf["AMPDBNAME"]) || ($conf["AMPDBNAME"] == "")) { 
    40   $conf["AMPDBNAME"] = "asterisk"; 
    41   } 
    42    
    43   if ( !isset($conf["AMPENGINE"]) || ($conf["AMPENGINE"] == "")) { 
    44     $conf["AMPENGINE"] = "asterisk"
     46  // set defaults 
     47  foreach ($defaults as $key=>$val) { 
     48  if (!isset($conf[$key]) || $conf[$key] == '') { 
     49     $conf[$key] = $val; 
     50  } 
     51  } 
     52 
     53  // evaluate boolean values 
     54  foreach ($booleans as $key) { 
     55    $conf[$key] = isset($conf[$key]) && ($conf[$key] === true || strtolower($conf[$key]) == 'true' || $conf[$key] === 1 || $conf[$key] == '1' || strtolower($conf[$key]) == 'yes')
    4556  } 
    4657 
     
    274285  } 
    275286    
     287  $prevtag = ""; 
     288  $prevtag_pre = ""; 
    276289  if ($skip) { 
    277290     $prevskip= $skip - $perpage;