Exemple #1
0
defined('_HZEXEC_') or die;
$num_columns = $this->get('num_columns', 2);
$display_logos = $this->get('display_logos', true);
$display_private_description = $this->get('display_private_description', false);
$description_char_limit = $this->get('description_char_limit', 150);
//check to see if we have any groups to show
if (!$this->groups) {
    echo '<p class="info">' . Lang::txt('COM_GROUPS_INTRO_NO_' . str_replace(' ', '_', strtoupper($this->name)), User::get('id')) . '</p>';
} else {
    //var to hold html
    $html = '<div class="grid">';
    //var to hold count
    $count = 1;
    $totalCount = 0;
    //get current user object
    $user = \Hubzero\User::getInstance();
    //loop through each group
    foreach ($this->groups as $group) {
        //get the Hubzero Group Object
        $hg = \Hubzero\User\Group::getInstance($group->gidNumber);
        $gt = new \Components\Groups\Models\Tags();
        //var to hold group description
        $description = '';
        //get the column were on
        $cls = '';
        if ($count == $num_columns) {
            $count = 0;
            $cls = 'omega';
        }
        //how many columns are we showing
        switch ($num_columns) {
Exemple #2
0
 /**
  * Go through the checkout/payment process
  *
  * @return     void
  */
 public function checkoutTask()
 {
     // Check authorization
     if (User::isGuest()) {
         $this->loginTask();
         return;
     }
     // Set page title
     $this->_buildTitle();
     // Set the pathway
     $this->_buildPathway();
     $this->view->infolink = $this->infolink;
     $this->view->final = false;
     // Get cart object
     $item = new Cart($this->database);
     // Update quantaties and selections
     $item->saveCart(array_map('trim', $_POST), User::get('id'));
     // Calculate total
     $this->view->cost = $item->getCartItems(User::get('id'), 'cost');
     // Check available user funds
     $BTL = new Teller(User::get('id'));
     $balance = $BTL->summary();
     $credit = $BTL->credit_summary();
     $funds = $balance - $credit;
     $this->view->funds = $funds > 0 ? $funds : '0';
     if ($this->view->cost > $this->view->funds) {
         $this->cartTask();
         return;
     }
     // Get cart items
     $this->view->items = $item->getCartItems(User::get('id'));
     // Clean-up unavailable items
     $item->deleteUnavail(User::get('id'), $this->view->items);
     // Updated item list
     $this->view->items = $item->getCartItems(User::get('id'));
     // Output HTML
     $this->view->xprofile = \Hubzero\User::getInstance();
     $this->view->posted = array();
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     $this->view->display();
 }