diff --git a/e107_admin/header.php b/e107_admin/header.php index e2aca9ab1..a0c30f282 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -50,8 +50,11 @@ function loadJSAddons() // e107::js('core', 'bootstrap/js/bootstrap-modal.js', 'jquery', 2); // Special Version see: https://github.com/twitter/bootstrap/pull/4224 - e107::css('core', 'bootstrap-editable/css/bootstrap-editable.css', 'jquery'); - e107::js('core', 'bootstrap-editable/js/bootstrap-editable.min.js', 'jquery', 2); +// e107::css('core', 'bootstrap-editable/css/bootstrap-editable.css', 'jquery'); + //e107::js('core', 'bootstrap-editable/js/bootstrap-editable.min.js', 'jquery', 2); + + e107::css('url', "//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap-editable/css/bootstrap-editable.css"); + e107::js('url', "//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap-editable/js/bootstrap-editable.min.js"); e107::css('core', 'bootstrap-select/bootstrap-select.min.css', 'jquery'); e107::js('core', 'bootstrap-select/bootstrap-select.min.js', 'jquery', 2); diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index d4a867abe..6862e0bef 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2451,23 +2451,7 @@ class e_parse extends e_parser } return $text; } - - /** - * Display a Date in the browser. - * Includes support for 'livestamp' (http://mattbradley.github.io/livestampjs/) - * @param integer $datestamp - unix timestamp - * @param string $format - short | long | relative - * @return HTML with converted date. - */ - public function toDate($datestamp = null, $format='short') - { - if(!is_numeric($datestamp)){ return; } - return ''.e107::getDate()->convert($datestamp, $format).''; - } - - - @@ -2541,6 +2525,7 @@ class e_parse extends e_parser /** + * New v2 Parser * Start Fresh and Build on it over time to become eventual replacement to e_parse. * Cameron's DOM-based parser. */ @@ -2749,15 +2734,19 @@ class e_parser // return $text; } + + + /** * Display an icon. * @param string $icon * @example $tp->toIcon("{e_IMAGES}icons/something.png"); */ - public function toIcon($icon='',$legacyPath ='') + public function toIcon($icon='',$parm = array()) { + if(!vartrue($icon)) { return; @@ -2776,11 +2765,11 @@ class e_parser { $path = $this->replaceConstants($icon,'full'); } - elseif($legacyPath) + elseif(vartrue($parm['legacy'])) { - if(is_readable($legacyPath.$icon)) + if(is_readable($parm['legacy'].$icon)) { - $path = $legacyPath.$icon; + $path = $parm['legacy'].$icon; } elseif(ADMIN) { @@ -2788,11 +2777,19 @@ class e_parser } } + else + { + $path = $icon; + } return "".basename($path).""; } + + + /** + * Display a Video file. * @param string $file - format: id.type eg. x123dkax.youtube * @param boolean $thumbnail - set to 'tag' to return an image thumbnail and 'src' to return the src url or 'video' for a small video thumbnail. */ @@ -2844,6 +2841,22 @@ class e_parser + /** + * Display a Date in the browser. + * Includes support for 'livestamp' (http://mattbradley.github.io/livestampjs/) + * @param integer $datestamp - unix timestamp + * @param string $format - short | long | relative + * @return HTML with converted date. + */ + public function toDate($datestamp = null, $format='short') + { + if(!is_numeric($datestamp)){ return; } + + return ''.e107::getDate()->convert($datestamp, $format).''; + } + + + diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index e493601f7..a32bf5566 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -2682,12 +2682,15 @@ class e_form if($glyph = $tp->toGlyph($value)) { - $value = $glyph; + // $value = $glyph; } else { - $value = ''.basename($value).''; + // $value = ''.basename($value).''; } + + $value = $tp->toIcon($value); + break; case 'file': diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index f24c2289a..eb6f482db 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -904,8 +904,8 @@ class download_shortcodes extends e_shortcode if (!$source) return " "; // list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1)); //XXX ??? // if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE]; //XXX ??? - - return e107::getParser()->toIcon($source, e_IMAGE."icons/"); + $parms = array('legacy'=> e_IMAGE."icons/"); + return e107::getParser()->toIcon($source, $parms); //return "*"; }