Skip to content

Commit

Permalink
プラグインを無効にした場合でも、そのプラグインに依存するランキングが表示できてしまっていたのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Kousuke Ebihara committed May 11, 2010
1 parent 5f33ef9 commit 037fdea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/pc_frontend/modules/ranking/templates/_menu.php
@@ -1,7 +1,7 @@
<?php slot('op_sidemenu'); ?>
<div class="parts rankingSideNav">

<?php if (class_exists('Ashiato')): ?>
<?php if ($isAshiatoUsable): ?>
<div class="item">
<div class="partsHeading"><h3><?php echo __('Access number No1 member') ?></h3></div>
<p><?php echo __('It is a ranking of the member with a lot of numbers of yesterday of accesses.') ?></p>
Expand All @@ -23,7 +23,7 @@
<p class="link"><?php echo link_to(__('Participation number No1 %community%'), 'ranking/community') ?></p>
</div>

<?php if (class_exists('CommunityTopicComment')): ?>
<?php if ($isTopicUsable): ?>
<div class="item">
<div class="partsHeading"><h3><?php echo __('No1 %community% at each upsurge') ?></h3></div>
<p><?php echo __('It is a ranking of the %community% with a lot of numbers of yesterday of bulletin board writing.') ?></p>
Expand Down
5 changes: 4 additions & 1 deletion apps/pc_frontend/modules/ranking/templates/showSuccess.php
@@ -1,2 +1,5 @@
<?php include_partial('menu') ?>
<?php include_partial('menu', array(
'isAshiatoUsable' => $isAshiatoUsable,
'isTopicUsable' => $isTopicUsable,
)) ?>
<?php include_component('ranking', $type, array('culture' => $sf_user->getCulture())) ?>
9 changes: 6 additions & 3 deletions lib/action/opRankingPluginRankingActions.class.php
Expand Up @@ -17,9 +17,12 @@ class opRankingPluginRankingActions extends sfActions
*/
public function executeShow(sfWebRequest $request)
{
$this->isAshiatoUsable = opPlugin::getInstance('opAshiatoPlugin')->getIsActive();
$this->isTopicUsable = opPlugin::getInstance('opCommunityTopicPlugin')->getIsActive();

if (!$request->hasParameter('type'))
{
if (class_exists('Ashiato'))
if ($this->isAshiatoUsable)
{
$this->type = 'access';
}
Expand All @@ -40,13 +43,13 @@ public function executeShow(sfWebRequest $request)
switch ($this->type)
{
case "access" :
$this->forward404Unless(class_exists('Ashiato'));
$this->forward404Unless($this->isAshiatoUsable);
break;
case "friend" :
$this->forward404Unless(opConfig::get('enable_friend_link', true));
break;
case "topic" :
$this->forward404Unless(class_exists('CommunityTopicComment'));
$this->forward404Unless($this->isTopicUsable);
}
}
}

0 comments on commit 037fdea

Please sign in to comment.