示例#1
0
 protected function populateState()
 {
     $layout = $this->getCmd('layout', 'default');
     $this->setState('layout', $layout);
     // Administrator state
     if ($layout == 'manage' || $layout == 'create' || $layout == 'edit') {
         parent::populateState();
         return;
     }
     $active = $this->app->getMenu()->getActive();
     $active = $active ? (int) $active->id : 0;
     $catid = $this->getInt('catid', 0);
     $this->setState('item.id', $catid);
     $format = $this->getWord('format', 'html');
     $this->setState('format', $format);
     // List state information
     $value = $this->getUserStateFromRequest("com_kunena.category{$catid}_{$format}_list_limit", 'limit', 0, 'int');
     $defaultlimit = $format != 'feed' ? $this->config->threads_per_page : $this->config->rss_limit;
     if ($value < 1 || $value > 100) {
         $value = $defaultlimit;
     }
     $this->setState('list.limit', $value);
     //$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_{$format}_{$active}_list_ordering", 'filter_order', 'time', 'cmd' );
     //$this->setState ( 'list.ordering', $value );
     $value = $this->getUserStateFromRequest("com_kunena.category{$catid}_{$format}_list_start", 'limitstart', 0, 'int');
     $this->setState('list.start', $value);
     $value = $this->getUserStateFromRequest("com_kunena.category{$catid}_{$format}_{$active}_list_direction", 'filter_order_Dir', 'desc', 'word');
     if ($value != 'asc') {
         $value = 'desc';
     }
     $this->setState('list.direction', $value);
 }
示例#2
0
	protected function populateState() {
		$layout = $this->getCmd ( 'layout', 'default' );
		$this->setState ( 'layout', $layout );

		// Administrator state
		if ($layout == 'manage' || $layout == 'create' || $layout == 'edit') {
			return parent::populateState();
		}

		$app = JFactory::getApplication ();
		$this->config = KunenaFactory::getConfig ();
		$this->me = KunenaUserHelper::get();

		$active = $app->getMenu ()->getActive ();
		$active = $active ? (int) $active->id : 0;
		$catid = $this->getInt ( 'catid', 0 );
		$this->setState ( 'item.id', $catid );

		// List state information
		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_list_limit", 'limit', 0, 'int' );
		if ($value < 1) $value = $this->config->threads_per_page;
		$this->setState ( 'list.limit', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_{$active}_list_ordering", 'filter_order', 'time', 'cmd' );
		//$this->setState ( 'list.ordering', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_list_start", 'limitstart', 0, 'int' );
		$this->setState ( 'list.start', $value );

		$value = $this->getUserStateFromRequest ( "com_kunena.category{$catid}_{$active}_list_direction", 'filter_order_Dir', 'desc', 'word' );
		if ($value != 'asc')
			$value = 'desc';
		$this->setState ( 'list.direction', $value );
	}