|
|
{*************************}
{* FI External data *}
{* salvestab parameetrina kataloogitee (võib olla suhteline tee nt /test_html/) *}
{* näitab kataloogi sisu iframe-s *}
{php}
global $leht, $site, $objekt;
if (!$content_template) {
$content_template = &$template;
}
#################################
# malli parameetrite salvestamine
if ($site->fdat[salvesta]) {
$sql = $site->db->prepare("
UPDATE objekt SET ttyyp_params = ?
WHERE objekt_id = ?",
save_params(),
$leht->id
);
$sth = new SQL($sql);
}
# / malli parameetrite salvestamine
###################################
####################################
# Konfiguratsiooni vormi näitamine
//if ($site->admin && $site->admin->on_access($leht->id)) {
if ($site->admin) {
edit_params();
}
# /
####################################
$objekt = new Objekt(array(
objekt_id => $leht->objekt->objekt_id,
no_cache => 1
));
##############################
# Loeme andmed objekti confist
$conf = new CONFIG($objekt->all['ttyyp_params']);
$external_data_path = $conf->get('external_data_path');
$this->assign("external_data_path", $site->absolute_path.$external_data_path);
# /
###############################
{/php}
{************************* SISU ***********************}
{*
OLD version with iframes:
*}
{* NEW version with include: *}
{include_php file=$external_data_path}
{php}
/*---------------------Malli konfigureerimine on siin-------------------------------*/
function save_params() {
global $site, $leht;
$objekt = new Objekt(array(
objekt_id => $leht->objekt->objekt_id
));
$conf = new CONFIG($objekt->all['ttyyp_params']);
$conf->put("external_data_path", $conf->site->fdat['external_data_path']);
return $conf->Export();
}
function edit_params() {
global $site, $leht;
$objekt = new Objekt(array(
objekt_id => $leht->objekt->objekt_id,
no_cache => 1
));
$conf = new CONFIG($objekt->all['ttyyp_params']);
{/php}
{php}
}
{/php}
|