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


PHP c2cTools::getRequestParameterArray方法代码示例

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


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

示例1: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'images');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('inam'), array('image_i18n', 'join_image'));
     self::buildOrderCondition($joins_order, $orderby_list, array('odate'), array('outing', 'join_outing'));
     self::buildOrderCondition($joins_order, $orderby_list, array('oid'), array('post_outing', 'join_outing'));
     self::buildOrderCondition($joins, $orderby_list, array('oid', 'odate'), array('post_outing', 'join_outing'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'i');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, true);
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Join', '', 'join', '');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // document criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lid.main_id', 'docs', 'doc');
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'ldc.linked_id', 'dtags', 'dtag');
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'hm.user_id', 'users', 'user_id');
     // TODO here we should restrict to initial uploader (ticket #333)
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lou.main_id', 'ousers', array('ouser_id', 'join_outing', 'post_outing'));
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:78,代码来源:Image.class.php

示例2: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'sites');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('tnam'), array('site_i18n', 'join_site'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 's');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'linked_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:67,代码来源:Site.class.php

示例3: pager_navigation

function pager_navigation($pager, $class = array())
{
    sfLoader::loadHelpers(array('General'));
    $navigation = '';
    if ($pager->haveToPaginate()) {
        $context = sfContext::getInstance();
        $request = $context->getRequest();
        $orderby_params = array('orderby', 'orderby2', 'orderby3');
        $order_params = array('order', 'order2', 'order3');
        $orderby_list = c2cTools::getRequestParameterArray($orderby_params);
        $order_list = c2cTools::getRequestParameterArray($order_params);
        $params = array();
        foreach ($orderby_params as $key => $orderby_param) {
            $params[$orderby_param] = $orderby_list[$key];
            $params[$order_params[$key]] = $order_list[$key];
        }
        $uri = _addUrlParameters(_getBaseUri(), array(), $params);
        $uri .= _getSeparator($uri) . 'page=';
        // First and previous pages
        if ($pager->getPage() != 1) {
            $navigation .= link_to(picto_tag('action_first', __('first page')), $uri . '1');
            $navigation .= ' ';
            $navigation .= link_to(picto_tag('action_back', __('previous page')), $uri . $pager->getPreviousPage());
            $navigation .= '  ';
        }
        // Pages one by one
        $links = array();
        foreach ($pager->getLinks() as $page) {
            $links[] = link_to_unless($page == $pager->getPage(), $page, $uri . $page);
        }
        $navigation .= implode('  ', $links);
        // Next and last pages
        if ($pager->getPage() != $pager->getLastPage()) {
            $navigation .= '  ';
            $navigation .= link_to(picto_tag('action_next', __('next page')), $uri . $pager->getNextPage());
            $navigation .= ' ';
            $navigation .= link_to(picto_tag('action_last', __('last page')), $uri . $pager->getLastPage());
        }
    }
    $class[] = 'pages_navigation';
    return '<div class="' . implode(' ', $class) . '">' . $navigation . '</div>';
}
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:42,代码来源:PaginationHelper.php

示例4: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'users');
     // criteria to hide users whithout public profile
     if (!sfContext::getInstance()->getUser()->isConnected()) {
         $conditions[] = 'upd.is_profile_public IS TRUE';
         $joins['user_pd'] = true;
         $joins['join_user'] = true;
         if (isset($joins['all'])) {
             unset($joins['all']);
         }
     }
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('unam'), array('user_i18n', 'join_user'));
     self::buildOrderCondition($joins_order, $orderby_list, array('ufnam'), array('user_pd', 'join_user'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'u');
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('go', 'linked_id'), 'oareas', 'oarea');
     if (isset($joins['oarea'])) {
         $joins['join_outing'] = true;
         $joins['post_outing'] = true;
     }
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, true);
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Join', '', 'ijoin', '', 'image');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'linked_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false, 'document_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:73,代码来源:User.class.php

示例5: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'maps');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('mnam'), array('map_i18n', 'join_map'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'm');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // map criteria
     $m = 'm';
     $m2 = 'm';
     $mid = 'm.id';
     $midi18n = $mid;
     $join = null;
     $join_id = null;
     $join_idi18n = null;
     $join_i18n = null;
     $is_module = true;
     $nb_id = 0;
     $nb_name = 0;
     $nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, array('id', 'maps'), $join_id);
     $has_id = $nb_id == 1;
     if (!$has_id) {
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'marnd', $join);
         $nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'mi.search_name'), $is_module ? array('mnam', 'name') : 'mnam', array($join_idi18n, $join_i18n), 'Map');
         if ($nb_name === 'no_result') {
             return $nb_name;
         }
         $nb_id += $nb_name;
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', $m . '.code', 'code', $join);
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.scale', 'scal', $join);
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $m . '.editor', 'edit', $join);
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'mi.culture', 'mcult', $join_i18n);
     }
     if ($is_module && $nb_id) {
         $joins['nb_id'] = $nb_id;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:61,代码来源:Map.class.php

示例6: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'books');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('bnam'), array('book_i18n', 'join_book'));
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = $conditions;
         $criteria[1] = $values;
         $criteria[2] = $joins;
         $criteria[3] = $joins_order;
         return $criteria;
     }
     // area criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('g', 'linked_id'), 'areas', 'area_id');
     // book / article criteria
     $has_name = Book::buildBookListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', 'm.author', 'auth', null);
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Istring', 'm.editor', 'edit', null);
     // linked doc criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lbd.linked_id', 'bdocs', 'bdoc');
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:46,代码来源:Book.class.php

