Skip to content

Instantly share code, notes, and snippets.

@co3k
Created April 2, 2010 13:05
Show Gist options
  • Save co3k/353106 to your computer and use it in GitHub Desktop.
Save co3k/353106 to your computer and use it in GitHub Desktop.
diff --git a/apps/pc_frontend/config/routing.yml b/apps/pc_frontend/config/routing.yml
index 10e96c1..1fca8c9 100644
--- a/apps/pc_frontend/config/routing.yml
+++ b/apps/pc_frontend/config/routing.yml
@@ -37,6 +37,66 @@ error:
url: /default/error
param: { module: default, action: error }
+global_search:
+ url: /search
+ param: { module: default, action: search }
+
+global_changeLanguage:
+ url: /language
+ param: { module: member, action: changeLanguage }
+
+global_privacy_policy:
+ url: /privacyPolicy
+ param: { module: default, action: privacyPolicy }
+
+global_user_agreement:
+ url: /userAgreement
+ param: { module: default, action: userAgreement }
+
+# member rules
+member_config_image:
+ url: /member/image/config
+ param: { module: member, action: configImage }
+
+member_config:
+ url: /member/config
+ param: { module: member, action: config }
+
+member_delete:
+ url: /leave
+ param: { module: member, action: delete }
+
+member_invite:
+ url: /invite
+ param: { module: member, action: invite }
+
+# friend rules
+friend_show_image:
+ url: /friend/image
+ param: { module: friend, action: showImage }
+
+friend_list:
+ url: /friend/list
+ param: { module: friend, action: list }
+
+friend_manage:
+ url: /friend/manage
+ param: { module: friend, action: manage }
+
+# community rules
+community_joinlist:
+ url: /community/joinList
+ param: { module: community, action: joinlist }
+
+# openid rules
+openid_idpxrds:
+ url: /OpenID/idpXrds
+ param: { module: OpenID, action: idpXrds }
+
+openid_list:
+ url: /OpenID/list
+ param: { module: OpenID, action: list }
+
# oauth rules
oauth_request_token:
url: /oauth/request_token
diff --git a/apps/pc_frontend/modules/community/templates/_joinListBox.php b/apps/pc_frontend/modules/community/templates/_joinListBox.php
index 03f7383..122189d 100644
--- a/apps/pc_frontend/modules/community/templates/_joinListBox.php
+++ b/apps/pc_frontend/modules/community/templates/_joinListBox.php
@@ -3,8 +3,8 @@ $options = array(
'title' => __('%community% List', array('%community%' => $op_term['community']->titleize())),
'list' => $communities,
'crownIds' => $sf_data->getRaw('crownIds'),
- 'link_to' => 'community/home?id=',
- 'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->CommunityMember->count()), 'community/joinlist?id='.$member->id)),
+ 'link_to' => '@community_home?id=',
+ 'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->CommunityMember->count()), '@community_joinlist?id='.$member->id)),
'type' => $sf_data->getRaw('gadget')->getConfig('type'),
'row' => $row,
'col' => $col,
diff --git a/apps/pc_frontend/modules/community/templates/joinlistSuccess.php b/apps/pc_frontend/modules/community/templates/joinlistSuccess.php
index 153ba2c..8cc5ad8 100644
--- a/apps/pc_frontend/modules/community/templates/joinlistSuccess.php
+++ b/apps/pc_frontend/modules/community/templates/joinlistSuccess.php
@@ -3,9 +3,9 @@ $options = array(
'title' => __('%community% List', array('%community%' => $op_term['community']->titleize())),
'list' => $pager->getResults(),
'crownIds' => $sf_data->getRaw('crownIds'),
- 'link_to' => 'community/home?id=',
+ 'link_to' => '@community_home?id=',
'pager' => $pager,
- 'link_to_pager' => 'community/joinlist?page=%d&id='.$member->getId(),
+ 'link_to_pager' => '@community_joinlist?page=%d&id='.$member->getId(),
);
op_include_parts('photoTable', 'communityList', $options)
?>
diff --git a/apps/pc_frontend/modules/community/templates/searchSuccess.php b/apps/pc_frontend/modules/community/templates/searchSuccess.php
index 938a7aa..ab87ada 100644
--- a/apps/pc_frontend/modules/community/templates/searchSuccess.php
+++ b/apps/pc_frontend/modules/community/templates/searchSuccess.php
@@ -26,7 +26,7 @@ $options = array(
'title' => __('Search Results'),
'pager' => $pager,
'link_to_page' => 'community/search?page=%d',
- 'link_to_detail' => 'community/home?id=%d',
+ 'link_to_detail' => '@community_home?id=%d',
'list' => $list,
);
diff --git a/apps/pc_frontend/modules/default/templates/_languageSelecterBox.php b/apps/pc_frontend/modules/default/templates/_languageSelecterBox.php
index 36d86b2..8840012 100644
--- a/apps/pc_frontend/modules/default/templates/_languageSelecterBox.php
+++ b/apps/pc_frontend/modules/default/templates/_languageSelecterBox.php
@@ -1,4 +1,4 @@
-<?php echo $form->renderFormTag(url_for('member/changeLanguage')) ?>
+<?php echo $form->renderFormTag(url_for('@global_changeLanguage')) ?>
<?php echo $form['culture']->renderLabel() ?>:
<?php echo $form['culture']->render(array('onchange' => 'submit(this.form)')) ?>
<?php echo $form->renderHiddenFields() ?>
diff --git a/apps/pc_frontend/modules/default/templates/_memberImageBox.php b/apps/pc_frontend/modules/default/templates/_memberImageBox.php
index 3ea9aa8..f6943a0 100644
--- a/apps/pc_frontend/modules/default/templates/_memberImageBox.php
+++ b/apps/pc_frontend/modules/default/templates/_memberImageBox.php
@@ -2,12 +2,12 @@
$moreInfo = array();
if ($member->getId() === $id)
{
- $moreInfo[] = link_to(__('Edit Photo'), 'member/configImage');
- $moreInfo[] = link_to(__('Show Profile'), 'member/profile');
+ $moreInfo[] = link_to(__('Edit Photo'), '@member_config_image');
+ $moreInfo[] = link_to(__('Show Profile'), '@member_profile_mine');
}
elseif ($member->getImageFileName())
{
- $moreInfo[] = link_to(__('Show more Photos'), 'friend/showImage?id='.$member->getId());
+ $moreInfo[] = link_to(__('Show more Photos'), '@friend_show_image?id='.$member->getId());
}
$options = array(
diff --git a/apps/pc_frontend/modules/friend/templates/_friendListBox.php b/apps/pc_frontend/modules/friend/templates/_friendListBox.php
index 0e3ae2f..430f84c 100644
--- a/apps/pc_frontend/modules/friend/templates/_friendListBox.php
+++ b/apps/pc_frontend/modules/friend/templates/_friendListBox.php
@@ -2,8 +2,8 @@
$options = array(
'title' => __('%friend% List', array('%friend%' => $op_term['friend']->titleize())),
'list' => $friends,
- 'link_to' => 'member/profile?id=',
- 'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countFriends()), 'friend/list?id='.$member->getId())),
+ 'link_to' => '@obj_member_profile?id=',
+ 'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countFriends()), '@friend_list?id='.$member->getId())),
'type' => $sf_data->getRaw('gadget')->getConfig('type'),
'row' => $row,
'col' => $col,
@@ -13,7 +13,7 @@ if ($member->getId() == $sf_user->getMember()->getId())
{
$options['moreInfo'][] = link_to(__('%my_friend% Setting', array(
'%my_friend%' => $op_term['my_friend']->titleize()->pluralize(),
- )), 'friend/manage');
+ )), '@friend_manage');
}
op_include_parts('nineTable', 'frendList_'.$gadget->getId(), $options);
diff --git a/apps/pc_frontend/modules/friend/templates/manageSuccess.php b/apps/pc_frontend/modules/friend/templates/manageSuccess.php
index f52dc3d..b1cb38d 100644
--- a/apps/pc_frontend/modules/friend/templates/manageSuccess.php
+++ b/apps/pc_frontend/modules/friend/templates/manageSuccess.php
@@ -1,6 +1,6 @@
<?php echo op_include_parts('manageList', 'manageList', array(
'pager' => $pager,
- 'pager_url'=> 'friend/manage?page=%d',
+ 'pager_url'=> '@friend_manage?page=%d',
'item_url' => 'obj_member_profile',
'image_filename_method' => 'getImageFilename',
'title' => __('%my_friend% Setting', array(
diff --git a/apps/pc_frontend/modules/friend/templates/unlinkInput.php b/apps/pc_frontend/modules/friend/templates/unlinkInput.php
index 7ad14c7..f46bf37 100644
--- a/apps/pc_frontend/modules/friend/templates/unlinkInput.php
+++ b/apps/pc_frontend/modules/friend/templates/unlinkInput.php
@@ -3,5 +3,5 @@ op_include_parts('yesNo', 'unlinkConfirmForm', array(
'title' => __('Do you delete %0% from %my_friend%?', array('%0%' => link_to($member->getName(), '@member_profile?id='.$member->getId()))),
'yes_form' => new sfForm(),
'no_method' => 'get',
- 'no_url' => url_for('friend/manage')
+ 'no_url' => url_for('@friend_manage')
)) ?>
diff --git a/apps/pc_frontend/modules/member/actions/actions.class.php b/apps/pc_frontend/modules/member/actions/actions.class.php
index 97f7e08..245e452 100644
--- a/apps/pc_frontend/modules/member/actions/actions.class.php
+++ b/apps/pc_frontend/modules/member/actions/actions.class.php
@@ -139,7 +139,7 @@ class memberActions extends opMemberAction
{
$this->getUser()->setFlash('error', $e->getMessage());
}
- $this->redirect('member/configImage');
+ $this->redirect('@member_config_image');
}
}
diff --git a/apps/pc_frontend/modules/member/templates/configSuccess.php b/apps/pc_frontend/modules/member/templates/configSuccess.php
index 0545456..dd352eb 100644
--- a/apps/pc_frontend/modules/member/templates/configSuccess.php
+++ b/apps/pc_frontend/modules/member/templates/configSuccess.php
@@ -5,7 +5,7 @@ foreach ($categories as $key => $value)
{
if (count($value))
{
- $list[$key] = link_to(__($categoryCaptions[$key]), 'member/config?category='.$key);
+ $list[$key] = link_to(__($categoryCaptions[$key]), '@member_config?category='.$key);
}
}
op_include_parts('pageNav', 'pageNav', array('list' => $list, 'current' => $categoryName));
@@ -13,14 +13,14 @@ op_include_parts('pageNav', 'pageNav', array('list' => $list, 'current' => $cate
<?php
$list = array(
- link_to(__('Connecting with External Application'), 'connection/list'),
- link_to(__('OpenID Configuration'), 'OpenID/list'),
+ link_to(__('Connecting with External Application'), '@connection_list'),
+ link_to(__('OpenID Configuration'), '@openid_list'),
);
op_include_parts('pageNav', 'connection', array('list' => $list));
?>
<?php
-$list = array(link_to(__('Delete your %1% account', array('%1%' => $op_config['sns_name'])), 'member/delete'));
+$list = array(link_to(__('Delete your %1% account', array('%1%' => $op_config['sns_name'])), '@member_delete'));
op_include_parts('pageNav', 'navForDelete', array('list' => $list));
?>
<?php end_slot(); ?>
diff --git a/apps/pc_frontend/modules/member/templates/inviteInput.php b/apps/pc_frontend/modules/member/templates/inviteInput.php
index 380a97a..e0671b2 100644
--- a/apps/pc_frontend/modules/member/templates/inviteInput.php
+++ b/apps/pc_frontend/modules/member/templates/inviteInput.php
@@ -2,7 +2,7 @@
$options = array(
'title' => __('Invite a friend to %1%', array('%1%' => $op_config['sns_name'])),
- 'url' => url_for('member/invite'),
+ 'url' => url_for('@member_invite'),
'button' => __('Send'),
);
op_include_form('inviteForm', $form, $options);
@@ -16,7 +16,7 @@ op_include_form('inviteForm', $form, $options);
<h3><?php echo __('Mail address list during invitation') ?></h3>
</div>
-<?php echo $listform->renderFormTag(url_for('member/invite')) ?>
+<?php echo $listform->renderFormTag(url_for('@member_invite')) ?>
<?php $i = 0 ?>
<?php foreach ($listform as $field): ?>
<?php if ($field->isHidden()) continue; ?>
diff --git a/apps/pc_frontend/templates/_footer.php b/apps/pc_frontend/templates/_footer.php
index d7f2b96..91aa7c4 100644
--- a/apps/pc_frontend/templates/_footer.php
+++ b/apps/pc_frontend/templates/_footer.php
@@ -1,6 +1,6 @@
<p>
-<?php echo link_to('プライバシーポリシー', 'default/privacyPolicy', array('target' => '_blank')); ?>
-<?php echo link_to('利用規約', 'default/userAgreement', array('target' => '_blank')); ?>
+<?php echo link_to('プライバシーポリシー', '@global_privacy_policy', array('target' => '_blank')); ?>
+<?php echo link_to('利用規約', '@global_user_agreement', array('target' => '_blank')); ?>
<?php $snsConfigSettings = sfConfig::get('openpne_sns_config'); ?>
<?php if (opToolkit::isSecurePage()) : ?>
<?php echo Doctrine::getTable('SnsConfig')->get('footer_after', $snsConfigSettings['footer_after']['Default']); ?>
diff --git a/apps/pc_frontend/templates/_partsSearchFormLine.php b/apps/pc_frontend/templates/_partsSearchFormLine.php
index 686a4a9..3444acb 100644
--- a/apps/pc_frontend/templates/_partsSearchFormLine.php
+++ b/apps/pc_frontend/templates/_partsSearchFormLine.php
@@ -1,6 +1,6 @@
<?php $options->setDefault('single', true) ?>
-<form action="<?php echo url_for('default/search') ?>" method="get">
+<form action="<?php echo url_for('@global_search') ?>" method="get">
<ul>
<li><?php echo image_tag('icon_search.gif', array('alt' => 'search')) ?></li>
<li>
diff --git a/lib/filter/opAppendXRDSHeaderFilter.class.php b/lib/filter/opAppendXRDSHeaderFilter.class.php
index ea64256..08f92fe 100644
--- a/lib/filter/opAppendXRDSHeaderFilter.class.php
+++ b/lib/filter/opAppendXRDSHeaderFilter.class.php
@@ -23,7 +23,7 @@ class opAppendXRDSHeaderFilter extends sfFilter
if ('homepage' === $route)
{
- $this->context->getResponse()->setHttpHeader('X-XRDS-Location', $this->context->getController()->genUrl('OpenID/idpXrds', true));
+ $this->context->getResponse()->setHttpHeader('X-XRDS-Location', $this->context->getController()->genUrl('@openid_idpxrds', true));
}
$filterChain->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment