/**
  * Build the demo configuration for this table
  * 
  * @param DataTable_Config $config
  */
 public function __construct(DataTable_Config $config = null)
 {
     // create first column
     $column1 = new DataTable_Column();
     $column1->setName("renderingEngine")->setTitle("Rendering Engine")->setGetMethod("getRenderingEngine")->setSortKey("renderingEngine")->setIsSortable(true)->setIsDefaultSort(true);
     // create second column
     $column2 = new DataTable_Column();
     $column2->setName("browser")->setTitle("Browser")->setGetMethod("getBrowser")->setSortKey("browser")->setIsSortable(true)->setIsSearchable(true);
     // create third column
     $column3 = new DataTable_Column();
     $column3->setName("platform")->setTitle("Platform(s)")->setGetMethod("getPlatform")->setSortKey("platform")->setIsSortable(true)->setIsDefaultSort(false);
     // create fourth column
     $column4 = new DataTable_Column();
     $column4->setName("engineVersion")->setTitle("Engine Version")->setGetMethod("getEngineVersion")->setSortKey("engineVersion")->setIsSortable(true)->setIsDefaultSort(false);
     // create fifth column
     $column5 = new DataTable_Column();
     $column5->setName("cssGrade")->setTitle("CSS Grade")->setGetMethod("getCssGrade")->setSortKey("cssGrade")->setIsSortable(true)->setIsDefaultSort(false);
     // create the actions column
     $column6 = new DataTable_Column();
     $column6->setName("actions")->setTitle("Actions")->setGetMethod("getActions");
     // create an invisible column
     $column7 = new DataTable_Column();
     $column7->setName("invisible")->setTitle("Invisible")->setIsVisible(false)->setGetMethod("getInvisible");
     // create config
     $config = new DataTable_Config();
     // add columns to collection
     $config->getColumns()->add($column1)->add($column2)->add($column3)->add($column4)->add($column5)->add($column6)->add($column7);
     // build the language configuration
     $languageConfig = new DataTable_LanguageConfig();
     $languageConfig->setPaginateFirst("Beginning")->setPaginateLast("End")->setSearch("Find it:");
     // add LangugateConfig to the DataTableConfig object
     $config->setLanguageConfig($languageConfig);
     // set data table options
     $config->setClass("display")->setDisplayLength(10)->setIsPaginationEnabled(true)->setIsLengthChangeEnabled(true)->setIsFilterEnabled(true)->setIsInfoEnabled(true)->setIsSortEnabled(true)->setIsAutoWidthEnabled(true)->setIsScrollCollapseEnabled(false)->setPaginationType(DataTable_Config::PAGINATION_TYPE_FULL_NUMBERS)->setIsJQueryUIEnabled(false)->setIsServerSideEnabled(true);
     // pass DataTable_Config to the parent
     parent::__construct($config);
 }