示例7: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for enabling/disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'outings');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('onam'), array('outing_i18n', 'join_outing'));
     self::buildOrderCondition($joins_order, $orderby_list, array('lat', 'lon'), array('summit', 'join_summit'));
     //FIXME : Don't work : $outings_sort_route_criteria = sfConfig::get('app_outings_sort_route_criteria');
     $outings_sort_route_criteria = array('fac', 'time', 'ralt', 'dhei', 'grat', 'erat', 'prat', 'frat', 'arat', 'irat', 'mrat', 'trat', 'sexpo', 'lrat', 'srat', 'hrat', 'wrat');
     self::buildOrderCondition($joins_order, $orderby_list, $outings_sort_route_criteria, array('route', 'join_route'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'o');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // outing / article criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:76,代码来源:Outing.class.php

示例8: getListSortCriteria

 /**
  * Detects list sort parameters: what field to order on, direction and 
  * number of items per page (npp).
  * @return array
  */
 public static function getListSortCriteria($model = 'Document', $default_npp = null, $max_npp = 100, $mi = 'mi')
 {
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     $order_list = c2cTools::getRequestParameterArray(array('order', 'order2', 'order3'), sfConfig::get('app_list_default_order'));
     if (empty($default_npp)) {
         $default_npp = c2cTools::mobileVersion() ? sfConfig::get('app_list_mobile_maxline_number') : sfConfig::get('app_list_maxline_number');
     }
     $npp = c2cTools::getRequestParameter('npp', $default_npp);
     if (!empty($max_npp)) {
         $npp = min($npp, $max_npp);
     }
     return self::buildSortCriteria($model, $orderby_list, $order_list, $npp, $mi);
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:18,代码来源:BaseDocument.class.php

示例9: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'articles');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('cnam'), array('article_i18n', 'join_article'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'a');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // article criteria
     $has_name = Article::buildArticleListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // linked document criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lcd.main_id', 'cdocs', 'cdoc');
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // book criteria
     $has_name = Book::buildBookListCriteria($criteria, $params_list, false, 'c', 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('u', 'main_id'), 'users', 'user_id');
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:81,代码来源:Article.class.php

示例10: pager_navigation

 $pager_navigation = pager_navigation($pager);
 if (!$mobile_version) {
     echo '<p class="list_header">' . __('to sort by one column, click once or twice in its title') . '</p>';
 }
 echo '<p class="list_header">' . link_to_default_order(__('sort by id'), __('the list is sorted by id'));
 if ($module == 'outings') {
     $orderby_images = array('orderby' => 'odate', 'order' => 'desc');
 } else {
     $orderby_images = array();
 }
 echo ' &nbsp; ' . link_to_associated_images(__('List all linked images'), $module, $orderby_images);
 echo '</p>';
 $orderby_params = array('orderby', 'orderby2', 'orderby3');
 $order_params = array('order', 'order2', 'order3');
 $orderby_list = c2cTools::getRequestParameterArray($orderby_params, '');
 $order_list = c2cTools::getRequestParameterArray($order_params, '');
 if (!$mobile_version && in_array($module, array('outings', 'routes', 'summits', 'sites', 'parkings', 'huts', 'areas', 'users'))) {
     $result_types = sfConfig::get('app_list_result_types');
     if ($module == 'outings') {
         unset($result_types[1]);
         unset($result_types[2]);
     } elseif (in_array($module, array('routes', 'sites', 'users'))) {
         unset($result_types[1]);
     }
     $result_type_options = options_for_select(array_map('__', $result_types), 3);
     $result_type_select = select_tag('result_type', $result_type_options);
     $result_type_select_2 = select_tag('result_type_2', $result_type_options);
     $linked_docs = sfConfig::get('app_list_linked_docs');
     $linked_doc_options = options_for_select(array_map('__', $linked_docs), 1);
     $linked_doc_select = select_tag('linked_docs', $linked_doc_options);
     $linked_doc_select_2 = select_tag('linked_docs_2', $linked_doc_options);
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:31,代码来源:listSuccess.php

示例11: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'portals');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('wnam'), array('portal_i18n', 'join_portal'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'w');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // portal criteria
     $m = 'm';
     $m2 = 'p';
     $mid = 'm.id';
     $midi18n = $mid;
     $join = null;
     $join_id = null;
     $join_idi18n = null;
     $join_i18n = 'portal_i18n';
     $is_module = true;
     $nb_id = 0;
     $nb_name = 0;
     $nb_id = self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', $mid, array('id', 'portals'), $join_id);
     $has_id = $nb_id == 1;
     if (!$has_id) {
         if ($is_module) {
             self::buildConditionItem($conditions, $values, $joins, $params_list, 'Georef', $join, 'geom', $join);
         }
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'Around', $m2 . '.geom', 'warnd', $join);
         $nb_name = self::buildConditionItem($conditions, $values, $joins, $params_list, 'String', array($midi18n, 'wi.search_name'), $is_module ? array('wnam', 'name') : 'wnam', array($join_idi18n, $join_i18n), 'Portal');
         if ($nb_name === 'no_result') {
             return $nb_name;
         }
         $nb_id += $nb_name;
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'Compare', $m . '.elevation', 'walt', $join);
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'Array', array($m, $m2, 'activities'), 'act', $join);
         self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'wi.culture', 'wcult', $join_i18n);
     }
     if ($is_module && $nb_id) {
         $joins['nb_id'] = $nb_id;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:68,代码来源:Portal.class.php


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