<?php define('KICKASSETS_DIR', basename(__DIR__)); // IE9 doesn't get to play with us. if (!preg_match('/(?i)msie [5-9]/', $_SERVER['HTTP_USER_AGENT'])) { CMSMenu::remove_menu_item('AssetAdmin'); } else { CMSMenu::remove_menu_item('KickAssets'); } if (KickAssets::config()->use_on_uploadfield) { Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', array(KICKASSETS_DIR . '/javascript/kickassets-uploadfield.js' => array())); } if (KickAssets::config()->use_on_tinymce) { HtmlEditorConfig::get('cms')->enablePlugins(array('kickassets' => '../../../' . KICKASSETS_DIR . '/javascript/kickassets-tinymce.js')); HtmlEditorConfig::get('cms')->insertButtonsAfter('ssmedia', 'kickassets'); }
/** * Helper method for generating an HTTPResponse based on given JSON * * @param array $json */ protected function JSONResponse($json = null) { if (!$json) { $json = $this->file instanceof Folder ? $this->parent->createFolderJSON($this->file) : $this->parent->createFileJSON($this->file); } return (new SS_HTTPResponse(Convert::array2json($json)))->addHeader('Content-Type', 'application/json'); }