create content controller
This commit is contained in:
@@ -221,6 +221,12 @@
|
|||||||
<default key="_controller">Thelia\Controller\Admin\FolderController::updatePositionAction</default>
|
<default key="_controller">Thelia\Controller\Admin\FolderController::updatePositionAction</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
<!-- content routes management -->
|
||||||
|
<route id="admin.content.update" path="admin/content/update/{content_id}">
|
||||||
|
<default key="_controller">Thelia\Controller\Admin\ContentController::updateAction</default>
|
||||||
|
<requirement key="content_id">\d+</requirement>
|
||||||
|
</route>
|
||||||
|
|
||||||
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
||||||
|
|
||||||
<route id="admin.coupon.list" path="/admin/coupon/">
|
<route id="admin.coupon.list" path="/admin/coupon/">
|
||||||
|
|||||||
169
core/lib/Thelia/Controller/Admin/ContentController.php
Normal file
169
core/lib/Thelia/Controller/Admin/ContentController.php
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Thelia */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : info@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* This program is free software; you can redistribute it and/or modify */
|
||||||
|
/* it under the terms of the GNU General Public License as published by */
|
||||||
|
/* the Free Software Foundation; either version 3 of the License */
|
||||||
|
/* */
|
||||||
|
/* This program is distributed in the hope that it will be useful, */
|
||||||
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||||
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||||
|
/* GNU General Public License for more details. */
|
||||||
|
/* */
|
||||||
|
/* You should have received a copy of the GNU General Public License */
|
||||||
|
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Controller\Admin;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ContentController
|
||||||
|
* @package Thelia\Controller\Admin
|
||||||
|
* @author manuel raynaud <mraynaud@openstudio.fr>
|
||||||
|
*/
|
||||||
|
class ContentController extends AbstractCrudController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the creation form for this object
|
||||||
|
*/
|
||||||
|
protected function getCreationForm()
|
||||||
|
{
|
||||||
|
// TODO: Implement getCreationForm() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the update form for this object
|
||||||
|
*/
|
||||||
|
protected function getUpdateForm()
|
||||||
|
{
|
||||||
|
// TODO: Implement getUpdateForm() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hydrate the update form for this object, before passing it to the update template
|
||||||
|
*
|
||||||
|
* @param unknown $object
|
||||||
|
*/
|
||||||
|
protected function hydrateObjectForm($object)
|
||||||
|
{
|
||||||
|
// TODO: Implement hydrateObjectForm() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the creation event with the provided form data
|
||||||
|
*
|
||||||
|
* @param unknown $formData
|
||||||
|
*/
|
||||||
|
protected function getCreationEvent($formData)
|
||||||
|
{
|
||||||
|
// TODO: Implement getCreationEvent() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the update event with the provided form data
|
||||||
|
*
|
||||||
|
* @param unknown $formData
|
||||||
|
*/
|
||||||
|
protected function getUpdateEvent($formData)
|
||||||
|
{
|
||||||
|
// TODO: Implement getUpdateEvent() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the delete event with the provided form data
|
||||||
|
*/
|
||||||
|
protected function getDeleteEvent()
|
||||||
|
{
|
||||||
|
// TODO: Implement getDeleteEvent() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the event contains the object, e.g. the action has updated the object in the event.
|
||||||
|
*
|
||||||
|
* @param unknown $event
|
||||||
|
*/
|
||||||
|
protected function eventContainsObject($event)
|
||||||
|
{
|
||||||
|
// TODO: Implement eventContainsObject() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the created object from an event.
|
||||||
|
*
|
||||||
|
* @param unknown $createEvent
|
||||||
|
*/
|
||||||
|
protected function getObjectFromEvent($event)
|
||||||
|
{
|
||||||
|
// TODO: Implement getObjectFromEvent() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load an existing object from the database
|
||||||
|
*/
|
||||||
|
protected function getExistingObject()
|
||||||
|
{
|
||||||
|
// TODO: Implement getExistingObject() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the object label form the object event (name, title, etc.)
|
||||||
|
*
|
||||||
|
* @param unknown $object
|
||||||
|
*/
|
||||||
|
protected function getObjectLabel($object)
|
||||||
|
{
|
||||||
|
// TODO: Implement getObjectLabel() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the object ID from the object
|
||||||
|
*
|
||||||
|
* @param unknown $object
|
||||||
|
*/
|
||||||
|
protected function getObjectId($object)
|
||||||
|
{
|
||||||
|
// TODO: Implement getObjectId() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the main list template
|
||||||
|
*
|
||||||
|
* @param unknown $currentOrder, if any, null otherwise.
|
||||||
|
*/
|
||||||
|
protected function renderListTemplate($currentOrder)
|
||||||
|
{
|
||||||
|
// TODO: Implement renderListTemplate() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the edition template
|
||||||
|
*/
|
||||||
|
protected function renderEditionTemplate()
|
||||||
|
{
|
||||||
|
// TODO: Implement renderEditionTemplate() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect to the edition template
|
||||||
|
*/
|
||||||
|
protected function redirectToEditionTemplate()
|
||||||
|
{
|
||||||
|
// TODO: Implement redirectToEditionTemplate() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect to the list template
|
||||||
|
*/
|
||||||
|
protected function redirectToListTemplate()
|
||||||
|
{
|
||||||
|
// TODO: Implement redirectToListTemplate() method.
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -214,7 +214,7 @@
|
|||||||
current_order=$content_order
|
current_order=$content_order
|
||||||
order='id'
|
order='id'
|
||||||
reverse_order='id_reverse'
|
reverse_order='id_reverse'
|
||||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
path={url path='/admin/folders' parent=$parent target='contents'}
|
||||||
label="{intl l='ID'}"
|
label="{intl l='ID'}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
current_order=$content_order
|
current_order=$content_order
|
||||||
order='alpha'
|
order='alpha'
|
||||||
reverse_order='alpha_reverse'
|
reverse_order='alpha_reverse'
|
||||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
path={url path='/admin/folders' parent=$parent target='contents'}
|
||||||
label="{intl l='Content title'}"
|
label="{intl l='Content title'}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
current_order=$content_order
|
current_order=$content_order
|
||||||
order='visible'
|
order='visible'
|
||||||
reverse_order='visible_reverse'
|
reverse_order='visible_reverse'
|
||||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
path={url path='/admin/folders' parent=$parent target='contents'}
|
||||||
label="{intl l='Online'}"
|
label="{intl l='Online'}"
|
||||||
}
|
}
|
||||||
</th>
|
</th>
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
current_order=$content_order
|
current_order=$content_order
|
||||||
order='manual'
|
order='manual'
|
||||||
reverse_order='manual_reverse'
|
reverse_order='manual_reverse'
|
||||||
path={url path='/admin/folders' id_folder=$folder_id target='contents'}
|
path={url path='/admin/folders' parent=$parent target='contents'}
|
||||||
label="{intl l='Position'}"
|
label="{intl l='Position'}"
|
||||||
}
|
}
|
||||||
</th>
|
</th>
|
||||||
@@ -262,7 +262,7 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
{loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
{loop type="image" name="folder_image" source="content" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||||
<a href="{url path='admin/content/edit' id=$ID}" title="{intl l='Edit this content'}">
|
<a href="{url path="admin/content/update/$ID"}" title="{intl l='Edit this content'}">
|
||||||
<img src="{$IMAGE_URL}" alt="{$TITLE}" />
|
<img src="{$IMAGE_URL}" alt="{$TITLE}" />
|
||||||
</a>
|
</a>
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|||||||
Reference in New Issue
Block a user