Author: tkoomzaaskz Date: 2010-01-18 00:01:50 +0100 (Mon, 18 Jan 2010) New Revision: 26790
Added: plugins/tdBlogPlugin/branches/ plugins/tdBlogPlugin/tags/ plugins/tdBlogPlugin/td_blog.jpg plugins/tdBlogPlugin/trunk/ plugins/tdBlogPlugin/trunk/LICENSE plugins/tdBlogPlugin/trunk/README plugins/tdBlogPlugin/trunk/config/ plugins/tdBlogPlugin/trunk/config/doctrine/ plugins/tdBlogPlugin/trunk/config/doctrine/schema.yml plugins/tdBlogPlugin/trunk/config/routing.yml plugins/tdBlogPlugin/trunk/config/tdBlogPluginConfiguration.class.php plugins/tdBlogPlugin/trunk/data/ plugins/tdBlogPlugin/trunk/data/fixtures/ plugins/tdBlogPlugin/trunk/data/fixtures/fixtures.yml plugins/tdBlogPlugin/trunk/lib/ plugins/tdBlogPlugin/trunk/lib/filter/ plugins/tdBlogPlugin/trunk/lib/filter/doctrine/ plugins/tdBlogPlugin/trunk/lib/filter/doctrine/PlugintdArticleFormFilter.class.php plugins/tdBlogPlugin/trunk/lib/form/ plugins/tdBlogPlugin/trunk/lib/form/doctrine/ plugins/tdBlogPlugin/trunk/lib/form/doctrine/PlugintdArticleForm.class.php plugins/tdBlogPlugin/trunk/lib/model/ plugins/tdBlogPlugin/trunk/lib/model/doctrine/ plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticle.class.php plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticleTable.class.php plugins/tdBlogPlugin/trunk/modules/ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/actions/ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/actions/actions.class.php plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/_article.php plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/indexSuccess.php plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/showSuccess.php plugins/tdBlogPlugin/trunk/modules/td_article/ plugins/tdBlogPlugin/trunk/modules/td_article/actions/ plugins/tdBlogPlugin/trunk/modules/td_article/actions/actions.class.php plugins/tdBlogPlugin/trunk/modules/td_article/config/ plugins/tdBlogPlugin/trunk/modules/td_article/config/generator.yml plugins/tdBlogPlugin/trunk/modules/td_article/i18n/ plugins/tdBlogPlugin/trunk/modules/td_article/i18n/sf_admin.pl.xml plugins/tdBlogPlugin/trunk/modules/td_article/lib/ plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorConfiguration.class.php plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorHelper.class.php plugins/tdBlogPlugin/trunk/modules/td_article/templates/ plugins/tdBlogPlugin/trunk/package.xml Log: initial import Added: plugins/tdBlogPlugin/td_blog.jpg =================================================================== (Binary files differ) Property changes on: plugins/tdBlogPlugin/td_blog.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: plugins/tdBlogPlugin/trunk/LICENSE =================================================================== --- plugins/tdBlogPlugin/trunk/LICENSE (rev 0) +++ plugins/tdBlogPlugin/trunk/LICENSE 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,7 @@ +Copyright (c) 2009 Tomasz Ducin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Added: plugins/tdBlogPlugin/trunk/README =================================================================== --- plugins/tdBlogPlugin/trunk/README (rev 0) +++ plugins/tdBlogPlugin/trunk/README 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,76 @@ +tdCorePlugin +============ + +The `tdVisitorCounterPlugin` is a symfony plugin that provides basic +functionalities enabling TD CMF, such as common configuration or random data +generation. + +This plugin is a part of __TD CMF__ and is based on __Doctrine ORM__. + +Installation +============ + +Install the plugin via the subversion repository by executing the following +command from the project root directory: + + $ svn co http://svn.symfony-project.com/plugins/tdCorePlugin/trunk plugins/tdCorePlugin + +or by using the default symfony plugin install command: + + $ ./symfony plugin:install -s beta tdCorePlugin + +as the actual release is in its beta stage. Run the following command to enable +the assets of tdCorePlugin: + + $ ./symfony plugin:publish-assets + +Usage +===== + + * This plugin is the main part of the __TD CMF__ and therefore it should be + installed as the first one. Other td components will use functionalities + provided with tdCorePlugin. + + * Add __/tdCorePlugin/css/td_core_icons.css__ to your backend/config/view.yml + in the css section array to enable admin generator icons. + +sfAdminDashPlugin compatibility +=============================== + +The icons provided with the plugin may be used for sfAdminDashPlugin. To do so, +you need to do the following: + + * modify the __sfAdminDashPlugin/config/app.yml__ file, set: + + [php] + image_dir: /tdCorePlugin/images/icons/ + + * and finally you may use the icons in the app.yml file: + + [php] + categories: + Administration: + items: + Newsletter: + url: newsletter + image: newsletter.png + +Random Data Generator +===================== + +There is a class in the plugin responsible for generating some random data used +for the symfony fixtures. During development phase its essential to see how some +mechanisms work when real data is available in the database. Writing the same +methods many times is useless - that's where random data generator comes in. an +example to generate some data in _data/fixtures/sample.yml_ file is shown below: + + [php] + <?php $generator = new tdRandomDataGenerator(); ?> + Guestbook: + <?php for($i = 0; $i < 150; $i++): ?> + guestbook_<?php echo $i ?>: + author: <?php echo $generator->getRandomName()."\n" ?> + email: <?php echo $generator->getRandomEmail()."\n" ?> + http: <?php echo $generator->getRandomHttp()."\n" ?> + text: <?php echo $generator->getRandomText(mt_rand(20,100)*mt_rand(1,5))."\n" ?> + <?php endfor; ?> Added: plugins/tdBlogPlugin/trunk/config/doctrine/schema.yml =================================================================== --- plugins/tdBlogPlugin/trunk/config/doctrine/schema.yml (rev 0) +++ plugins/tdBlogPlugin/trunk/config/doctrine/schema.yml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,29 @@ +options: + collate: utf8_general_ci + charset: utf8 + +tdArticle: + actAs: + Timestampable: ~ + columns: + title: + type: string(128) + notnull: true + author_id: + type: integer(4) + notnull: true + text: + type: clob + notnull: true + image: + type: string(255) + active: + type: boolean + notnull: true + default: true + relations: + Author: + class: sfGuardUser + local: author_id + foreign: id + foreignAlias: Articles \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/config/routing.yml =================================================================== --- plugins/tdBlogPlugin/trunk/config/routing.yml (rev 0) +++ plugins/tdBlogPlugin/trunk/config/routing.yml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,12 @@ +td_sample_aticle: + url: /sample-article + param: { module: tdSampleArticle, action: index } + +td_article: + class: sfDoctrineRouteCollection + options: + model: tdArticle + module: td_article + prefix_path: /td_article + column: id + with_wildcard_routes: true Added: plugins/tdBlogPlugin/trunk/config/tdBlogPluginConfiguration.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/config/tdBlogPluginConfiguration.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/config/tdBlogPluginConfiguration.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,26 @@ +<?php +/** + * tdBlogPluginConfiguration.class + */ + +/** + * tdBlogPluginConfiguration + * + * @package tdGuestbookPlugin + * @author Tomasz Ducin <[email protected]> + */ + +class tdBlogPluginConfiguration extends sfPluginConfiguration +{ + /** + * Initialize + */ + public function initialize() + { + // blog short text sign count + sfConfig::set('td_blog_short_text_sign_count', 300); + + // article images upload dir + sfConfig::set('td_blog_image_dir', sfConfig::get('sf_upload_dir').'/articles'); + } +} \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/data/fixtures/fixtures.yml =================================================================== --- plugins/tdBlogPlugin/trunk/data/fixtures/fixtures.yml (rev 0) +++ plugins/tdBlogPlugin/trunk/data/fixtures/fixtures.yml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,12 @@ +<?php $generator = new tdRandomDataGenerator(); ?> +tdArticle: +<?php for($i = 0; $i < 50; $i++): ?> + article_<?php echo $i ?>: + title: <?php echo $generator->getRandomText(mt_rand(15, 80))."\n" ?> + Author: unknown + text: <?php echo $generator->getRandomText(mt_rand(200, 2500))."\n" ?> + image: sample.jpg + active: <?php echo (mt_rand(0,4) == 0 ? 'false' : 'true')."\n" ?> + created_at: <?php echo $generator->getRandomCreatedAt(2009 + mt_rand(0,1))."\n" ?> + updated_at: <?php echo $generator->getRandomCreatedAt(2009 + mt_rand(0,1))."\n" ?> +<?php endfor; ?> \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/lib/filter/doctrine/PlugintdArticleFormFilter.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/lib/filter/doctrine/PlugintdArticleFormFilter.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/lib/filter/doctrine/PlugintdArticleFormFilter.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,24 @@ +<?php + +/** + * PlugintdArticle form. + * + * @package ##PROJECT_NAME## + * @subpackage filter + * @author ##AUTHOR_NAME## + * @version SVN: $Id: sfDoctrineFormFilterPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + */ +abstract class PlugintdArticleFormFilter extends BasetdArticleFormFilter +{ + public function setup() + { + parent::setup(); + + $this->removeFields(); + } + + protected function removeFields() + { + unset( $this['image'] ); + } +} Added: plugins/tdBlogPlugin/trunk/lib/form/doctrine/PlugintdArticleForm.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/lib/form/doctrine/PlugintdArticleForm.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/lib/form/doctrine/PlugintdArticleForm.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,55 @@ +<?php + +/** + * PlugintdArticle form. + * + * @package ##PROJECT_NAME## + * @subpackage form + * @author ##AUTHOR_NAME## + * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + */ +abstract class PlugintdArticleForm extends BasetdArticleForm +{ + public function setup() + { + parent::setup(); + + $this->removeFields(); + + $this->manageWidgets(); + + $this->manageValidators(); + } + + protected function removeFields() + { + unset($this['created_at'], $this['updated_at']); + } + + protected function manageWidgets() + { + $this->setWidget('image', new sfWidgetFormInputFileEditable(array( + 'with_delete' => false, + 'delete_label' => 'usuń miniaturkę', + 'label' => 'Miniaturka artykułu', + 'file_src' => '/uploads/articles/'.$this->getObject()->getImage(), + 'is_image' => true, + 'edit_mode' => !$this->isNew(), + 'template' => '%file%<br />%input%<br />%delete% %delete_label%', + ))); + } + + protected function manageValidators() + { + $this->setValidator('title', + new sfValidatorString(array(), array('required' => 'Musisz podać tytuł artykułu.'))); + + $this->setValidator('image', new sfValidatorFile(array( + 'required' => true, + 'path' => sfConfig::get('td_blog_image_dir'), + 'mime_types' => 'web_images', + ), array( + 'required' => 'Musisz wybrać plik', + ))); + } +} Added: plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticle.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticle.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticle.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,48 @@ +<?php + +/** + * PlugintdArticle + * + * This class has been auto-generated by the Doctrine ORM Framework + * + * @package ##PACKAGE## + * @subpackage ##SUBPACKAGE## + * @author ##NAME## <##EMAIL##> + * @version SVN: $Id: Builder.php 7021 2010-01-12 20:39:49Z lsmith $ + */ +abstract class PlugintdArticle extends BasetdArticle +{ + /** + * Returns short text of the article. + * + * @return String - short text. + */ + public function getTextShort() + { + return mb_substr($this->getText(), 0, sfConfig::get('td_blog_short_text_sign_count')).'...'; + } + + /** + * Activates the article. + * + * @return True + */ + public function activate() + { + $this->setActive(true); + $this->save(); + return true; + } + + /** + * Deactivates the article. + * + * @return True + */ + public function deactivate() + { + $this->setActive(false); + $this->save(); + return true; + } +} \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticleTable.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticleTable.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/lib/model/doctrine/PlugintdArticleTable.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,66 @@ +<?php +/** + */ +class PlugintdArticleTable extends Doctrine_Table +{ + /** + * Returns DQL query retrieving recent articles. + * + * @return Doctrine_Query + */ + static public function getRecentArticlesWithAuthorsQuery() + { + $fields = 'a.id, a.text, a.title, a.image, a.created_at, a.updated_at, '; + $fields .= 'CONCAT(p.first_name, " ", p.last_name) as author_name'; + return Doctrine_Query::create() + ->from('tdArticle a') + ->select($fields) + ->orderBy('a.created_at') + ->leftJoin('a.Author u') + ->leftJoin('u.Profile p') + ->limit(5); + } + + /** + * Returns DQL query retrieving an article given by the id parameter. + * + * @param Integer $id - id of the article + * @return Doctrine_Query + */ + static public function getArticleWithAuthorByIdQuery($id) + { + $fields = 'a.id, a.text, a.title, a.image, a.created_at, a.updated_at, '; + $fields .= 'CONCAT(p.first_name, " ", p.last_name) as author_name'; + return Doctrine_Query::create() + ->from('tdArticle a') + ->select($fields) + ->where('a.id = ?', $id) + ->leftJoin('a.Author u') + ->leftJoin('u.Profile p'); + } + + /** + * Returns DQL query retrieving all active articles. + * + * @return Doctrine_Query + */ + static public function getActiveArticlesQuery() + { + return Doctrine_Query::create() + ->from('tdArticle a') + ->where('a.active = "1"'); + } + + /** + * Returns DQL query retrieving articles selected by ids. + * + * @param Array $ids - Identifiers of selected articles. + * @return Doctrine_Query + */ + static public function getSelectedArticlesQuery($ids) + { + return Doctrine_Query::create() + ->from('tdArticle a') + ->whereIn('a.id', $ids); + } +} \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/actions/actions.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/actions/actions.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/actions/actions.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,35 @@ +<?php + +/** + * tdSampleArticle actions. + * + * @package gospel + * @subpackage article + * @author Tomasz Ducin + * @version SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $ + */ +class tdSampleArticleActions extends sfActions +{ + /** + * Executes index action. Displays recent articles abbreviations. + * + * @param sfRequest $request A request object + */ + public function executeIndex(sfWebRequest $request) + { + $this->articles = Doctrine::getTable('tdArticle')->getRecentArticlesWithAuthorsQuery()->fetchArray(); + } + + /** + * Executes show action. Displays full details about an article given by the + * id parameter. + * + * @param sfRequest $request A request object + */ + public function executeShow(sfWebRequest $request) + { + $id = $request->getParameter('id'); + $articles = Doctrine::getTable('tdArticle')->getArticleWithAuthorByIdQuery($id)->fetchArray(); + $this->article = $articles[0]; + } +} Added: plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/_article.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/_article.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/_article.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,49 @@ +<?php use_helper('Date') ?> + +<tr> + <td valign="top"> + <div> + <table class="contentpaneopen"> + <tbody> + <tr> + <td class="contentheading" width="100%"> + <?php echo $article['title'] ?> + <div> + <div class="small"> + <span class="small"> + autor: <?php echo $article['author_name'] ?> + </span> + + </div> + <div class="createdate"> + <?php echo (false !== strtotime($article['created_at']) ? format_date($article['created_at'], "f") : ' ') ?> + </div> + </div> + </td> + </tr> + </tbody> + </table> + <table class="contentpaneopen"> + <tbody> + <tr> + <td colspan="2" class="article_indent" valign="top"> + <?php echo image_tag('/uploads/articles/'.$article['image'], array('align' => 'left', 'border' => 0)) ?> + <p><?php echo ($mode == 'multi' ? mb_substr($article['text'], 0, 500).'...' : $article['text']) ?><p> + <div class="modifydate"> + Ostatnia data aktualizacji (<?php echo (false !== strtotime($article['updated_at']) ? format_date($article['updated_at'], "f") : ' ') ?>) + </div> + <div class="readmore"> + <?php if($mode == 'multi'): ?> + <?php echo link_to('Czytaj więcej...', '@article?id='.$article['id'], array('class' => 'readon')) ?> + <?php else: ?> + <?php echo link_to('Powrót do aktualności...', '@articles', array('class' => 'readon')) ?> + <?php endif; ?> + </div> + </td> + </tr> + </tbody> + </table> + <span class="article_separator"> </span> + </div> + </td> +</tr> \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/indexSuccess.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/indexSuccess.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/indexSuccess.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,9 @@ +<h1>Aktualności</h1> + +<table class="blog" cellpadding="0" cellspacing="0"> + <tbody> + <?php foreach($articles as $article): ?> + <?php include_partial('tdSampleArticle/article', array('article' => $article, 'mode' => 'multi')) ?> + <?php endforeach; ?> + </tbody> +</table> \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/showSuccess.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/showSuccess.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/tdSampleArticle/templates/showSuccess.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,7 @@ +<h1>Aktualności</h1> + +<table class="blog" cellpadding="0" cellspacing="0"> + <tbody> + <?php include_partial('tdSampleArticle/article', array('article' => $article, 'mode' => 'single')) ?> + </tbody> +</table> \ No newline at end of file Added: plugins/tdBlogPlugin/trunk/modules/td_article/actions/actions.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/td_article/actions/actions.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/td_article/actions/actions.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,85 @@ +<?php + +require_once dirname(__FILE__).'/../lib/td_articleGeneratorConfiguration.class.php'; +require_once dirname(__FILE__).'/../lib/td_articleGeneratorHelper.class.php'; + +/** + * td_article actions. + * + * @package gospel + * @subpackage td_article + * @author Tomasz Ducin + * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + */ +class td_articleActions extends autoTd_articleActions +{ + /** + * Activates selected articles. + * + * @param sfWebRequest $request + */ + public function executeBatchActivate(sfWebRequest $request) + { + $ids = $request->getParameter('ids'); + $query = Doctrine::getTable('tdArticle')->getSelectedArticlesQuery($ids); + + foreach ($query->execute() as $article) + { + $article->activate(true); + } + + $this->getUser()->setFlash('notice', 'The selected articles have been activated successfully.'); + + $this->redirect('@td_article'); + } + + /** + * Deactivates selected articles. + * + * @param sfWebRequest $request + */ + public function executeBatchDeactivate(sfWebRequest $request) + { + $ids = $request->getParameter('ids'); + $query = Doctrine::getTable('tdArticle')->getSelectedArticlesQuery($ids); + + foreach ($query->execute() as $article) + { + $article->deactivate(true); + } + + $this->getUser()->setFlash('notice', 'The selected articles have been deactivated successfully.'); + + $this->redirect('@td_article'); + } + + /** + * Activates selected article. + * + * @param sfWebRequest $request + */ + public function executeListActivate(sfWebRequest $request) + { + $article = $this->getRoute()->getObject(); + $article->activate(); + + $this->getUser()->setFlash('notice', 'The selected article has been activated successfully.'); + + $this->redirect('@td_article'); + } + + /** + * Deactivates selected article. + * + * @param sfWebRequest $request + */ + public function executeListDeactivate(sfWebRequest $request) + { + $article = $this->getRoute()->getObject(); + $article->deactivate(); + + $this->getUser()->setFlash('notice', 'The selected article has been deactivated successfully.'); + + $this->redirect('@td_article'); + } +} Added: plugins/tdBlogPlugin/trunk/modules/td_article/config/generator.yml =================================================================== --- plugins/tdBlogPlugin/trunk/modules/td_article/config/generator.yml (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/td_article/config/generator.yml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,76 @@ +generator: + class: sfDoctrineGenerator + param: + model_class: tdArticle + theme: admin + non_verbose_templates: true + with_show: false + singular: ~ + plural: ~ + route_prefix: td_article + with_doctrine_route: true + actions_base_class: sfActions + css: nothing + i18n_catalogue: sf_admin + + config: + actions: ~ + fields: + author_id: + label: Autor + title: + label: Tytuł + text: + label: Treść + text_short: + label: Treść + image: + label: Zdjęcie + active: + label: Aktywny + help: if the link shall be visible on the frontend website + created_at: + label: Utworzono + updated_at: + label: Zmieniono + list: + title: Article list + batch_actions: + _delete: ~ + activate: ~ + deactivate: ~ + object_actions: + _edit: ~ + _delete: ~ + activate: ~ + deactivate: ~ + display: [ active, title, author, text, created_at, updated_at ] + max_per_page: 10 + layout: stacked + params: | + <div style="text-align: justify"> + <img src="/uploads/articles/%%image%%" class="border" /> + <br /> + <strong>autor</strong>: %%author%% + <br /> + <strong>tytuł</strong>: %%title%% + <br /> + <strong>treść</strong>: %%text_short%% + <br /> + <strong>utworzono</strong>: %%created_at%% + <br /> + <strong>zmieniono</strong>: %%updated_at%% + <br /> + %%active%% + </div> + filter: ~ + form: + fields: + title: + attributes: { size: 80 } + text: + attributes: { cols: 80, rows: 10 } + edit: + title: Edit article + new: + title: New article Added: plugins/tdBlogPlugin/trunk/modules/td_article/i18n/sf_admin.pl.xml =================================================================== --- plugins/tdBlogPlugin/trunk/modules/td_article/i18n/sf_admin.pl.xml (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/td_article/i18n/sf_admin.pl.xml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "http://www.oasis-open.org/committees/xliff/documents/xliff.dtd" > +<xliff version="1.0"> + <file original="global" source-language="en" datatype="plaintext"> + <header /> + <body> + + <!-- Help fields --> + <trans-unit> + <source>if the link shall be visible on the frontend website</source> + <target>czy link ma być widoczny na stronie www</target> + </trans-unit> + + <!-- Object/Batch Actions --> + <trans-unit> + <source>Activate</source> + <target>Aktywuj</target> + </trans-unit> + <trans-unit> + <source>Deactivate</source> + <target>Deaktywuj</target> + </trans-unit> + + <!-- Actions --> + <trans-unit> + <source>Article list</source> + <target>Lista artykułów</target> + </trans-unit> + <trans-unit> + <source>Edit article</source> + <target>Edytuj artykuł</target> + </trans-unit> + <trans-unit> + <source>New article</source> + <target>Nowy artykuł</target> + </trans-unit> + + <!-- Flashes --> + <trans-unit> + <source>The selected articles have been activated successfully.</source> + <target>Wybrane artykuły zostały aktywowane.</target> + </trans-unit> + <trans-unit> + <source>The selected article has been activated successfully.</source> + <target>Wybrany artykuł został aktywowany.</target> + </trans-unit> + <trans-unit> + <source>The selected articles have been deactivated successfully.</source> + <target>Wybrane artykuły zostały deaktywowane.</target> + </trans-unit> + <trans-unit> + <source>The selected article has been deactivated successfully.</source> + <target>Wybrany artykuł został deaktywowany.</target> + </trans-unit> + + <!-- Fields --> + <trans-unit> + <source>Created at</source> + <target>Utworzono</target> + </trans-unit> + <trans-unit> + <source>Updated at</source> + <target>Zmodyfikowano</target> + </trans-unit> + </body> + </file> +</xliff> Added: plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorConfiguration.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorConfiguration.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorConfiguration.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,13 @@ +<?php + +/** + * td_article module configuration. + * + * @package gospel + * @subpackage td_article + * @author Tomasz Ducin + * @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + */ +class td_articleGeneratorConfiguration extends BaseTd_articleGeneratorConfiguration +{ +} Added: plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorHelper.class.php =================================================================== --- plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorHelper.class.php (rev 0) +++ plugins/tdBlogPlugin/trunk/modules/td_article/lib/td_articleGeneratorHelper.class.php 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,13 @@ +<?php + +/** + * td_article module helper. + * + * @package gospel + * @subpackage td_article + * @author Tomasz Ducin + * @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + */ +class td_articleGeneratorHelper extends BaseTd_articleGeneratorHelper +{ +} Added: plugins/tdBlogPlugin/trunk/package.xml =================================================================== --- plugins/tdBlogPlugin/trunk/package.xml (rev 0) +++ plugins/tdBlogPlugin/trunk/package.xml 2010-01-17 23:01:50 UTC (rev 26790) @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package packagerversion="1.4.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> + <name>tdBlogPlugin</name> + <channel>plugins.symfony-project.org</channel> + <summary>Provides basic blog functionalities.</summary> + <description>Provides basic blog functionalities. This plugin is a part of __TD CMF__ and is based on __Doctrine ORM__.</description> + <lead> + <name>Tomasz Ducin</name> + <user>tkoomzaaskz</user> + <email>[email protected]</email> + <active>yes</active> + </lead> + <date>2010-01-17</date> + <time>11:00:00</time> + <version> + <release>0.1.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <license uri="http://www.symfony-project.com/license">MIT</license> + <notes>-</notes> + + <contents> + <dir name="/"> + + <dir name="config"> + <dir name="doctrine"> + <file name="schema.yml" role="data" /> + </dir> + <file name="routing.yml" role="data" /> + <file name="tdBlogPluginConfiguration.class.php" role="data" /> + </dir> + + <dir name="data"> + <dir name="fixtures"> + <file name="fixtures.yml" role="data" /> + </dir> + </dir> + + <dir name="lib"> + <dir name="filter"> + <dir name="doctrine"> + <file name="PlugintdArticleFormFilter.class.php" role="data" /> + </dir> + </dir> + <dir name="form"> + <dir name="doctrine"> + <file name="PlugintdArticleForm.class.php" role="data" /> + </dir> + </dir> + <dir name="model"> + <dir name="doctrine"> + <file name="PlugintdArticle.class.php" role="data" /> + <file name="PlugintdArticleTable.class.php" role="data" /> + </dir> + </dir> + </dir> + + <dir name="modules"> + <dir name="td_article"> + <dir name="actions"> + <file name="actions.class.php" role="data" /> + </dir> + <dir name="config"> + <file name="generator.yml" role="data" /> + </dir> + <dir name="i18n"> + <file name="sf_admin.pl.xml" role="data" /> + </dir> + <dir name="lib"> + <file name="td_articleGeneratorConfiguration.class.php" role="data" /> + <file name="td_articleGeneratorHelper.class.php" role="data" /> + </dir> + <dir name="templates" /> + </dir> + <dir name="tdSampleArticle"> + <dir name="actions"> + <file name="actions.class.php" role="data" /> + </dir> + <dir name="templates"> + <file name="_form.php" role="data" /> + <file name="editSuccess.php" role="data" /> + <file name="indexSuccess.php" role="data" /> + <file name="newSuccess.php" role="data" /> + </dir> + </dir> + </dir> + + <file name="LICENSE" role="data" /> + <file name="README" role="data" /> + </dir> + </contents> + + <dependencies> + <required> + <php> + <min>5.1.0</min> + </php> + <pearinstaller> + <min>1.4.1</min> + </pearinstaller> + <package> + <name>symfony</name> + <channel>pear.symfony-project.com</channel> + <min>1.3.0</min> + <max>1.5.0</max> + <exclude>1.5.0</exclude> + </package> + </required> + </dependencies> + + <phprelease> + </phprelease> + + <changelog> + + <release> + <version> + <release>0.1.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <license uri="http://www.symfony-project.org/license">MIT license</license> + <date>2010-01-17</date> + <license>MIT</license> + <notes> + * initial import + </notes> + </release> + + </changelog> + +</package> \ No newline at end of file
-- You received this message because you are subscribed to the Google Groups "symfony SVN" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-svn?hl=en.
