Example #1
0
 /**
  * The index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Proud = new Proud();
     /*$Category = new Client();
     		foreach ( $Category->findList( array(), 'Position asc', 0, 1 ) as $Category );
     		
     		$params = array();
     		$c = Request::get('c', $Category->Id);
     		$params[] = 'CategoryId = '.$c;
     		$_GET['c'] = $c;
      		$this->getView()->set( 'Prouds', $Proud->findList( $params, 'Position asc' ) );       */
     $this->getView()->set('Prouds', $Proud->findList('', 'Position desc'));
     return $this->getView()->render();
 }
Example #2
0
 /**
  * The function returns Prouds in current Category.
  * 
  * @access public
  * @param bool $assoc If TRUE returns products in associated array.
  * @return array The Prouds.
  */
 public function getProuds($assoc = false)
 {
     $Proud = new Proud();
     $params = array();
     $params[] = 'CategoryId = ' . $this->Id;
     $arr = $Proud->findShortList($params, 'Position asc');
     if (!$assoc) {
         return $arr;
     }
     return self::convertArray($arr, 'Id', 'Name');
 }
Example #3
0
 /**
  * The index handler.
  * 
  * @access public
  * @return string The HTML code.
  */
 public function index()
 {
     $Article = new Article();
     $Client = new Client();
     $Button = new Button();
     $Proud = new Proud();
     $Banner = new Banner();
     $a = array();
     $a[] = 'PostedAt < ' . time();
     $a[] = 'Type = ' . Article::ARTICLE;
     $b = array();
     $b[] = 'PostedAt < ' . time();
     $b[] = 'Type = ' . Article::NEWS;
     foreach ($Banner->findList(array(), 'rand()', 0, 1) as $Banner) {
     }
     $this->getView()->set(array('Articles' => $Article->findShortList($a, 'PostedAt desc', 0, 4), 'News' => $Article->findShortList($b, 'PostedAt desc', 0, 2), 'Clients' => $Client->findList(array(), 'Position asc', 0, 8), 'Buttons' => $Button->findList(array(), 'Position asc', 0, 3), 'Prouds' => $Proud->getLastProuds(), 'Banner' => $Banner));
     return $this->getView()->render();
 }
Example #4
0
 /**
  * The function returns Proud for current Brand.
  * 
  * @access public
  * @return object The Proud.
  */
 public function getProud()
 {
     $Proud = new Proud();
     return $Proud->findItem(array('Id = ' . $this->ProudId));
 }