Changeset 15211 for trunk/categories.php
- Timestamp:
- 06/07/11 23:41:51 (12 months ago)
- File:
-
- 1 edited
-
trunk/categories.php (modified) (23 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/categories.php
r15201 r15211 41 41 { 42 42 $oCateg = new BxTemplCategories(); 43 43 44 44 $oCateg->getTagObjectConfig($aParam); 45 45 46 46 if (empty($oCateg->aTagObjects)) 47 47 { … … 51 51 return MsgBox(_t('_Empty')); 52 52 } 53 53 54 54 $aParam['type'] = isset($_GET['tags_mode']) && isset($oCateg->aTagObjects[$_GET['tags_mode']]) ? $_GET['tags_mode'] : $oCateg->getFirstObject(); 55 55 56 56 $sCode = $oCateg->display($aParam, $iBoxId, $sAction, $bOrderPanel, getParam('categ_show_columns')); 57 57 58 58 if ($isBox) 59 59 { … … 73 73 74 74 75 class CategoriesCalendar extends BxTemplCalendar 76 { 77 function CategoriesCalendar($iYear, $iMonth) 75 class CategoriesCalendar extends BxTemplCalendar 76 { 77 function CategoriesCalendar($iYear, $iMonth) 78 78 { 79 79 parent::BxTemplCalendar($iYear, $iMonth); 80 80 } 81 81 82 82 function display() { 83 83 $aVars = array ( … … 96 96 $GLOBALS['oSysTemplate']->addCss('calendar.css'); 97 97 return $sHtml; 98 } 99 100 function getData() 98 } 99 100 function getData() 101 101 { 102 102 $oDb = new BxDolDb(); 103 103 104 104 return $oDb->getAll("SELECT *, DAYOFMONTH(`Date`) AS `Day` 105 105 FROM `sys_categories` 106 WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1') 107 AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1') 106 WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1') 107 AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1') 108 108 AND `Owner` <> 0 AND `Status` = 'active'"); 109 109 } 110 111 function getBaseUri() 110 111 function getBaseUri() 112 112 { 113 113 return BX_DOL_URL_ROOT . 'categories.php?action=calendar'; 114 114 } 115 116 function getBrowseUri() 115 116 function getBrowseUri() 117 117 { 118 118 return BX_DOL_URL_ROOT . 'categories.php?action=calendar'; 119 119 } 120 121 function getEntriesNames () 120 121 function getEntriesNames () 122 122 { 123 123 return array(_t('_categ_single'), _t('_categ_plural')); 124 124 } 125 126 function _getCalendar () 125 126 function _getCalendar () 127 127 { 128 128 $sBrowseUri = $this->getBrowseUri(); … … 131 131 $this->_getCalendarGrid($aCalendarGrid); 132 132 $aRet = array (); 133 for ($i = 0; $i < 6; $i++) { 133 for ($i = 0; $i < 6; $i++) { 134 134 135 135 $aRow = array ('bx_repeat:cell'); … … 156 156 'href' => $sBrowseUri . '&year=' . $this->iYear . '&month=' . $this->iMonth . '&day=' . $aCell['day'], 157 157 'entries' => 1 == $aCalendarGrid[$i][$j]['num'] ? $sEntriesSingle : $sEntriesMul, 158 )); 158 )); 159 159 $isRowEmpty = false; 160 160 } else { … … 166 166 'entries' => '', 167 167 )); 168 } 168 } 169 169 170 170 if ($aCell) … … 178 178 return $aRet; 179 179 } 180 181 } 182 183 class CategoriesCalendarPage extends BxDolPageView 184 { 180 181 } 182 183 class CategoriesCalendarPage extends BxDolPageView 184 { 185 185 var $sPage; 186 187 function CategoriesCalendarPage() 186 187 function CategoriesCalendarPage() 188 188 { 189 189 $this->sPage = 'categ_calendar'; 190 190 parent::BxDolPageView($this->sPage); 191 191 } 192 192 193 193 function getBlockCode_Calendar($iBlockId) 194 194 { … … 196 196 $sMonth = isset($_GET['month']) ? (int)$_GET['month'] : ''; 197 197 $oCalendar = new CategoriesCalendar($sYear, $sMonth); 198 198 199 199 return $oCalendar->display(); 200 200 } 201 201 202 202 function getBlockCode_CategoriesDate($iBlockId) 203 203 { … … 212 212 ) 213 213 ); 214 214 215 215 return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_CALENDAR, false, false, _t('_categ_caption_calendar')); 216 216 } … … 221 221 222 222 class CategoriesSearchPage extends BxDolPageView { 223 223 224 224 var $aSearchForm; 225 225 var $oForm; 226 226 var $sPage; 227 228 function CategoriesSearchPage() 227 228 function CategoriesSearchPage() 229 229 { 230 230 $this->sPage = 'categ_search'; 231 231 parent::BxDolPageView($this->sPage); 232 232 233 233 bx_import('BxTemplFormView'); 234 234 $this->aSearchForm = array( … … 237 237 'action' => '', 238 238 'method' => 'post', 239 ), 240 239 ), 240 241 241 'params' => array ( 242 242 'db' => array( … … 244 244 ), 245 245 ), 246 246 247 247 'inputs' => array( 248 248 'Keyword' => array( … … 257 257 ), 258 258 'db' => array ( 259 'pass' => 'Xss', 259 'pass' => 'Xss', 260 260 ), 261 ), 261 ), 262 262 'Submit' => array ( 263 263 'type' => 'submit', … … 266 266 'colspan' => true, 267 267 ), 268 ), 268 ), 269 269 ); 270 270 271 271 $this->oForm = new BxTemplFormView($this->aSearchForm); 272 272 $this->oForm->initChecker(); 273 273 } 274 274 275 275 function getBlockCode_Form() 276 276 { 277 277 return $GLOBALS['oSysTemplate']->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 278 278 } 279 279 280 280 function getBlockCode_Founded($iBlockId) 281 281 { … … 288 288 else if ($this->oForm->isSubmittedAndValid()) 289 289 $aParam['filter'] = $this->oForm->getCleanValue('Keyword'); 290 290 291 291 if (isset($aParam['filter'])) 292 292 return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_SEARCH, false, false, _t('_categ_caption_founded_categ')); … … 301 301 'pagination' => getParam('categ_perpage_browse') 302 302 ); 303 303 304 304 return showCategories($aParam, 1, BX_CATEG_ACTION_ALL, true, true, _t('_categ_caption_all')); 305 305 } … … 311 311 'common' => true, 312 312 ); 313 313 314 314 return showCategories($aParam, 1, BX_CATEG_ACTION_COMMON, true, false, _t('_categ_caption_common')); 315 315 } … … 321 321 'common' => false 322 322 ); 323 323 324 324 return showCategories($aParam, 1, BX_CATEG_ACTION_USERS, true, false, _t('_categ_caption_users')); 325 325 } … … 328 328 { 329 329 $oCalendarPage = new CategoriesCalendarPage(); 330 330 331 331 return $oCalendarPage->getCode(); 332 332 } … … 335 335 { 336 336 $oSearchPage = new CategoriesSearchPage(); 337 337 338 338 return $oSearchPage->getCode(); 339 339 } … … 345 345 $sContent = getPage_Common(); 346 346 break; 347 347 348 348 case BX_CATEG_ACTION_USERS: 349 349 $sContent = getPage_Users(); 350 350 break; 351 351 352 352 case BX_CATEG_ACTION_CALENDAR: 353 353 $sContent = getPage_Calendar(); 354 354 break; 355 355 356 356 case BX_CATEG_ACTION_SEARCH: 357 357 $sContent = getPage_Search(); 358 358 break; 359 359 360 360 default: 361 361 $sContent = getPage_All(); … … 367 367 global $_page_cont; 368 368 $iIndex = 25; 369 369 370 370 $_page['name_index'] = $iIndex; 371 371 $_page['css_name'] = 'tags.css'; 372 372 373 373 $_page['header'] = _t('_Categories'); 374 374 $_page['header_text'] = _t('_Categories'); 375 375 $_page_cont[$iIndex]['page_main_code'] = $sContent; 376 376 377 377 check_logged(); 378 378 PageCode(); 379 379 } 380 else 380 else 381 381 echo $sContent; 382 382
Note: See TracChangeset
for help on using the changeset viewer.