当前位置: 首页>>代码示例>>PHP>>正文


PHP RSMembershipHelper::getShared方法代码示例

本文整理汇总了PHP中RSMembershipHelper::getShared方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::getShared方法的具体用法?PHP RSMembershipHelper::getShared怎么用?PHP RSMembershipHelper::getShared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSMembershipHelper的用法示例。


在下文中一共展示了RSMembershipHelper::getShared方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkMenu

 public static function checkMenu(&$has_access, &$found_shared, &$redirect, $memberships, $extras)
 {
     $app = JFactory::getApplication();
     $Itemid = JFactory::getApplication()->input->get('Itemid', 0, 'int');
     $type = $app->isAdmin() ? 'backendurl' : 'frontendurl';
     $shared = RSMembershipHelper::getShared('menu', $Itemid);
     // Get the database object
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     if (!empty($shared)) {
         foreach ($shared as $share) {
             $what = isset($share->membership_id) ? 'membership_id' : 'extra_value_id';
             $where = isset($share->membership_id) ? $memberships : $extras;
             $table = isset($share->membership_id) ? '#__rsmembership_memberships' : '#__rsmembership_extra_values';
             if ($share->params == $Itemid) {
                 $found_shared = true;
                 if (in_array($share->{$what}, $where)) {
                     $has_access = true;
                     break;
                 } else {
                     // Get the redirect page
                     $query->clear();
                     $query->select($db->qn('share_redirect'))->from($db->qn($table))->where($db->qn('id') . ' = ' . $db->q($share->{$what}));
                     $db->setQuery($query);
                     $redirect = $db->loadResult();
                 }
             }
         }
     }
 }
开发者ID:JozefAB,项目名称:qk,代码行数:30,代码来源:helper.php

示例2: checkMenu

 function checkMenu(&$has_access, &$found_shared, &$redirect, $memberships, $extras)
 {
     $mainframe =& JFactory::getApplication();
     $Itemid = JRequest::getInt('Itemid');
     $type = $mainframe->isAdmin() ? 'backendurl' : 'frontendurl';
     $shared = RSMembershipHelper::getShared('menu', $Itemid);
     // Get the database object
     $db =& JFactory::getDBO();
     if (!empty($shared)) {
         foreach ($shared as $share) {
             $what = isset($share->membership_id) ? 'membership_id' : 'extra_value_id';
             $where = isset($share->membership_id) ? $memberships : $extras;
             $table = isset($share->membership_id) ? '#__rsmembership_memberships' : '#__rsmembership_extra_values';
             if ($share->params == $Itemid) {
                 $found_shared = true;
                 if (in_array($share->{$what}, $where)) {
                     $has_access = true;
                     break;
                 } else {
                     // Get the redirect page
                     $db->setQuery("SELECT `share_redirect` FROM " . $table . " WHERE `id`='" . $share->{$what} . "'");
                     $redirect = $db->loadResult();
                 }
             }
         }
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:27,代码来源:rsmembership.php


注:本文中的RSMembershipHelper::getShared方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。