Commit 48680c56 authored by Яков's avatar Яков
Browse files

first

parents
<?php
class armConfiguration extends sfApplicationConfiguration
{
public function configure()
{
}
}
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/09-Cache
default:
enabled: false
contextual: true
with_layout: false
lifetime: 86400
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
all:
storage:
class: sfSessionStorage
param:
session_name: arm
mailer:
param:
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: localhost
port: 25
encryption: ~
username: ~
password: ~
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/12-Filters
rendering: ~
security: ~
remember_me:
class: doAuthRememberMeFilter
cache: ~
execution: ~
discount_phone:
class: sfDoctrineRouteCollection
options:
model: DiscountPhone
module: discount_phone
prefix_path: /discount_phone
column: id
with_wildcard_routes: true
discount:
class: sfDoctrineRouteCollection
options:
model: Discount
module: discount
prefix_path: /discount
column: id
with_wildcard_routes: true
notification_emails:
class: sfDoctrineRouteCollection
options:
model: NotificationEmails
module: notification_emails
prefix_path: /notification_emails
column: id
with_wildcard_routes: true
callback:
class: sfDoctrineRouteCollection
options:
model: Callback
module: callback
prefix_path: /callback
column: id
with_wildcard_routes: true
basket_order:
class: sfDoctrineRouteCollection
options:
model: BasketOrder
module: basket_order
prefix_path: /basket_order
column: id
with_wildcard_routes: true
offer:
class: sfDoctrineRouteCollection
options:
model: Offer
module: offer
prefix_path: /offer
column: id
with_wildcard_routes: true
product_prop_value:
class: sfDoctrineRouteCollection
options:
model: ProductPropValue
module: product_prop_value
prefix_path: /product_prop_value
column: id
with_wildcard_routes: true
suppliers:
class: sfDoctrineRouteCollection
options:
model: Suppliers
module: suppliers
prefix_path: /suppliers
column: id
with_wildcard_routes: true
review:
class: sfDoctrineRouteCollection
options:
model: Review
module: review
prefix_path: /review
column: id
with_wildcard_routes: true
partners:
class: sfDoctrineRouteCollection
options:
model: Partners
module: partners
prefix_path: /partners
column: id
with_wildcard_routes: true
video:
class: sfDoctrineRouteCollection
options:
model: Video
module: video
prefix_path: /video
column: id
with_wildcard_routes: true
article:
class: sfDoctrineRouteCollection
options:
model: Article
module: article
prefix_path: /article
column: id
with_wildcard_routes: true
tag:
class: sfDoctrineRouteCollection
options:
model: Tag
module: tag
prefix_path: /tag
column: id
with_wildcard_routes: true
product_prop_list_ajax_delete:
url: /product_prop/ajax_delete/
param: { module: product_prop, action: ajax_delete}
product_prop_list:
class: sfDoctrineRouteCollection
options:
model: ProductPropList
module: product_prop_list
prefix_path: /product_prop_list
column: id
with_wildcard_routes: true
product_prop:
class: sfDoctrineRouteCollection
options:
model: ProductProp
module: product_prop
prefix_path: /product_prop
column: id
with_wildcard_routes: true
product:
class: sfDoctrineRouteCollection
options:
model: Product
module: product
prefix_path: /product
column: id
with_wildcard_routes: true
cat:
class: sfDoctrineRouteCollection
options:
model: Cat
module: cat
prefix_path: /cat
column: id
with_wildcard_routes: true
user:
class: sfDoctrineRouteCollection
options:
model: User
module: user
prefix_path: /user
column: id
with_wildcard_routes: true
page:
class: sfDoctrineRouteCollection
options:
model: Page
module: page
prefix_path: /page
column: id
with_wildcard_routes: true
uploader:
url: /uploader
param: { module: main, action: uploader }
signin:
url: /login
param: { module: baseAuth, action: signin }
signout:
url: /logout
param: { module: baseAuth, action: signout }
homepage:
url: /
param: { module: cat, action: index }
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/08-Security
default:
is_secure: true
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/04-Settings
prod:
.settings:
logging_enabled: false
cache: false
dev:
.settings:
error_reporting: <?php echo ((E_ALL) ^ ~E_NOTICE)."\n" ?>
web_debug: false
cache: false
logging_enabled: true
test:
.settings:
error_reporting: <?php echo ((E_ALL | E_STRICT) ^ ~E_NOTICE)."\n" ?>
cache: false
web_debug: false
all:
.settings:
csrf_secret: 2450ecb2853511b9f9137ee54890608d0b8c62dd
escaping_strategy: true
escaping_method: ESC_SPECIALCHARS
use_database: true
no_script_name: true
enabled_modules: [default, csSetting, baseAuth]
default_culture: ru_RU
standard_helpers: [Partial, Cache, I18N]
i18n: true
.actions:
login_module: baseAuth
login_action: signin
secure_module: baseAuth
secure_action: secure
default:
http_metas:
content-type: text/html
stylesheets: [arm/lui.css, /js/redactor/css/redactor.css, arm/g.css, arm/p.css, chosen.css, fotorama.css, arm/struct.css]
javascripts: [jquery-2.1.4.min.js, jquery-migrate-1.2.1.min.js, jquery-ui.js, arm/plugins.js, jquery.plugins.js, chosen.jquery.js, arm/jquery.hideseek.js, redactor/redactor.js, perfect-scrollbar.min.js, sexypicker.js, jquery.liteuploader.js, jquery.fileupload.js, imageuploader_logic.js, arm/struct.js, arm/arm.js, arm/init.d.js]
has_layout: true
layout: layout
<?php
class myUser extends doAuthSecurityUser
{
}
<?php
require_once dirname(__FILE__).'/../lib/articleGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/articleGeneratorHelper.class.php';
/**
* article actions.
*
* @package sf
* @subpackage article
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class articleActions extends autoArticleActions
{
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{
$notice = $form->getObject()->isNew() ? 'The item was created successfully.' : 'The item was updated successfully.';
try
{
$article = $form->save();
$article_custom = $request->getParameter('article_custom');
if(count($article_custom['tags']) > 0)
{
foreach($article_custom['tags'] as $tag_id)
{
$newProductTags = new ArticleTags();
$newProductTags->setArticleId($article->getId());
$newProductTags->setTagId($tag_id);
$newProductTags->save();
}
}
}
catch (Doctrine_Validator_Exception $e)
{
$errorStack = $form->getObject()->getErrorStack();
$message = get_class($form->getObject()) . ' has ' . count($errorStack) . " field" . (count($errorStack) > 1 ? 's' : null) . " with validation errors: ";
foreach ($errorStack as $field => $errors)
{
$message .= "$field (" . implode(", ", $errors) . "), ";
}
$message = trim($message, ', ');
$this->getUser()->setFlash('error', $message);
return sfView::SUCCESS;
}
$this->dispatcher->notify(new sfEvent($this, 'admin.save_object', array('object' => $article)));
if ($request->hasParameter('_save_and_add'))
{
$this->getUser()->setFlash('notice', $notice.' You can add another one below.');
$this->redirect('@article_new');
}
elseif ($request->hasParameter('_save_and_list'))
{
$this->redirect('@article');
}
else
{
if(!$request->isXmlHttpRequest())
{
$this->getUser()->setFlash('notice', $notice);
$this->redirect($request->hasParameter('return') ? $request->getParameter('return') : array('sf_route' => 'article_edit', 'sf_subject' => $article));
}
}
}
else
{
$this->getUser()->setFlash('error', 'The item has not been saved due to some errors.', false);
$this->getResponse()->addHttpMeta('Sf-Form-Error', '1', true);
}
}
protected function buildQuery()
{
$query = parent::buildQuery();
$query->leftJoin("r.Translation t");
return $query;
}
}
generator:
class: sfDoctrineGenerator
param:
model_class: Article
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: article
with_doctrine_route: true
actions_base_class: sfActions
order: 50
config:
actions: ~
fields:
title: {label: 'Название'}
title_ru: {label: 'Название RU'}
title_en: {label: 'Название EN'}
alias: {label: 'Алиас'}
image: {label: 'Изображение'}
cover: {label: 'Изображение'}
created_at: {label: 'Дата создания'}
tags_list: {label: 'Теги'}
list:
layout: ~
title: 'Статьи'
display: [_title, _image, alias]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: [title]
export: false
filter:
class: false
form: ~
edit:
title: Редактирование статьи
new:
title: Добавление статьи
\ No newline at end of file
<?php
/**
* article module configuration.
*
* @package sf
* @subpackage article
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class articleGeneratorConfiguration extends BaseArticleGeneratorConfiguration
{
}
<?php
/**
* article module helper.
*
* @package sf
* @subpackage article
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class articleGeneratorHelper extends BaseArticleGeneratorHelper
{
}
<div class="sf_admin_form_row sf_admin_text tabbed_div">
<div>
<span class="inline-label">Теги</span>
<div class="content">
<?php
$tags = Doctrine::getTable('Tag')->findAll();
$obj = $form->getObject();
$selected_tag_dirty = $obj->getArticleTags();
$selected_tag = array();
foreach($selected_tag_dirty as $tag)
{
$selected_tag[] = $tag->getTagId();
}
foreach($tags as $tag)
{
$dopAttr = '';
if(in_array($tag->getId(), $selected_tag))
{
$dopAttr = 'checked';
}
?>
<label><input type="checkbox" name="article_custom[tags][]" value="<?php echo $tag->getId() ?>" <?php echo $dopAttr ?>><?php echo $tag->getTranslation()->ru->title ?></label>
&nbsp;
<?php
}
?>
</div>
</div>
</div>
\ No newline at end of file
<?php
include_partial('main/image', array('image' => $article->getCover(), 'type' => 'fotorama', 'id' => $article->getId()));
?>
<?php
include_partial('main/title', array('elem' => $article));
?>
\ No newline at end of file
<?php
$available = $article->getTranslation()->en->available;
if($available)
{
echo $article->getTranslation()->en->title;
}
else
{
echo '<div class="notActive">Не активно</div>';
}
\ No newline at end of file
<?php
$available = $article->getTranslation()->ru->available;
if($available)
{
echo $article->getTranslation()->ru->title;
}
else
{
echo '<div class="notActive">Не активно</div>';
}
\ No newline at end of file
<?php
require_once dirname(__FILE__).'/../lib/basket_orderGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/basket_orderGeneratorHelper.class.php';
/**
* basket_order actions.
*
* @package sf
* @subpackage basket_order
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class basket_orderActions extends autoBasket_orderActions
{
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment