HomeHelpTrac

Changeset 11828 for trunk/calendar.php


Ignore:
Timestamp:
07/31/09 01:14:44 (3 years ago)
Author:
Leonid Sokushev
Message:

Added browse mode by date for profiles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar.php

    r9839 r11828  
    11<?php 
    22 
    3 require_once( './inc/header.inc.php' ); 
    4 require_once( BX_DIRECTORY_PATH_INC     . 'admin.inc.php' ); 
    5 require_once( BX_DIRECTORY_PATH_INC     . 'db.inc.php' ); 
    6 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolProfileFields.php' ); 
    7 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolProfilesController.php' ); 
    8 require_once( BX_DIRECTORY_PATH_ROOT    . "templates/tmpl_{$tmpl}/scripts/BxTemplProfileView.php" ); 
     3require_once('./inc/header.inc.php'); 
     4require_once(BX_DIRECTORY_PATH_INC . 'admin.inc.php'); 
     5require_once(BX_DIRECTORY_PATH_INC . 'db.inc.php'); 
     6 
     7bx_import('BxDolProfileFields'); 
     8bx_import('BxDolProfilesController'); 
     9bx_import("BxTemplProfileView"); 
     10bx_import("BxTemplProfileView"); 
     11bx_import("BxTemplSearchProfile"); 
    912 
    1013check_logged(); 
    1114 
    1215$_page['name_index'] = 7; 
    13 $_page['css_name']   = 'search.css'; 
     16$_page['css_name']   = 'browse.css'; 
    1417 
    1518$_page['header'] = _t('_People_Calendar'); 
     
    2023 
    2124function getBlockCode_Results($iBlockID) { 
    22     $oProfile = new BxBaseProfileGenerator((int)$_COOKIE['memberID']); 
    23     $mSearchRes = $oProfile->GenProfilesCalendarBlock(); 
    24     list($sResults, $aDBTopMenu, $sPagination, $sTopFilter) = $mSearchRes; 
    25     return DesignBoxContent(_t('_People_Calendar'), $sResults, 1); 
     25    $sAction = strip_tags($_REQUEST['action']); 
     26    switch ($sAction) { 
     27        case 'browse': 
     28            $sCode = getProfilesByDate($_REQUEST['date']); 
     29            break; 
     30        default: 
     31            $sCode = getCalendar(); 
     32    } 
     33    return $sCode; 
     34} 
     35 
     36function getProfilesByDate ($sDate) { 
     37    $sDate = strip_tags($sDate); 
     38    $aDateParams = explode('/', $sDate); 
     39    $oSearch = new BxTemplSearchProfile('calendar', $aDateParams[0], $aDateParams[1], $aDateParams[2]); 
     40    $sCode = $oSearch->displayResultBlock(); 
     41    return $oSearch->displaySearchBox('<div class="search_container">' . $sCode . '</div>', $oSearch->showPagination()); 
     42} 
     43 
     44function getCalendar () { 
     45    $oProfile = new BxBaseProfileGenerator((int)$_COOKIE['memberID']); 
     46    $mSearchRes = $oProfile->GenProfilesCalendarBlock(); 
     47    list($sResults, $aDBTopMenu, $sPagination, $sTopFilter) = $mSearchRes; 
     48    return DesignBoxContent(_t('_People_Calendar'), $sResults, 1); 
    2649} 
    2750 
Note: See TracChangeset for help on using the changeset viewer.