Преглед изворни кода

ajout ckfinder & ckeditor

reduction
Fab пре 4 година
родитељ
комит
d8ee7c08e3
5 измењених фајлова са 29 додато и 36 уклоњено
  1. +0
    -35
      ShopBundle/Model/Address.php
  2. +1
    -1
      ShopBundle/Model/Product.php
  3. +11
    -0
      ShopBundle/Resources/public/js/backend/setup-ckfinder.js
  4. +4
    -0
      ShopBundle/Resources/views/form/ckfinder_widget.html.twig
  5. +13
    -0
      ShopBundle/Services/CustomCKFinderAuth.php

+ 0
- 35
ShopBundle/Model/Address.php Прегледај датотеку

@@ -87,11 +87,6 @@ abstract class Address extends AbstractEntity
*/
protected $comment;

/**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="invoiceAddress")
*/
protected $orders;

/**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", mappedBy="address", cascade={"persist", "remove"})
*/
@@ -287,36 +282,6 @@ abstract class Address extends AbstractEntity
return $this;
}

/**
* @return Collection|ShopOrder[]
*/
public function getOrders(): Collection
{
return $this->orders;
}

public function addOrder(OrderShop $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setInvoiceAddress($this);
}

return $this;
}

public function removeOrder(OrderShop $order): self
{
if ($this->orders->contains($order)) {
$this->orders->removeElement($order);
// set the owning side to null (unless already changed)
if ($order->getInvoiceAddress() === $this) {
$order->setInvoiceAddress(null);
}
}

return $this;
}

public function getPointSale(): ?PointSale
{

+ 1
- 1
ShopBundle/Model/Product.php Прегледај датотеку

@@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\MappedSuperclass()
*/
abstract class Product extends AbstractEntity
abstract class Product extends AbstractDocumentEntity
{
/**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", inversedBy="products")

+ 11
- 0
ShopBundle/Resources/public/js/backend/setup-ckfinder.js Прегледај датотеку

@@ -0,0 +1,11 @@
window.onload = function () {
/*if (window.CKEDITOR){
var path = '/ckfinder/connector';
CKFinder.config( { connectorPath: (window.location.pathname.indexOf("app_dev.php") == -1) ? path : '/app_dev.php'+path} );
for (var ckInstance in CKEDITOR.instances){
CKFinder.setupCKEditor(CKEDITOR.instances[ckInstance]);
}
}*/
alert('ncihce');
}
CKFinder.config( { connectorPath: '/ckfinder/connector' } );

+ 4
- 0
ShopBundle/Resources/views/form/ckfinder_widget.html.twig Прегледај датотеку

@@ -0,0 +1,4 @@
{% block _product_ck_finder_widget %}
{# ... #}
<a href="...">More information</a>
{% endblock %}

+ 13
- 0
ShopBundle/Services/CustomCKFinderAuth.php Прегледај датотеку

@@ -0,0 +1,13 @@
<?php

namespace Lc\ShopBundle\Services;

use CKSource\Bundle\CKFinderBundle\Authentication\Authentication as AuthenticationBase;

class CustomCKFinderAuth extends AuthenticationBase
{
public function authenticate()
{
return true;
}
}

Loading…
Откажи
Сачувај