ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12756


Ignore:
Timestamp:
Aug 26, 2009, 2:27:03 PM (10 years ago)
Author:
ShogoKawahara
Message:

fixed a layout of the mobile_frontend application for page anchor

Location:
OpenPNE3/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/templates/layout.php

    r12394 r12756  
    4646<?php endif; ?>
    4747
     48<?php echo op_within_page_link(''); ?>
    4849<a name="bottom"></a>
    4950
  • OpenPNE3/trunk/lib/helper/opUtilHelper.php

    r12740 r12756  
    596596}
    597597
    598   function op_have_privilege($privilege, $member_id = null, $route = null)
    599   {
    600     if (!$member_id)
    601     {
    602       $member_id = sfContext::getInstance()->getUser()->getMemberId();
    603     }
    604 
    605     if (!$route)
    606     {
    607       $route = sfContext::getInstance()->getRequest()->getAttribute('sf_route');
    608     }
    609 
    610     return $route->getAcl()->isAllowed($member_id, null, $privilege);
    611   }
    612 
    613   function op_have_privilege_by_uri($uri, $params = array(), $member_id = null)
    614   {
    615     $routing = sfContext::getInstance()->getRouting();
    616     $routes = $routing->getRoutes();
    617 
    618     if (empty($routes[$uri]))
    619     {
    620       return true;
    621     }
    622 
    623     $route = $routes[$uri];
    624     if ($route instanceof opDynamicAclRoute)
    625     {
    626       $route->bind(sfContext::getInstance(), $params);
    627       try
    628       {
    629         $route->getObject();
    630       }
    631       catch (sfError404Exception $e)
    632       {
    633         // do nothing
    634       }
    635       $options = $route->getOptions();
    636       return op_have_privilege($options['privilege'], $member_id, $route);
    637     }
    638 
     598function op_have_privilege($privilege, $member_id = null, $route = null)
     599{
     600  if (!$member_id)
     601  {
     602    $member_id = sfContext::getInstance()->getUser()->getMemberId();
     603  }
     604
     605  if (!$route)
     606  {
     607    $route = sfContext::getInstance()->getRequest()->getAttribute('sf_route');
     608  }
     609
     610  return $route->getAcl()->isAllowed($member_id, null, $privilege);
     611}
     612
     613function op_have_privilege_by_uri($uri, $params = array(), $member_id = null)
     614{
     615  $routing = sfContext::getInstance()->getRouting();
     616  $routes = $routing->getRoutes();
     617
     618  if (empty($routes[$uri]))
     619  {
    639620    return true;
    640621  }
    641 ?>
     622
     623  $route = $routes[$uri];
     624  if ($route instanceof opDynamicAclRoute)
     625  {
     626    $route->bind(sfContext::getInstance(), $params);
     627    try
     628    {
     629      $route->getObject();
     630    }
     631    catch (sfError404Exception $e)
     632    {
     633      // do nothing
     634    }
     635    $options = $route->getOptions();
     636    return op_have_privilege($options['privilege'], $member_id, $route);
     637  }
     638
     639  return true;
     640}
Note: See TracChangeset for help on using the changeset viewer.