Changeset 3251:9ed815f75542 for inc/admin
- Timestamp:
- 06/15/16 17:36:30 (9 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/lib.dc.page.php
r3224 r3251 939 939 } 940 940 941 public static function jsCodeMirror($theme = '',$multi = true,$modes = array('css','htmlmixed','javascript','php','xml')) 942 { 943 $ret = 944 self::cssLoad('js/codemirror/lib/codemirror.css'). 945 self::jsLoad('js/codemirror/lib/codemirror.js'); 946 if ($multi) { 947 $ret .= self::jsLoad('js/codemirror/addon/mode/multiplex.js'); 948 } 949 foreach ($modes as $mode) { 950 $ret .= self::jsLoad('js/codemirror/mode/'.$mode.'/'.$mode.'.js'); 951 } 952 $ret .= 953 self::jsLoad('js/codemirror/addon/edit/closebrackets.js'). 954 self::jsLoad('js/codemirror/addon/edit/matchbrackets.js'); 955 if ($theme != '') { 956 $ret .= self::cssLoad('js/codemirror/theme/'.$theme.'.css'); 957 } 958 return $ret; 959 } 960 961 public static function getCodeMirrorThemes() 962 { 963 $themes = array(); 964 $themes_root = dirname(__FILE__).'/../../admin'.'/js/codemirror/theme/'; 965 if (is_dir($themes_root) && is_readable($themes_root)) { 966 if (($d = @dir($themes_root)) !== false) { 967 while (($entry = $d->read()) !== false) { 968 if ($entry != '.' && $entry != '..' && substr($entry, 0, 1) != '.' && is_readable($themes_root.'/'.$entry)) { 969 $themes[] = substr($entry,0,-4); // remove .css extension 970 } 971 } 972 } 973 } 974 return $themes; 975 } 976 941 977 public static function getPF($file) 942 978 {
Note: See TracChangeset
for help on using the changeset viewer.