Changeset 13481
- Timestamp:
- 02/20/12 07:01:29 (1 year ago)
- Files:
-
- freepbx/branches/2.10/amp_conf/htdocs/admin/assets/js/script.legacy.js (modified) (1 diff)
- freepbx/branches/2.10/amp_conf/htdocs/admin/config.php (modified) (1 diff)
- freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/components.class.php (modified) (11 diffs)
- freepbx/branches/2.10/amp_conf/htdocs/admin/views/footer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.10/amp_conf/htdocs/admin/assets/js/script.legacy.js
r12976 r13481 723 723 var txt = $(this).find('.guielToggleBut'); 724 724 var el = $(this).data('toggle_class'); 725 var section = $.urlParam('display') + '#' + el; 726 727 //true = hide 728 //false = dont hide 725 729 switch(txt.text().replace(/ /g,'')) { 726 730 case '-': 727 731 txt.text('+ '); 728 $('.'+el).hide() 732 $('.' + el).hide(); 733 734 //set cookie of hidden section 735 guielToggle = $.parseJSON($.cookie('guielToggle')) || {}; 736 guielToggle[section] = false; 737 $.cookie('guielToggle', JSON.stringify(guielToggle)); 729 738 break; 730 739 case '+': 731 740 txt.text('- '); 732 741 $('.'+el).show(); 742 743 //set cookie of hidden section 744 guielToggle = $.parseJSON($.cookie('guielToggle')) || {}; 745 if (guielToggle.hasOwnProperty(section)){ 746 guielToggle[section] = true; 747 $.cookie('guielToggle', JSON.stringify(guielToggle)); 748 } 733 749 break; 734 750 } freepbx/branches/2.10/amp_conf/htdocs/admin/config.php
r13119 r13481 241 241 if ($display != '' && isset($configpageinits) && is_array($configpageinits) ) { 242 242 243 $currentcomponent = new component($display,$type); 244 243 $CC = $currentcomponent = new component($display,$type); 245 244 // call every modules _configpageinit function which should just 246 245 // register the gui and process functions for each module, if relevant freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/components.class.php
r12995 r13481 27 27 28 28 function component($compname, $type = 'setup') { 29 global $display; 29 30 $this->_compname = $compname; 30 31 $this->_type = $type; … … 34 35 $this->_sorted_guifuncs = true; 35 36 $this->_sorted_processfuncs = true; 37 38 //set section to hidden if requested by user 39 $user_hidden = isset($_COOKIE['guielToggle']) ? json_decode($_COOKIE['guielToggle']) : array(); 40 foreach($user_hidden as $k => $v) { 41 list($page, $section) = explode('#', $k); 42 if ($page == $display) { 43 $this->_opts[$section]['guielToggle'] = $v ? true :false; 44 } 45 } 46 } 47 48 /* 49 * Toggle open state 50 * true = open, false = closed 51 * wont over write a users settings 52 */ 53 function sectionToggle($section, $state = false) { 54 $section = preg_replace('/[^A-Za-z]/', '' ,$section); 55 if (!isset($this->_opts[$section]['guielToggle'])) { 56 $this->_opts[$section]['guielToggle'] = $state; 57 } 36 58 } 37 59 … … 284 306 $this->sortguielems(); 285 307 308 286 309 // Start of form 287 310 … … 306 329 } 307 330 } 308 331 309 332 // Middle 310 333 if ( is_array($this->_guielems_middle) ) { … … 318 341 $htmlout .= "\t\t<td colspan=\"2\">"; 319 342 if ($section) { 320 $state = isset($this_opts[$section]['guielToggle']) && $this_opts[$section]['guielToggle'] == true 321 ? '+' : '- '; 343 $mysec = preg_replace('/[^A-Za-z]/', '' ,$section); 344 $state = isset($this->_opts[$mysec]['guielToggle']) && $this->_opts[$mysec]['guielToggle'] == false 345 ? '+' : '- '; 322 346 $htmlout .= "<h5>" 323 347 . "<span class=\"guielToggleBut\">$state</span>" … … 456 480 var $_html; 457 481 var $_javascript; 458 482 var $_opts; 483 459 484 function guielement($elemname, $html = '', $javascript = '') { 485 global $CC; 460 486 // name that will be the id tag 461 487 $this->_elemname = $elemname; … … 466 492 $this->_html = $html; 467 493 $this->_javascript = $javascript; 494 495 496 $this->_opts = & $CC->_opts; 468 497 } 469 498 … … 524 553 525 554 function guiinput($elemname, $currentvalue = '', $prompttext = '', $helptext = '', $jsvalidation = '', $failvalidationmsg = '', $canbeempty = true, $jsvalidationtest='') { 555 526 556 // call parent class contructor 527 557 guielement::guielement($elemname, '', ''); … … 581 611 // start new row 582 612 if ($section) { 583 $output .= "\t<tr class=\"$section\">\n"; 613 $mysec = preg_replace('/[^A-Za-z]/', '' ,$section); 614 $output .= '<tr class="' . $section . '" ' 615 . ((isset($this->_opts[$mysec]['guielToggle']) && $this->_opts[$mysec]['guielToggle'] == false) 616 ? ' style="display:none" ' 617 : '') 618 .' >' . "\n"; 584 619 } else { 585 620 $output .= "\t<tr>\n"; … … 775 810 // this effectivly creates the template using the html_text 776 811 // we would expect the $html_text to be set by the child class 777 812 778 813 $output = ''; 779 814 780 815 // start new row 781 816 if ($section) { 782 $output .= "\t<tr class=\"$section\">\n"; 817 $mysec = preg_replace('/[^A-Za-z]/', '' ,$section); 818 $output .= '<tr class="' . $section . '" ' 819 . ((isset($this->_opts[$mysec]['guielToggle']) && $this->_opts[$mysec]['guielToggle'] == false) 820 ? ' style="display:none" ' 821 : '') 822 .' >' . "\n"; 783 823 } else { 784 824 $output .= "\t<tr>\n"; … … 838 878 class gui_link extends guitext { 839 879 function gui_link($elemname, $text, $url, $uselang = true) { 880 840 881 // call parent class contructor 841 882 $parent_class = get_parent_class($this); freepbx/branches/2.10/amp_conf/htdocs/admin/views/footer.php
r13443 r13481 147 147 148 148 //add IE specifc styling polyfills 149 $html .= '<!--[if lte IE 10]>'; 150 $html .= '<link rel="stylesheet" href="assets/css/progress-polyfill.css" type="text/css">'; 151 $html .= '<script type="text/javascript" src="assets/js/progress-polyfill.min.js"></script>'; 152 $html .= '<![endif]-->'; 149 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { 150 $html .= '<!--[if lte IE 10]>'; 151 $html .= '<link rel="stylesheet" href="assets/css/progress-polyfill.css" type="text/css">'; 152 $html .= '<script type="text/javascript" src="assets/js/progress-polyfill.min.js"></script>'; 153 $html .= '<![endif]-->'; 154 155 //offer google chrome frame for the richest experience 156 $html .= <<<END 157 <!--[if IE]> 158 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script> 159 <script> 160 !$.cookie('skip_cf_check') //skip check if skip_cf_check cookie is active 161 && CFInstall //make sure CFInstall is loaded 162 && !!window.attachEvent //attachEvent is ie only, should never fire in other browsers 163 && window.attachEvent("onload", function() { 164 CFInstall.check({ 165 preventPrompt: true, 166 onmissing: function() { 167 $('<div></div>') 168 .html('Unfortunately, some features may not work correctly in your ' 169 + 'current browser. We suggest that you activate Chrome Frame, ' 170 + 'which will offer you the richest posible experience. ') 171 .dialog({ 172 title: 'Activate Chrome Frame', 173 resizable: false, 174 modal: true, 175 position: ['center', 'center'], 176 close: function (e) { 177 $.cookie('skip_cf_check', 'true'); 178 $(e.target).dialog("destroy").remove(); 179 }, 180 buttons: [ 181 { 182 text: 'Activate', 183 click: function() { 184 window.location = 'http://www.google.com/chromeframe/?redirect=true'; 185 } 186 187 }, 188 { 189 text: fpbx.msg.framework.cancel, 190 click: function() { 191 //set cookie to prevent prompting again in this session 192 $.cookie('skip_cf_check', 'true'); 193 $(this).dialog("destroy").remove(); 194 } 195 } 196 ] 197 }); 198 } 199 }); 200 201 }); 202 </script> 203 <![endif]--> 204 END; 205 } 206 153 207 154 208 //offer google chrome frame for the richest experience
