Example #1
0
 public function display($messages = false)
 {
     if ($messages) {
         $this->pdh->process_hook_queue();
         $this->core->messages($messages);
     }
     $order = $this->in->get('sort', '0.0');
     $red = 'RED' . str_replace('.', '', $order);
     $mdkp_ids = $this->pdh->get('multidkp', 'id_list');
     $mdkp = array();
     foreach ($mdkp_ids as $id) {
         $mdkp[$id]['sortid'] = $this->pdh->get('multidkp', 'sortid', $id);
         $mdkp[$id]['name'] = $this->pdh->get('multidkp', 'name', $id);
         $mdkp[$id]['desc'] = $this->pdh->get('multidkp', 'desc', $id);
         $mdkp[$id]['events'] = $this->pdh->aget('event', 'name', 0, array($this->pdh->get('multidkp', 'event_ids', $id)));
         $mdkp[$id]['no_atts'] = $this->pdh->get('multidkp', 'no_attendance', array($id));
         $ip_ids = $this->pdh->get('multidkp', 'itempool_ids', $id);
         $mdkp[$id]['itempools'] = $this->pdh->aget('itempool', 'name', 0, array(is_array($ip_ids) ? $ip_ids : array()));
     }
     $sort_ids = get_sortedids($mdkp, explode('.', $order), array('sortid', 'name', 'desc'));
     foreach ($sort_ids as $id) {
         $event_string = array();
         foreach ($mdkp[$id]['events'] as $eid => $event) {
             $event_string[] = "<span class='" . (in_array($eid, $mdkp[$id]['no_atts']) ? 'negative' : 'positive') . "'>" . $event . "</span>";
         }
         $this->tpl->assign_block_vars('multi_row', array('ID' => $id, 'NAME' => $mdkp[$id]['name'], 'DESC' => $mdkp[$id]['desc'], 'EVENTS' => implode(', ', $event_string), 'ITEMPOOLS' => implode(', ', $mdkp[$id]['itempools'])));
     }
     $this->tpl->assign_vars(array('SID' => $this->SID, $red => '_red', 'LISTMULTI_FOOTCOUNT' => sprintf($this->user->lang('multi_footcount'), count($sort_ids))));
     $this->tpl->add_js("\n\t\t\t\$(\"#multidkpsort tbody\").sortable({\n\t\t\t\tcancel: '.not-sortable, input, tr th.footer, th',\n\t\t\t\tcursor: 'pointer',\n\t\t\t});\n\t\t", "docready");
     $this->core->set_vars(array('page_title' => $this->user->lang('manmdkp_title'), 'template_file' => 'admin/manage_multidkp.html', 'display' => true));
 }
 public function display($messages = false)
 {
     if ($messages) {
         $this->pdh->process_hook_queue();
         $this->core->messages($messages);
     }
     $order = $this->in->get('sort', '0.0');
     $red = 'RED' . str_replace('.', '', $order);
     $itempool_ids = $this->pdh->get('itempool', 'id_list');
     foreach ($itempool_ids as $id) {
         $itempools[$id]['name'] = $this->pdh->get('itempool', 'name', $id);
         $itempools[$id]['desc'] = $this->pdh->get('itempool', 'desc', $id);
     }
     $sortedids = get_sortedids($itempools, explode('.', $order), array('name', 'desc'));
     foreach ($sortedids as $id) {
         $this->tpl->assign_block_vars('itempools', array('ID' => $id, 'NAME' => $itempools[$id]['name'], 'DESC' => $itempools[$id]['desc']));
     }
     $this->tpl->assign_vars(array($red => '_red', 'SID' => $this->SID));
     $this->core->set_vars(array('page_title' => $this->user->lang('manitempool_title'), 'template_file' => 'admin/manage_itempools.html', 'display' => true));
 }