Example #2
0
 /**
  * @param DataTable_Config $config
  */
 public function __construct(DataTable_Config $config = null)
 {
     // create first column
     $column0 = new DataTable_Column();
     $column0->setName("checkbox")->setTitle("Δ")->setGetMethod("getCheckbox")->setSortKey("id")->setIsSortable(false);
     $column1 = new DataTable_Column();
     $column1->setName("id")->setTitle("id")->setGetMethod("getID")->setSortKey("id")->setIsSortable(true)->setIsDefaultSort(true);
     // create second column
     $column2 = new DataTable_Column();
     $column2->setName("date")->setTitle("date")->setGetMethod("getDate")->setSortKey("date")->setIsSortable(true)->setIsSearchable(false);
     // create second column
     $column3 = new DataTable_Column();
     $column3->setName("micro_ts")->setTitle("ts")->setGetMethod("getMicroTs")->setSortKey("micro_ts")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     // create second column
     $column4 = new DataTable_Column();
     $column4->setName("method")->setTitle("method")->setGetMethod("getMethod")->setSortKey("method")->setIsSortable(true)->setIsSearchable(false);
     $column5 = new DataTable_Column();
     $column5->setName("reply_reason")->setTitle("Reason")->setGetMethod("getReplyReason")->setSortKey("reply_reason")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     // create second column
     $column6 = new DataTable_Column();
     $column6->setName("ruri")->setTitle("ruri")->setGetMethod("getRuri")->setSortKey("ruri")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column7 = new DataTable_Column();
     $column7->setName("ruri_user")->setTitle("Ruser")->setGetMethod("getRuriUser")->setSortKey("ruri_user")->setIsSortable(true)->setIsSearchable(true);
     $column8 = new DataTable_Column();
     $column8->setName("from_user")->setTitle("from user")->setGetMethod("getFromUser")->setSortKey("from_user")->setIsSortable(true)->setIsSearchable(true);
     $column9 = new DataTable_Column();
     $column9->setName("from_tag")->setTitle("from tag")->setGetMethod("getFromTag")->setSortKey("from_tag")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column10 = new DataTable_Column();
     $column10->setName("to_user")->setTitle("to user")->setGetMethod("getToUser")->setSortKey("to_user")->setIsSortable(true)->setIsSearchable(true);
     $column11 = new DataTable_Column();
     $column11->setName("to_tag")->setTitle("to tag")->setGetMethod("getToTag")->setSortKey("to_tag")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column12 = new DataTable_Column();
     $column12->setName("pid_user")->setTitle("pid")->setGetMethod("getPidUser")->setSortKey("pid_user")->setIsSortable(true)->setIsSearchable(true);
     $column13 = new DataTable_Column();
     $column13->setName("contact_user")->setTitle("Cont. user")->setGetMethod("getContactUser")->setSortKey("contact_user")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column14 = new DataTable_Column();
     $column14->setName("auth_user")->setTitle("Auth user")->setGetMethod("getAuthUser")->setSortKey("auth_user")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(true);
     $column15 = new DataTable_Column();
     $column15->setName("callid")->setTitle("Call-id")->setGetMethod("getCallId")->setSortKey("callid")->setIsSortable(true)->setIsSearchable(true);
     $column16 = new DataTable_Column();
     $column16->setName("callid_aleg")->setTitle("Call-ID Aleg")->setGetMethod("getCalIdAleg")->setSortKey("callid_aleg")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column17 = new DataTable_Column();
     $column17->setName("via_1")->setTitle("Via")->setGetMethod("getVia1")->setSortKey("via_1")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column18 = new DataTable_Column();
     $column18->setName("via_1_branch")->setTitle("Via Branch")->setGetMethod("getVia1Branch")->setSortKey("via_1_branch")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column19 = new DataTable_Column();
     $column19->setName("cseq")->setTitle("Cseq")->setGetMethod("getCseq")->setSortKey("cseq")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column20 = new DataTable_Column();
     $column20->setName("diversion")->setTitle("Diversion")->setGetMethod("getDiversion")->setSortKey("diversion")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column21 = new DataTable_Column();
     $column21->setName("reason")->setTitle("Reason")->setGetMethod("getReason")->setSortKey("reason")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     $column22 = new DataTable_Column();
     $column22->setName("content_type")->setTitle("Cont-Type")->setGetMethod("getContentType")->setSortKey("content_type")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column23 = new DataTable_Column();
     $column23->setName("authorization")->setTitle("Authoriz.")->setGetMethod("getAuthorization")->setSortKey("authorization")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     /* SCHEMA */
     if (SQL_SCHEMA_VERSION == 2) {
         $column23->setName("auth")->setSortKey("auth");
     }
     $column24 = new DataTable_Column();
     $column24->setName("user_agent")->setTitle("UAG")->setGetMethod("getUserAgent")->setIsVisible(false)->setSortKey("user_agent")->setIsSortable(true)->setIsSearchable(false);
     $column25 = new DataTable_Column();
     $column25->setName("source_ip")->setTitle("Src.IP")->setGetMethod("getSourceIp")->setSortKey("source_ip")->setIsSortable(true)->setIsSearchable(false);
     $column26 = new DataTable_Column();
     $column26->setName("source_port")->setTitle("Src.Port")->setGetMethod("getSourcePort")->setSortKey("source_port")->setIsSortable(true)->setIsSearchable(false);
     $column27 = new DataTable_Column();
     $column27->setName("destination_ip")->setTitle("Dest.IP")->setGetMethod("getDestinationIp")->setSortKey("destination_ip")->setIsSortable(true)->setIsSearchable(false);
     $column28 = new DataTable_Column();
     $column28->setName("destination_port")->setTitle("Dst. Port")->setGetMethod("getDestinationPort")->setSortKey("destination_port")->setIsSortable(true)->setIsSearchable(false);
     $column29 = new DataTable_Column();
     $column29->setName("contact_ip")->setTitle("Contact IP")->setGetMethod("getContactIp")->setSortKey("contact_ip")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     $column30 = new DataTable_Column();
     $column30->setName("contact_port")->setTitle("Contact Port")->setGetMethod("getContactPort")->setSortKey("contact_port")->setIsSortable(true)->setIsVisible(false)->setIsSearchable(false);
     $column31 = new DataTable_Column();
     $column31->setName("originator_ip")->setTitle("Originator.IP")->setGetMethod("getOriginatorIp")->setSortKey("originator_ip")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     $column32 = new DataTable_Column();
     $column32->setName("originator_port")->setTitle("Orig. Port")->setGetMethod("getOriginatorPort")->setSortKey("originator_port")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     $column33 = new DataTable_Column();
     $column33->setName("family")->setTitle("Family")->setGetMethod("getFamily")->setSortKey("family")->setIsVisible(false)->setIsSortable(true)->setIsDefaultSort(false);
     // create second column
     $column34 = new DataTable_Column();
     $column34->setName("proto")->setTitle("Proto")->setGetMethod("getProto")->setSortKey("proto")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     // create second column
     $column35 = new DataTable_Column();
     $column35->setName("type")->setTitle("TYPE")->setGetMethod("getType")->setSortKey("type")->setIsVisible(false)->setIsSortable(true)->setIsSearchable(false);
     // create third column
     $column36 = new DataTable_Column();
     $column36->setName("node")->setTitle("Node")->setGetMethod("getNode")->setSortKey("node")->setIsSortable(true)->setIsSearchable(false)->setIsDefaultSort(false);
     // create the actions column
     $column37 = new DataTable_Column();
     $column37->setName("actions")->setTitle("Actions")->setGetMethod("getActions");
     // create an invisible column
     $column38 = new DataTable_Column();
     $column38->setName("invisible")->setTitle("Invisible")->setIsVisible(false)->setGetMethod("getInvisible");
     // create third column
     $column39 = new DataTable_Column();
     $column39->setName("loctable")->setTitle("loctable")->setGetMethod("getLoctable")->setSortKey("loctable")->setIsSortable(false)->setIsSearchable(false)->setIsVisible(false)->setIsDefaultSort(false);
     // create third column
     $column40 = new DataTable_Column();
     $column40->setName("tnode")->setTitle("tnode")->setGetMethod("getTnode")->setSortKey("tnode")->setIsSortable(false)->setIsSearchable(false)->setIsVisible(false)->setIsDefaultSort(false);
     $column41 = new DataTable_Column();
     $column41->setName("callidtag")->setTitle("callidtag")->setGetMethod("getCallIdTag")->setSortKey("callid")->setIsSortable(false)->setIsSearchable(false)->setIsVisible(false)->setIsDefaultSort(false);
     // create config
     $config = new DataTable_Config();
     // add columns to collection
     $config->getColumns()->add($column0)->add($column1)->add($column2)->add($column3)->add($column4)->add($column5)->add($column6)->add($column7)->add($column8)->add($column9)->add($column10)->add($column11)->add($column12)->add($column13)->add($column14)->add($column15)->add($column16)->add($column17)->add($column18)->add($column19)->add($column20)->add($column21)->add($column22)->add($column23)->add($column24)->add($column25)->add($column26)->add($column27)->add($column28)->add($column29)->add($column30)->add($column31)->add($column32)->add($column33)->add($column34)->add($column35)->add($column36)->add($column38)->add($column39)->add($column40)->add($column41);
     // build the language configuration
     $languageConfig = new DataTable_LanguageConfig();
     $languageConfig->setPaginateFirst("Beginning")->setPaginateLast("End")->setSearch("Find it:");
     // add LangugateConfig to the DataTableConfig object
     $config->setLanguageConfig($languageConfig);
     $dom = "<\"top\"fip<\"clear\">>rt<\"bottom\"lip<\"clear\">>";
     $config->setDom($dom);
     // set data table options
     $config->setClass("display")->setDisplayLength(25)->setIsPaginationEnabled(true)->setIsLengthChangeEnabled(true)->setIsFilterEnabled(true)->setIsInfoEnabled(true)->setIsSortEnabled(true)->setIsAutoWidthEnabled(false)->setIsScrollCollapseEnabled(false)->setPaginationType(DataTable_Config::PAGINATION_TYPE_FULL_NUMBERS)->setIsJQueryUIEnabled(true)->setIsServerSideEnabled(true);
     // pass DataTable_Config to the parent
     parent::__construct($config);
 }
Example #3
0
 /**
  * Get the data for for a column from the given data object row
  * 
  * This method will first try calling the get method on the current
  * DataTable object. If the method doesn't exist, then it will default
  * to calling the method on the object for the current row
  * 
  * @param object $object
  * @param DataTable_Column $column
  * @return mixed
  */
 protected function getDataForColumn($object, DataTable_Column $column)
 {
     $getter = $column->getGetMethod();
     if (method_exists($this, $getter)) {
         return call_user_func(array($this, $getter), $object);
     } else {
         if (method_exists($object, $getter)) {
             return call_user_func(array($object, $getter));
         } else {
             throw new DataTable_DataTableException("{$getter}() method is required in " . get_class($object) . " or " . get_class($this));
         }
     }
 }