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


PHP JCckDevHelper::getRouteParams方法代码示例

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


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

示例1: CckParseRoute

function CckParseRoute($segments)
{
    $app = JFactory::getApplication();
    $count = count($segments);
    $menu = $app->getMenu();
    $menuItem = $menu->getActive();
    $vars = array();
    if ($segments[0] == 'form') {
        $menu->setActive($app->input->getInt('Itemid', 0));
        $vars['option'] = 'com_cck';
        $vars['view'] = 'form';
        $vars['layout'] = 'edit';
        $vars['type'] = $segments[1];
    } else {
        $legacy = 0;
        // check later
        if (!($menuItem->query['option'] == 'com_cck' && $menuItem->query['view'] == 'list')) {
            $legacy = 0;
        }
        if (!$legacy) {
            if (isset($menuItem->query['search'])) {
                $params = JCckDevHelper::getRouteParams($menuItem->query['search']);
            }
            if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                JCck::callFunc_Array('plgCCK_Storage_Location' . $params['location'], 'parseRoute', array(&$vars, $segments, $count, $params));
            } else {
                $legacy = 1;
            }
        }
        if ($legacy) {
            if ($count == 2) {
                $vars['option'] = 'com_content';
                $vars['view'] = 'article';
                $vars['catid'] = $segments[0];
                $vars['id'] = $segments[1];
            } elseif ($count == 1) {
                $vars['option'] = 'com_content';
                @(list($id, $alias) = explode(':', $segments[0], 2));
                $category = JCategories::getInstance('Content')->get($id);
                if ($category && $category->id == $id && $category->alias == $alias) {
                    $vars['view'] = 'categories';
                } else {
                    $vars['view'] = 'article';
                }
                $vars['id'] = $segments[0];
            }
        }
    }
    return $vars;
}
开发者ID:pctechnikch,项目名称:SEBLOD,代码行数:51,代码来源:router.php

示例2: parse

 public function parse(&$segments)
 {
     $app = JFactory::getApplication();
     $count = count($segments);
     $menu = $app->getMenu();
     $menuItem = $menu->getActive();
     $vars = array();
     if ($segments[0] == 'form') {
         $menu->setActive($app->input->getInt('Itemid', 0));
         $vars['option'] = 'com_cck';
         $vars['view'] = 'form';
         $vars['layout'] = 'edit';
         $vars['type'] = @$segments[1];
     } else {
         $legacy = 0;
         // check later
         if (!($menuItem->query['option'] == 'com_cck' && $menuItem->query['view'] == 'list')) {
             $legacy = 0;
         }
         if (!$legacy) {
             if (isset($menuItem->query['search'])) {
                 $params = JCckDevHelper::getRouteParams($menuItem->query['search']);
                 if ($params['doSEF'][0] == '4' || $params['doSEF'][0] == '5') {
                     if ($count == 1) {
                         if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                             require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                             $target = $params['doSEF'][0] == '5' ? 'author_object' : 'parent_object';
                             $properties = array($target);
                             $properties = JCck::callFunc('plgCCK_Storage_Location' . $params['location'], 'getStaticProperties', $properties);
                             if ($properties[$target] != '') {
                                 $params['doSEF'][0] = '2';
                                 $params['location'] = $properties[$target];
                             }
                         }
                     }
                 }
             }
             if (isset($params['location']) && $params['location'] && is_file(JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php')) {
                 require_once JPATH_SITE . '/plugins/cck_storage_location/' . $params['location'] . '/' . $params['location'] . '.php';
                 JCck::callFunc_Array('plgCCK_Storage_Location' . $params['location'], 'parseRoute', array(&$vars, $segments, $count, $params));
             } else {
                 $legacy = 1;
             }
         }
         if ($legacy) {
             if ($count == 2) {
                 $vars['option'] = 'com_content';
                 $vars['view'] = 'article';
                 $vars['catid'] = $segments[0];
                 $vars['id'] = $segments[1];
             } elseif ($count == 1) {
                 $vars['option'] = 'com_content';
                 $idArray = explode(':', $segments[0], 2);
                 $id = (int) $idArray[0];
                 $alias = (string) @$idArray[1];
                 $category = JCategories::getInstance('Content')->get($id);
                 if ($category && $category->id == $id && $category->alias == $alias) {
                     $vars['view'] = 'categories';
                 } else {
                     $vars['view'] = 'article';
                 }
                 $vars['id'] = $segments[0];
             }
         }
     }
     return $vars;
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:67,代码来源:router.php


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