//
// cms_widget
//
require_once dirname(__FILE__)."/dataelement.cms.php";
class money_dataelement extends dataelement{
// private
var $type = "money";
var $fieldtype = array("VARCHAR", "TEXT", "STRING", "BLOB", "DOUBLE", "INTEGER", "REAL");
var $sql_type = "VARCHAR(255)";
// public
function get_currencies(){
$out = array();
$dbo =& new dbo("currency", "core");
$dbo->set_sorting("abbr ASC");
if($db = $dbo->get_all()){
foreach($db as $row){
$out[$row["abbr"]] = $row;
}
}
return $out;
}
function show_list($inValue, $inKeyValue=""){
$currencies = $this->get_currencies();
$value = unserialize($inValue);
return (floatval($value['value'])?$currencies[$value["currency"]]["symbol"]." ":"").sprintf("%.02f", $value['value']);
}
function show(){
$currencies = $this->get_currencies();
$value = unserialize($this->value);
return (floatval($value['value'])?$currencies[$value["currency"]]["symbol"]." ":"").sprintf("%.02f", $value['value']);
}
function edit(){
$value = unserialize($this->value);
$currencies = $this->get_currencies();
$out .= "
";
return $out;
}
function insert(){
unset($values);
$values["currency"] = getvar("pgs", $this->name."_currency");
$values["value"] = getvar("pgs", $this->name."_value");
$this->value = serialize($values);
}
function update(){
unset($values);
$values["currency"] = getvar("pgs", $this->name."_currency");
$values["value"] = getvar("pgs", $this->name."_value");
$this->value = serialize($values);
}
}
?>
//
// cms_widget
//
require_once dirname(__FILE__)."/dataelement.cms.php";
class currency_dataelement extends dataelement{
// private
var $type = "currency";
var $fieldtype = array("VARCHAR", "TEXT", "STRING", "BLOB", "DOUBLE", "INTEGER", "REAL");
var $sql_type = "DECIMAL(10,2)";
// public
var $currency = "euro"; // currency name
var $currency_symbols = array("euro"=>"€" , "dollar"=>"\$", "sterling"=>"£", "yen", "¥"); // currency symbol
function show_list($inValue, $inKeyValue=""){
return $this->currency_symbols[$this->currency]." ".mod::stripstring(number_format($inValue, 2, ".", ""), 50);
}
function show(){
return $this->currency_symbols[$this->currency]." ".number_format($this->value, 2, ".", "");
}
function edit(){
return $this->currency_symbols[$this->currency]." name."\" value=\"".esc::to_form(number_format($this->value, 2, ".", ""))."\" ".($this->disabled?" readonly ":"")." class=\"textelement\" style=\"width: 100px;\">";
}
function insert(){
$this->value = number_format(str_replace(",",".", getvar("pgs", $this->name)), 2, ".", ",");
}
function update(){
$this->value = number_format(str_replace(",",".", getvar("pgs", $this->name)), 2, ".", ",");
}
}
?>
// create object
$this->title = "Languages";
$this->table = "languages";
$this->items_per_page = 10;
$this->pagewindow = 10;
$this->search = 0;
$this->controls = array("list", "check", "show", "edit", "delete", "add", "sort");
$this->check = 0;
$this->autocheck = 1;
$this->parentTxt = "";
$this->is_core = true;
//
// parent / child declarations
//
$this->setChild("");
$this->setParent("");
// object data & properties
$this->addKey("language_id");
//--
$element = $this->addDataItem("rank", "rank", "Rank");
//--
$element = $this->addDataItem("textline", "short_name", "Language ID");
$this->setProperty( $element, "list", true);
$this->setProperty( $element, "required", true);
//--
$element = $this->addDataItem("textline", "name", "Language name");
$this->setProperty( $element, "list", true);
$this->setProperty( $element, "required", true);
//--
?>
// create object
$this->title = "Channels";
$this->table = "channels";
$this->items_per_page = 10;
$this->pagewindow = 10;
$this->search = 0;
$this->controls = array("list", "check", "show", "edit", "delete", "add", "sort");
$this->check = 0;
$this->autocheck = 1;
$this->parentTxt = "";
$this->is_core = true;
//
// parent / child declarations
//
$this->setChild("");
$this->setParent("");
// object data & properties
$this->addKey("channel_id");
//--
$element = $this->addDataItem("rank", "rank", "Rank");
//--
$element = $this->addDataItem("textline", "channel_short", "Channel short name");
$this->setProperty( $element, "list", true);
$this->setProperty( $element, "required", true);
//--
$element = $this->addDataItem("textline", "channel", "Channel name");
$this->setProperty( $element, "list", true);
$this->setProperty( $element, "required", true);
//--
$element = $this->addDataItem("color", "color", "Color");
$this->setProperty( $element, "list", true);
$this->setProperty( $element, "required", true);
//--
?>This website is temporarily offline for maintenance...