<commit_before><?php
/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license
 *
 * @copyright  Copyright (c) 2009-2014 pimcore GmbH (http://www.pimcore.org)
 * @license    http://www.pimcore.org/license     New BSD License
 */

class Pimcore_Controller_Plugin_Frontend_Editmode extends Zend_Controller_Plugin_Abstract {
    protected $controller;

    public function __construct(Pimcore_Controller_Action_Frontend $controller) {
        $this->controller = $controller;
    }

    public function postDispatch(Zend_Controller_Request_Abstract $request) {

        // add scripts to editmode
        
        $editmodeLibraries = array(
            "/pimcore/static/js/pimcore/namespace.js",
            
            "/pimcore/static/js/lib/prototype-light.js",
            "/pimcore/static/js/lib/jquery.min.js",
            "/pimcore/static/js/lib/ext/adapter/jquery/ext-jquery-adapter-debug.js",
            
            "/pimcore/static/js/lib/ext/ext-all-debug.js",
            "/pimcore/static/js/lib/ext-plugins/ux/Spinner.js",
            "/pimcore/static/js/lib/ext-plugins/ux/SpinnerField.js",
            "/pimcore/static/js/lib/ext-plugins/ux/MultiSelect.js",
            "/pimcore/static/js/lib/ext-plugins/ux/Portal.js",
            "/pimcore/static/js/lib/ext-plugins/ux/PortalColumn.js",
            "/pimcore/static/js/lib/ext-plugins/ux/Portlet.js",
            "/pimcore/static/js/lib/ext-plugins/GridRowOrder/roworder.js",
            "/pimcore/static/js/lib/ckeditor/ckeditor.js",
            "/pimcore/static/js/pimcore/libfixes.js"
        );
        
        $editmodeScripts = array(
            "/pimcore/static/js/pimcore/functions.js",
            "/pimcore/static/js/pimcore/element/tag/imagehotspotmarkereditor.js",
            "/pimcore/static/js/pimcore/element/tag/imagecropper.js",
            "/pimcore/static/js/pimcore/document/edit/helper.js",
            "/pimcore/static/js/pimcore/document/edit/dnd.js",
            "/pimcore/static/js/pimcore/document/tag.js",
            "/pimcore/static/js/pimcore/document/tags/block.js",
            "/pimcore/static/js/pimcore/document/tags/date.js",
            "/pimcore/static/js/pimcore/document/tags/href.js",
            "/pimcore/static/js/pimcore/document/tags/multihref.js",
            "/pimcore/static/js/pimcore/document/tags/checkbox.js",
            "/pimcore/static/js/pimcore/document/tags/image.js",
            "/pimcore/static/js/pimcore/document/tags/input.js",
            "/pimcore/static/js/pimcore/document/tags/link.js",
            "/pimcore/static/js/pimcore/document/tags/select.js",
            "/pimcore/static/js/pimcore/document/tags/snippet.js",
            "/pimcore/static/js/pimcore/document/tags/textarea.js",
            "/pimcore/static/js/pimcore/document/tags/numeric.js",
            "/pimcore/static/js/pimcore/document/tags/wysiwyg.js",
            "/pimcore/static/js/pimcore/document/tags/renderlet.js",
            "/pimcore/static/js/pimcore/document/tags/table.js",
            "/pimcore/static/js/pimcore/document/tags/video.js",
            "/pimcore/static/js/pimcore/document/tags/multiselect.js",
            "/pimcore/static/js/pimcore/document/tags/areablock.js",
            "/pimcore/static/js/pimcore/document/tags/area.js",
            "/pimcore/static/js/pimcore/document/tags/pdf.js",
            "/pimcore/static/js/pimcore/document/edit/helper.js"
        );


        $conf = Pimcore_Config::getSystemConfig();

        $editmodeStylesheets = array(
            "/pimcore/static/js/lib/ext/resources/css/ext-all.css",
            "/pimcore/static/js/lib/ext/resources/css/xtheme-gray.css",
            "/pimcore/static/css/icons.css",
            "/pimcore/static/css/editmode.css",
            "/pimcore/static/js/lib/ext-plugins/ux/css/Spinner.css",
            "/pimcore/static/js/lib/ext-plugins/ux/css/MultiSelect.css",
            "/pimcore/static/js/lib/ext-plugins/ux/css/Portal.css",
            "/pimcore/static/css/ext-admin-overwrite.css"
        );

        //add plugin editmode JS and CSS
        try {
            $pluginConfigs = Pimcore_ExtensionManager::getPluginConfigs();
            $jsPaths = array();
            $cssPaths = array();

            if (!empty($pluginConfigs)) {
                //registering plugins
                foreach ($pluginConfigs as $p) {

                    $pluginJsPaths = array();
                    if(array_key_exists("pluginDocumentEditmodeJsPaths", $p['plugin'])
                    && is_array($p['plugin']['pluginDocumentEditmodeJsPaths'])
                    && isset($p['plugin']['pluginDocumentEditmodeJsPaths']['path'])) {
                        if (is_array($p['plugin']['pluginDocumentEditmodeJsPaths']['path'])) {
                            $pluginJsPaths = $p['plugin']['pluginDocumentEditmodeJsPaths']['path'];
                        }
                        else if ($p['plugin']['pluginDocumentEditmodeJsPaths']['path'] != null) {
                            $pluginJsPaths[] = $p['plugin']['pluginDocumentEditmodeJsPaths']['path'];
                        }
                    }

                    //manipulate path for frontend
                    if (is_array($pluginJsPaths) and count($pluginJsPaths) > 0) {
                        for ($i = 0; $i < count($pluginJsPaths); $i++) {<commit_msg>document editmode: removed useless css and js<commit_after><?php
/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license
 *
 * @copyright  Copyright (c) 2009-2014 pimcore GmbH (http://www.pimcore.org)
 * @license    http://www.pimcore.org/license     New BSD License
 */

class
Pimcore_Controller_Plugin_Frontend_Editmode extends Zend_Controller_Plugin_Abstract {
    protected $controller;

    public function __construct(Pimcore_Controller_Action_Frontend $controller) {
        $this->controller = $controller;
    }

    public function postDispatch(Zend_Controller_Request_Abstract $request) {

        // add scripts to editmode
        
        $editmodeLibraries = array(
            "/pimcore/static/js/pimcore/namespace.js",
            
            "/pimcore/static/js/lib/prototype-light.js",
            "/pimcore/static/js/lib/jquery.min.js",
            "/pimcore/static/js/lib/ext/adapter/jquery/ext-jquery-adapter-debug.js",
            
            "/pimcore/static/js/lib/ext/ext-all-debug.js",
            "/pimcore/static/js/lib/ext-plugins/ux/Spinner.js",
            "/pimcore/static/js/lib/ext-plugins/ux/SpinnerField.js",
            "/pimcore/static/js/lib/ext-plugins/ux/MultiSelect.js",
            "/pimcore/static/js/lib/ext-plugins/GridRowOrder/roworder.js",
            "/pimcore/static/js/lib/ckeditor/ckeditor.js",
            "/pimcore/static/js/pimcore/libfixes.js"
        );
        
        $editmodeScripts = array(
            "/pimcore/static/js/pimcore/functions.js",
            "/pimcore/static/js/pimcore/element/tag/imagehotspotmarkereditor.js",
            "/pimcore/static/js/pimcore/element/tag/imagecropper.js",
            "/pimcore/static/js/pimcore/document/edit/helper.js",
            "/pimcore/static/js/pimcore/document/edit/dnd.js",
            "/pimcore/static/js/pimcore/document/tag.js",
            "/pimcore/static/js/pimcore/document/tags/block.js",
            "/pimcore/static/js/pimcore/document/tags/date.js",
            "/pimcore/static/js/pimcore/document/tags/href.js",
            "/pimcore/static/js/pimcore/document/tags/multihref.js",
            "/pimcore/static/js/pimcore/document/tags/checkbox.js",
            "/pimcore/static/js/pimcore/document/tags/image.js",
            "/pimcore/static/js/pimcore/document/tags/input.js",
            "/pimcore/static/js/pimcore/document/tags/link.js",
            "/pimcore/static/js/pimcore/document/tags/select.js",
            "/pimcore/static/js/pimcore/document/tags/snippet.js",
            "/pimcore/static/js/pimcore/document/tags/textarea.js",
            "/pimcore/static/js/pimcore/document/tags/numeric.js",
            "/pimcore/static/js/pimcore/document/tags/wysiwyg.js",
            "/pimcore/static/js/pimcore/document/tags/renderlet.js",
            "/pimcore/static/js/pimcore/document/tags/table.js",
            "/pimcore/static/js/pimcore/document/tags/video.js",
            "/pimcore/static/js/pimcore/document/tags/multiselect.js",
            "/pimcore/static/js/pimcore/document/tags/areablock.js",
            "/pimcore/static/js/pimcore/document/tags/area.js",
            "/pimcore/static/js/pimcore/document/tags/pdf.js",
            "/pimcore/static/js/pimcore/document/edit/helper.js"
        );


        $conf = Pimcore_Config::getSystemConfig();

        $editmodeStylesheets = array(
            "/pimcore/static/js/lib/ext/resources/css/ext-all.css",
            "/pimcore/static/js/lib/ext/resources/css/xtheme-gray.css",
            "/pimcore/static/css/icons.css",
            "/pimcore/static/css/editmode.css",
            "/pimcore/static/js/lib/ext-plugins/ux/css/Spinner.css",
            "/pimcore/static/js/lib/ext-plugins/ux/css/MultiSelect.css",
            "/pimcore/static/css/ext-admin-overwrite.css"
        );

        //add plugin editmode JS and CSS
        try {
            $pluginConfigs = Pimcore_ExtensionManager::getPluginConfigs();
            $jsPaths = array();
            $cssPaths = array();

            if (!empty($pluginConfigs)) {
                //registering plugins
                foreach ($pluginConfigs as $p) {

                    $pluginJsPaths = array();
                    if(array_key_exists("pluginDocumentEditmodeJsPaths", $p['plugin'])
                    && is_array($p['plugin']['pluginDocumentEditmodeJsPaths'])
                    && isset($p['plugin']['pluginDocumentEditmodeJsPaths']['path'])) {
                        if (is_array($p['plugin']['pluginDocumentEditmodeJsPaths']['path'])) {
                            $pluginJsPaths = $p['plugin']['pluginDocumentEditmodeJsPaths']['path'];
                        }
                        else if ($p['plugin']['pluginDocumentEditmodeJsPaths']['path'] != null) {
                            $pluginJsPaths[] = $p['plugin']['pluginDocumentEditmodeJsPaths']['path'];
                        }
                    }

                    //manipulate path for frontend
                    if (is_array($pluginJsPaths) and count($pluginJsPaths) > 0) {
                        for ($i = 0; $i < count($pluginJsPaths); $i++) {
{'fraction_non_alphanumeric': 0.14661723818350325, 'fraction_numerical': 0.0018535681186283596, 'mean_word_length': 2.044864559819413, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6343795', 'n_tokens_mistral': 3433, 'n_tokens_neox': 3358, 'n_words': 352}