Author: flukers
Date: 2010-03-03 23:48:45 +0100 (Wed, 03 Mar 2010)
New Revision: 28371
Added:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/editTopicSuccess.php
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/config/doctrine/schema.yml
plugins/sfDoctrineSimpleForumPlugin/trunk/config/routing.yml
plugins/sfDoctrineSimpleForumPlugin/trunk/data/fixtures/fixtures.yml
plugins/sfDoctrineSimpleForumPlugin/trunk/lib/model/doctrine/PluginsfDoctrineSimpleForumTopic.class.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/config/security.yml
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/lib/BasesfDoctrineSimpleForumActions.class.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/createTopicSuccess.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/indexSuccess.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewBoardSuccess.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewLatestFeedSuccess.xml.php
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewTopicSuccess.php
Log:
- Cleaned schema.yml. Removed some useless 'performance enhancers'
- Updated and cleaned fixtures.yml
- Updated CSS and added some images
- Created admin features such as lock topic, sticky topic, delete etc.
(integrated into sfGuard permissions group of
sf_doctrine_simple_forum_moderator_group)
- Updated feed
- Updated routing.yml
- tidied templates
Modified: plugins/sfDoctrineSimpleForumPlugin/trunk/config/doctrine/schema.yml
===================================================================
--- plugins/sfDoctrineSimpleForumPlugin/trunk/config/doctrine/schema.yml
2010-03-03 18:00:05 UTC (rev 28370)
+++ plugins/sfDoctrineSimpleForumPlugin/trunk/config/doctrine/schema.yml
2010-03-03 22:48:45 UTC (rev 28371)
@@ -16,20 +16,14 @@
description: { type: string }
rank: { type: integer }
category_id: { type: integer(4) }
- # Performance Enhancers
- stripped_name: { type: string(255) }
- latest_post_id: { type: integer(4) }
nb_posts: { type: integer(4) }
nb_topics: { type: integer(4) }
relations:
sfDoctrineSimpleForumCategory:
- alias: Categories
+ alias: Category
local: category_id
foreign: id
onDelete: cascade
- sfDoctrineSimpleForumPost:
- local: latest_post_Id
- foreign: id
sfDoctrineSimpleForumTopic:
actAs: [Timestampable, SoftDelete,Sluggable]
tableName: sf_doctrine_simple_forum_topic
@@ -39,15 +33,12 @@
is_sticked: { type: boolean, default: false }
is_locked: { type: boolean, default: false }
forum_id: { type: integer(4) }
- # performance enhancers
- latest_post_id: { type: integer(4) }
- user_id: { type: integer(4) }
- stripped_title: { type: string(255) }
+ user_id: { type: integer }
nb_posts: { type: integer(4), default: 0 }
nb_views: { type: integer(10), default: 0 }
relations:
sfDoctrineSimpleForumForum:
- alias: forum
+ alias: Forum
local: forum_id
foreign: id
onDelete: cascade
@@ -60,7 +51,6 @@
alias: User
local: user_id
foreign: id
-
sfDoctrineSimpleForumPost:
actAs: [Timestampable, SoftDelete]
tableName: sf_doctrine_simple_forum_post
@@ -71,21 +61,20 @@
topic_id: { type: integer(4) }
is_reply_to_comment: { type: integer(1), default: 0 }
reply_id: { type: integer(10) }
- user_id: { type: integer(4) }
- # performance enhancers
+ user_id: { type: integer }
+ first_post: { type: integer(1) }
forum_id: { type: integer(4) }
relations:
sfDoctrineSimpleForumTopic:
- alias: topic
+ alias: Topic
local: topic_id
foreign: id
- onDelete: cascade
sfGuardUser:
alias: User
local: user_id
foreign: id
- onDelete: cascade
sfDoctrineSimpleForumForum:
+ alias: Forum
local: forum_id
foreign: id
onDelete: cascade
@@ -94,14 +83,10 @@
tableName: sf_doctrine_simple_forum_topic_view
columns:
id: { type: integer(4), primary: true, autoincrement: true }
- user_id: { type: integer(4), primary: true }
- topic_id : {type: integer(4), primary: true }
+ user_id: { type: integer }
+ topic_id : {type: integer }
relations:
sfGuardUser:
+ alias: User
local: user_id
- local: id
- onDelete: cascade
- sfDoctrineSimpleForumTopic:
- local: topic_id
- foreign: id
- onDelete: cascade
\ No newline at end of file
+ foreign: id
\ No newline at end of file
Modified: plugins/sfDoctrineSimpleForumPlugin/trunk/config/routing.yml
===================================================================
--- plugins/sfDoctrineSimpleForumPlugin/trunk/config/routing.yml
2010-03-03 18:00:05 UTC (rev 28370)
+++ plugins/sfDoctrineSimpleForumPlugin/trunk/config/routing.yml
2010-03-03 22:48:45 UTC (rev 28371)
@@ -10,6 +10,24 @@
sf_doctrine_simple_forum_create_topic:
url: /forum/topic/:id/create
params: { module: sfDoctrineSimpleForum, action: createTopic }
+sf_doctrine_simple_forum_delete_topic:
+ url: /forum/topic/:id/delete
+ params: { module: sfDoctrineSimpleForum, action: deleteTopic }
+sf_doctrine_simple_forum_edit_topic:
+ url: /forum/topic/:id/edit
+ params: { module: sfDoctrineSimpleForum, action: editTopic }
sf_doctrine_simple_forum_view_latest_feed:
url: /forum/latest/feed
- params: { module: sfDoctrineSimpleForum, action: viewLatestFeed, sf_format:
xml }
\ No newline at end of file
+ params: { module: sfDoctrineSimpleForum, action: viewLatestFeed, sf_format:
xml }
+sf_doctrine_simple_forum_lock_topic:
+ url: /forum/topic/:id/lock
+ params: { module: sfDoctrineSimpleForum, action: lockTopic }
+sf_doctrine_simple_forum_unlock_topic:
+ url: /forum/topic/:id/unlock
+ params: { module: sfDoctrineSimpleForum, action: unlockTopic }
+sf_doctrine_simple_forum_sticky_topic:
+ url: /forum/topic/:id/sticky
+ params: { module: sfDoctrineSimpleForum, action: stickyTopic }
+sf_doctrine_simple_forum_unsticky_topic:
+ url: /forum/topic/:id/unsticky
+ params: { module: sfDoctrineSimpleForum, action: unstickyTopic }
\ No newline at end of file
Modified: plugins/sfDoctrineSimpleForumPlugin/trunk/data/fixtures/fixtures.yml
===================================================================
--- plugins/sfDoctrineSimpleForumPlugin/trunk/data/fixtures/fixtures.yml
2010-03-03 18:00:05 UTC (rev 28370)
+++ plugins/sfDoctrineSimpleForumPlugin/trunk/data/fixtures/fixtures.yml
2010-03-03 22:48:45 UTC (rev 28371)
@@ -3,52 +3,66 @@
name: moderator
sfGuardUser:
- 1:
+ user_1:
username: johndoe
password: johndoe
- 2:
+ email_address: [email protected]
+ user_2:
username: tarzanman
password: tarzanman
- 3:
+ email_address: [email protected]
+ user_3:
username: testuser
password: testuser
+ email_address: [email protected]
+ Groups: [sf_doctrine_simple_forum_moderator_group]
+sfGuardGroup:
+ sf_doctrine_simple_forum_moderator_group:
+ name: sf_doctrine_simple_forum_moderator_group
+ description: sfDoctrineSimpleForumModerator Group
+ Permissions: [sf_doctrine_simple_forum_moderator_permission]
+
sfGuardPermission:
- testuser_is_moderator:
- name: testuser
- description: moderator
+ sf_doctrine_simple_forum_moderator_permission:
+ name: sf_doctrine_simple_forum_moderator
+ description: sfDoctrineSimpleForumModerator Permission
sfDoctrineSimpleForumCategory:
- c1:
+ category_1:
id: 1
name: Public Boards
description: We talk about stuff here.
rank: 1
- c2:
+ category_2:
id: 2
name: Miscellaneous
description: Secret matters
rank: 2
-
-sfDoctrineSimpleForumTopic:
- 1:
- title: Installing foo
- forum_id: 1
- user_id: 2
- 2:
- title: Stick Moo
- forum_id: 2
- user_id: 1
- is_sticked: true
-
sfDoctrineSimpleForumForum:
- 1:
+ forum_1:
name: Foo discussion
description: Everybody is foo here
- category_id: 1
+ Category: category_1
rank: 1
- 2:
+ forum_2:
name: Bar discussion
description: If you want a bar, this is where you will find it
- category_id: 2
+ Category: category_2
rank: 2
+sfDoctrineSimpleForumTopic:
+ topic_1:
+ title: Installing foo
+ Forum: forum_1
+ User: user_3
+ topic_2:
+ title: Stick Moo
+ Forum: forum_2
+ User: user_3
+ is_sticked: true
+sfDoctrineSimpleForumPost:
+ post_1:
+ content: Hello, how is everyone?
+ User: user_3
+ Topic: topic_2
+ Forum: forum_2
\ No newline at end of file
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/lib/model/doctrine/PluginsfDoctrineSimpleForumTopic.class.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/lib/model/doctrine/PluginsfDoctrineSimpleForumTopic.class.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/lib/model/doctrine/PluginsfDoctrineSimpleForumTopic.class.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -55,5 +55,25 @@
->execute();
return (count($topic)>0) ? $topic : array();
}
-
+
+ // lock thread
+ public function lock($status)
+ {
+ $this->setIsLocked($status);
+ $this->save();
+ }
+
+ // sticky thread
+ public function sticky($status)
+ {
+ $this->setIsSticked($status);
+ $this->save();
+ }
+ public function deleteTopic()
+ {
+ $query =
Doctrine_Query::create()->from("sfDoctrineSimpleForumTopic")
+ ->where("id = ?", $this->getId())
+ ->delete()
+ ->execute();
+ }
}
\ No newline at end of file
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/config/security.yml
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/config/security.yml
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/config/security.yml
2010-03-03 22:48:45 UTC (rev 28371)
@@ -9,16 +9,4 @@
deletePost:
is_secure: on
- credentials: [moderator]
-
-deleteTopic:
- is_secure: on
- credentials: [moderator]
-
-toggleStick:
- is_secure: on
- credentials: [moderator]
-
-toggleLock:
- is_secure: on
credentials: [moderator]
\ No newline at end of file
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/lib/BasesfDoctrineSimpleForumActions.class.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/lib/BasesfDoctrineSimpleForumActions.class.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/lib/BasesfDoctrineSimpleForumActions.class.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -19,6 +19,34 @@
class BasesfDoctrineSimpleForumActions extends sfActions
{
+
+ /* Common methods */
+
+ private function isModerator()
+ {
+ if($this->getUser()->hasGroup("sf_doctrine_simple_forum_moderator_group"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private function isTopicOwner($topic)
+ {
+ if($topic->getUserId() == $this->getUser()->getGuardUser()->getId())
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
public function executeIndex(sfWebRequest $request)
{
$this->forums =
Doctrine::getTable("sfDoctrineSimpleForumForum")->findAll();
@@ -27,6 +55,7 @@
{
// get un-stickied
$topic = new sfDoctrineSimpleForumTopic;
+ $this->topics =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findAll();
$this->stickies = $topic->getSticked($request->getParameter("id"));
$this->board = $topic->getUnsticked($request->getParameter("id"));
// get stickied
@@ -46,8 +75,7 @@
$this->forward404Unless($topic);
$this->topic = $topic;
-
- // check for reply
+ // check for reply
if($request->isMethod("post"))
{
// check user is authenticated
@@ -82,38 +110,35 @@
public function executeCreateTopic(sfWebRequest $request)
{
- $this->forward404Unless($this->getUser()->isAuthenticated());
-
- $this->forum =
Doctrine::getTable("sfDoctrineSimpleForumForum")->findOneById($request->getParameter("id"));
-
- $this->forward404Unless($this->forum);
+ $this->forum =
Doctrine::getTable("sfDoctrineSimpleForumForum")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($this->forum);
- $this->form = new sfDoctrineSimpleForumCreateTopicForm;
- if ($request->isMethod('post'))
+ $this->form = new sfDoctrineSimpleForumCreateTopicForm;
+ if ($request->isMethod('post'))
{
$this->form->bind($request->getParameter('sf_doctrine_simple_forum_topic_create'));
if ($this->form->isValid())
{
- // form is valid. insert records
- $topic = new sfDoctrineSimpleForumTopic;
- $values = $this->form->getValues();
- // set title
- $topic->setTitle($values['title']);
- // set user id
-
$topic->setUserId($this->getUser()->getGuardUser()->getId());
- // set forum id
- $topic->setForumId($this->forum->getId());
- $topic->save();
-
- $post = new sfDoctrineSimpleForumPost;
- $post->setContent($values['content']);
-
$post->setUserId($this->getUser()->getGuardUser()->getId());
- $post->setForumId($this->forum->getId());
- $post->setTopicId($topic->getId());
- $post->save();
-
- // redirect to topic
-
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ // form is valid. insert records
+ $topic = new sfDoctrineSimpleForumTopic;
+ $values = $this->form->getValues();
+ // set title
+ $topic->setTitle($values['title']);
+ // set user id
+ $topic->setUserId($this->getUser()->getGuardUser()->getId());
+ // set forum id
+ $topic->setForumId($this->forum->getId());
+ $topic->save();
+
+ $post = new sfDoctrineSimpleForumPost;
+ $post->setContent($values['content']);
+ $post->setUserId($this->getUser()->getGuardUser()->getId());
+ $post->setForumId($this->forum->getId());
+ $post->setTopicId($topic->getId());
+ $post->save();
+
+ // redirect to topic
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
}
}
}
@@ -122,5 +147,124 @@
{
$this->latest_posts =
Doctrine_Query::create()->from("sfDoctrineSimpleForumPost
p")->orderBy("p.created_at DESC")->execute();
}
+
+ /* Lock a thread */
+ public function executeLockTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($topic);
+ if(self::isTopicOwner($topic) || self::isModerator())
+ {
+ $topic->lock(1);
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ else
+ {
+ $this->getUser()->setFlash("error",
$this->getContext()->getI18N()->__("You do not have permission to perform that
action", null, 'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ };
+ }
+
+ /* Edit Topic */
+ public function executeEditTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forum =
Doctrine::getTable("sfDoctrineSimpleForumForum")->findOneById($topic->getForumId());
+ $this->form = new sfDoctrineSimpleForumCreateTopicForm($topic, array(),
false);
+ if ($request->isMethod('post'))
+ {
+
$this->form->bind($request->getParameter('sf_doctrine_simple_forum_topic_create'));
+ if ($this->form->isValid())
+ {
+ // form is valid. insert records
+ $topic = new sfDoctrineSimpleForumTopic;
+ $values = $this->form->getValues();
+ // set title
+ $topic->setTitle($values['title']);
+ // set user id
+ $topic->setUserId($this->getUser()->getGuardUser()->getId());
+ // set forum id
+ $topic->setForumId($this->forum->getId());
+ $topic->save();
+
+ $post = new sfDoctrineSimpleForumPost;
+ $post->setContent($values['content']);
+ $post->setUserId($this->getUser()->getGuardUser()->getId());
+ $post->setForumId($this->forum->getId());
+ $post->setTopicId($topic->getId());
+ $post->save();
+
+ // redirect to topic
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ }
+ }
+ /* Unlock a topic */
+ public function executeUnlockTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($topic);
+ if(self::isTopicOwner($topic) || self::isModerator())
+ {
+ $topic->lock(0);
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ else
+ {
+ $this->getUser()->setFlash("error",
$this->getContext()->getI18N()->__("You do not have permission to perform that
action", null, 'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ }
+ /* Delete a topic */
+ public function executeDeleteTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($topic);
+ if(self::isTopicOwner($topic) || self::isModerator())
+ {
+ $topic->deleteTopic();
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_board?id=%s&slug=%s",$topic->getForumId(),$topic->getForum()->getSlug()));
+ }
+ else
+ {
+ $this->getUser()->setFlash("error",
$this->getContext()->getI18N()->__("You do not have permission to perform that
action", null, 'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ }
+
+ /* Sticky a topic */
+ public function executeStickyTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($topic);
+ if(self::isTopicOwner($topic) || self::isModerator())
+ {
+ $topic->sticky(1);
+ $this->getUser()->setFlash("success",
$this->getContext()->getI18N()->__("This thread has now been sticked", null,
'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ else
+ {
+ $this->getUser()->setFlash("error",
$this->getContext()->getI18N()->__("You do not have permission to perform that
action", null, 'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ };
+ }
+
+ public function executeUnstickyTopic(sfWebRequest $request)
+ {
+ $topic =
Doctrine::getTable("sfDoctrineSimpleForumTopic")->findOneById($request->getParameter("id"));
+ $this->forward404Unless($topic);
+ if(self::isTopicOwner($topic) || self::isModerator())
+ {
+ $topic->sticky(0);
+ $this->getUser()->setFlash("success",
$this->getContext()->getI18N()->__("This thread has now been unsticked", null,
'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ }
+ else
+ {
+ $this->getUser()->setFlash("error",
$this->getContext()->getI18N()->__("You do not have permission to perform that
action", null, 'sfDoctrineSimpleForum'));
+
$this->redirect(sprintf("@sf_doctrine_simple_forum_view_topic?id=%s&slug=%s",
$topic->getId(), $topic->getSlug()));
+ };
+ }
}
\ No newline at end of file
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/createTopicSuccess.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/createTopicSuccess.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/createTopicSuccess.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -26,7 +26,7 @@
<?php echo $form['content']->render()?>
<span class="hint"><?php echo __("Please enter
in some content for the thread. Please make sure it's more than 50 characters
in length..", null, 'sfDoctrineSimpleForum'); ?><span
class="hint-pointer"> </span></span>
</dd>
- </dl>
- <a href="#" class="awesome"
onClick="document.sf_doctrine_simple_forum_create_topicc.submit()"><?php echo
__("Create Topic", null, 'sfDoctrineSimpleForum'); ?></a>
+ </dl>
+ <button type="submit" class="awesome"><?php echo __("Create
Topic", null, "sfDoctrineSimpleForum")?></button>
</form>
Added:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/editTopicSuccess.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/editTopicSuccess.php
(rev 0)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/editTopicSuccess.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -0,0 +1,24 @@
+<?php use_helper('I18N'); ?>
+ <ul id="crumbs">
+ <li><?php echo link_to(__("Forum Index", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_index")?></li>
+ <li><?php echo link_to($forum->getName(),
"sf_doctrine_simple_forum_view_board", array("id"=>$forum->getId(),
"slug"=>$forum->getSlug()))?></li>
+ <li><?php echo __("Edit Topic", null, 'sfDoctrineSimpleForum');
?></li>
+ </ul>
+ <form method="POST" action=""
name="sf_doctrine_simple_forum_create_topicc"
id="sf_doctrine_simple_forum_create_topicc">
+ <br />
+ <h3 class="toolbar" style="clear:both"><?php echo __("Create a
thread", null, 'sfDoctrineSimpleForum'); ?></h3>
+ <div class="info"><?php echo __("Please make sure all the
fields are filled in.", null, 'sfDoctrineSimpleForum'); ?></div>
+ <dl class="list_form">
+ <dt>
+ <label><?php echo __("Topic Title", null,
'sfDoctrineSimpleForum'); ?>:</label>
+ <?php echo $form->renderHiddenFields(); ?>
+ </dt>
+ <dd>
+ <?php echo $form['title']->renderError()?>
+ <?php echo $form['title']->render()?>
+ <span class="hint"><?php echo __("Please choose
a topic name. Please try and keep it as short and concise as possible.", null,
'sfDoctrineSimpleForum'); ?><span class="hint-pointer"> </span></span>
+ </dd>
+ </dl>
+ <button type="submit" class="awesome"><?php echo __("Edit
Topic", null, "sfDoctrineSimpleForum")?></button>
+ </form>
+
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/indexSuccess.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/indexSuccess.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/indexSuccess.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -13,7 +13,7 @@
<tbody>
<?php foreach ($forums as $forum): ?>
<tr class="category">
- <td class="category_header"
colspan="4"><?=$forum->getCategories()->getName() ?></td>
+ <td class="category_header"
colspan="4"><?=$forum->getCategory()->getName() ?></td>
</tr>
<?php include_partial('forum', array('forum' => $forum)) ?>
<?php endforeach; ?>
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewBoardSuccess.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewBoardSuccess.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewBoardSuccess.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -1,17 +1,14 @@
<?php use_helper('I18N'); ?>
-
-<h3 class="toolbar"><?php echo $forum->getName()?></h3>
-<p><?php echo $forum->getDescription() ?></p>
<ul id="crumbs">
<li><?php echo link_to("Forum Index",
"sf_doctrine_simple_forum_index")?></li>
<li><?php echo $forum->getName(); ?></li>
</ul>
+<h3 class="subtoolbar"><?php echo $forum->getDescription() ?></h3>
<br />
-<?php if(count($board)==0 && $sf_user->isAuthenticated()):?>
- <div class="info"><?php echo __("Oooops! There are no topics for this
board. ", null, 'sfDoctrineSimpleForum')?><br /><?php echo __("Why not create
one?", null, 'sfDoctrineSimpleForum')?></div>
+<?php if(count($topics)==0 && $sf_user->isAuthenticated()):?>
+ <p class="success"><?php echo __("Oooops! There are no topics for this
board. ", null, 'sfDoctrineSimpleForum')?><br /><?php echo __("Why not create
one?", null, 'sfDoctrineSimpleForum')?></p>
<?php endif?>
-
<table id="thread_table">
<thead>
<tr>
@@ -61,5 +58,5 @@
</tbody>
</table>
<?php if($sf_user->isAuthenticated()):?>
-<? echo link_to(__("Create Topic", null, 'sfDoctrineSimpleForum'),
"sf_doctrine_simple_forum_create_topic", array("id"=>$forum->getId()),
array("class"=>"medium awesome"))?>
+<?php echo link_to(__("Create Topic", null, 'sfDoctrineSimpleForum'),
"sf_doctrine_simple_forum_create_topic", array("id"=>$forum->getId()),
array("class"=>"awesome"))?>
<?php endif;?>
\ No newline at end of file
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewLatestFeedSuccess.xml.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewLatestFeedSuccess.xml.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewLatestFeedSuccess.xml.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -7,7 +7,6 @@
<?php foreach($latest_posts as $post):?>
<entry>
<title type="html"><?php echo $post->getTopic()->getTitle()?>: </title>
- <link rel="alternate"
href="http://www.erepublik.com/en/forum/topic/123672/yes-you-saw-it-coming-from-a-mile-away/1"></link>
<updated><?php echo $post->getCreatedAt()?></updated>
<id><?php echo $post->getId()?></id>
<summary type="html"><?php echo $post->getContent()?></summary>
Modified:
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewTopicSuccess.php
===================================================================
---
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewTopicSuccess.php
2010-03-03 18:00:05 UTC (rev 28370)
+++
plugins/sfDoctrineSimpleForumPlugin/trunk/modules/sfDoctrineSimpleForum/templates/viewTopicSuccess.php
2010-03-03 22:48:45 UTC (rev 28371)
@@ -1,6 +1,6 @@
-<?php use_helper("Date", "I18N", "Javascript")?>
+<?php use_helper("Date", "i18N")?>
-<?php echo javascript_tag('
+<script type="text/javascript">
$(function(){
$(".comment-reply-link").click(function(){
@@ -11,29 +11,56 @@
});
});
-'); ?>
-
+</script>
+<div style="float: left; margin-right: 10px">
+ <div class="box">
+ <h3>Admin Tools</h3>
+ <ul class="list_links">
+ <li>
+ <?php
+ if($topic->getIsLocked()):
+ echo link_to(__("Unlock this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_unlock_topic",
array("id"=>$topic->getId()));
+ else:
+ echo link_to(__("Lock this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_lock_topic",
array("id"=>$topic->getId()));
+ endif;
+ ?>
+ </li>
+ <li>
+ <?php
+ if($topic->getIsSticked()):
+ echo link_to(__("Unsticky this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_unsticky_topic",
array("id"=>$topic->getId()));
+ else:
+ echo link_to(__("Sticky this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_sticky_topic",
array("id"=>$topic->getId()));
+ endif;
+ ?>
+ </li>
+ <li><?php echo link_to(__("Delete this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_delete_topic",
array("id"=>$topic->getId()))?></li>
+ <li><?php echo link_to(__("Edit this topic", null,
'sfDoctrineSimpleForum'), "sf_doctrine_simple_forum_edit_topic",
array("id"=>$topic->getId()))?></li>
+ </ul>
+ </div>
+</div>
+<div style="float: left; width: 700px">
<div id="respond" style="display:none">
-
</div>
<h3 class="toolbar"><?php echo $topic->getTitle()?></h3>
<ul id="crumbs">
<li><?php echo link_to("Forum Index",
"sf_doctrine_simple_forum_index")?></li>
- <li><?php echo
link_to($topic->getForum()->getCategories()->getName(),
"sf_doctrine_simple_forum_view_board", array("id"=>$topic->getForumId(),
"slug"=>$topic->getForum()->getSlug()))?></li>
+ <li><?php echo
link_to($topic->getForum()->getCategory()->getName(),
"sf_doctrine_simple_forum_view_board", array("id"=>$topic->getForumId(),
"slug"=>$topic->getForum()->getSlug()))?></li>
<li><?php echo $topic->getTitle()?></li>
</ul>
<br />
+<?php if($sf_user->hasFlash('success')): ?>
+ <p class="success"><?php echo $sf_user->getFlash('success'); ?>
+<?php endif; ?>
+<?php if($sf_user->hasFlash('error')): ?>
+ <p class="error"><?php echo $sf_user->getFlash('error'); ?>
+<?php endif; ?>
<?php if($topic->getIsLocked()):?>
<p class="notice">
<?php echo image_tag("/sfDoctrineSimpleForumPlugin/images/lock.png",
array("style"=>"vertical-align: -3px; margin-right: 5px;"))?>
<?php echo __("This thread is closed for posting.", null,
'sfDoctrineSimpleForum'); ?>
</p>
<?php endif;?>
-<?php if($sf_user->hasFlash('success')): ?>
- <p class="success">
- <?php echo $sf_user->getFlash('success'); ?>
- </p>
-<?php endif; ?>
<ol class="commentlist">
<?php $count = 0 ?>
@@ -85,5 +112,4 @@
</ul>
</form>
<?php endif?>
-
-
+</div>
--
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.