Changeset 9130
- Timestamp:
- 03/11/10 14:42:06 (2 years ago)
- Files:
-
- freepbx/trunk/amp_conf/bin/retrieve_conf (modified) (1 diff)
- freepbx/trunk/amp_conf/htdocs/admin/extensions.class.php (modified) (4 diffs)
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (1 diff)
- freepbx/trunk/amportal.conf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/bin/retrieve_conf
r8701 r9130 352 352 require_once($amp_conf['AMPWEBROOT']."/admin/extensions.class.php"); 353 353 $ext = new extensions; 354 355 if ($amp_conf['DISABLECUSTOMCONTEXTS']) { 356 $ext->disableCustomContexts(true); 357 } 354 358 355 359 // create objects for any module classes freepbx/trunk/amp_conf/htdocs/admin/extensions.class.php
r9043 r9130 14 14 15 15 var $_sorted; 16 17 var $_section_comment = array(); 18 19 var $_section_no_custom = array(); 20 21 var $disable_custom_contexts = false; 16 22 17 23 /** The filename to write this configuration to … … 83 89 $this->_sorted = true; 84 90 } 91 function addSectionComment($section, $comment) { 92 $this->_section_comment[$section] = $comment; 93 } 94 95 function addSectionNoCustom($section, $setting) { 96 $this->_section_no_custom[$section] = $setting ? true : false; 97 } 98 99 function disableCustomContexts($setting) { 100 $this->_disable_custom_contexts = $setting ? true : false; 101 } 85 102 86 103 function addHint($section, $extension, $hintvalue) { … … 92 109 } 93 110 94 function addInclude($section, $incsection ) {95 $this->_includes[$section][] = $incsection;111 function addInclude($section, $incsection, $comment='') { 112 $this->_includes[$section][] = array('include' => $incsection, 'comment' => $comment); 96 113 } 97 114 … … 266 283 if(is_array($this->_exts)){ 267 284 foreach (array_keys($this->_exts) as $section) { 268 $output .= "[".$section."]\n"; 285 $comment = isset($this->_section_comment[$section]) ? ' ; '.$this->_section_comment[$section] : ''; 286 $output .= "[$section]$comment\n"; 269 287 270 //automatically include a -custom context 271 $output .= "include => {$section}-custom\n"; 288 //automatically include a -custom context unless no_custom is true 289 if (!$this->_disable_custom_contexts && (!isset($this->_section_no_custom[$section]) || $this->_section_no_custom[$section] == false)) { 290 $output .= "include => {$section}-custom\n"; 291 } 272 292 //add requested includes for this context 273 293 if (isset($this->_includes[$section])) { 274 294 foreach ($this->_includes[$section] as $include) { 275 $output .= "include => ".$include ."\n";295 $output .= "include => ".$include['include'] . ($include['comment'] != ''?' ; '.$include['comment']:'') . "\n"; 276 296 } 277 297 } freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r9127 r9130 754 754 'USEDIALONE' => array('bool' , false), 755 755 'RELOADCONFIRM' => array('bool' , true), 756 'DISABLECUSTOMCONTEXTS' => array('bool' , false), 756 757 ); 757 758 freepbx/trunk/amportal.conf
r9110 r9130 283 283 # When set to true, a beep is played instead of confirmation message when activating/de-activating: 284 284 # CallForward, CallWaiting, DayNight, DoNotDisturb and FindMeFollow 285 286 DISABLECUSTOMCONTEXTS=true 287 # DISABLECUSTOMCONTEXTS=true|false 288 # DEFAULT VALUE: false 289 # Normally FreePBX auto-generates a custome context that may be usable for adding custom dialplan to modify the normal behavior 290 # of FreePBX. It takes a good understanding of how Asterisk processes these includes to use this and in many of the cases, there 291 # is no useful application. All includes will result in a WARNING in the Asterisk log if there is no countext found to include 292 # though it results in no errors. If you know that you want the includes, you can set this to true. If you comment it out FreePBX 293 # will revert to legacy behavior and include the contexts.
