Skip to content

Instantly share code, notes, and snippets.

View lolautruche's full-sized avatar

Jérôme Vieilledent lolautruche

View GitHub Profile
@lolautruche
lolautruche / 0 - Readme.md
Last active August 29, 2015 14:04
Oro DistributionBundle split

Subtree split of OroCRM/DistributionBundle

  1. Clone the base repository into oro-platform directory:

    git clone git@github.com:lolautruche/platform.git oro-platform
    git remote add upstream git@github.com:orocrm/platform.git
    git config branch.master.remote upstream
  2. Run the 2 shell scripts, split_oro_config_component.sh and split_oro_distribution_bundle.sh

@lolautruche
lolautruche / ezxml_to_html5.html.twig
Created October 15, 2013 18:29
Convert XmlText to HTML - eZ Publish 5
{% set html = content.getFieldValue( "my_xmltext_field" ).xml|xmltext_to_html5 %}
<div>
{{ html }}
</div>
@lolautruche
lolautruche / controller.php
Last active December 25, 2015 04:39
Pagination in eZ Publish 5
<?php
namespace Acme\TestBundle\Controller;
use eZ\Publish\Core\Pagination\Pagerfanta\ContentSearchAdapter;
use Pagerfanta\Pagerfanta;
use Symfony\Component\HttpFoundation\Response;
use eZ\Bundle\EzPublishCoreBundle\Controller;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier;
use eZ\Publish\API\Repository\Values\Content\Query;
<?php
use Composer\Package\Version\VersionParser;
require 'vendor/autoload.php';
$parser = new VersionParser();
$constraint = $parser->parseConstraints('2013.09.*');
$single = $parser->parseConstraints('v2013.09.0');
@lolautruche
lolautruche / AdminController.php
Created June 2, 2013 19:58
eZ Publish 5 - Legacy module with a Symfony controller
<?php
/**
* AcmeTestBundle/Controller/AdminController.php
*/
namespace Acme\TestBundle\Controller;
use eZ\Bundle\EzPublishCoreBundle\Controller;
/**
* Here is your Symfony controller, defined as a service (see service definition below)
@lolautruche
lolautruche / ezrouter.php
Created March 5, 2012 20:17
Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
<?php
/**
* Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
* WARNING !!! Use it for DEVELOPMENT purpose ONLY !!!
* This script is provided as is, use it at your own risk !
*
* @copyright Copyright (C) 2011 Jérôme Vieilledent. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
*/
@lolautruche
lolautruche / gist:1447481
Created December 8, 2011 16:20
eZ Publish router script to be used with PHP 5.4 built-in webserver
<?php
// Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
// WARNING !!! Use it for development purpose ONLY !!!
// This script is provided as is, use it at your own risk
// Determine which script to redirect to depending on rewrite rule to apply
// If the request needs to be served directly, $script needs to be null
$uri = $_SERVER['REQUEST_URI'];
$script = 'index.php';
<html>
<head>
<title>JQuery - FadeIn() et FadeOut() - Exemple</title>
<script type="text/javascript" src="jquery-1.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#boutonFadeOut").click(function () {
$("#contenu").fadeOut();
});
$("#boutonFadeIn").click(function () {
<?php
public function trashSubtree( $locationId )
{
$location = $this->load( $locationId );
// Create new trashed location and remove original location from tree
$params = (array)$location;
$params['locationId'] = $locationId;
// Be sure to not overlap id
unset( $params['id'] );