<commit_before><?php
/**
 * PluginRenderApiController.php
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   Rcm\Controller
 * @author    <NAME> <<EMAIL>>
 * @copyright 2014 Reliv International
 * @license   License.txt New BSD License
 * @version   GIT: <git_id>
 * @link      https://github.com/reliv
 */

namespace Rcm\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;


/**
 * PluginRenderApiController
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   Rcm\Controller
 * @author    <NAME> <<EMAIL>>
 * @copyright 2014 Reliv International
 * @license   License.txt New BSD License
 * @version   Release: <package_version>
 * @link      https://github.com/reliv
 */
class NewPluginInstanceApiController extends AbstractActionController
{
    public function getNewInstanceAction()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $pluginType = $routeMatch->getParam('type');
        $instanceId = $routeMatch->getParam('instanceId');
        $pluginManager = $this->getServiceLocator()
            ->get('Rcm\Service\PluginManager');
        if ($instanceId < 0) {
            $instanceConfig = $pluginManager
                ->getDefaultInstanceConfig($pluginType);
        } else {
            $instanceConfig = $pluginManager->getInstanceConfig($instanceId);
        }
        $viewData = $pluginManager->getPluginViewData(
            $pluginType,
            $instanceId,
            $instanceConfig
        );
        $jsonModel = new JsonModel();
        $jsonModel->setVariables(
            array(
                'display' => $viewData['html'],
                //These were for edit js and edit css but that was removed
                'js' => '', //$viewData['js'],
                'css' => '', //$viewData['css']
            )
        );
        return $jsonModel;
    }
} <commit_msg>allow sitewide plugins to drag on page<commit_after><?php
/**
 * PluginRenderApiController.php
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   Rcm\Controller
 * @author    <NAME> <<EMAIL>>
 * @copyright 2014 Reliv International
 * @license   License.txt New BSD License
 * @version   GIT: <git_id>
 * @link      https://github.com/reliv
 */

namespace Rcm\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;

/**
 * PluginRenderApiController
 *
 * PHP version 5
 *
 * @category  Reliv
 * @package   Rcm\Controller
 * @author    <NAME> <<EMAIL>>
 * @copyright 2014 Reliv International
 * @license   License.txt New BSD License
 * @version   Release: <package_version>
 * @link      https://github.com/reliv
 */
class NewPluginInstanceApiController extends AbstractActionController
{
    public function getNewInstanceAction()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $pluginType = $routeMatch->getParam('type');
        $instanceId = $routeMatch->getParam('instanceId');
        $pluginManager = $this->getServiceLocator()
            ->get('Rcm\Service\PluginManager');
        if ($instanceId < 0) {
            $instanceConfig = $pluginManager
                ->getDefaultInstanceConfig($pluginType);
        } else {
            $instanceConfig = $pluginManager->getInstanceConfig($instanceId);
        }
        $viewData = $pluginManager->getPluginViewData(
            $pluginType,
            $instanceId,
            $instanceConfig
        );
        $jsonModel = new JsonModel();
        $jsonModel->setVariables(
            array(
                'display' => $viewData['html'],
                //These were for edit js and edit css but that was removed
                'js' => '', //$viewData['js'],
                'css' => '', //$viewData['css']
            )
        );
        return $jsonModel;
    }
}
{'fraction_non_alphanumeric': 0.12853742396191484, 'fraction_numerical': 0.0058185665167944985, 'mean_word_length': 2.3919282511210764, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 45, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '2647679', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1035, 'n_words': 230}