/** * standard constructor * @param string Text that is to be shown as description or label with your object. (will not be displayed !!) * @param string Table, you want to connect with the object. * @param string column, you want to connect with the object. * @param string $row_identifier Usually to be generated with form->setPK. Identifies the * row in db, you want to affect with operation. Keep empty for insert. (Example: stdEDForm) * @param string $params Allowed parameters are: * type:RICH; * size:XX Size of Input in chars. * width:XX Size of Input in pixel. * @param string $check Does checks on user input. Allowed are MANDATORY (=not null)|UNIQUE. Separate with &. * @param string $db_datatype Datatype of the database, you want to use. Allowed are CHAR|NUMBER|PASSWORD */ function RicheditInput($label, $table, $column, $row_identifier = "1", $params = "type:rich,size:10,width:100", $check = "", $db_datatype = "TEXT") { DBO::DBO($label, $table, $column, $row_identifier, $params, $db_datatype, $check); global $page_state, $page_action, $forceLoadFromDB; if ($page_state == "processing" && value("changevariation") != "GO" && value("changetranslation") != "GO" && ! ($forceLoadFromDB=="yes")) { //$fieldname = $this->table."_".$this->column; $fieldname = $this->name; if (value($fieldname) != "0") { $this->value = value($fieldname); } else { $this->value = $_POST[$fieldname]; } /** added 21.1.2002 */ global $c_magic_quotes_gpc; if ($c_magic_quotes_gpc == 1) $this->value = str_replace("\\", "", $this->value); $this->value = str_replace('&', '&', $this->value); /** got rid of magic quotes! */ $this->oldvalue = getDBCell($table, $column, $row_identifier); } else { if (($page_action == "UPDATE" || $page_action == "DELETE") && $this->row_identifier != "1") { $parser = new NX2HTML(variation()); $this->value = $parser->parseText(getDBCell($table, $column, $row_identifier)); } } switch ($this->type): case "RICH": $this->v_wuiobject = new Richedit($this->name, $this->value, $this->std_style, $this->size, $this->parameter, $this->width); break; endswitch; }
/** * This function is used for drawing the html-code out to the templates. * It just returns the code * @param string Optional parameters for the draw-function. There are none supported. * @return string HTML-CODE to be written into the template. */ function draw($param = "") { global $cds; $variation = value("v"); if ($variation == "0") $variation = $cds->variation; $parser = new NX2HTML($variation); $content = $parser->parseText(getDBCell("pgn_text", "CONTENT", "FKID = $this->fkid")); return applyFilterPlugins($content); }
/** * returns the data for an event * @param integer ID of the event */ function getEventData($eventId) { global $db, $cds; $variation = value("v"); if ($variation == "0") $variation = $cds->variation; $sql = "SELECT * FROM pgn_cal_appointment WHERE APID = ".$eventId; $query = new query($db, $sql); $parser= new NX2HTML($variation); while ($query->getrow()) { $compareDate = date('Y-m-d', strtotime($query->field("STARTDATE"))); $date = date('Y-m-d'); $over = $compareDate < $date; $event = array( "TITLE" => $query->field("TITLE"), "DESCRIPTION" => applyFilterPlugins($parser->parseText($query->field("DESCRIPTION"))), "STARTDATE" => date('d.m.Y', strtotime($query->field("STARTDATE"))), "STARTTIME" => substr($query->field("STARTTIME"),0,5), "ENDDATE" => date('d.m.Y', strtotime($query ->field("ENDDATE"))), "ENDTIME" => substr($query->field("ENDTIME"),0,5), "UNIXSTART" => $query->field("STARTDATE") .' '. $query->field("STARTTIME"), "UNIXEND" => $query->field("ENDDATE") .' '. $query->field("ENDTIME"), "APID" => $query->field("APID"), "REPORT" => applyFilterPlugins($parser->parseText($query->field("REPORT"))), "GALLERY" => $query->field("GALLERY"), "OVER" => $over, "CATID" => $query->field("CATID")); } $query->free(); return $event; }