• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Table/classes/class.ilTableGUI.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2005 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00037 class ilTableGUI
00038 {
00039         var $title;                                     // table title name
00040         var $icon;                                      // table title icon
00041         var $icon_alt;                          // table title icon alt text
00042 
00043         var $help_page;                         // table help name
00044         var $help_icon;                         // table help icon
00045         var $help_icon_alt;                     // table help icon alt text
00046 
00047         var $header_names;                      // titles of header columns
00048         var $header_vars;                       // var names of header columns (i.e. for database order column)
00049         var $linkbar_vars;                      // additional variables for linkbar
00050 
00051         var $data;                                      // table content
00052         
00053         var $column_count;                      // no. of columns (based on element count of $this->header array)
00054         var $column_width;                      // column width of each column (used in order until max. column from column count is reached)
00055                                                                 // any exceeding values are ignored
00056         var $max_count;                         // max. count of database query
00057         var $limit;                                     // max. count of dataset per page
00058         var $max_limit = false;
00059         var $offset;                            // dataset offset
00060         var $order_column;                      // order column
00061         var $order_direction;           // order direction
00062         
00063         var $footer_style;                      // css format for links
00064         var     $footer_previous;               // value of previous link
00065         var     $footer_next;                   // value of next link
00066         
00067         var $lang_support = true;       // if a lang object is included
00068         var $global_tpl;                        // uses global tpl (true) or a local one (false)
00069         var $form_name;                 // the name of the parent form of the table
00070         var $select_all_checkbox;  // the name (or the first characters if unique) of a checkbox the should be toggled with a select all button
00071         var $action_buttons;  // action buttons in the table footer
00072         
00073         var $prefix;                            // prefix for sort and offset fields if you have two or more tables on a page that you want to sort separately
00074         var $base = "";                         // base script (deprecated)
00075         
00076         // default settings for enabled/disabled table modules 
00077         var $enabled = array(   "table"                 =>  true,
00078                                                         "title"                 =>      true,
00079                                                         "icon"                  =>      true,
00080                                                         "help"                  =>      false,
00081                                                         "content"               =>      true,
00082                                                         "action"                =>      false,
00083                                                         "header"        =>  true,
00084                                                         "footer"                =>      true,
00085                                                         "linkbar"               =>      true,
00086                                                         "numinfo"               =>      true,
00087                                                         "numinfo_header"                =>      false,
00088                                                         "sort"                  =>  true,
00089                                                         "hits"          =>  false,
00090                                                         "auto_sort"     =>  true,
00091                                                         "select_all" => false
00092                                                 );
00093 
00094         // tpl styles (only one so far)
00095         var $styles = array(
00096                                                         "table"         => "fullwidth"
00097                                                 );
00098         
00106         function ilTableGUI($a_data = 0,$a_global_tpl = true)
00107         {
00108                 global $ilias, $tpl, $lng;
00109 
00110                 $this->global_tpl = $a_global_tpl;
00111                 $this->ilias =& $ilias;
00112                 $this->header_vars = array();
00113                 $this->header_params = array();
00114                 $this->enabled["form"] = true;
00115                 $this->action_buttons = array();
00116                 if ($this->global_tpl)
00117                 {
00118                         $this->tpl =& $tpl;
00119                 }
00120                 else
00121                 {
00122                         $this->tpl = new ilTemplate("tpl.table.html", true, true, "Services/Table");
00123                 }
00124 
00125                 $this->lng =& $lng;
00126 
00127                 if (!$this->lng)
00128                 {
00129                         $this->lang_support = false;
00130                 }
00131 
00132                 $this->setData($a_data);
00133         }
00134 
00135 
00141         function setTemplate(&$a_tpl)
00142         {
00143                 $this->tpl =& $a_tpl;
00144         }
00145 
00146         function &getTemplateObject()
00147         {
00148                 return $this->tpl;
00149         }
00150 
00156         function setData($a_data)
00157         {
00158                 if (is_array($a_data))
00159                 {
00160                         $this->data = $a_data;
00161                 }
00162         }
00163 
00164         function getData()
00165         {
00166                 return $this->data;
00167         }
00168 
00176         function setTitle($a_title,$a_icon = 0,$a_icon_alt = 0)
00177         {
00178                 $this->title = $a_title;
00179                 $this->icon = $a_icon;
00180                 $this->icon_alt = $a_icon_alt;
00181 
00182                 if (!$this->icon)
00183                 {
00184                         $this->enabled["icon"] = false;
00185 
00186                         return;
00187                 }
00188 
00189                 if (!$this->icon_alt)
00190                 {
00191                         $this->icon_alt = $this->icon;
00192                 }
00193                 $this->enabled["icon"] = true;
00194         }
00195         
00203         function setHelp($a_help_page,$a_help_icon,$a_help_icon_alt = 0)
00204         {
00205                 $this->help_page = $a_help_page;
00206                 $this->help_icon = $a_help_icon;
00207                 $this->help_icon_alt = $a_help_icon_alt;
00208 
00209                 if (!$this->help_icon_alt)
00210                 {
00211                         $this->help_icon_alt = $this->help_icon;
00212                 }
00213         }
00214         
00220         function setHeaderNames($a_header_names)
00221         {
00222                 $this->header_names = $a_header_names;
00223                 $this->column_count = count($this->header_names);
00224         }
00225         
00231         function getColumnCount()
00232         {
00233                 return $this->column_count;
00234         }
00235 
00242         function setHeaderVars($a_header_vars,$a_header_params = 0)
00243         {
00244                 $this->header_vars = $a_header_vars;
00245                 
00246                 if ($a_header_params == 0 or !is_array($a_header_params))
00247                 {
00248                         $this->link_params = "";
00249                 }
00250                 else
00251                 {
00252                         $this->header_params = $a_header_params;        // temp. solution for linkbar
00253 
00254                         foreach ($a_header_params as $key => $val)
00255                         {
00256                                 $this->link_params .= $key."=".$val."&";
00257                         }
00258                 }
00259         }
00260         
00266         function setColumnWidth($a_column_width)
00267         {
00268                 $this->column_width = $a_column_width;
00269         }
00270         
00277         function setOneColumnWidth($a_column_width,$a_column_number)
00278         {
00279                 $this->column_width[$a_column_number] = $a_column_width;
00280         }
00281 
00289         function setMaxCount($a_max_count)
00290         {
00291                 $this->max_count = $a_max_count;
00292 
00293                 if ($this->max_limit)
00294                 {
00295                         $this->limit = $this->max_count;
00296                 }
00297         }
00298         
00305         function setLimit($a_limit = 0, $a_default_limit = 0)
00306         {
00307                 $this->limit = ($a_limit) ? $a_limit : $a_default_limit;
00308 
00309                 if ($this->limit == 0)
00310                 {
00311                         $this->max_limit = true;
00312                 }
00313         }
00314         
00318         function getLimit()
00319         {
00320                 return $this->limit;
00321         }
00322 
00323 
00329         function setPrefix($a_prefix)
00330         {
00331                 $this->prefix = ($a_prefix) ? $a_prefix : "";
00332         }
00333         
00339         function setOffset($a_offset)
00340         {
00341                 $this->offset = ($a_offset) ? $a_offset : 0;
00342         }
00343         
00347         function getOffset()
00348         {
00349                 return $this->offset;
00350         }
00351         
00358         function setOrderColumn($a_order_column = 0,$a_default_column = 0)
00359         {
00360                 // set default sort column to first column
00361                 if (empty($a_order_column))
00362                 {
00363                         if (!empty($a_default_column))
00364                         {
00365                                 $this->order_column = array_search($a_default_column,$this->header_vars);       
00366                         }
00367                         else
00368                         {
00369                                 $this->order_column = 0;
00370                                 return;
00371                         }
00372                 }
00373                 else
00374                 {
00375                         $this->order_column = array_search($a_order_column,$this->header_vars);
00376                 }
00377 
00378                 if ($this->order_column === false)
00379                 {
00380                         // if not found, set default sort column to first column
00381                         $this->order_column = 0;
00382                 }
00383         }
00384         
00388         function getOrderColumn()
00389         {
00390                 return $this->order_column;
00391         }
00392 
00398         function setOrderDirection($a_order_direction)
00399         {
00400                 if ($a_order_direction == "desc")
00401                 {
00402                         $this->order_direction = "desc";
00403                         $this->sort_order = "asc";
00404                 }
00405                 else
00406                 {
00407                         $this->order_direction = "asc"; // set default sort order to "ASC"
00408                         $this->sort_order = "desc";
00409                 }
00410         }
00411 
00415         function getOrderDirection()
00416         {
00417                 return $this->order_direction;
00418         }
00419 
00427         function setFooter($a_style,$a_previous = 0,$a_next = 0)
00428         {
00429                 $this->footer_style = $a_style;
00430 
00431                 $this->footer_previous = ($a_previous) ? $a_previous : "<<<";
00432                 $this->footer_next = ($a_next) ? $a_next : ">>>";
00433         }
00434 
00440         function enable($a_module_name)
00441         {
00442                 if (!in_array($a_module_name,array_keys($this->enabled)))
00443                 {
00444                         return false;
00445                 }
00446 
00447                 $this->enabled[$a_module_name] = true;
00448         } 
00449 
00455         function disable($a_module_name)
00456         {
00457                 if (!in_array($a_module_name,array_keys($this->enabled)))
00458                 {
00459                         return false;
00460                 }
00461 
00462                 $this->enabled[$a_module_name] = false;
00463         }
00464         
00465 
00466         function sortData()
00467         {
00468                 if($this->enabled["sort"])
00469                 {
00470                         $this->data = ilUtil::sortArray($this->data,$this->order_column,$this->order_direction);
00471                 }
00472                 $this->data = array_slice($this->data,$this->offset,$this->limit);
00473         }
00474 
00479         function render()
00480         {
00481                 if($this->enabled['table'])
00482                 {
00483                         $this->tpl->setVariable("CSS_TABLE",$this->getStyle("table"));
00484                 }
00485 
00486                 // table title icon
00487                 if ($this->enabled["icon"] && $this->enabled["title"])
00488                 {
00489                         $this->tpl->setCurrentBlock("tbl_header_title_icon");
00490                         $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath($this->icon));
00491                         $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->icon_alt);
00492                         $this->tpl->parseCurrentBlock();
00493                 }
00494                 // table title help
00495                 if ($this->enabled["help"] && $this->enabled["title"])
00496                 {
00497                         $this->tpl->setCurrentBlock("tbl_header_title_help");
00498                         $this->tpl->setVariable("TBL_HELP_IMG",ilUtil::getImagePath($this->help_icon));
00499                         $this->tpl->setVariable("TBL_HELP_LINK",$this->help_page);
00500                         $this->tpl->setVariable("TBL_HELP_IMG_ALT",$this->help_icon_alt);
00501                         $this->tpl->parseCurrentBlock();
00502                 }
00503 
00504                 // hits per page selector
00505                 if ($this->enabled["hits"] && $this->enabled["title"])
00506                 {
00507                         $this->tpl->setCurrentBlock("tbl_header_hits_page");
00508                         $this->tpl->setVariable("LIMIT",$_SESSION["tbl_limit"]);
00509                         $this->tpl->setVariable("HITS_PER_PAGE",$this->lng->txt("hits_per_page"));
00510                         $this->tpl->parseCurrentBlock();
00511                 }
00512                 
00513                 // table title
00514                 if ($this->enabled["title"])
00515                 {
00516                         $this->tpl->setCurrentBlock("tbl_header_title");
00517                         $this->tpl->setVariable("COLUMN_COUNT",$this->column_count);
00518                         $this->tpl->setVariable("TBL_TITLE",$this->title);
00519                         $this->tpl->parseCurrentBlock();
00520                 }
00521 
00522                 // table header
00523                 if ($this->enabled["header"])
00524                 {
00525                         $this->renderHeader();
00526                 }
00527 
00528                 // table data
00529                 // the table content may be skipped to use an individual template blockfile
00530                 // To do so don't set $this->data and parse your table content by yourself
00531                 // The template block name for the blockfile MUST be 'TBL_CONTENT'
00532 
00533                 if ($this->enabled["content"] && is_array($this->data))
00534                 {
00535                         if($this->enabled['auto_sort'])
00536                         {
00537                                 $this->setMaxCount(count($this->data));
00538                                 $this->sortData();
00539                         }
00540                         $count = 0;
00541                         
00542                         foreach ($this->data as $tbl_content_row)
00543                         {
00544                                 foreach ($tbl_content_row as $key => $tbl_content_cell)
00545                                 {
00546                                         if (is_array($tbl_content_cell))
00547                                         {
00548                                                 $this->tpl->setCurrentBlock("tbl_cell_subtitle");
00549                                                 $this->tpl->setVariable("TBL_CELL_SUBTITLE",$tbl_content_cell[1]);
00550                                                 $this->tpl->parseCurrentBlock();
00551                                                 $tbl_content_cell = "<b>".$tbl_content_cell[0]."</b>";
00552                                         }
00553 
00554                                         $this->tpl->setCurrentBlock("tbl_content_cell");
00555                                         $this->tpl->setVariable("TBL_CONTENT_CELL",$tbl_content_cell);
00556                                         $this->tpl->parseCurrentBlock();
00557                                 }
00558 
00559                                 $this->tpl->setCurrentBlock("tbl_content_row");
00560                                 $rowcolor = ilUtil::switchColor($count,"tblrow1","tblrow2");
00561                                 $this->tpl->setVariable("ROWCOLOR", $rowcolor);
00562                                 $this->tpl->parseCurrentBlock();
00563                         
00564                                 $count++;
00565                         }
00566                 }
00567                 // select all checkbox
00568                 if ($this->enabled["select_all"])
00569                 {
00570                         if ((strlen($this->getFormName())) && (strlen($this->getSelectAllCheckbox())))
00571                         {
00572                                 $this->tpl->setVariable('SELECT_PREFIX',$this->prefix);
00573                                 $this->tpl->setVariable("SELECT_ALL_TXT_SELECT_ALL", $this->lng->txt("select_all"));
00574                                 $this->tpl->setVariable("SELECT_ALL_CHECKBOX_NAME", $this->getSelectAllCheckbox());
00575                                 $this->tpl->setVariable("SELECT_ALL_FORM_NAME", $this->getFormName());
00576                                 if (!($this->enabled["numinfo"] && $this->enabled["footer"]))
00577                                 {
00578                                         $this->tpl->setVariable("COLUMN_COUNT", $this->getColumnCount());
00579                                 }
00580                         }
00581                 }
00582                 
00583                 // table header numinfo
00584                 if ($this->enabled["numinfo_header"])
00585                 {
00586                         $start = $this->offset + 1;                             // compute num info
00587                         $end = $this->offset + $this->limit;
00588                         
00589                         if ($end > $this->max_count or $this->limit == 0)
00590                         {
00591                                 $end = $this->max_count;
00592                         }
00593                         
00594                         if ($this->lang_support)
00595                         {
00596                                 $numinfo = "(".$this->lng->txt("dataset")." ".$start." - ".$end." ".strtolower($this->lng->txt("of"))." ".$this->max_count.")";
00597                         }
00598                         else
00599                         {
00600                                 $numinfo = "(Dataset ".$start." - ".$end." of ".$this->max_count.")";
00601                         }
00602                         if ($this->max_count > 0)
00603                         {
00604                                 //$numinfo = $this->lng->txt("no_datasets");
00605                                 $this->tpl->setCurrentBlock("tbl_header_numinfo");
00606                                 $this->tpl->setVariable("NUMINFO_HEADER", $numinfo);
00607                                 $this->tpl->setVariable("COLUMN_COUNT_HEADER", $this->getColumnCount());
00608                                 $this->tpl->parseCurrentBlock();
00609                         }
00610                 }
00611                 // table footer numinfo
00612                 if ($this->enabled["numinfo"] && $this->enabled["footer"])
00613                 {
00614                         $start = $this->offset + 1;                             // compute num info
00615                         $end = $this->offset + $this->limit;
00616                         
00617                         if ($end > $this->max_count or $this->limit == 0)
00618                         {
00619                                 $end = $this->max_count;
00620                         }
00621                         
00622                         if ($this->lang_support)
00623                         {
00624                                 $numinfo = "(".$this->lng->txt("dataset")." ".$start." - ".$end." ".strtolower($this->lng->txt("of"))." ".$this->max_count.")";
00625                         }
00626                         else
00627                         {
00628                                 $numinfo = "(Dataset ".$start." - ".$end." of ".$this->max_count.")";
00629                         }
00630                         if ($this->max_count > 0)
00631                         {
00632                                 //$numinfo = $this->lng->txt("no_datasets");
00633                                 $this->tpl->setCurrentBlock("tbl_footer_numinfo");
00634                                 $this->tpl->setVariable("NUMINFO", $numinfo);
00635                                 $this->tpl->parseCurrentBlock();
00636                         }
00637                 }
00638                 // table footer linkbar
00639                 if ($this->enabled["linkbar"] && $this->enabled["footer"] && $this->limit  != 0
00640                          && $this->max_count > 0)
00641                 {
00642                         $params = array(
00643                                                         $this->prefix."sort_by"         => $this->header_vars[$this->order_column],
00644                                                         $this->prefix."sort_order"      => $this->order_direction
00645                                                         );
00646                         $params = array_merge($this->header_params,$params);
00647                         
00648                         $layout = array(
00649                                                         "link"  => $this->footer_style,
00650                                                         "prev"  => $this->footer_previous,
00651                                                         "next"  => $this->footer_next,
00652                                                         );
00653                                                         
00654                         $base = ($this->getBase() == "")
00655                                 ? basename($_SERVER["PHP_SELF"])
00656                                 : $this->getBase();
00657 
00658                         $linkbar = ilUtil::Linkbar($base,$this->max_count,$this->limit,$this->offset,$params,$layout);
00659                         $this->tpl->setCurrentBlock("tbl_footer_linkbar");
00660                         $this->tpl->setVariable("LINKBAR", $linkbar);
00661                         $this->tpl->parseCurrentBlock();
00662                 }
00663                                                 
00664                 // table footer
00665                 if ($this->enabled["footer"] && $this->max_count > 0)
00666                 {
00667                         $this->tpl->setCurrentBlock("tbl_footer");
00668                         $this->tpl->setVariable("COLUMN_COUNT",$this->column_count);
00669                         $this->tpl->parseCurrentBlock();
00670                 }
00671 
00672                 // action buttons
00673                 if ($this->enabled["action"])
00674                 {
00675                         foreach ($this->action_buttons as $button)
00676                         {
00677                                 $this->tpl->setCurrentBlock("tbl_action_btn");
00678                                 $this->tpl->setVariable("BTN_NAME", $button["name"]);
00679                                 $this->tpl->setVariable("BTN_VALUE", $button["value"]);
00680                                 $this->tpl->parseCurrentBlock();
00681                         }
00682                         $this->tpl->setCurrentBlock("tbl_action_row");
00683                         $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
00684                         $this->tpl->setVariable("ALT_ARROW", $this->lng->txt("arrow_downright.gif"));
00685                         $this->tpl->setVariable("COLUMN_COUNTS", $this->getColumnCount());
00686                         $this->tpl->parseCurrentBlock();
00687                 }
00688 
00689                 if ($this->enabled["form"])
00690                 {
00691                         $this->tpl->touchBlock("tbl_form_footer");
00692                 }
00693                 
00694                 if($this->enabled['table'])
00695                 {
00696                         $this->tpl->touchBlock("tbl_table_end");
00697                 }
00698 
00699                 if (!$this->global_tpl)
00700                 {
00701                         return $this->tpl->get();
00702                 }
00703         }
00704         
00705         function renderHeader()
00706         {
00707                 foreach ($this->header_names as $key => $tbl_header_cell)
00708                 {
00709                         if (!$this->enabled["sort"])
00710                         {
00711                                 $this->tpl->setCurrentBlock("tbl_header_no_link");
00712                                 if ($this->column_width[$key])
00713                                 {
00714                                         $this->tpl->setVariable("TBL_COLUMN_WIDTH_NO_LINK"," width=\"".$this->column_width[$key]."\"");
00715                                 }
00716                                 $this->tpl->setVariable("TBL_HEADER_CELL_NO_LINK",$tbl_header_cell);
00717                                 $this->tpl->parseCurrentBlock();
00718                                 continue;
00719                         }
00720                         if (($key == $this->order_column) && ($this->order_direction != ""))
00721                         {
00722                                 if (strcmp($this->header_vars[$key], "") != 0)
00723                                 {
00724                                         $this->tpl->setCurrentBlock("tbl_order_image");
00725                                         $this->tpl->setVariable("IMG_ORDER_DIR",ilUtil::getImagePath($this->order_direction."_order.gif"));
00726                                         $this->tpl->parseCurrentBlock();
00727                                 }
00728                         }
00729 
00730                         $this->tpl->setCurrentBlock("tbl_header_cell");
00731                         $this->tpl->setVariable("TBL_HEADER_CELL",$tbl_header_cell);
00732                         
00733                         // only set width if a value is given for that column
00734                         if ($this->column_width[$key])
00735                         {
00736                                 $this->tpl->setVariable("TBL_COLUMN_WIDTH"," width=\"".$this->column_width[$key]."\"");
00737                         }
00738 
00739                         $lng_sort_column = ($this->lang_support) ? $this->lng->txt("sort_by_this_column") : "Sort by this column";
00740                         $this->tpl->setVariable("TBL_ORDER_ALT",$lng_sort_column);
00741                 
00742                         $order_dir = "asc";
00743 
00744                         if ($key == $this->order_column)
00745                         { 
00746                                 $order_dir = $this->sort_order;
00747 
00748                                 $lng_change_sort = ($this->lang_support) ? $this->lng->txt("change_sort_direction") : "Change sort direction";
00749                                 $this->tpl->setVariable("TBL_ORDER_ALT",$lng_change_sort);
00750                         }
00751                 
00752                         $this->setOrderLink($key, $order_dir);
00753                         $this->tpl->parseCurrentBlock();
00754                 }
00755                 
00756                 $this->tpl->setCurrentBlock("tbl_header");
00757                 $this->tpl->parseCurrentBlock();
00758         }
00759         
00760         function setOrderLink($key, $order_dir)
00761         {
00762                 $this->tpl->setVariable("TBL_ORDER_LINK",basename($_SERVER["PHP_SELF"])."?".$this->link_params.$this->prefix."sort_by=".$this->header_vars[$key]."&".$this->prefix."sort_order=".$order_dir."&".$this->prefix."offset=".$this->offset);
00763         }
00764         
00765         /*
00766         * set a tpl stylesheet
00767         * @access       public
00768         * @param        string  table element
00769         * @param        string  CSS definition
00770         */
00771         function setStyle($a_element,$a_style)
00772         {
00773                 $this->styles[$a_element] = $a_style;
00774         }
00775 
00776         /*
00777         * get a tpl stylesheet
00778         * @access       public
00779         * @param        string  table element
00780         */
00781         function getStyle($a_element)
00782         {
00783                 return $this->styles[$a_element];
00784         }
00785 
00791         function setBase($a_base)
00792         {
00793                 $this->base = $a_base;
00794         }
00795 
00801         function getBase()
00802         {
00803                 return $this->base;
00804         }
00805 
00806         /*
00807         * get the name of the parent form
00808         * @access       public
00809         * @return       string  name of the parent form
00810         */
00811         function getFormName()
00812         {
00813                 return $this->form_name;
00814         }
00815         
00816         /*
00817         * set the name of the parent form
00818         * @access       public
00819         * @param        string  $a_name name of the parent form
00820         */
00821         function setFormName($a_name = "cmd")
00822         {
00823                 $this->form_name = $a_name;
00824         }
00825 
00826         /*
00827         * get the name of the checkbox that should be toggled with a select all button
00828         * @access       public
00829         * @return       string  name of the checkbox
00830         */
00831         function getSelectAllCheckbox()
00832         {
00833                 return $this->select_all_checkbox;
00834         }
00835         
00836         /*
00837         * set the name of the checkbox that should be toggled with a select all button
00838         * @access       public
00839         * @param        string  $a_select_all_checkbox name of the checkbox
00840         */
00841         function setSelectAllCheckbox($a_select_all_checkbox)
00842         {
00843                 $this->select_all_checkbox = $a_select_all_checkbox;
00844         }
00845         
00846         /*
00847         * Removes all action buttons from the table
00848         *
00849         * @access       public
00850         */
00851         function clearActionButtons()
00852         {
00853                 $this->action_buttons = array();
00854         }
00855         
00856         /*
00857         * Adds an action button to the table
00858         *
00859         * @param string $btn_name Name of the action button
00860         * @param string $btn_value Value of the action button
00861         * @access       public
00862         */
00863         function addActionButton($btn_name, $btn_value)
00864         {
00865                 array_push($this->action_buttons, 
00866                         array(
00867                                 "name" => $btn_name, 
00868                                 "value" => $btn_value
00869                         )
00870                 );
00871         }
00872 }
00873 ?>

Generated on Fri Dec 13 2013 17:57:01 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1